|
IBM WebSphereTM eXtreme Scale, Release 8.5 API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.objectgrid.plugins.builtins.NoVersioningOptimisticCallback
DataSerializer.DataAttributeInflatable
plug-in with the ValueDataSerializer.Versionable
mix-in interface.
@Deprecated public class NoVersioningOptimisticCallback
This built-in OptimisticCallback allows the user to use Optimistic locking without doing version checking. In the 6.0.x release this was the default behavior to not actually have any version checking since the ObjectGrid runtime does not know how to version an application's object. A default version mechanism is now used by default where the entire application object is used as the version value to know if the initial version matches the current committed value. If the application's object does not have an equals() method, the default versioning will not work.
A use case for using this built-in OptimisticCallback is the Loader is handling the version checking, but optimistic locking is used to guarantee committed data is always returned on a read. If there is no contention between map entries that would cause a collision with two threads modifying a value at the same time, then this built-in plugin should also be used to avoid the overhead of optimistic version checking.
OptimisticCallback
Field Summary |
---|
Fields inherited from interface com.ibm.websphere.objectgrid.plugins.OptimisticCallback |
---|
NULL_OPTIMISTIC_VERSION |
Constructor Summary | |
---|---|
NoVersioningOptimisticCallback()
Deprecated. |
Method Summary | |
---|---|
Object |
getVersionedObjectForValue(Object value)
Deprecated. Returns the value (must be a copy) or it may return an attribute of the value that can be used for versioning purposes. |
Object |
inflateVersionedValue(ObjectInputStream stream)
Deprecated. Reads a versioned value object from the specified stream. |
void |
serializeVersionedValue(Object versionedValue,
ObjectOutputStream stream)
Deprecated. This method does nothing because no version checking is used. |
void |
updateVersionedObjectForValue(Object value)
Deprecated. This method does nothing because no version checking is used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoVersioningOptimisticCallback()
Method Detail |
---|
public Object getVersionedObjectForValue(Object value)
OptimisticCallback
This method is called whenever an object is associated with a transaction
so that at commit time, the ObjectGrid runtime can do qualified updates
using this value to detect if the value changed during the optimistic
transaction. The Loader
also gets this value from the
LogElement
.
getVersionedObjectForValue
in interface OptimisticCallback
value
- The value to version
OptimisticCallback.NULL_OPTIMISTIC_VERSION
to indicate no
versioning check is used.OptimisticCallback.getVersionedObjectForValue(Object)
public void updateVersionedObjectForValue(Object value)
updateVersionedObjectForValue
in interface OptimisticCallback
value
- The value whose version attribute must be updated.OptimisticCallback.updateVersionedObjectForValue(Object)
public void serializeVersionedValue(Object versionedValue, ObjectOutputStream stream)
serializeVersionedValue
in interface OptimisticCallback
versionedValue
- the versioned value objectstream
- The stream to write the object toOptimisticCallback.serializeVersionedValue(Object, ObjectOutputStream)
public Object inflateVersionedValue(ObjectInputStream stream)
OptimisticCallback
This method takes the Serializable version of the versioned value and
returns the actual versioned value object.
Depending on the implementation, the versioned value can be used to
identify optimistic update collisions. In the default implementation,
the versioned value is just a copy of the original value. Other
implementations may have a sequence number or some other object to
indicate the version of the value. Since the actual implementation is
unknown, this method is provided to perform the proper de-serialization.
The default implementation just does a readObject
.
inflateVersionedValue
in interface OptimisticCallback
stream
- the ObjectInputStream
object to read the
versioned value object from
OptimisticCallback.NULL_OPTIMISTIC_VERSION
to indicate no
versioning check is used.OptimisticCallback.inflateVersionedValue(ObjectInputStream)
|
IBM WebSphereTM eXtreme Scale, Release 8.5 API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |