|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.ourgrid.test.threadServices.ShutdownableThread
public class ShutdownableThread
This class is used just to test the auxiliary classes used by the aspects.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static int |
DEAD
A Thread that has leaved the run method. |
static boolean |
DEBUG
A DEBUG constant. |
static int |
NEW
A Thread that has been created. |
static int |
NOT_CREATED
A constant used to represent a Thread not yet created. |
static int |
NOT_RUNNABLE
A thread is NOT_RUNNABLE when: * Its sleep method is invoked. * The thread calls the wait method to wait for a specific condition to be satisfied. |
static int |
NOT_RUNNABLE_SLEEP
The thread has called the sleep method. |
static int |
NOT_RUNNABLE_WAIT
The thread calls the wait method to wait for a specific condition to be satisfied. |
static int |
POSSIBLY_NOTIFIED
A notify method has been called on an object whose lock was waited by this thread. |
static int |
RUNNING
A Thread that has entered the run method and has not yet left it. |
static int |
STARTED
The Thread has been created and a start method has been called on it. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ShutdownableThread(java.lang.Runnable target)
Constructor. |
|
ShutdownableThread(java.lang.Runnable target,
java.lang.String name)
Constructor. |
|
ShutdownableThread(java.lang.ThreadGroup group,
java.lang.Runnable target,
java.lang.String name)
Constructor. |
Method Summary | |
---|---|
java.lang.Runnable |
getMyRunnable()
Gets the myRunnable object. |
java.lang.String |
getStateString()
Returns the textual representation of this Thread state. |
static java.lang.String |
getStateString(int state)
Gets the string representation of a certain state. |
int |
getStateValue()
Gets the state of a this Thread. |
void |
println(java.lang.String str)
General method that prints the string parameter on the standard output. |
void |
run()
Simply calls the super class run method, changing this thread state before and after this. |
protected void |
setState(int state)
Sets the state of this Thread. |
void |
shutdown()
Invokes shutdown on this thread's runnable, if it is Shutdownable. |
void |
start()
Starts this Thread, changing its state. |
void |
waitFor(java.lang.Object o)
Makes this thread wait for an object. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
public static final int NOT_CREATED
public static final int NEW
public static final int RUNNING
public static final int STARTED
public static final int DEAD
public static final int NOT_RUNNABLE
public static final int NOT_RUNNABLE_WAIT
public static final int NOT_RUNNABLE_SLEEP
public static final int POSSIBLY_NOTIFIED
Constructor Detail |
---|
public ShutdownableThread(java.lang.Runnable target)
target
- The Runnable related with this Thread.public ShutdownableThread(java.lang.Runnable target, java.lang.String name)
target
- The Runnable related with this Thread.name
- The Thread name.public ShutdownableThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
group
- The Thread group.target
- The Runnable related with this thread.name
- The Thread name.Method Detail |
---|
public void shutdown()
shutdown
in interface Shutdownable
public java.lang.String getStateString()
public static java.lang.String getStateString(int state)
state
- The state value.
state
.public void start()
start
in class java.lang.Thread
public void waitFor(java.lang.Object o) throws java.lang.InterruptedException
o
- The object this thread should wait for.
java.lang.InterruptedException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public int getStateValue()
protected void setState(int state)
state
- The state to set.public java.lang.Runnable getMyRunnable()
public void println(java.lang.String str)
str
- String to be printed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |