IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface ObjectTransformer


Deprecated. This plug-in is deprecated in version 7.1.1. Use the KeySerializerPlugin or ValueSerializerPlugin plug-in

@Deprecated
public interface ObjectTransformer

An ObjectTransformer can be used to serialize map entries that are not defined to be Serializable. This plugin is essential to high performance. Java serialization is a very costly operation. Serialization is the default mechanism for copying objects as well as transmitting objects over the network. Java serialization will normally take around 60-70% of the total CPU cost.

If an application provides an ObjectTransformer for each BackingMap, this cost can drop to less than 5%, a significant performance improvement. If a customer has a performance problem, the #1 advice is to provide ObjectTransformers for every Map.

An ObjectTransformer implementation that also implements the BackingMapLifecycleListener interface will be automatically added as an EventListener on the BackingMap when the arbiter set on the backing map.

An ObjectTransformer 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).

Since:
WAS XD 6.0
See Also:
BackingMap.addMapEventListener(EventListener), BackingMap.setObjectTransformer(ObjectTransformer)

Method Summary
 Object copyKey(Object key)
          Deprecated. Creates a copy of a key object.
 Object copyValue(Object value)
          Deprecated. Creates a copy of a value object.
 Object inflateKey(ObjectInputStream stream)
          Deprecated. Reads a key object from the specified stream.
 Object inflateValue(ObjectInputStream stream)
          Deprecated. Reads a value object from the specified stream.
 void serializeKey(Object key, ObjectOutputStream stream)
          Deprecated. Writes a key object to the specified stream.
 void serializeValue(Object value, ObjectOutputStream stream)
          Deprecated. Writes a value object to the specified stream.
 

Method Detail

serializeKey

void serializeKey(Object key,
                  ObjectOutputStream stream)
                  throws IOException
Deprecated. 
Writes a key object to the specified stream.

The default implementation simply performs a writeObject invocation passing in the key object.

Parameters:
key - the key object to serialize
stream - the ObjectOutputStream object to write the key object to
Throws:
IOException - if an error occurs during processing of this method

serializeValue

void serializeValue(Object value,
                    ObjectOutputStream stream)
                    throws IOException
Deprecated. 
Writes a value object to the specified stream.

The default implementation simply performs a writeObject invocation passing in the value object. A proper implementation needs to handle null values if they are supported.

Parameters:
value - the value object to serialize (may be null)
stream - the ObjectOutputStream object to write the value object to
Throws:
IOException - if an error occurs during processing of this method
See Also:
BackingMap.setNullValuesSupported(boolean)

inflateKey

Object inflateKey(ObjectInputStream stream)
                  throws IOException,
                         ClassNotFoundException
Deprecated. 
Reads a key object from the specified stream.

The default implementation simply performs a readObject invocation.

Parameters:
stream - the ObjectInputStream object to read the key object from
Returns:
de-serialized key object
Throws:
IOException - if an error occurs during processing of this method
ClassNotFoundException - if the key class isn't found
See Also:
serializeKey(Object, ObjectOutputStream)

inflateValue

Object inflateValue(ObjectInputStream stream)
                    throws IOException,
                           ClassNotFoundException
Deprecated. 
Reads a value object from the specified stream.

The default implementation simply performs a readObject invocation. A proper implementation needs to handle null values if they are supported.

Parameters:
stream - the ObjectInputStream object to read the value object from
Returns:
de-serialized value object (may be null)
Throws:
IOException - if an error occurs during processing of this method
ClassNotFoundException - if the value class isn't found
See Also:
serializeValue(Object, ObjectOutputStream), BackingMap.setNullValuesSupported(boolean)

copyValue

Object copyValue(Object value)
Deprecated. 
Creates a copy of a value object.

The default implementation attempts to locate and use a defined clone() method on the value object. If the method isn't found, it copies the value object using serialization. A proper implementation needs to handle null values if they are supported.

Parameters:
value - the value object to copy (may be null)
Returns:
a copy of the value.
See Also:
CopyMode, BackingMap.setCopyMode(CopyMode, Class), BackingMap.setNullValuesSupported(boolean)

copyKey

Object copyKey(Object key)
Deprecated. 
Creates a copy of a key object.

The default implementation attempts to locate and use a defined clone() method on the key object. If the method isn't found, it copies the key object using serialization.

Parameters:
key - the key object to copy
Returns:
a copy of the key
See Also:
BackingMap.setCopyKey(boolean)

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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