org.dmonix.thread
Class PooledThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.dmonix.thread.PooledThread
All Implemented Interfaces:
java.lang.Runnable

public class PooledThread
extends java.lang.Thread

The thread used in the pool.

Copyright: Copyright (c) 2003

Company: dmonix.org

Version:
1.0
Author:
Peter Nerg

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) PooledThread(ThreadPool pool, java.lang.String name)
           
 
Method Summary
 void execute()
          Allows for this thread to execute its Runnable object once by releasing the mutex lock.
 void run()
          The thread is immediately put on a mutex wait.
 void setRunnable(java.lang.Runnable runnable)
          Sets the Runnable object to run.
 
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

PooledThread

PooledThread(ThreadPool pool,
             java.lang.String name)
Method Detail

execute

public void execute()
Allows for this thread to execute its Runnable object once by releasing the mutex lock.


setRunnable

public void setRunnable(java.lang.Runnable runnable)
Sets the Runnable object to run.

Parameters:
runnable -

run

public void run()
The thread is immediately put on a mutex wait.
The mutex is released when the execute method is invoked.
Once the mutex lock is released this thread will execute the run method on the Runnable object.
After execution the thread is returned to the pool.

See Also:
setRunnable(Runnable), execute


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.