IBM WebSphere Extended Deployment (XD)TM
Release 6.0.1

com.ibm.websphere.objectgrid.plugins
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 the application provides an ObjectTransformer for each BackingMap then this drops to less than 5%, a significant performance improvement. If a customer has a performance problem then this is the #1 advice, provide ObjectTransformers for every Map.
See Also:
    setObjectTransformer(ObjectTransformer)



Method Summary
public  voidserializeKey(java.lang.Object, java.io.ObjectOutputStream)
           This method will write the value to the specified stream. The.
public  voidserializeValue(java.lang.Object, java.io.ObjectOutputStream)
           This method will write the value to the specified stream. The.
public  ObjectinflateKey(java.io.ObjectInputStream)
           This method reads a Key object from the stream. The default implementation.
public  ObjectinflateValue(java.io.ObjectInputStream)
           This method takes the Serializable version of the value and returns the actual value object.
public  ObjectcopyValue(java.lang.Object)
           This allows a custom copy method to be used whenever the core needs to clone a value.
public  ObjectcopyKey(java.lang.Object)
           This is used to copy the key efficiently. This is called mainly for safety so that if the application.

Method Detail

serializeKey

public void serializeKey(Object key,ObjectOutputStream stream)
This method will write the value to the specified stream. The default implementation just does a writeObject.
Parameters:
    key - the key object
    stream - the ObjectOutputStream object to write the key object to


Throws:
    java.io.IOException


serializeValue

public void serializeValue(Object value,ObjectOutputStream stream)
This method will write the value to the specified stream. The default implementation just does a writeObject.
Parameters:
    value - the value object
    stream - the ObjectOutputStream object to write the value object to


Throws:
    java.io.IOException


inflateKey

public Object inflateKey(ObjectInputStream stream)
This method reads a Key object from the stream. The default implementation just does a readObject.
Parameters:
    stream - The stream where the key was serialized using the serializeKey method.


Returns:
     Object de-serialized key object


Throws:
    java.io.IOExceptionjava.lang.ClassNotFoundException


inflateValue

public Object inflateValue(ObjectInputStream stream)
This method takes the Serializable version of the value and returns the actual value object.
Parameters:
    stream - The stream where the value was serialized using the serializeValue method.


Returns:
     Object de-serialized value object.


Throws:
    java.io.IOExceptionjava.lang.ClassNotFoundException


copyValue

public Object copyValue(Object value)
This allows a custom copy method to be used whenever the core needs to clone a value.
Parameters:


Returns:
     a copy of value.


copyKey

public Object copyKey(Object key)
This is used to copy the key efficiently. This is called mainly for safety so that if the application inadvertantly modifies a key then the result isn't a corrupted runtime.
Parameters:
    key - The key to copy


Returns:
     A copy of the key


IBM WebSphere Extended Deployment (XD)TM
Release 6.0.1