|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Interface for all Threads. All JCast Threads manage their states, and need to have utility methods to access name, priority, etc. Through this interface you can interact with all threads in JCast, regarding direct thread control mechanism.
Field Summary | |
static int |
RUNNING
|
static int |
STOPPED
My states |
static int |
WAITING
|
Method Summary | |
boolean |
checkState(int state)
checks the current state |
void |
doKill()
Trys to kill the running thread |
void |
doRestart()
Trys to restart the waiting thread |
void |
doStart()
Gets the thread into running mode |
void |
doStop()
Trys to stop the running thread |
void |
doWork()
Executes whatever this thread is supposed to do |
java.lang.String |
getThreadClass()
Returns the class by which this thread was initialized |
java.lang.String |
getThreadName()
Returns the Name of the Thread |
int |
getThreadPriority()
Returns threads priority |
boolean |
isRunning()
Returns true if the thread is Running |
boolean |
isStopped()
Returns true if the thread is stopped |
boolean |
isWaiting()
Returns true if the thread is waiting for something |
void |
setState(int state)
Sets the threads state |
void |
setThreadPriority(int i)
Sets thread priority |
Methods inherited from interface java.lang.Runnable |
run |
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
configure |
Field Detail |
public static final int STOPPED
public static final int RUNNING
public static final int WAITING
Method Detail |
public java.lang.String getThreadName()
public java.lang.String getThreadClass()
public int getThreadPriority()
public void setThreadPriority(int i)
public boolean checkState(int state)
public void setState(int state)
public boolean isRunning()
public boolean isStopped()
public boolean isWaiting()
public void doStart() throws java.lang.Exception
doStart
in interface IStartable
public void doStop() throws java.lang.Exception
doStop
in interface IStartable
public void doKill()
public void doRestart() throws java.lang.Exception
public void doWork() throws java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |