Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
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 targetSecurityException
- 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 nameSecurityException
- 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 nameSecurityException
- if the current thread cannot create a thread in the specified thread group#Thread(ThreadGroup,Runnable,String,long)
public void interrupt()
public void run()
Runnable
. Logs a trace message at the start and end of execution.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 handlerpublic org.jboss.threads.ThreadNameInfo getThreadNameInfo()
public void setThreadNameInfo(org.jboss.threads.ThreadNameInfo threadNameInfo) throws SecurityException
threadNameInfo
- the new thread name infoSecurityException
- if the calling thread is not allowed to modify this threadCopyright © 2012 JBoss by Red Hat. All Rights Reserved.