|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.jdbc.pool.GenericPool
GenericPool is the main class of the Pool. It works with any kind of object that's implement PoolHelper (must provide specific operation on the specific object) Objects stored in hashtables are GenerationObject object. These objects allow to store multiples things in them, in particular, the generation number to identify the generation of an object.
Field Summary | |
---|---|
static int |
DEFAULT_DEADLOCKMAXWAIT
|
static int |
DEFAULT_DEADLOCKRETRYWAIT
|
static long |
DEFAULT_EXPIRATION
|
static int |
DEFAULT_MAXSIZE
|
static int |
DEFAULT_MINSIZE
|
static long |
DEFAULT_SLEEPTIME
|
protected int |
generation
Generation number. |
protected java.lang.Thread |
keeper
|
protected PoolKeeper |
poolKeeper
|
Constructor Summary | |
---|---|
GenericPool(PoolHelper helper)
Creates an GenericPool with the default params. |
|
GenericPool(PoolHelper helper,
int initSize)
|
|
GenericPool(PoolHelper helper,
int minSize,
int maxSize,
long lifeTime,
long sleepTime)
Constructor, set the two hashtables and set by default the other values |
Method Summary | |
---|---|
void |
checkIn(java.lang.Object o)
remove object from locked pool |
java.lang.Object |
checkOut(java.lang.String user,
java.lang.String password)
return pooled object |
boolean |
checkOwner(GenerationObject genObject,
java.lang.String user,
java.lang.String password)
|
protected void |
cleanUp()
Remove unusable objects from the pool, called by PoolKeeper Check the unlocked objects for expired members. |
int |
getCheckLevelObject()
|
int |
getCount()
|
long |
getDeadLockMaxWait()
|
long |
getDeadLockRetryWait()
|
int |
getGeneration()
|
long |
getLifeTime()
|
java.util.Hashtable |
getLockedObject()
|
int |
getLockedObjectCount()
returns the current number of objects that are locked |
int |
getMaxSize()
|
int |
getMinSize()
|
long |
getSleepTime()
|
int |
getUnlockedObjectCount()
returns the current number of objects that are unlocked |
boolean |
isDebug()
|
boolean |
isGC()
|
void |
minimumObject()
|
void |
minimumObject(java.lang.String user,
java.lang.String password)
|
void |
nextGeneration(java.lang.Object obj)
Allows to verify if objects from the pool - for the o generation - are valid or not. |
void |
removeLockedObject(java.lang.Object obj)
removes an object for the locked pool, when an error has occurred |
void |
setCheckLevelObject(int level)
level are accepted between 0 and 4 |
void |
setDeadLockMaxWait(long deadLock)
|
void |
setDeadLockRetryWait(long deadLockRetryWait)
|
void |
setDebug(boolean debug)
|
void |
setGC(boolean gc)
|
void |
setGeneration(int generation)
|
void |
setLifeTime(long lifeTime)
|
void |
setLogger(Logger alog)
Outputs a log message to the log writer. |
void |
setMaxSize(int max)
|
void |
setMinSize(int min)
|
void |
setSleepTime(long sleepTime)
|
void |
start()
Start method, to initialize independant values of the pool |
void |
stop()
switch off the pool |
java.lang.String |
toString()
returns information from the pool |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Thread keeper
protected PoolKeeper poolKeeper
protected int generation
public static final long DEFAULT_EXPIRATION
public static final long DEFAULT_SLEEPTIME
public static final int DEFAULT_MINSIZE
public static final int DEFAULT_MAXSIZE
public static final int DEFAULT_DEADLOCKMAXWAIT
public static final int DEFAULT_DEADLOCKRETRYWAIT
Constructor Detail |
public GenericPool(PoolHelper helper)
public GenericPool(PoolHelper helper, int initSize)
public GenericPool(PoolHelper helper, int minSize, int maxSize, long lifeTime, long sleepTime)
Method Detail |
public void start()
public boolean checkOwner(GenerationObject genObject, java.lang.String user, java.lang.String password)
public java.lang.Object checkOut(java.lang.String user, java.lang.String password) throws java.lang.Exception
java.lang.Exception
public void minimumObject()
public void minimumObject(java.lang.String user, java.lang.String password)
public void checkIn(java.lang.Object o)
public void setDebug(boolean debug)
public boolean isDebug()
public void setMinSize(int min) throws java.lang.Exception
java.lang.Exception
public void setMaxSize(int max) throws java.lang.Exception
java.lang.Exception
public void setLifeTime(long lifeTime)
public void setSleepTime(long sleepTime)
public void setGeneration(int generation)
public void setGC(boolean gc)
public void setCheckLevelObject(int level)
public void setDeadLockMaxWait(long deadLock)
public void setDeadLockRetryWait(long deadLockRetryWait)
public int getMinSize()
public int getMaxSize()
public long getLifeTime()
public boolean isGC()
public int getCount()
public long getSleepTime()
public int getGeneration()
public int getCheckLevelObject()
public void stop()
public int getLockedObjectCount()
public int getUnlockedObjectCount()
public long getDeadLockMaxWait()
public long getDeadLockRetryWait()
public java.lang.String toString()
protected void cleanUp()
public void nextGeneration(java.lang.Object obj)
public void removeLockedObject(java.lang.Object obj)
public void setLogger(Logger alog)
public java.util.Hashtable getLockedObject()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |