Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


com.tangosol.io
Class DefaultSerializer

java.lang.Object
  extended by com.tangosol.io.DefaultSerializer

All Implemented Interfaces:
ClassLoaderAware, Serializer

public final class DefaultSerializer
extends java.lang.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)

Constructor Summary
DefaultSerializer()
          Default constructor.
DefaultSerializer(java.lang.ClassLoader loader)
          Construct a DefaultSerializer that will use the passed ClassLoader.

 

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.ClassLoader getContextClassLoader()
          Retrieve the context ClassLoader for this object.
 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 setContextClassLoader(java.lang.ClassLoader loader)
          Specify the context ClassLoader for this object.
 java.lang.String toString()
          Return a description of this DefaultSerializer.

 

Constructor Detail

DefaultSerializer

public DefaultSerializer()
Default constructor.

DefaultSerializer

public DefaultSerializer(java.lang.ClassLoader loader)
Construct a DefaultSerializer that will use the passed ClassLoader.
Parameters:
loader - the ClassLoader to use for deserialization

Method Detail

serialize

public void serialize(WriteBuffer.BufferOutput out,
                      java.lang.Object o)
               throws java.io.IOException
Serialize an object to a WriteBuffer by writing its state using the specified BufferOutput object.
Specified by:
serialize in interface Serializer
Parameters:
out - the BufferOutput with which to write the object's state
o - the object to serialize
Throws:
java.io.IOException - if an I/O error occurs

deserialize

public java.lang.Object deserialize(ReadBuffer.BufferInput in)
                             throws java.io.IOException
Deserialize an object from a ReadBuffer by reading its state using the specified BufferInput object.
Specified by:
deserialize in interface Serializer
Parameters:
in - the BufferInput with which to read the object's state
Returns:
the deserialized user type instance
Throws:
java.io.IOException - if an I/O error occurs

getContextClassLoader

public java.lang.ClassLoader getContextClassLoader()
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 interface ClassLoaderAware
Returns:
the context ClassLoader for this object
See Also:
Thread.getContextClassLoader()

setContextClassLoader

public void setContextClassLoader(java.lang.ClassLoader loader)
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 interface ClassLoaderAware
Parameters:
loader - the context ClassLoader for this object

toString

public java.lang.String toString()
Return a description of this DefaultSerializer.
Returns:
a String representation of the DefaultSerializer object

Skip navigation links

Oracle® Coherence Java API Reference
v3.5.1

E15583-01


Copyright © 2000, 2009, Oracle. All rights reserved.