org.apache.mina.filter.codec.serialization

Class ObjectSerializationCodecFactory

Implemented Interfaces:
ProtocolCodecFactory

public class ObjectSerializationCodecFactory
extends java.lang.Object
implements ProtocolCodecFactory

A ProtocolCodecFactory that serializes and deserializes Java objects. This codec is very useful when you have to prototype your application rapidly without any specific codec.

Constructor Summary

ObjectSerializationCodecFactory()
Creates a new instance with the ClassLoader of the current thread.
ObjectSerializationCodecFactory(ClassLoader classLoader)
Creates a new instance with the specified ClassLoader.

Method Summary

ProtocolDecoder
getDecoder()
Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
int
getDecoderMaxObjectSize()
Returns the allowed maximum size of the object to be decoded.
ProtocolEncoder
getEncoder()
Returns a new (or reusable) instance of ProtocolEncoder which encodes message objects into binary or protocol-specific data.
int
getEncoderMaxObjectSize()
Returns the allowed maximum size of the encoded object.
void
setDecoderMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the object to be decoded.
void
setEncoderMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the encoded object.

Constructor Details

ObjectSerializationCodecFactory

public ObjectSerializationCodecFactory()
Creates a new instance with the ClassLoader of the current thread.

ObjectSerializationCodecFactory

public ObjectSerializationCodecFactory(ClassLoader classLoader)
Creates a new instance with the specified ClassLoader.

Method Details

getDecoder

public ProtocolDecoder getDecoder()
Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
Specified by:
getDecoder in interface ProtocolCodecFactory

getDecoderMaxObjectSize

public int getDecoderMaxObjectSize()

getEncoder

public ProtocolEncoder getEncoder()
Returns a new (or reusable) instance of ProtocolEncoder which encodes message objects into binary or protocol-specific data.
Specified by:
getEncoder in interface ProtocolCodecFactory

getEncoderMaxObjectSize

public int getEncoderMaxObjectSize()

setDecoderMaxObjectSize

public void setDecoderMaxObjectSize(int maxObjectSize)

setEncoderMaxObjectSize

public void setEncoderMaxObjectSize(int maxObjectSize)