org.objectweb.dream.message.codec
Interface MessageCodecHelperObjectStreamAttributeController

All Superinterfaces:
AttributeController
All Known Implementing Classes:
MessageCodecHelperObjectStreamImpl

public interface MessageCodecHelperObjectStreamAttributeController
extends AttributeController

Attribute controller interface for MessageCodecHelperObjectStreamImplmessage codec helper component. Defines a reuseObjectStream boolean attribute that control the "life cycle" of the object streams used by the codec. If false, the codec will open a new Object stream for each encoding or decoding operation. Else, the codec resuse the already opened Object stream (see CodecInputOutput.setInput(Object)and CodecInputOutput.setOutput(Object)).
Warning : if true, you must be sure that the ObjectOutputStream.writeObject(Object)(respectivly readObject) method is never used, unless a memory leak can happen. Inded, the writeObject method keeps a reference to each serialized object. You must use the Util.writeObject(java.io.ObjectOutput, Object) (respectivly, Util.readObject(java.io.ObjectInput)) instead. This method will use the ObjectOutputStream.writeUnshared(Object)method (respectivly, ObjectInputStream.readUnshared()).
To do so, you must implements specialized serialization method in your chunk and message implementations, and in any serialized object.

See Also:
Serializable, Externalizable, ObjectOutputStream, ObjectInputStream

Method Summary
 boolean getReuseObjectStream()
          Returns the reuseObjectStream attribute value.
 void setReuseObjectStream(boolean reuseObjectStream)
          Sets the reuseObjectStream attribute.
 

Method Detail

getReuseObjectStream

boolean getReuseObjectStream()
Returns the reuseObjectStream attribute value.

Returns:
the reuseObjectStream attribute value.

setReuseObjectStream

void setReuseObjectStream(boolean reuseObjectStream)
Sets the reuseObjectStream attribute.

Parameters:
reuseObjectStream - the new reuseObjectStream attribute value.


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