IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins.io.dataobject
Interface SerializedEntry

All Superinterfaces:
DataObjectContextAware, DataObjectEntry, Serializable
All Known Subinterfaces:
SerializedKey, SerializedValue

public interface SerializedEntry
extends DataObjectEntry, DataObjectContextAware, Serializable

A data object wrapper that wraps a data object and its serialized form.

A SerializedEntry implements the Serializable interface and can therefore be serialized using Java serialization methods. Since SerializedEntry's are associated with a DataObjectContext, serialization of the SerializedEntry will remove the context from the object, and it will become detached. When detached, methods that require the context will throw an IllegalStateException. Use the DataObjectContextAware.applyContext(DataObjectContext) method to reassociate the context with the SerializedEntry.

The data represented by this SerializedEntry is created using a DataSerializer.

Since:
7.1.1

Method Summary
 XsDataInputStream getInputStream()
          Return a data input stream for the serialized form of the entry.
<T> T
getObject()
          Return the Object form of the data object.
 String toString()
          Return a user readable representation of the entry.
 
Methods inherited from interface com.ibm.websphere.objectgrid.plugins.io.dataobject.DataObjectContextAware
applyContext, getContext
 

Method Detail

toString

String toString()
Return a user readable representation of the entry. This is equivalent to using to using a DataSerializer.UserReadable to retrieve the string.

If DataObjectContextAware.getContext() answers null, the result is undefined.

Overrides:
toString in class Object
Returns:
a user readable representation of the entry.

getInputStream

XsDataInputStream getInputStream()
Return a data input stream for the serialized form of the entry.

Do not store or use the data stream beyond the confines of the method call that receives the SerializedEntry object. The data underlying the stream is owned by the WebSphere eXtreme Scale framework and my be pooled or reused as required.

Returns:
the data input stream with read-only access to the serialized form of the entry.

getObject

<T> T getObject()
Return the Object form of the data object. The SerializedEntry, when returned from any eXtreme Scale API will be a copy. However, subsequent calls to the same SerializedEntry instance will produce the same Object instance.

Specified by:
getObject in interface DataObjectEntry
Returns:
the object instance as created by the DataSerializer
Throws:
IllegalStateException - if DataObjectContextAware.getContext() answers null.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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