public abstract class AbstractObjectPool extends Object implements Runnable, Configurable
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config_ |
static boolean |
DEBUG |
static int |
INITIAL_SIZE_DEFAULT |
protected org.slf4j.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
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractObjectPool(String name) |
protected |
AbstractObjectPool(String name,
int lowerWatermark,
int sizeincrease,
int initialsize,
int maxWatermark,
int maximumSize) |
Modifier and Type | Method and Description |
---|---|
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() |
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
public static final int MAXIMUM_SIZE_DEFAULT
protected final org.slf4j.Logger logger_
protected Configuration config_
protected AbstractObjectPool(String name)
protected AbstractObjectPool(String name, int lowerWatermark, int sizeincrease, int initialsize, int maxWatermark, int maximumSize)
public void configure(Configuration conf)
configure
in interface Configurable
public void dispose()
public Object lendObject()
protected boolean isCreationAllowed()
protected void poolIsEmpty()
public void returnObject(Object o)
public abstract Object newInstance()
public void doPassivateObject(Object o)
public void doActivateObject(Object o)
public void doDestroyObject(Object o)
Copyright © 2017 JacORB. All rights reserved.