org.objectweb.jonas.dbm
Class PoolKeeper

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.objectweb.jonas.dbm.PoolKeeper
All Implemented Interfaces:
java.lang.Runnable

public class PoolKeeper
extends java.lang.Thread

Keeps pool as small as possible (after conn's has reached MaxAge)

Author:
Philippe Durieux Contributor(s):

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PoolKeeper(Pool pool)
          Constructor
 
Method Summary
 void run()
          Start the pool keeper thread
 void setSamplingPeriod(int sec)
          Set the sampling period.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PoolKeeper

public PoolKeeper(Pool pool)
Constructor

Parameters:
pool - Pool to monitor
Method Detail

setSamplingPeriod

public void setSamplingPeriod(int sec)
Set the sampling period. This cannot be done in the PoolKeeper constructor, because the sampling period has not been set already in the Pool. Moreover, this can be reconfigured later.

Parameters:
sec - sampling period in sec.

run

public void run()
Start the pool keeper thread