|
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 |
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).
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 |
---|
void serializeKey(Object key, ObjectOutputStream stream) throws 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
IOException
- if an error occurs during processing of this methodvoid serializeValue(Object value, ObjectOutputStream stream) throws 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
IOException
- if an error occurs during processing of this methodBackingMap.setNullValuesSupported(boolean)
Object inflateKey(ObjectInputStream stream) throws IOException, ClassNotFoundException
The default implementation simply performs a readObject
invocation.
stream
- the ObjectInputStream
object to read the key object from
IOException
- if an error occurs during processing of this method
ClassNotFoundException
- if the key class isn't foundserializeKey(Object, ObjectOutputStream)
Object inflateValue(ObjectInputStream stream) throws IOException, 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
)
IOException
- if an error occurs during processing of this method
ClassNotFoundException
- if the value class isn't foundserializeValue(Object, ObjectOutputStream)
,
BackingMap.setNullValuesSupported(boolean)
Object copyValue(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)
Object copyKey(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 WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |