org.jacorb.notification.util
public abstract class AbstractObjectPool extends Object implements Runnable, Configurable
Version: $Id: AbstractObjectPool.java,v 1.22 2006/06/14 11:57:54 alphonse.bendt Exp $
Field Summary | |
---|---|
protected Configuration | config_ |
static boolean | DEBUG |
static int | INITIAL_SIZE_DEFAULT |
protected Logger | logger_ |
static int | LOWER_WATERMARK_DEFAULT |
static int | MAXIMUM_SIZE_DEFAULT |
static int | MAXIMUM_WATERMARK_DEFAULT |
static int | SIZE_INCREASE_DEFAULT |
static long | SLEEP
time the cleaner thread sleeps between two cleanups |
Constructor Summary | |
---|---|
protected | AbstractObjectPool(String name) |
protected | AbstractObjectPool(String name, int lowerWatermark, int sizeincrease, int initialsize, int maxWatermark, int maximumSize) |
Method Summary | |
---|---|
void | configure(Configuration conf) |
void | dispose()
Release this Pool. |
void | doActivateObject(Object o)
Is called before Object is returned to Client (lendObject). |
void | doDestroyObject(Object o)
Is called if Pool is full and returned Object is discarded. |
void | doPassivateObject(Object o)
Is called after Object is returned to pool. |
protected boolean | isCreationAllowed()
check if it is allowed to create more instances.
|
Object | lendObject()
lend an object from the pool. |
abstract Object | newInstance()
This method is called by the Pool to create a new Instance. |
protected void | poolIsEmpty() |
void | returnObject(Object o)
return an Object to the pool. |
void | run() |
String | toString() |