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 ObjectSerializationDecoder

    java.lang.Object
      org.apache.mina.filter.codec.ProtocolDecoderAdapter
          org.apache.mina.filter.codec.CumulativeProtocolDecoder
              org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder

All Implemented Interfaces:
  ProtocolDecoder

    public class ObjectSerializationDecoder

extends CumulativeProtocolDecoder

A `ProtocolDecoder` which deserializes `Serializable` Java objects using `ByteBuffer.getObject(ClassLoader)`.

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

Constructor Summary
`ObjectSerializationDecoder()` Creates a new instance with the `ClassLoader` of the current thread.
`ObjectSerializationDecoder(ClassLoader classLoader)` Creates a new instance with the specified `ClassLoader`.

Method Summary
`protected boolean` | `doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out)` Implement this method to consume the specified cumulative buffer and decode its content into message(s).
`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

### ObjectSerializationDecoder

    public ObjectSerializationDecoder()

  Creates a new instance with the `ClassLoader` of the current thread.

### ObjectSerializationDecoder

    public ObjectSerializationDecoder(ClassLoader classLoader)

  Creates a new instance with the specified `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 `1048576` (1MB).

### 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 `1048576` (1MB).

### doDecode

    protected boolean doDecode(IoSession session,
                               ByteBuffer in,
                               ProtocolDecoderOutput out)
                        throws Exception

  Description copied from class: `CumulativeProtocolDecoder`
  Implement this method to consume the specified cumulative buffer and decode its content into message(s).

  Specified by:
    `doDecode` in class `CumulativeProtocolDecoder`
    `in` - the cumulative buffer
  Returns:
    `true` if and only if there's more to decode in the buffer and you want to have `doDecode` method invoked again. Return `false` if remaining data is not enough to decode, then this method will be invoked again when more data is cumulated.
  Throws:
    `Exception` - if cannot decode `in`.

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.