org.objectweb.dream.message.codec
Class CodecInputOutputImpl

java.lang.Object
  extended by org.objectweb.dream.message.codec.CodecInputOutputImpl
All Implemented Interfaces:
CodecInputOutput, Recyclable

public class CodecInputOutputImpl
extends Object
implements CodecInputOutput, Recyclable

Basic implementation of the CodecInputOutput interface.


Field Summary
protected  Object input
           
protected  Object output
           
 
Constructor Summary
CodecInputOutputImpl()
          Default constructor
CodecInputOutputImpl(Object input, Object output)
           
 
Method Summary
 Object getInput()
          Returns an input that can be used to read data to decode.
 Object getOutput()
          Returns an output that can be used to write encoded data.
 Reference<? extends Recyclable> getReference()
          Returns the reference object set by the Recyclable.setReference(Reference) method.
 void recycle()
          Recycles the object.
 void setInput(Object input)
          Set the input.
 void setOutput(Object output)
          Set the output.
 void setReference(Reference<? extends Recyclable> reference)
          Sets a Reference object that can be used by object pool implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected Object input

output

protected Object output
Constructor Detail

CodecInputOutputImpl

public CodecInputOutputImpl()
Default constructor


CodecInputOutputImpl

public CodecInputOutputImpl(Object input,
                            Object output)
Parameters:
input - the input
output - the output
Method Detail

getInput

public Object getInput()
                throws IOException
Description copied from interface: CodecInputOutput
Returns an input that can be used to read data to decode.

Specified by:
getInput in interface CodecInputOutput
Returns:
an input.
Throws:
IOException - if the input can't be created.
See Also:
CodecInputOutput.getInput()

setInput

public void setInput(Object input)
Description copied from interface: CodecInputOutput
Set the input. This is usefull for MessageCodecthat use specialized input. If this object is used to decode another message, the codec can reuse its specialized input.

Specified by:
setInput in interface CodecInputOutput
Parameters:
input - the new input.
See Also:
CodecInputOutput.setInput(Object)

getOutput

public Object getOutput()
                 throws IOException
Description copied from interface: CodecInputOutput
Returns an output that can be used to write encoded data.

Specified by:
getOutput in interface CodecInputOutput
Returns:
an output.
Throws:
IOException - if the output can't be created.
See Also:
CodecInputOutput.getOutput()

setOutput

public void setOutput(Object output)
Description copied from interface: CodecInputOutput
Set the output. This is usefull for MessageCodecthat use specialized output. If this object is used to decode another message, the codec can reuse its specialized output.

Specified by:
setOutput in interface CodecInputOutput
Parameters:
output - the new output.
See Also:
CodecInputOutput.setOutput(Object)

recycle

public void recycle()
Description copied from interface: Recyclable
Recycles the object. This consists in reseting all the fields of the object, except the reference field.

Specified by:
recycle in interface Recyclable
See Also:
Recyclable.recycle()

setReference

public void setReference(Reference<? extends Recyclable> reference)
Description copied from interface: Recyclable
Sets a Reference object that can be used by object pool implementation. This field must not be erase by the Recyclable.recycle() method.

Specified by:
setReference in interface Recyclable
Parameters:
reference - a Reference object that can be used by object pool implementation.
See Also:
Recyclable.setReference(Reference)

getReference

public Reference<? extends Recyclable> getReference()
Description copied from interface: Recyclable
Returns the reference object set by the Recyclable.setReference(Reference) method.

Specified by:
getReference in interface Recyclable
Returns:
a Reference object that can be used by object pool implementation.
See Also:
Recyclable.getReference()


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.