|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--gecco.util.SignalThread
This subclass of Thread
has been extended with signal
facilities. Other threads may send signals to it, requesting that it
terminate or pause execution. This class only implements mechanisms for
supporting signals; it is up to the run()
method to check
regularly whether a signal has been received, and act upon it.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface gecco.util.SignalRunnable |
SIGKILL, SIGNONE, SIGPAUSE, SIGQUIT, SIGRESUME |
Constructor Summary | |
SignalThread()
Constructs a new thread. |
|
SignalThread(SignalRunnable target)
Constructs a new thread. |
|
SignalThread(SignalRunnable target,
String name)
Constructs a new thread. |
|
SignalThread(String name)
Constructs a new thread. |
|
SignalThread(ThreadGroup group,
SignalRunnable target)
Constructs a new thread. |
|
SignalThread(ThreadGroup group,
SignalRunnable target,
String name)
Constructs a new thread. |
|
SignalThread(ThreadGroup group,
String name)
Constructs a new thread. |
Method Summary | |
static void |
clearSignal()
This clears any pending signal for the current thread. |
static SignalThread |
current()
Returns the object representing the currently executing signal thread. |
static void |
pauseHandler()
This utility method will cause the thread to sleep as long as the currently pending signal is SIGPAUSE . |
void |
sendSignal(int signal)
This sends a signal to the thread. |
static int |
signalPending()
Returns the currently pending signal for the current 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, run, 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 |
Methods inherited from interface java.lang.Runnable |
run |
Constructor Detail |
public SignalThread()
run()
method to actually do anything.
public SignalThread(SignalRunnable target)
target
- The object whose run()
method is called.public SignalThread(SignalRunnable target, String name)
target
- The object whose run()
method is called.name
- The name of the new thread.public SignalThread(String name)
run()
method to actually do anything.
name
- The name of the new thread.public SignalThread(ThreadGroup group, SignalRunnable target)
group
- The thread group.target
- The object whose run()
method is called.public SignalThread(ThreadGroup group, SignalRunnable target, String name)
group
- The thread group.target
- The object whose run()
method is called.name
- The name of the new thread.public SignalThread(ThreadGroup group, String name)
run()
method to actually do anything.
group
- The thread group.name
- The name of the new thread.Method Detail |
public void sendSignal(int signal)
SIGQUIT
goes before SIGRESUME
.
signal
- The signal.public static SignalThread current() throws ClassCastException
ClassCastException
- If the current thread is not a
SignalThread.public static int signalPending()
SIGNONE
if the thread isn't a SignalThread
.
public static void clearSignal()
public static void pauseHandler()
SIGPAUSE
. When that is no
longer the case, it will return immediately.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |