|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.
BackingMap.setObjectTransformer(ObjectTransformer)| Method Summary | |
|---|---|
java.lang.Object |
copyKey(java.lang.Object key)
Creates a copy of a key object. |
java.lang.Object |
copyValue(java.lang.Object value)
Creates a copy of a value object. |
java.lang.Object |
inflateKey(java.io.ObjectInputStream stream)
Reads a key object from the specified stream. |
java.lang.Object |
inflateValue(java.io.ObjectInputStream stream)
Reads a value object from the specified stream. |
void |
serializeKey(java.lang.Object key,
java.io.ObjectOutputStream stream)
Writes a key object to the specified stream. |
void |
serializeValue(java.lang.Object value,
java.io.ObjectOutputStream stream)
Writes a value object to the specified stream. |
| Method Detail |
|---|
void serializeKey(java.lang.Object key,
java.io.ObjectOutputStream stream)
throws java.io.IOException
The default implementation simply performs a writeObject
invocation passing in the key object.
key - the key object to serializestream - the ObjectOutputStream object to write the key object to
java.io.IOException - if an error occurs during processing of this method
void serializeValue(java.lang.Object value,
java.io.ObjectOutputStream stream)
throws java.io.IOException
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.
value - the value object to serialize (may be null)stream - the ObjectOutputStream object to write the value object to
java.io.IOException - if an error occurs during processing of this methodBackingMap.setNullValuesSupported(boolean)
java.lang.Object inflateKey(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
The default implementation simply performs a readObject
invocation.
stream - the ObjectInputStream object to read the key object from
java.io.IOException - if an error occurs during processing of this method
java.lang.ClassNotFoundException - if the key class isn't foundserializeKey(Object, ObjectOutputStream)
java.lang.Object inflateValue(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
The default implementation simply performs a readObject
invocation. A proper implementation needs to handle null
values if they are supported.
stream - the ObjectInputStream object to read the value
object from
null)
java.io.IOException - if an error occurs during processing of this method
java.lang.ClassNotFoundException - if the value class isn't foundserializeValue(Object, ObjectOutputStream),
BackingMap.setNullValuesSupported(boolean)java.lang.Object copyValue(java.lang.Object value)
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.
value - the value object to copy (may be null)
CopyMode,
BackingMap.setCopyMode(CopyMode, Class),
BackingMap.setNullValuesSupported(boolean)java.lang.Object copyKey(java.lang.Object key)
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.
key - the key object to copy
BackingMap.setCopyKey(boolean)
|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||