Package com.tangosol.io
Class DefaultSerializer
java.lang.Object
com.tangosol.io.DefaultSerializer
- All Implemented Interfaces:
ClassLoaderAware
,Serializer
@Named("java")
public final class DefaultSerializer
extends Object
implements Serializer, ClassLoaderAware
A Serializer implementation that uses the ExternalizableHelper implementation
for serialization and deserialization of objects.
- Since:
- Coherence 3.4
- Author:
- cp/jh 2006.07.21 (SimpleSerializer)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefault constructor.DefaultSerializer
(ClassLoader loader) Construct a DefaultSerializer that will use the passed ClassLoader. -
Method Summary
Modifier and TypeMethodDescriptionDeserialize an object from a ReadBuffer by reading its state using the specified BufferInput object.Retrieve the context ClassLoader for this object.getName()
Return the name of this serializer.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.toString()
Return a description of this DefaultSerializer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tangosol.io.Serializer
deserialize
-
Field Details
-
NAME
The name of this serializer.- See Also:
-
-
Constructor Details
-
DefaultSerializer
public DefaultSerializer()Default constructor. -
DefaultSerializer
Construct a DefaultSerializer that will use the passed ClassLoader.- Parameters:
loader
- the ClassLoader to use for deserialization
-
-
Method Details
-
serialize
Description copied from interface:Serializer
Serialize an object to a WriteBuffer by writing its state using the specified BufferOutput object.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.- Specified by:
serialize
in interfaceSerializer
- Parameters:
out
- the BufferOutput with which to write the object's stateo
- the object to serialize- Throws:
IOException
- if an I/O error occurs
-
deserialize
Description copied from interface:Serializer
Deserialize an object from a ReadBuffer by reading its state using the specified BufferInput object.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.- Specified by:
deserialize
in interfaceSerializer
- Parameters:
in
- the BufferInput with which to read the object's state- Returns:
- the deserialized user type instance
- Throws:
IOException
- if an I/O error occurs
-
getName
Description copied from interface:Serializer
Return the name of this serializer.- Specified by:
getName
in interfaceSerializer
- Returns:
- the name of this serializer
-
getContextClassLoader
Description copied from interface:ClassLoaderAware
Retrieve the context ClassLoader for this object. The context ClassLoader is provided by the creator of the object for use by the object when loading classes and resources.- Specified by:
getContextClassLoader
in interfaceClassLoaderAware
- Returns:
- the context ClassLoader for this object
- See Also:
-
setContextClassLoader
Description copied from interface:ClassLoaderAware
Specify the context ClassLoader for this object. The context ClassLoader can be set when the object is created, and allows the creator to provide the appropriate class loader to be used by the object when when loading classes and resources.- Specified by:
setContextClassLoader
in interfaceClassLoaderAware
- Parameters:
loader
- the context ClassLoader for this object
-
toString
Return a description of this DefaultSerializer.
-