org.huihoo.jfox.pool.thread
Class PoolableThreadImpl

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.huihoo.jfox.pool.thread.PoolableThreadImpl
All Implemented Interfaces:
PoolableObject, org.huihoo.jfox.pool.thread.PoolableThread, java.lang.Runnable

public class PoolableThreadImpl
extends java.lang.Thread
implements org.huihoo.jfox.pool.thread.PoolableThread


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PoolableThreadImpl()
           
 
Method Summary
 void activate()
          actvite the object before it be retrived
 void discard()
          destroy this thread
 void passivate()
          passivate the object before it be restored, set the status to initialized
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
 void setTask(org.huihoo.jfox.pool.thread.ThreadTask task)
           
 
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

PoolableThreadImpl

public PoolableThreadImpl()
Method Detail

run

public void run()
Description copied from interface: java.lang.Runnable
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

The general contract of the method run is that it may take any action whatsoever.

Specified by:
run in interface java.lang.Runnable
See Also:
Thread.start(), Thread.stop(), Thread.Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String), Runnable.run()

activate

public void activate()
              throws java.lang.Exception
Description copied from interface: PoolableObject
actvite the object before it be retrived

Specified by:
activate in interface PoolableObject
Throws:
java.lang.Exception

passivate

public void passivate()
               throws java.lang.Exception
Description copied from interface: PoolableObject
passivate the object before it be restored, set the status to initialized

Specified by:
passivate in interface PoolableObject
Throws:
java.lang.Exception

setTask

public void setTask(org.huihoo.jfox.pool.thread.ThreadTask task)
Specified by:
setTask in interface org.huihoo.jfox.pool.thread.PoolableThread

discard

public void discard()
Description copied from interface: org.huihoo.jfox.pool.thread.PoolableThread
destroy this thread

Specified by:
discard in interface org.huihoo.jfox.pool.thread.PoolableThread