DESY ACOP Beans Home

com.cosylab.util
Interface PoolableObject


public interface PoolableObject

An object that is able of being recycled and stored in an object pool. This object must support:

Note that object pools are mostly usable for simple data holder objects, which are created in great amounts and are also frequently released. This means that the receivers of these objects simply inspect some values (or even do nothing), after which they have no more use for the object and do not store it in some sort of data container structure.


Method Summary
 void clear()
          Clears the contents (data fields) of this object by resetting them to the uninitialized (after construction) values.
 void setObjectPool(ObjectPool pool)
          Sets the object pool to which this object belongs.
 

Method Detail

clear

void clear()
Clears the contents (data fields) of this object by resetting them to the uninitialized (after construction) values.


setObjectPool

void setObjectPool(ObjectPool pool)
Sets the object pool to which this object belongs. During finalization of this object, it will attempt to resurrect itself by returning to the object pool.

Parameters:
pool - the pool to which this object will return


Copyright © 2010. All Rights Reserved.