|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread marf.util.BaseThread
public class BaseThread
Class BaseThread is customized base class for many of our own threads.
It provides an attempt to maintain an automatic unique TID (thread ID) among all the derivatives and allow setting your own if needed, integrates with ExpandedThreadGroup, and maintains a local reference for the Runnable target if clients need it.
Java 1.5 NOTE: In this Java version they finally managed to provide
a method similar to our getTID()
, called getId()
and this class was created prior that. And the functionality we offer
seems to be superior anyway.
ExpandedThreadGroup
,
Runnable
,
iTID
,
getNextTID()
,
getTID()
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected int |
iTID
Our Thread ID. |
protected java.lang.Runnable |
oTarget
Local references to the target, in case clients need it. |
protected static int |
siNextTID
Next TID to be assigned. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
BaseThread()
Default constructor. |
|
BaseThread(ExpandedThreadGroup poThreadGroup,
java.lang.Runnable poTarget)
Assigns name to the thread and places it to the specified expanded group. |
|
BaseThread(ExpandedThreadGroup poThreadGroup,
java.lang.Runnable poTarget,
java.lang.String pstrName)
Assigns name to the thread and places it to the specified expanded group. |
|
BaseThread(ExpandedThreadGroup poThreadGroup,
java.lang.String pstrName)
Assigns name to the thread and places it to the specified expanded group. |
|
BaseThread(int piTID)
Sets user-specified thread ID and resets the sequencing from it. |
|
BaseThread(java.lang.Runnable poTarget)
Constructor with Runnable. |
|
BaseThread(java.lang.Runnable poTarget,
java.lang.String pstrName)
Constructor with Runnable and thread name. |
|
BaseThread(java.lang.String pstrName)
Assigns name to the thread. |
|
BaseThread(java.lang.ThreadGroup poThreadGroup,
java.lang.Runnable poTarget,
java.lang.String pstrName)
Constructor with ThreadGroup, Runnable, and thread name. |
|
BaseThread(java.lang.ThreadGroup poThreadGroup,
java.lang.String pstrName)
Assigns name to the thread and places it to the specified group. |
Method Summary | |
---|---|
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
static int |
getNextTID()
Lets to examine the next TID to be assigned. |
java.lang.Runnable |
getTarget()
Retrieves the thread's target. |
int |
getTID()
Retrieves our TID. |
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
Field Detail |
---|
protected static int siNextTID
protected int iTID
protected java.lang.Runnable oTarget
Constructor Detail |
---|
public BaseThread()
public BaseThread(java.lang.Runnable poTarget)
poTarget
- runnable Thread-like object.public BaseThread(java.lang.Runnable poTarget, java.lang.String pstrName)
poTarget
- runnable Thread-like object.pstrName
- name of the thread.public BaseThread(java.lang.ThreadGroup poThreadGroup, java.lang.Runnable poTarget, java.lang.String pstrName)
poThreadGroup
- ThreadGroup to add this thread topoTarget
- runnable Thread-like object.pstrName
- name of the thread.public BaseThread(java.lang.ThreadGroup poThreadGroup, java.lang.String pstrName)
poThreadGroup
- ThreadGroup to add this thread topstrName
- A string indicating human-readable thread's namepublic BaseThread(java.lang.String pstrName)
pstrName
- A string indicating human-readable thread's namepublic BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.String pstrName)
poThreadGroup
- ExpandedThreadGroup to add this thread topstrName
- A string indicating human-readable thread's namepublic BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.Runnable poTarget)
poThreadGroup
- ExpandedThreadGroup to add this thread topoTarget
- runnable Thread-like object.public BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.Runnable poTarget, java.lang.String pstrName)
poThreadGroup
- ExpandedThreadGroup to add this thread topoTarget
- runnable Thread-like object.pstrName
- A string indicating human-readable thread's namepublic BaseThread(int piTID)
piTID
- starting TIDMethod Detail |
---|
public final int getTID()
public static final int getNextTID()
public java.lang.Runnable getTarget()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |