IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins.io
Interface SerializerAccessor


public interface SerializerAccessor

Each BackingMap has a SerializerAccessor associated with it, which includes references to custom DataSerializers that eXtreme Scale uses to serialize, inflate and query data.

The MapSerializerPlugin BackingMap plug-in is the BackingMap's main interface which provides metadata and a DataSerializer for both the map's key and value.

The DataObjectContext associated with a SerializerAccessor provides methods for creating and converting key and value data objects.

A MapSerializerPlugin can be registered programmatically using the registerMapSerializer when using a local, in-memory ObjectGrid. For a distributed ObjectGrid, a MapSerializer is configured using the ObjectGrid descriptor XML file as a BackingMap plug-in.

Example MapSerializerPlugin configuration:

 <backingMapPluginCollections>
   <backingMapPluginCollection id="plugin_Order">
     <bean
        id="MapSerializerPlugin"
        className="com.ibm.websphere.objectgrid.plugins.io.BasicMapSerializer">

       <property
          name="keyDataSerializerClass" type="java.lang.String"
          value="com.ibm.websphere.samples.xs.serializer.proto.ProtoKeySerializer" />
       <property
          name="keyProperties" type="java.lang.String"
          value="type=com.ibm.websphere.samples.xs.serializer.proto.DataObjects$OrderKey" />

       <property
          name="valueDataSerializerClass" type="java.lang.String"
          value="com.ibm.websphere.samples.xs.serializer.proto.ProtoValueSerializer" />
       <property
          name="valueProperties" type="java.lang.String"
          value="type=com.ibm.websphere.samples.xs.serializer.proto.DataObjects$Order" />
     </bean>
 ...
 

Since:
7.1.1

Method Summary
 BackingMap getBackingMap()
          Retrieve the BackingMap associated with this SerializerAccessor.
 DataObjectContext getDefaultContext()
          Retrieve the default DataObjectContext associated with this SerializerAccessor
 MapSerializerPlugin getMapSerializerPlugin()
          Retrieve the MapSerializerPlugin instance.
 void registerMapSerializerPlugin(MapSerializerPlugin mapSerializerPlugin)
          Register a new MapSerializerPlugin for the cache entry key for a local, in-memory ObjectGrid instance.
 MapSerializerPlugin unregisterMapSerializerPlugin()
          Remove the MapSerializerPlugin instance.
 

Method Detail

registerMapSerializerPlugin

void registerMapSerializerPlugin(MapSerializerPlugin mapSerializerPlugin)
Register a new MapSerializerPlugin for the cache entry key for a local, in-memory ObjectGrid instance.

A MapSerializerPlugin can only be registered before the BackingMap has been initialized. A MapSerializerPlugin that implements the BackingMapLifecycleListener is automatically added as if the BackingMap.addMapEventListener(EventListener) method was called. Any previous MapSerializer which implements BackingMapLifecycleListener is removed as if the BackingMap.removeMapEventListener(EventListener) method was called.

Parameters:
mapSerializerPlugin - the MapSerializerPlugin plug-in.

unregisterMapSerializerPlugin

MapSerializerPlugin unregisterMapSerializerPlugin()
Remove the MapSerializerPlugin instance. If the MapSerializerPlugin implements BackingMapLifecycleListener, it is removed as if the BackingMap.removeMapEventListener(EventListener) method was called.

Returns:
the MapSerializerPlugin that was removed.

getMapSerializerPlugin

MapSerializerPlugin getMapSerializerPlugin()
Retrieve the MapSerializerPlugin instance.

Returns:
the MapSerializerPlugin if present.

getBackingMap

BackingMap getBackingMap()
Retrieve the BackingMap associated with this SerializerAccessor.

Returns:
the BackingMap instance.

getDefaultContext

DataObjectContext getDefaultContext()
Retrieve the default DataObjectContext associated with this SerializerAccessor

Returns:
the default DataObjectContext, or null if there is no MapSerializer defined.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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