|
|||||||||
| Home >> All >> marf >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
marf.util
Class BaseThread

java.lang.Objectjava.lang.Thread
marf.util.BaseThread
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- Logger
- public class BaseThread
- extends java.lang.Thread
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.
- Since:
- 0.3.0
- Version:
- $Revision: 1.16 $
| Nested Class Summary |
| Nested classes inherited from class java.lang.Thread |
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. |
private void |
setTID()
Sets internal TID and updates next TID on contruction time, so it's private. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, 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 |
siNextTID
protected static int siNextTID
- Next TID to be assigned.
Preserves value across all instances.
iTID
protected int iTID
- Our Thread ID.
oTarget
protected java.lang.Runnable oTarget
- Local references to the target, in case clients
need it.
| Constructor Detail |
BaseThread
public BaseThread()
- Default constructor.
Calls Thread's constructor and setTID().
BaseThread
public BaseThread(java.lang.Runnable poTarget)
- Constructor with Runnable.
Calls Thread's constructor with the Runnable argument and setTID().
BaseThread
public BaseThread(java.lang.Runnable poTarget, java.lang.String pstrName)
- Constructor with Runnable and thread name.
Equivalent to this(null, poTarget, pstrName).
BaseThread
public BaseThread(java.lang.ThreadGroup poThreadGroup, java.lang.Runnable poTarget, java.lang.String pstrName)
- Constructor with ThreadGroup, Runnable, and thread name.
Equivalent to super(poThreadGroup, poTarget, pstrName), but
overridden to call setTID().
BaseThread
public BaseThread(java.lang.ThreadGroup poThreadGroup, java.lang.String pstrName)
- Assigns name to the thread and places it to the specified group.
Equivalent to BaseThread(poThreadGroup, null, pstrName).
BaseThread
public BaseThread(java.lang.String pstrName)
- Assigns name to the thread.
Equivalent to BaseThread(null, null, pstrName).
BaseThread
public BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.String pstrName)
- Assigns name to the thread and places it to the specified expanded group.
Calls this(poThreadGroup, null, pstrName), but also keeps a local reference
to this thread inside the group.
BaseThread
public BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.Runnable poTarget)
- Assigns name to the thread and places it to the specified expanded group.
Calls this(poThreadGroup, poTarget, null), but also keeps a local reference
to this thread inside the group.
BaseThread
public BaseThread(ExpandedThreadGroup poThreadGroup, java.lang.Runnable poTarget, java.lang.String pstrName)
- Assigns name to the thread and places it to the specified expanded group.
Does super(poThreadGroup, poTarget, pstrName), but also keeps a local reference
to this thread inside the group.
BaseThread
public BaseThread(int piTID)
- Sets user-specified thread ID and resets the sequencing from it.
| Method Detail |
getTID
public final int getTID()
- Retrieves our TID.
setTID
private final void setTID()
- Sets internal TID and updates next TID on contruction time, so it's private.
getNextTID
public static final int getNextTID()
- Lets to examine the next TID to be assigned.
getTarget
public java.lang.Runnable getTarget()
- Retrieves the thread's target.
Proved to be usefult in some caes, e.g. in the GIPSY,
needed to know who was actually the target posmortem.
getMARFSourceCodeRevision
public static java.lang.String getMARFSourceCodeRevision()
- Retrieves class' revision.
|
|||||||||
| Home >> All >> marf >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC