|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object org.jboss.netty.util.ThreadRenamingRunnable
public class ThreadRenamingRunnable
一个用于改变当前线程名称并在它执行结束后重新设置回原来名称的Runnable
.要使用Netty修改默认线程名称,请使用
setThreadNameDeterminer(ThreadNameDeterminer)
.
构造方法摘要 | |
---|---|
ThreadRenamingRunnable(java.lang.Runnable runnable,
java.lang.String proposedThreadName)
创建一个包装指定runnable并当指定的runnable正在运行时使用指定的线程名称代替原名称 Creates a new instance which wraps the specified runnable and changes the thread name to
the specified thread name when the specified runnable is running. |
方法摘要 | |
---|---|
static ThreadNameDeterminer |
getThreadNameDeterminer()
返回一个用于重写建议线程名称的 ThreadNameDeterminer . |
void |
run()
|
static void |
setThreadNameDeterminer(ThreadNameDeterminer threadNameDeterminer)
设置一个用于重写建议 Sets the ThreadNameDeterminer which overrides the
proposed new thread name. |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public ThreadRenamingRunnable(java.lang.Runnable runnable, java.lang.String proposedThreadName)
runnable
and changes the thread name to
the specified thread name when the specified runnable
is running.
方法详细信息 |
---|
public static ThreadNameDeterminer getThreadNameDeterminer()
ThreadNameDeterminer
.
public static void setThreadNameDeterminer(ThreadNameDeterminer threadNameDeterminer)
ThreadNameDeterminer
which overrides the
proposed new thread name. Please note that the specified
ThreadNameDeterminer
affects only new
ThreadRenamingRunnable
s; the existing instances are not affected
at all. Therefore, you should make sure to call this method at the
earliest possible point (i.e. before any Netty worker thread starts) for
consistent thread naming. Otherwise, you might see the default thread
names and the new names appear at the same time in the full thread dump.
public void run()
java.lang.Runnable
中的 run
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |