|
JBoss Threads 2.0.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jboss.threads.JBossThread
public final class JBossThread
A JBoss thread. Supports logging and extra operations.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
JBossThread(Runnable target)
Construct a new instance. |
|
JBossThread(Runnable target,
String name)
Construct a new instance. |
|
JBossThread(ThreadGroup group,
Runnable target)
Construct a new instance. |
|
JBossThread(ThreadGroup group,
Runnable target,
String name)
Construct a new instance. |
|
JBossThread(ThreadGroup group,
Runnable target,
String name,
long stackSize)
Construct a new instance. |
Method Summary | |
---|---|
static JBossThread |
currentThread()
Get the current JBossThread , or null if the current thread is not a JBossThread . |
static InterruptHandler |
getAndSetInterruptHandler(InterruptHandler newInterruptHandler)
Swap the current thread's active interrupt handler. |
org.jboss.threads.ThreadNameInfo |
getThreadNameInfo()
Get the thread name information. |
void |
interrupt()
Interrupt this thread. |
void |
run()
Execute the thread's Runnable . |
void |
setThreadNameInfo(org.jboss.threads.ThreadNameInfo threadNameInfo)
Set the thread name information. |
void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Change the uncaught exception handler for this thread. |
void |
start()
Start the thread. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, sleep, 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 JBossThread(Runnable target)
target
- the runnable target#Thread(Runnable)
public JBossThread(Runnable target, String name)
target
- the runnable targetname
- the initial thread name#Thread(Runnable, String)
public JBossThread(ThreadGroup group, Runnable target) throws SecurityException
group
- the parent thread grouptarget
- the runnable target
SecurityException
- if the current thread cannot create a thread in the specified thread group#Thread(ThreadGroup, Runnable)
public JBossThread(ThreadGroup group, Runnable target, String name) throws SecurityException
group
- the parent thread grouptarget
- the runnable targetname
- the initial thread name
SecurityException
- if the current thread cannot create a thread in the specified thread group#Thread(ThreadGroup,Runnable,String)
public JBossThread(ThreadGroup group, Runnable target, String name, long stackSize) throws SecurityException
group
- the parent thread grouptarget
- the runnable targetname
- the initial thread name
SecurityException
- if the current thread cannot create a thread in the specified thread group#Thread(ThreadGroup,Runnable,String,long)
Method Detail |
---|
public void interrupt()
interrupt
in class Thread
public void run()
Runnable
. Logs a trace message at the start and end of execution.
run
in interface Runnable
run
in class Thread
public static JBossThread currentThread()
JBossThread
, or null
if the current thread is not a JBossThread
.
null
public void start()
start
in class Thread
IllegalThreadStateException
- if the thread was already started.public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
setUncaughtExceptionHandler
in class Thread
eh
- the new handlerpublic static InterruptHandler getAndSetInterruptHandler(InterruptHandler newInterruptHandler)
finally
block like this:
InterruptHandler oldHandler = JBossThread.getAndSetInterruptHandler(newHandler); try { ...execute interrupt-sensitive operation... } finally { JBossThread.getAndSetInterruptHandler(oldHandler); }
newInterruptHandler
- the new interrupt handler
public org.jboss.threads.ThreadNameInfo getThreadNameInfo()
public void setThreadNameInfo(org.jboss.threads.ThreadNameInfo threadNameInfo) throws SecurityException
threadNameInfo
- the new thread name info
SecurityException
- if the calling thread is not allowed to modify this thread
|
JBoss Threads 2.0.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |