com.cafesoft.core.pool
Class ObjectPoolCleanUpThread
java.lang.Object
|
+--java.lang.Thread
|
+--com.cafesoft.core.pool.ObjectPoolCleanUpThread
- All Implemented Interfaces:
- Runnable
- public class ObjectPoolCleanUpThread
- extends Thread
The ObjectPoolCleanUpThread is a thread that is used to periodically
remove objects that are no longer needed. Only when the ObjectPool has an
expiration period will the thread begin.
- Since:
- 10/23/01
|
Method Summary |
void |
run()
Run the clean up thread. |
void |
setExpirationTime(long expiration)
Set the expiration time |
| 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 |
ObjectPoolCleanUpThread
public ObjectPoolCleanUpThread(ObjectPool objectPool,
long expiration)
- Create a new ObjectPoolCleanUpThread.
- Parameters:
objectPool - the ObjectPool to clean upexpiration - the expiration time to sleep between cleanups
run
public void run()
- Run the clean up thread. The thread sleeps and wakes up and cleans the
ObjectPool and goes back to sleep.
If this thread was constructed using a separate
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns.
Subclasses of Thread should override this method.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
- See Also:
Thread.start(),
Thread.stop(),
Thread.Thread(),
Runnable.run()
setExpirationTime
public void setExpirationTime(long expiration)
- Set the expiration time
- Parameters:
expiration - the new expiration time
Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.