openlsd.network.common.codec
Class LSDSerializationDecoderCumulative

java.lang.Object
  extended by org.apache.mina.filter.codec.ProtocolDecoderAdapter
      extended by org.apache.mina.filter.codec.CumulativeProtocolDecoder
          extended by openlsd.network.common.codec.LSDSerializationDecoderCumulative
All Implemented Interfaces:
org.apache.mina.filter.codec.ProtocolDecoder

public class LSDSerializationDecoderCumulative
extends org.apache.mina.filter.codec.CumulativeProtocolDecoder

A ProtocolDecoder which deserializes Serializable Java objects using IoBuffer.getObject(ClassLoader). Small changes to the default implementation of serialization from Mina. (mainly size limits and free structure)

Version:
$Rev: 389042 $, $Date: 2006-03-27 16:49:41 +0900 (Mon, 27 Mar 2006) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
LSDSerializationDecoderCumulative()
          Creates a new instance with the ClassLoader of the current thread.
LSDSerializationDecoderCumulative(java.lang.ClassLoader classLoader)
          Creates a new instance with the specified ClassLoader.
 
Method Summary
protected  boolean doDecode(org.apache.mina.common.IoSession session, org.apache.mina.common.IoBuffer in, org.apache.mina.filter.codec.ProtocolDecoderOutput out)
           
 int getMaxObjectSize()
          Returns the allowed maximum size of the object to be decoded.
 void setMaxObjectSize(int maxObjectSize)
          Sets the allowed maximum size of the object to be decoded.
 
Methods inherited from class org.apache.mina.filter.codec.CumulativeProtocolDecoder
decode, dispose
 
Methods inherited from class org.apache.mina.filter.codec.ProtocolDecoderAdapter
finishDecode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSDSerializationDecoderCumulative

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


LSDSerializationDecoderCumulative

public LSDSerializationDecoderCumulative(java.lang.ClassLoader classLoader)
Creates a new instance with the specified ClassLoader.

Parameters:
classLoader -
Method Detail

getMaxObjectSize

public int getMaxObjectSize()
Returns the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, this decoder will throw a BufferDataException. The default value is 2GB.

Returns:
the allowed maximum size

setMaxObjectSize

public void setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, this decoder will throw a BufferDataException. The default value is 2GB.

Parameters:
maxObjectSize -

doDecode

protected boolean doDecode(org.apache.mina.common.IoSession session,
                           org.apache.mina.common.IoBuffer in,
                           org.apache.mina.filter.codec.ProtocolDecoderOutput out)
                    throws java.lang.Exception
Specified by:
doDecode in class org.apache.mina.filter.codec.CumulativeProtocolDecoder
Throws:
java.lang.Exception
See Also:
CumulativeProtocolDecoder.doDecode(org.apache.mina.common.IoSession, org.apache.mina.common.IoBuffer, org.apache.mina.filter.codec.ProtocolDecoderOutput)