@Named(value="java") public final class DefaultSerializer extends Object implements Serializer, ClassLoaderAware
| Constructor and Description |
|---|
DefaultSerializer()
Default constructor.
|
DefaultSerializer(ClassLoader loader)
Construct a DefaultSerializer that will use the passed ClassLoader.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
deserialize(ReadBuffer.BufferInput in)
Deserialize an object from a ReadBuffer by reading its state using the
specified BufferInput object.
|
ClassLoader |
getContextClassLoader()
Retrieve the context ClassLoader for this object.
|
void |
serialize(WriteBuffer.BufferOutput out,
Object o)
Serialize an object to a WriteBuffer by writing its state using the
specified BufferOutput object.
|
void |
setContextClassLoader(ClassLoader loader)
Specify the context ClassLoader for this object.
|
String |
toString()
Return a description of this DefaultSerializer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdeserialize, getNamepublic DefaultSerializer()
public DefaultSerializer(ClassLoader loader)
loader - the ClassLoader to use for deserializationpublic void serialize(WriteBuffer.BufferOutput out, Object o) throws IOException
Serializer
Note: Starting with Coherence 12.2.1 classes that need to designate
an alternative object to be used by the Serializer when writing the object
to the buffer should implement the SerializationSupport.writeReplace()
method.
serialize in interface Serializerout - the BufferOutput with which to write the object's stateo - the object to serializeIOException - if an I/O error occurspublic Object deserialize(ReadBuffer.BufferInput in) throws IOException
Serializer
Note: Starting with Coherence 12.2.1 classes that need to designate
an alternative object to be returned by the Serializer after an object is
deserialized from the buffer should implement the
SerializationSupport.readResolve() method.
deserialize in interface Serializerin - the BufferInput with which to read the object's stateIOException - if an I/O error occurspublic ClassLoader getContextClassLoader()
ClassLoaderAwaregetContextClassLoader in interface ClassLoaderAwareThread.getContextClassLoader()public void setContextClassLoader(ClassLoader loader)
ClassLoaderAwaresetContextClassLoader in interface ClassLoaderAwareloader - the context ClassLoader for this object