|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread com.isti.util.IstiThread com.isti.util.IstiNotifyThread
public class IstiNotifyThread
Class IstiThread extends 'Thread' to add wait/notify and terminate functionality. Subclasses should use the 'waitForNotify()' method to perform thread-sleep delays.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class com.isti.util.IstiThread |
---|
DEFAULT_TERMINATE_WAIT_TIME, terminateFlag |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
IstiNotifyThread(java.lang.Runnable target,
java.lang.String name)
Allocates a new IstiNotifyThread object. |
|
IstiNotifyThread(java.lang.String name)
Allocates a new IstiNotifyThread object. |
|
IstiNotifyThread(java.lang.ThreadGroup group,
java.lang.Runnable target,
java.lang.String name)
Allocates a new IstiNotifyThread object so that it has
target as its run object, has the specified
name as its name, and belongs to the thread group
referred to by group . |
|
IstiNotifyThread(java.lang.ThreadGroup group,
java.lang.String name)
Allocates a new IstiNotifyThread object. |
Method Summary | |
---|---|
static void |
sleep(long millis)
Deprecated. Use 'waitForNotify()' instead. |
void |
terminate()
Performs a thread-notify and terminates this thread if the thread is not terminated and alive. |
Methods inherited from class com.isti.util.IstiThread |
---|
clearThreadWaitNotifyFlag, isTerminated, nextThreadNum, notifyThread, start, terminate, waitForNotify, waitForNotify, waitForTerminate, waitForTerminate, wasStarted |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IstiNotifyThread(java.lang.Runnable target, java.lang.String name)
IstiNotifyThread
object. This constructor
has the same effect as IstiNotifyThread(null, target, name)
.
target
- the object whose run
method is called.name
- the name of the new thread.public IstiNotifyThread(java.lang.String name)
IstiNotifyThread
object. This constructor
has the same effect as IstiNotifyThread(null, null, name)
.
name
- the name of the new thread.public IstiNotifyThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
IstiNotifyThread
object so that it has
target
as its run object, has the specified
name
as its name, and belongs to the thread group
referred to by group
.
If group
is null
, the group is
set to be the same ThreadGroup as
the thread that is creating the new thread.
If there is a security manager, its checkAccess
method is called with the ThreadGroup as its argument.
This may result in a SecurityException.
If the target
argument is not null
, the
run
method of the target
is called when
this thread is started. If the target argument is
null
, this thread's run
method is called
when this thread is started.
The priority of the newly created thread is set equal to the
priority of the thread creating it, that is, the currently running
thread. The method setPriority
may be used to
change the priority to a new value.
The newly created thread is initially marked as being a daemon
thread if and only if the thread creating it is currently marked
as a daemon thread. The method setDaemon
may be used
to change whether or not a thread is a daemon.
group
- the thread group.target
- the object whose run
method is called.name
- the name of the new thread.
java.lang.SecurityException
- if the current thread cannot create a
thread in the specified thread group.public IstiNotifyThread(java.lang.ThreadGroup group, java.lang.String name)
IstiNotifyThread
object. This constructor has
the same effect as IstiNotifyThread(group, null, name)
group
- the thread group.name
- the name of the new thread.
java.lang.SecurityException
- if the current thread cannot create a
thread in the specified thread group.Method Detail |
---|
public void terminate()
terminate
in class IstiThread
public static void sleep(long millis) throws java.lang.InterruptedException
millis
- the length of time to sleep in milliseconds.
java.lang.InterruptedException
- if another thread has interrupted
the current thread. The interrupted status of the
current thread is cleared when this exception is thrown.Object.notify()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |