|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.pool.StandardLiteObjectPool
Standard implementation of the LiteObjectPool interface.
LiteObjectPool| Field Summary |
| Fields inherited from interface com.cafesoft.core.pool.LiteObjectPool |
OBJECT_STATUS_ACTIVE, OBJECT_STATUS_IDLE, OBJECT_STATUS_UNKNOWN |
| Constructor Summary | |
StandardLiteObjectPool()
Create a new StandardLiteObjectPool. |
|
StandardLiteObjectPool(ObjectPoolConfig config)
Create a new StandardLiteObjectPool. |
|
StandardLiteObjectPool(ObjectPoolConfig config,
boolean destroyObjects)
Create a new StandardLiteObjectPool. |
|
| Method Summary | |
void |
addObject(Object object,
int objectStatus)
Add an Object to the ObjectPool. |
Object |
borrowObject()
Borrow an Object from the ObjectPool. |
void |
destroy()
Destroy the object and it's resources. |
ObjectPoolConfig |
getConfig()
Get the pool's configuration object. |
void |
removeObject(Object object)
Remove an Object from the ObjectPool. |
void |
returnObject(Object object)
Return an Object to the ObjectPool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StandardLiteObjectPool()
public StandardLiteObjectPool(ObjectPoolConfig config)
config - the ObjectPool's configuration object.
public StandardLiteObjectPool(ObjectPoolConfig config,
boolean destroyObjects)
config - the ObjectPool's configuration object.destroyObjects - a boolean that informs the ObjectPool to destroy
the objects.| Method Detail |
public ObjectPoolConfig getConfig()
getConfig in interface LiteObjectPool
public void addObject(Object object,
int objectStatus)
throws ObjectPoolException
addObject in interface LiteObjectPoolobject - the Object to add to the ObjectPool.objectStatus - the status of the Object being added to the
ObjectPool. This value informs the ObjectPool of the Object
current usage.
ObjectPoolException - if any error occurs adding the Object
to the ObjectPool.public void removeObject(Object object)
removeObject in interface LiteObjectPoolobject - the Object to remove from the ObjectPool.
public Object borrowObject()
throws ObjectPoolException
borrowObject in interface LiteObjectPoolObjectPoolException - if any error occurs borrowing an
Object from the ObjectPool.public void returnObject(Object object)
returnObject in interface LiteObjectPoolobject - the Object to return to the ObjectPool.public void destroy()
This method when called should free all resources used by this object. In addition, it should render the object unusable. Therefore, this method should only be called once per object.
destroy in interface Destroyable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||