|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ValueSerializerPlugin
with the ValueDataSerializer.Versionable
mix-in interface.
@Deprecated public interface OptimisticCallback
An object implementing this interface is used to provide optimistic comparison operations for the values of a Map.
An OptimisticCallback
implementation that also implements the BackingMapLifecycleListener
interface will be automatically added as an EventListener
on the BackingMap
when the
callback set on the backing map.
An OptimisticCallback
may also implement the BackingMapPlugin
interface in order
to receive enhanced BackingMap plug-in lifecycle method calls. The plug-in is then
also required to correctly implement each of the bean methods related to
introspection of its state (for example isInitialized()
,
isDestroyed()
, etc).
BackingMap.addMapEventListener(EventListener)
,
BackingMap.setLockStrategy(LockStrategy)
,
BackingMap.setOptimisticCallback(OptimisticCallback)
,
LockStrategy.OPTIMISTIC
Field Summary | |
---|---|
static Byte |
NULL_OPTIMISTIC_VERSION
Deprecated. Special value returned by getVersionObjectForValue if the default OptimisticCallback is used by a BackingMap since the BackingMap.setOptimisticCallback(OptimisticCallback)
method was never called. |
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. Writes the versioned value object to the specified stream. |
void |
updateVersionedObjectForValue(Object value)
Deprecated. Called whenever a transaction has updated a value and a new versioned object is needed. |
Field Detail |
---|
static final Byte NULL_OPTIMISTIC_VERSION
BackingMap.setOptimisticCallback(OptimisticCallback)
method was never called.
Method Detail |
---|
Object getVersionedObjectForValue(Object value)
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
.
value
- The value to version
Loader
,
LogElement.getVersionedValue()
void updateVersionedObjectForValue(Object value)
If the getVersionedObjectForValue(Object)
method returned an
attribute of the value, this method typically updates that value with a
new version object for the value. If the getVersionedObjectForValue(Object)
method returned a copy of the value, then this method typically does nothing.
value
- The value whose version attribute must be updated.getVersionedObjectForValue(Object)
void serializeVersionedValue(Object versionedValue, ObjectOutputStream stream) throws IOException
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 serialization.
The default implementation just does a writeObject
.
versionedValue
- the versioned value objectstream
- The stream to write the object to
IOException
- if an error occurs during processing of this methodObject inflateVersionedValue(ObjectInputStream stream) throws IOException, ClassNotFoundException
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
.
stream
- the ObjectInputStream
object to read the
versioned value object from
IOException
- if an error occurs during processing of this method
ClassNotFoundException
- if the versioned value class isn't foundserializeVersionedValue(Object, ObjectOutputStream)
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |