IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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

All Known Subinterfaces:
DataSerializer.DataAttributeInflatable, DataSerializer.Identifiable, DataSerializer.UserReadable, KeyDataSerializer, KeyDataSerializer.Partitionable, KeySerializerPlugin, ValueDataSerializer, ValueDataSerializer.Mergeable, ValueDataSerializer.Versionable, ValueSerializerPlugin

public interface DataSerializer

Includes methods to serialize and inflate a data objects.

Implement the child interfaces to add additional functionality to the DataSerializer.

The serialized form typically needs the data type and/or attribute encoded into it so that single attributes can be extracted from the serialized form.

Use the MapSerializerPlugin, KeySerializerPlugin and ValueSerializerPlugin interfaces to create custom DataSerializers that can be used to interact with data objects stored in BackingMaps.

Since:
7.1.1

Nested Class Summary
static interface DataSerializer.DataAttributeInflatable
          DataSerializers implement this interface to allow inflating attributes from the serialized form of a data object.
static interface DataSerializer.Identifiable
          DataSerializers implement this interface to allow an alternative identity.
static class DataSerializer.SpecialValue
          Specialty values used by DataSerializer.DataAttributeInflatable.inflateDataObjectAttributes(DataObjectContext, XsDataInputStream, Object).
static interface DataSerializer.UserReadable
          DataSerializers implement this optional interface to allow a customized human readable representation of a data object.
 
Method Summary
 Object inflateDataObject(DataObjectContext ctx, XsDataInputStream dataObjectInput)
          Inflate a data object from the specified data input stream.
 void serializeDataObject(DataObjectContext ctx, Object dataObject, XsDataOutputStream dataObjectOutput)
          Serialize the specified data object.
 

Method Detail

serializeDataObject

void serializeDataObject(DataObjectContext ctx,
                         Object dataObject,
                         XsDataOutputStream dataObjectOutput)
                         throws IOException
Serialize the specified data object.

Do not store or use the data stream beyond the confines of this method call. The data stream is owned by the WebSphere eXtreme Scale framework and my be closed, pooled or reused as required.

Parameters:
ctx - the Context of the method call.
dataObject - the object to serialize. The object may be null.
dataObjectOutput - the data output stream to receive the serialized form of the object.
Throws:
IOException - thrown if there is a problem serializing the data.

inflateDataObject

Object inflateDataObject(DataObjectContext ctx,
                         XsDataInputStream dataObjectInput)
                         throws IOException
Inflate a data object from the specified data input stream.

Do not store or use the data stream beyond the confines of this method call. The data stream is owned by the WebSphere eXtreme Scale framework and my be closed, pooled or reused as required.

Parameters:
ctx - the Context of the method call.
dataObjectInput - the data input stream to read the object, produced from serializeDataObject(DataObjectContext, Object, XsDataOutputStream). Must not be null.
Returns:
the inflated object.
Throws:
IOException - thrown if there is a problem reading the data.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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