org.aitools.programd.util.sql
Class CleanUpThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.aitools.programd.util.sql.CleanUpThread
All Implemented Interfaces:
java.lang.Runnable

 class CleanUpThread
extends java.lang.Thread

Calls the cleanup method of an ObjectPool at a period determined by its sleepTime .

Author:
Cristian Mircioiu

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  ObjectPool pool
          The object pool that this will clean up.
private  long sleepTime
          The period (in milliseconds) to wait before cleaning up.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CleanUpThread(ObjectPool poolToUse, long sleepTimeToUse)
          Creates a new CleanUpThread for a given object pool and with a given sleep time.
 
Method Summary
 void run()
          Cleans up the object pool at the period determined by sleepTime .
 
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Field Detail

pool

private ObjectPool pool
The object pool that this will clean up.


sleepTime

private long sleepTime
The period (in milliseconds) to wait before cleaning up.

Constructor Detail

CleanUpThread

public CleanUpThread(ObjectPool poolToUse,
                     long sleepTimeToUse)
Creates a new CleanUpThread for a given object pool and with a given sleep time.

Parameters:
poolToUse - the object pool to clean up
sleepTimeToUse - the period (in milliseconds) to wait before cleaning up
Method Detail

run

public void run()
Cleans up the object pool at the period determined by sleepTime .

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread