CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.io.pof
Class SafeConfigurablePofContext.SafePofHolder

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.BitHelper
          extended by com.tangosol.util.ExternalizableHelper
              extended by com.tangosol.io.pof.SafeConfigurablePofContext.SafePofHolder
All Implemented Interfaces:
Evolvable, ExternalizableLite, EvolvablePortableObject, PortableObject, Externalizable, Serializable
Enclosing class:
SafeConfigurablePofContext

public static final class SafeConfigurablePofContext.SafePofHolder
extends ExternalizableHelper
implements EvolvablePortableObject, Externalizable, ExternalizableLite

A SafePofHolder represents the serialized form of any valid POF user type instance.

The type identifier and version of the serialized POF user type can be obtained via the getTypeId() and getVersionId() accessors respectively. The serialized POF user type properties are treated as "future" properties and can be obtained via the getFutureData() accessor.


Field Summary
static int TYPE_ID
          The type identifier of a SafePofHolder.
 
Constructor Summary
SafeConfigurablePofContext.SafePofHolder()
          Default constructor.
SafeConfigurablePofContext.SafePofHolder(int nTypeId, int nVersion, Binary binData)
          Create a new SafePofHolder from the given POF user type identifier, version identifier and serialized property data.
 
Method Summary
 boolean equals(Object o)
          
 Binary getData()
          Return the serialized property values of the POF user type instance represented by this SafePofHolder.
 int getDataVersion()
          Obtain the version associated with the data stream from which this object was deserialized.
 Binary getFutureData()
          Return all the unknown remainder of the data stream from which this object was deserialized.
 int getImplVersion()
          Determine the serialization version supported by the implementing class.
 int getTypeId()
          Return the type identifier of the POF user type instance represented by his SafePofHolder.
 int getVersionId()
          Return the version identifier of the POF user type instance represented by this SafePofHolder.
 int hashCode()
          
 void readExternal(DataInput in)
          Restore the contents of this object by loading the object's state from the passed DataInput object.
 void readExternal(ObjectInput in)
          
 void readExternal(PofReader in)
          Restore the contents of a user type instance by reading its state using the specified PofReader object.
 void setDataVersion(int nVersionId)
          Set the version associated with the data stream with which this object is being deserialized.
 void setFutureData(Binary binFuture)
          Store the unknown remainder of the data stream from which this object is being deserialized.
 String toString()
          
 void writeExternal(DataOutput out)
          Save the contents of this object by storing the object's state into the passed DataOutput object.
 void writeExternal(ObjectOutput out)
          
 void writeExternal(PofWriter out)
          Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
 
Methods inherited from class com.tangosol.util.BitHelper
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, toBitString, toBitString, toBitString
 

Field Detail

TYPE_ID

public static final int TYPE_ID
The type identifier of a SafePofHolder.

See Also:
Constant Field Values
Constructor Detail

SafeConfigurablePofContext.SafePofHolder

public SafeConfigurablePofContext.SafePofHolder()
Default constructor. Required for Externalizable and ExternalizableLite support.


SafeConfigurablePofContext.SafePofHolder

public SafeConfigurablePofContext.SafePofHolder(int nTypeId,
                                                int nVersion,
                                                Binary binData)
Create a new SafePofHolder from the given POF user type identifier, version identifier and serialized property data.

Parameters:
nTypeId - the type identifier of the POF user type instance
nVersion - the version identifier of the POF user type instance
binData - the serialized POF user type property data
Method Detail

readExternal

public void readExternal(PofReader in)
Restore the contents of a user type instance by reading its state using the specified PofReader object.

Specified by:
readExternal in interface PortableObject
Parameters:
in - the PofReader from which to read the object's state

writeExternal

public void writeExternal(PofWriter out)
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.

Specified by:
writeExternal in interface PortableObject
Parameters:
out - the PofWriter to which to write the object's state

getImplVersion

public int getImplVersion()
Determine the serialization version supported by the implementing class.

Specified by:
getImplVersion in interface Evolvable
Returns:
the serialization version supported by this object

getDataVersion

public int getDataVersion()
Obtain the version associated with the data stream from which this object was deserialized. If the object was constructed (not deserialized), the data version is the same as the implementation version.

Specified by:
getDataVersion in interface Evolvable
Returns:
the version of the data used to initialize this object, greater than or equal to zero

setDataVersion

public void setDataVersion(int nVersionId)
Set the version associated with the data stream with which this object is being deserialized.

Specified by:
setDataVersion in interface Evolvable
Parameters:
nVersionId - the version of the data in the data stream that will be used to deserialize this object; greater than or equal to zero

getFutureData

public Binary getFutureData()
Return all the unknown remainder of the data stream from which this object was deserialized. The remainder is unknown because it is data that was originally written by a future version of this object's class.

Specified by:
getFutureData in interface Evolvable
Returns:
future data in binary form

setFutureData

public void setFutureData(Binary binFuture)
Store the unknown remainder of the data stream from which this object is being deserialized. The remainder is unknown because it is data that was originally written by a future version of this object's class.

Specified by:
setFutureData in interface Evolvable
Parameters:
binFuture - future data in binary form

readExternal

public void readExternal(ObjectInput in)
                  throws IOException

Specified by:
readExternal in interface Externalizable
Throws:
IOException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException

Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(DataInput in)
                  throws IOException
Restore the contents of this object by loading the object's state from the passed DataInput object.

Specified by:
readExternal in interface ExternalizableLite
Parameters:
in - the DataInput stream to read data from in order to restore the state of this object
Throws:
IOException - if an I/O exception occurs
NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into

writeExternal

public void writeExternal(DataOutput out)
                   throws IOException
Save the contents of this object by storing the object's state into the passed DataOutput object.

Specified by:
writeExternal in interface ExternalizableLite
Parameters:
out - the DataOutput stream to write the state of this object to
Throws:
IOException - if an I/O exception occurs

hashCode

public int hashCode()


equals

public boolean equals(Object o)


toString

public String toString()


getTypeId

public int getTypeId()
Return the type identifier of the POF user type instance represented by his SafePofHolder.

Returns:
the type identifier of the POF user type instance

getVersionId

public int getVersionId()
Return the version identifier of the POF user type instance represented by this SafePofHolder.

Returns:
the version identifier of the POF user type instance

getData

public Binary getData()
Return the serialized property values of the POF user type instance represented by this SafePofHolder.

Returns:
the serialized property values of the POF user type instance

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation