|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.io.pof.SimplePofContext
public class SimplePofContext
Basic PofContext
implementation.
PortableObjectSerializer
Field Summary | |
---|---|
protected boolean |
m_fReferenceEnabled True if POF Identity/Reference type support is enabled. |
protected LongArray |
m_laClass A LongArray of user types, indexed by type identifier. |
protected LongArray |
m_laSerializer A LongArray of PofSerializer objects, indexed by type identifier. |
protected java.util.Map |
m_mapTypeId A Map that contains mappings from a registered user type into type identifier. |
Constructor Summary | |
---|---|
SimplePofContext() Create a new SimplePofContext. |
Method Summary | |
---|---|
java.lang.Object |
deserialize(ReadBuffer.BufferInput in) Deserialize an object from a ReadBuffer by reading its state using the specified BufferInput object. |
java.lang.Class |
getClass(int nTypeId) Determine the class associated with the given user type identifier. |
java.lang.String |
getClassName(int nTypeId) Determine the name of the class associated with the given user type identifier. |
PofSerializer |
getPofSerializer(int nTypeId) Return a PofSerializer that can be used to serialize and deserialize an object of the specified user type to and from a POF stream. |
int |
getUserTypeIdentifier(java.lang.Class clz) Determine the user type identifier associated with the given class. |
int |
getUserTypeIdentifier(java.lang.Object o) Determine the user type identifier associated with the given object. |
int |
getUserTypeIdentifier(java.lang.String sClass) Determine the user type identifier associated with the given class name. |
boolean |
isReferenceEnabled() Determine if Identity/Reference type support is enabled for this SimplePofContext. |
boolean |
isUserType(java.lang.Class clz) Determine if the given class is a user type known to this PofContext. |
boolean |
isUserType(java.lang.Object o) Determine if the given object is of a user type known to this PofContext. |
boolean |
isUserType(java.lang.String sClass) Determine if the class with the given name is a user type known to this PofContext. |
void |
registerUserType(int nTypeId, java.lang.Class clz, PofSerializer serializer) Associate a user type with a type identifier and PofSerializer . |
void |
serialize(WriteBuffer.BufferOutput out, java.lang.Object o) Serialize an object to a WriteBuffer by writing its state using the specified BufferOutput object. |
void |
setReferenceEnabled(boolean fEnabled) Enable or disable POF Identity/Reference type support for this SimplePofContext. |
void |
unregisterUserType(int nTypeId) Unregister a user type that was previously registered using the specified type identifier. |
protected void |
validateTypeId(int nTypeId) Ensure that the given user type identifier is valid. |
Field Detail |
---|
protected java.util.Map m_mapTypeId
protected LongArray m_laClass
protected LongArray m_laSerializer
protected boolean m_fReferenceEnabled
Constructor Detail |
---|
public SimplePofContext()
Method Detail |
---|
public void serialize(WriteBuffer.BufferOutput out, java.lang.Object o) throws java.io.IOException
serialize
in interface Serializer
out
- the BufferOutput with which to write the object's stateo
- the object to serializejava.io.IOException
- if an I/O error occurspublic java.lang.Object deserialize(ReadBuffer.BufferInput in) throws java.io.IOException
deserialize
in interface Serializer
in
- the BufferInput with which to read the object's statejava.io.IOException
- if an I/O error occurspublic PofSerializer getPofSerializer(int nTypeId)
getPofSerializer
in interface PofContext
nTypeId
- the type identifier of the user type that can be serialized and deserialized using the returned PofSerializer; must be non-negativepublic int getUserTypeIdentifier(java.lang.Object o)
getUserTypeIdentifier
in interface PofContext
o
- an instance of a user type; must not be nullpublic int getUserTypeIdentifier(java.lang.Class clz)
getUserTypeIdentifier
in interface PofContext
clz
- a user type class; must not be nullpublic int getUserTypeIdentifier(java.lang.String sClass)
getUserTypeIdentifier
in interface PofContext
sClass
- the name of a user type class; must not be nullpublic java.lang.String getClassName(int nTypeId)
getClassName
in interface PofContext
nTypeId
- the user type identifier; must be non-negativepublic java.lang.Class getClass(int nTypeId)
getClass
in interface PofContext
nTypeId
- the user type identifier; must be non-negativepublic boolean isUserType(java.lang.Object o)
isUserType
in interface PofContext
o
- the object to test; must not be nullpublic boolean isUserType(java.lang.Class clz)
isUserType
in interface PofContext
clz
- the class to test; must not be nullpublic boolean isUserType(java.lang.String sClass)
isUserType
in interface PofContext
sClass
- the name of the class to test; must not be nullpublic void registerUserType(int nTypeId, java.lang.Class clz, PofSerializer serializer)
PofSerializer
.nTypeId
- the type identifier of the specified user type; must be greater or equal to 0clz
- the user type to register with this PofContext; must not be nullserializer
- the PofSerializer that will be used to serialize and deserialize objects of the specified class; must not be nulljava.lang.IllegalArgumentException
- on invalid type identifer, class, or PofSerializerpublic void unregisterUserType(int nTypeId)
nTypeId
- the type identifier of the user type to unregisterjava.lang.IllegalArgumentException
- if the specified user type identifier is unknown to this PofContextprotected void validateTypeId(int nTypeId)
nTypeId
- the user type identifier to validatejava.lang.IllegalArgumentException
- if the given user type identifier is negativepublic boolean isReferenceEnabled()
public void setReferenceEnabled(boolean fEnabled)
fEnabled
- true to enable POF Identity/Reference type support; false to disable
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |