com.caucho.env.thread
Class AbstractTaskWorker

java.lang.Object
  extended by com.caucho.env.thread.AbstractTaskWorker
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AbstractThreadLauncher, TaskWorker

public abstract class AbstractTaskWorker
extends java.lang.Object
implements java.lang.Runnable

A generic pool of threads available for Alarms and Work tasks.


Constructor Summary
protected AbstractTaskWorker(java.lang.ClassLoader classLoader)
           
 
Method Summary
 void destroy()
           
protected  long getCurrentTimeActual()
           
protected  java.lang.String getThreadName()
           
 boolean isClosed()
           
protected  boolean isPermanent()
           
 boolean isTaskActive()
           
protected  void onThreadComplete()
           
protected  void onThreadStart()
           
 void run()
           
abstract  long runTask()
           
protected  void setLoopCount(int count)
           
protected  void setWorkerIdleTimeout(long timeout)
           
protected abstract  void startWorkerThread()
           
 java.lang.String toString()
           
 void wake()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTaskWorker

protected AbstractTaskWorker(java.lang.ClassLoader classLoader)
Method Detail

isPermanent

protected boolean isPermanent()

setWorkerIdleTimeout

protected void setWorkerIdleTimeout(long timeout)

setLoopCount

protected void setLoopCount(int count)

isTaskActive

public boolean isTaskActive()

isClosed

public boolean isClosed()

runTask

public abstract long runTask()

destroy

public void destroy()

wake

public final void wake()

startWorkerThread

protected abstract void startWorkerThread()

getThreadName

protected java.lang.String getThreadName()

onThreadStart

protected void onThreadStart()

onThreadComplete

protected void onThreadComplete()

run

public final void run()
Specified by:
run in interface java.lang.Runnable

getCurrentTimeActual

protected long getCurrentTimeActual()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object