|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jasen.thread.StoppableThread
org.jasen.thread.ControlledThread
A simple thread implementation which provides the capability to be stopped.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ControlledThread()
|
|
ControlledThread(Runnable target)
|
|
ControlledThread(Runnable target,
String name)
|
|
ControlledThread(String name)
|
|
ControlledThread(ThreadGroup group,
Runnable target)
|
|
ControlledThread(ThreadGroup group,
Runnable target,
String name)
|
|
ControlledThread(ThreadGroup group,
Runnable target,
String name,
long stackSize)
|
|
ControlledThread(ThreadGroup group,
String name)
|
Method Summary | |
void |
finish()
Stops the thread. |
long |
getSleepTime()
Gets the sleep time for the thread. |
abstract void |
handleException(Exception e)
Handles unrecoverable errors. |
boolean |
isProcessOnStart()
Indicates whether the thread will process on startup. |
boolean |
isRunning()
Returns true if the thread is currently running. |
abstract void |
process()
Performs the primary thread processing. |
void |
run()
|
void |
setProcessOnStart(boolean processOnStart)
Flags the thread to execute a process on startup. |
void |
setSleepTime(long sleepTime)
Sets the sleep time for the thread. |
void |
wake()
Wakes up the sleeping thread |
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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ControlledThread()
public ControlledThread(Runnable target)
target
- public ControlledThread(String name)
name
- public ControlledThread(ThreadGroup group, Runnable target)
group
- target
- public ControlledThread(Runnable target, String name)
target
- name
- public ControlledThread(ThreadGroup group, String name)
group
- name
- public ControlledThread(ThreadGroup group, Runnable target, String name)
group
- target
- name
- public ControlledThread(ThreadGroup group, Runnable target, String name, long stackSize)
group
- target
- name
- stackSize
- Method Detail |
public void run()
public void wake()
public void finish()
public boolean isProcessOnStart()
public void setProcessOnStart(boolean processOnStart)
processOnStart
- True if the thread should process on startup. If false, the thread automatically enters a wait statepublic long getSleepTime()
public void setSleepTime(long sleepTime)
sleepTime
- public boolean isRunning()
public abstract void process() throws JasenException
JasenException
public abstract void handleException(Exception e)
e
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |