Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.filter.codec.serialization
Class ObjectSerializationEncoder

    java.lang.Object
      org.apache.mina.filter.codec.ProtocolEncoderAdapter
          org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder

All Implemented Interfaces:
  ProtocolEncoder

    public class ObjectSerializationEncoder

extends ProtocolEncoderAdapter

A `ProtocolEncoder` which serializes `Serializable` Java objects using `ByteBuffer.putObject(Object)`.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
`ObjectSerializationEncoder()` Creates a new instance.

Method Summary
`void` | `encode(IoSession session, Object message, ProtocolEncoderOutput out)` Encodes higher-level message objects into binary or protocol-specific data.
`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

### ObjectSerializationEncoder

    public ObjectSerializationEncoder()

  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`.

### 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`.

### encode

    public void encode(IoSession session,
                       Object message,
                       ProtocolEncoderOutput out)
                throws Exception

  Description copied from interface: `ProtocolEncoder`
  Encodes higher-level message objects into binary or protocol-specific data. MINA invokes `ProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)` method with message which is popped from the session write queue, and then the encoder implementation puts encoded `ByteBuffer`s into `ProtocolEncoderOutput`.

  Throws:
    `Exception` - if the message violated protocol specification

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.