|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jacorb.notification.util.AbstractObjectPool
public abstract class AbstractObjectPool
Abstract Base Class for Simple Pooling Mechanism. Subclasses must at least implement the method newInstance. To use a Object call lendObject. After use the Object must be returned with returnObject(Object). An Object must not be used after it has been returned to its pool!
Field Summary | |
---|---|
static boolean |
DEBUG
|
static int |
INITIAL_SIZE_DEFAULT
|
protected org.apache.avalon.framework.logger.Logger |
logger_
|
static int |
LOWER_WATERMARK_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(java.lang.String name)
|
protected |
AbstractObjectPool(java.lang.String name,
int threshold,
int sizeincrease,
int initialsize,
int maxsize)
|
Method Summary | |
---|---|
void |
activateObject(java.lang.Object o)
Is called before Object is returned to Client (lendObject). |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
|
static void |
deregisterPool(AbstractObjectPool pool)
|
void |
destroyObject(java.lang.Object o)
Is called if Pool is full and Object is discarded. |
void |
dispose()
Release this Pool. |
void |
init()
Initialize this Pool. |
java.lang.Object |
lendObject()
lend an object from the pool. |
abstract java.lang.Object |
newInstance()
This method is called by the Pool to create a new Instance. |
void |
passivateObject(java.lang.Object o)
Is called after Object is returned to pool. |
void |
returnObject(java.lang.Object o)
return an Object to the pool. |
void |
run()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
public static final long SLEEP
public static final int LOWER_WATERMARK_DEFAULT
public static final int SIZE_INCREASE_DEFAULT
public static final int INITIAL_SIZE_DEFAULT
public static final int MAXIMUM_WATERMARK_DEFAULT
protected org.apache.avalon.framework.logger.Logger logger_
Constructor Detail |
---|
protected AbstractObjectPool(java.lang.String name)
protected AbstractObjectPool(java.lang.String name, int threshold, int sizeincrease, int initialsize, int maxsize)
Method Detail |
---|
public static void deregisterPool(AbstractObjectPool pool)
public void configure(org.apache.avalon.framework.configuration.Configuration conf)
configure
in interface org.apache.avalon.framework.configuration.Configurable
public void run()
run
in interface java.lang.Runnable
public void init()
public void dispose()
public java.lang.Object lendObject()
public void returnObject(java.lang.Object o)
public abstract java.lang.Object newInstance()
public void passivateObject(java.lang.Object o)
public void activateObject(java.lang.Object o)
public void destroyObject(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |