org.objectweb.dream.pool
Interface Recyclable

All Known Implementing Classes:
AbstractChunk, CodecInputOutputImpl, Message

public interface Recyclable

This interface defines a method to recycle an object.


Method Summary
 Reference<? extends Recyclable> getReference()
          Returns the reference object set by the setReference(Reference) method.
 void recycle()
          Recycles the object.
 void setReference(Reference<? extends Recyclable> reference)
          Sets a Reference object that can be used by object pool implementation.
 

Method Detail

recycle

void recycle()
Recycles the object. This consists in reseting all the fields of the object, except the reference field.


setReference

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

Parameters:
reference - a Reference object that can be used by object pool implementation.

getReference

Reference<? extends Recyclable> getReference()
Returns the reference object set by the setReference(Reference) method.

Returns:
a Reference object that can be used by object pool implementation.


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