openlsd.network.common.codec
Class LSDSerializationEncoder

java.lang.Object
  extended by org.apache.mina.filter.codec.ProtocolEncoderAdapter
      extended by openlsd.network.common.codec.LSDSerializationEncoder
All Implemented Interfaces:
org.apache.mina.filter.codec.ProtocolEncoder

public class LSDSerializationEncoder
extends org.apache.mina.filter.codec.ProtocolEncoderAdapter

Small changes to the default implementation of serialization from Mina. (mainly size limits and free structures)

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
LSDSerializationEncoder()
          Creates a new instance.
 
Method Summary
 void encode(org.apache.mina.common.IoSession session, java.lang.Object message, org.apache.mina.filter.codec.ProtocolEncoderOutput out)
           
 int getMaxObjectSize()
          Returns the allowed maximum size of the encoded object.
 void setMaxObjectSize(int maxObjectSize)
          Sets the allowed maximum size of the encoded object.
 
Methods inherited from class org.apache.mina.filter.codec.ProtocolEncoderAdapter
dispose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSDSerializationEncoder

public LSDSerializationEncoder()
Creates a new instance.

Method Detail

getMaxObjectSize

public int getMaxObjectSize()
Returns the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, this encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

Returns:
the allowed maximum size

setMaxObjectSize

public void setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, this encoder will throw a IllegalArgumentException. The default value is Integer.MAX_VALUE.

Parameters:
maxObjectSize -

encode

public void encode(org.apache.mina.common.IoSession session,
                   java.lang.Object message,
                   org.apache.mina.filter.codec.ProtocolEncoderOutput out)
            throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
ProtocolEncoder.encode(org.apache.mina.common.IoSession, java.lang.Object, org.apache.mina.filter.codec.ProtocolEncoderOutput)