jadex.standalone.transport.codecs
Class CodecFactory

java.lang.Object
  extended by jadex.standalone.transport.codecs.CodecFactory

public class CodecFactory
extends Object

The factory for codecs.


Field Summary
protected  Map codeccache
          The codec cache (id -> codec instance).
protected  Map codecclasses
          The mapping (id -> codec class).
protected  byte default_id
          The default codec id.
 
Constructor Summary
CodecFactory()
          Create a new codec factory.
 
Method Summary
 void addCodec(Class codec_class)
          Add a new codec.
 byte getCodecId(Class codec_class)
          Get the codec id for a codec class.
 IDecoder getDecoder(byte id)
          Create a new default decoder.
 byte getDefaultCodecId()
          Get the default decoder/encoder id.
 IDecoder getDefaultDecoder()
          Create a new default decoder.
 IEncoder getDefaultEncoder()
          Create a new default encoder.
 IEncoder getEncoder(byte id)
          Create a new default encoder.
 void removeCodec(Class codec_class)
          Remove a codec via its id.
 void setDefaultCodec(Object codec)
          Set the default decoder/encoder id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codecclasses

protected Map codecclasses
The mapping (id -> codec class).


codeccache

protected Map codeccache
The codec cache (id -> codec instance).


default_id

protected byte default_id
The default codec id.

Constructor Detail

CodecFactory

public CodecFactory()
Create a new codec factory.

Method Detail

getDefaultEncoder

public IEncoder getDefaultEncoder()
Create a new default encoder.

Returns:
The new encoder.

getDefaultDecoder

public IDecoder getDefaultDecoder()
Create a new default decoder.

Returns:
The new decoder.

getEncoder

public IEncoder getEncoder(byte id)
Create a new default encoder.

Returns:
The new encoder.

getDecoder

public IDecoder getDecoder(byte id)
Create a new default decoder.

Returns:
The new decoder.

setDefaultCodec

public void setDefaultCodec(Object codec)
Set the default decoder/encoder id.

Parameters:
id - The id.

getDefaultCodecId

public byte getDefaultCodecId()
Get the default decoder/encoder id.

Parameters:
id - The id.

addCodec

public void addCodec(Class codec_class)
Add a new codec.

Parameters:
codec_id - The codec_id.
codec_class - The codec class.

removeCodec

public void removeCodec(Class codec_class)
Remove a codec via its id.

Parameters:
id - The codec id.

getCodecId

public byte getCodecId(Class codec_class)
Get the codec id for a codec class.



Copyright © 2010. All Rights Reserved.