|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.tivoli.twg.libs.ServiceThread
This class is intended to accomplish several key behaviors in a JVM application : create and use a special ThreadGroup under that of the "main" thread and create a thread under that thread group to continue the processing of the main thread. The new thread group will have an alternate handler for unhandled exceptions, which will log the exceptions and terminate the JVM (as opposed to the default handler, which only terminates the thread).
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ServiceThread(java.lang.Runnable run)
Create thread in service thread group |
|
ServiceThread(java.lang.Runnable run,
java.lang.String str)
Create thread in service thread group |
|
ServiceThread(java.lang.String str)
Create thread in service thread group |
|
ServiceThread(java.lang.ThreadGroup tg,
java.lang.Runnable run)
Create thread in service thread group |
|
ServiceThread(java.lang.ThreadGroup tg,
java.lang.Runnable run,
java.lang.String str)
Create thread in service thread group |
Method Summary | |
---|---|
static void |
dumpThreadDebugObjects(java.io.PrintStream out)
Dump all thread debug information to given writer |
static void |
dumpThreadDebugObjects(java.io.Writer out)
Dump all thread debug information to given writer |
Vect |
generateDebugStack()
Generate debug message stack for all objects current obj debug stack |
static java.lang.String |
getApplicationName()
Get name of application in this JVM. |
static java.lang.Object |
popDebugObject()
Pop last object on debug stack of current thread (only if current thread is ServiceThread) |
java.lang.Object |
popDebugObjectFromThread()
Pop last object on debug stack |
static void |
popDebugObjectsUpToIndex(int index)
Pop all debug object up to and including given index |
void |
popDebugObjectsUpToIndexFromThread(int index)
Pop all debug object up to and including given index |
static void |
popPushDebugObjects(java.lang.Object new_obj)
Pop last object and push new object onto debug stack |
void |
popPushDebugObjectsOnThread(java.lang.Object new_obj)
Pop last object and push new object onto debug stack |
static int |
pushDebugObject(java.lang.Object debug_obj)
Push object on to debug stack of current thread (only if current thread is ServiceThread) |
int |
pushDebugObjectToThread(java.lang.Object debug_obj)
Push object on to debug stack |
static void |
setApplicationName(java.lang.String n)
Set name of application. |
static void |
shutdown()
Terminates anything running under the service 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 |
Constructor Detail |
public ServiceThread(java.lang.Runnable run)
run
- - runnable object to use for threadpublic ServiceThread(java.lang.ThreadGroup tg, java.lang.Runnable run)
tg
- - thread grouprun
- - runnable object to use for threadpublic ServiceThread(java.lang.Runnable run, java.lang.String str)
run
- - runnable object to use for threadstr
- - name of threadpublic ServiceThread(java.lang.ThreadGroup tg, java.lang.Runnable run, java.lang.String str)
tg
- - thread grouprun
- - runnable object to use for threadstr
- - name of threadpublic ServiceThread(java.lang.String str)
str
- - name of threadMethod Detail |
public static void setApplicationName(java.lang.String n)
n
- - application namepublic static java.lang.String getApplicationName()
public static void shutdown()
public Vect generateDebugStack()
public int pushDebugObjectToThread(java.lang.Object debug_obj)
debug_obj
- - debug object
public java.lang.Object popDebugObjectFromThread()
public void popDebugObjectsUpToIndexFromThread(int index)
index
- - index of last object to pop (0=all objects on stack)public void popPushDebugObjectsOnThread(java.lang.Object new_obj)
new_obj
- - new object to pushpublic static int pushDebugObject(java.lang.Object debug_obj)
debug_obj
- - debug object
public static java.lang.Object popDebugObject()
public static void popDebugObjectsUpToIndex(int index)
index
- - index of last object to pop (0=all objects on stack)public static void popPushDebugObjects(java.lang.Object new_obj)
new_obj
- - new object to pushpublic static void dumpThreadDebugObjects(java.io.PrintStream out)
out
- - output writer for debug infopublic static void dumpThreadDebugObjects(java.io.Writer out) throws java.io.IOException
out
- - output writer for debug info
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |