IBM WebSphereTM eXtreme Scale, Release 8.5
API Specification

com.ibm.websphere.objectgrid.plugins.builtins
Class NoVersioningOptimisticCallback

java.lang.Object
  extended by com.ibm.websphere.objectgrid.plugins.builtins.NoVersioningOptimisticCallback
All Implemented Interfaces:
OptimisticCallback

Deprecated. This plug-in is deprecated in version 7.1.1. Use the DataSerializer.DataAttributeInflatable plug-in with the ValueDataSerializer.Versionable mix-in interface.

@Deprecated
public class NoVersioningOptimisticCallback
extends Object
implements OptimisticCallback

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.

Since:
WAS XD 6.1
See Also:
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

NoVersioningOptimisticCallback

public NoVersioningOptimisticCallback()
Deprecated. 
Method Detail

getVersionedObjectForValue

public Object getVersionedObjectForValue(Object value)
Deprecated. 
Description copied from interface: OptimisticCallback
Returns the value (must be a copy) or it may return an attribute of the value that can be used for versioning purposes.

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.

Specified by:
getVersionedObjectForValue in interface OptimisticCallback
Parameters:
value - The value to version
Returns:
a OptimisticCallback.NULL_OPTIMISTIC_VERSION to indicate no versioning check is used.
See Also:
OptimisticCallback.getVersionedObjectForValue(Object)

updateVersionedObjectForValue

public void updateVersionedObjectForValue(Object value)
Deprecated. 
This method does nothing because no version checking is used.

Specified by:
updateVersionedObjectForValue in interface OptimisticCallback
Parameters:
value - The value whose version attribute must be updated.
See Also:
OptimisticCallback.updateVersionedObjectForValue(Object)

serializeVersionedValue

public void serializeVersionedValue(Object versionedValue,
                                    ObjectOutputStream stream)
Deprecated. 
This method does nothing because no version checking is used.

Specified by:
serializeVersionedValue in interface OptimisticCallback
Parameters:
versionedValue - the versioned value object
stream - The stream to write the object to
See Also:
OptimisticCallback.serializeVersionedValue(Object, ObjectOutputStream)

inflateVersionedValue

public Object inflateVersionedValue(ObjectInputStream stream)
Deprecated. 
Description copied from interface: OptimisticCallback
Reads a versioned value object from the specified stream.

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.

Specified by:
inflateVersionedValue in interface OptimisticCallback
Parameters:
stream - the ObjectInputStream object to read the versioned value object from
Returns:
a OptimisticCallback.NULL_OPTIMISTIC_VERSION to indicate no versioning check is used.
See Also:
OptimisticCallback.inflateVersionedValue(ObjectInputStream)

IBM WebSphereTM eXtreme Scale, Release 8.5
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.