org.apache.mina.filter.codec.serialization
Class ObjectSerializationCodecFactory
java.lang.Object
org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory
- ProtocolCodecFactory
public class ObjectSerializationCodecFactory
extends java.lang.Object
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.
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
.
getDecoderMaxObjectSize
public int getDecoderMaxObjectSize()
getEncoderMaxObjectSize
public int getEncoderMaxObjectSize()
Returns the allowed maximum size of the encoded object.
If the size of the encoded object exceeds this value, the encoder
will throw a
IllegalArgumentException
. The default value
is
Integer.MAX_VALUE
.
This method does the same job with
ObjectSerializationEncoder.getMaxObjectSize()
.
setDecoderMaxObjectSize
public void setDecoderMaxObjectSize(int maxObjectSize)
setEncoderMaxObjectSize
public void setEncoderMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the encoded object.
If the size of the encoded object exceeds this value, the encoder
will throw a
IllegalArgumentException
. The default value
is
Integer.MAX_VALUE
.
This method does the same job with
ObjectSerializationEncoder.setMaxObjectSize(int)
.