com.cafesoft.core.pool
Interface LiteObjectPool

All Superinterfaces:
Destroyable
All Known Implementing Classes:
StandardLiteObjectPool

public interface LiteObjectPool
extends Destroyable

The LiteObjectPool interface defines an interface for an ObjectPool object that does not carry with it several restrictions that our ObjectPool interface does. Therefore, it is more lightweight than our standard ObjectPool and thus is perfect for situations where you need a simply ObjectPool.

Since:
11/11/03

Field Summary
static int OBJECT_STATUS_ACTIVE
          Integer constant that represents the status of an object is active.
static int OBJECT_STATUS_IDLE
          Integer constant that represents the status of an object is idle.
static int OBJECT_STATUS_UNKNOWN
          Integer constant that represents the status of an Object is unknown.
 
Method Summary
 void addObject(Object object, int objectStatus)
          Add an Object to the ObjectPool.
 Object borrowObject()
          Borrow an Object from the ObjectPool.
 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 interface com.cafesoft.core.util.Destroyable
destroy
 

Field Detail

OBJECT_STATUS_UNKNOWN

public static final int OBJECT_STATUS_UNKNOWN
Integer constant that represents the status of an Object is unknown.

See Also:
Constant Field Values

OBJECT_STATUS_ACTIVE

public static final int OBJECT_STATUS_ACTIVE
Integer constant that represents the status of an object is active. Thus indicating to the ObjectPool that the Object being added to the ObjectPool is being used.

See Also:
Constant Field Values

OBJECT_STATUS_IDLE

public static final int OBJECT_STATUS_IDLE
Integer constant that represents the status of an object is idle. Thus indicating to the ObjectPool that the Object being added to the ObjectPool is being used.

See Also:
Constant Field Values
Method Detail

getConfig

public ObjectPoolConfig getConfig()
Get the pool's configuration object.

Returns:
the LiteObjectPool's configuration object.

addObject

public void addObject(Object object,
                      int objectStatus)
               throws ObjectPoolException
Add an Object to the ObjectPool.

Parameters:
object - 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.
Throws:
ObjectPoolException - if any error occurs adding the Object to the ObjectPool.

removeObject

public void removeObject(Object object)
Remove an Object from the ObjectPool.

Parameters:
object - the Object to remove from the ObjectPool.

borrowObject

public Object borrowObject()
                    throws ObjectPoolException
Borrow an Object from the ObjectPool.

Returns:
an Object from the ObjectPool.
Throws:
ObjectPoolException - if any error occurs borrowing an Object from the ObjectPool.

returnObject

public void returnObject(Object object)
Return an Object to the ObjectPool.

Parameters:
object - the Object to return to the ObjectPool.


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.