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 ObjectSerializationCodecFactory

    java.lang.Object
      org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory

All Implemented Interfaces:
  ProtocolCodecFactory

    public class ObjectSerializationCodecFactory

extends Object
implements ProtocolCodecFactory

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.

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
`ObjectSerializationCodecFactory()` Creates a new instance with the `ClassLoader` of the current thread.
`ObjectSerializationCodecFactory(ClassLoader classLoader)` Creates a new instance with the specified `ClassLoader`.

Method Summary
`ProtocolDecoder` | `getDecoder()` Returns a new (or reusable) instance of `ProtocolDecoder` which decodes binary or protocol-specific data into message objects.
`int` | `getDecoderMaxObjectSize()` Returns the allowed maximum size of the object to be decoded.
`ProtocolEncoder` | `getEncoder()` Returns a new (or reusable) instance of `ProtocolEncoder` which encodes message objects into binary or protocol-specific data.
`int` | `getEncoderMaxObjectSize()` Returns the allowed maximum size of the encoded object.
`void` | `setDecoderMaxObjectSize(int maxObjectSize)` Sets the allowed maximum size of the object to be decoded.
`void` | `setEncoderMaxObjectSize(int maxObjectSize)` Sets the allowed maximum size of the encoded object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

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

Method Detail

### getEncoder

    public ProtocolEncoder getEncoder()

  Description copied from interface: `ProtocolCodecFactory`
  Returns a new (or reusable) instance of `ProtocolEncoder` which encodes message objects into binary or protocol-specific data.

  Specified by:
    `getEncoder` in interface `ProtocolCodecFactory`

### getDecoder

    public ProtocolDecoder getDecoder()

  Description copied from interface: `ProtocolCodecFactory`
  Returns a new (or reusable) instance of `ProtocolDecoder` which decodes binary or protocol-specific data into message objects.

  Specified by:
    `getDecoder` in interface `ProtocolCodecFactory`

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

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

### getDecoderMaxObjectSize

    public int getDecoderMaxObjectSize()

  Returns the allowed maximum size of the object to be decoded. If the size of the object to be decoded exceeds this value, the decoder will throw a `BufferDataException`. The default value is `1048576` (1MB).

  This method does the same job with `ObjectSerializationDecoder.getMaxObjectSize()`.

### setDecoderMaxObjectSize

    public void setDecoderMaxObjectSize(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, the decoder will throw a `BufferDataException`. The default value is `1048576` (1MB).

  This method does the same job with `ObjectSerializationDecoder.setMaxObjectSize(int)`.

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.