Package org.apache.mina.util
Class NamePreservingRunnable
- java.lang.Object
-
- org.apache.mina.util.NamePreservingRunnable
-
- All Implemented Interfaces:
java.lang.Runnable
public class NamePreservingRunnable extends java.lang.Object implements java.lang.RunnableARunnablewrapper that preserves the name of the thread after the runnable is complete (forRunnables that change the name of the Thread they use.)
-
-
Constructor Summary
Constructors Constructor Description NamePreservingRunnable(java.lang.Runnable runnable, java.lang.String newName)Creates a new instance of NamePreservingRunnable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Run the runnable after having renamed the current thread's name to the new name.private voidsetName(java.lang.Thread thread, java.lang.String name)WrapsThread.setName(String)to catch a possibleExceptions such asSecurityExceptionin sandbox environments, such as applets
-
-
-
Method Detail
-
run
public void run()
Run the runnable after having renamed the current thread's name to the new name. When the runnable has completed, set back the current thread name back to its origin.- Specified by:
runin interfacejava.lang.Runnable
-
setName
private void setName(java.lang.Thread thread, java.lang.String name)WrapsThread.setName(String)to catch a possibleExceptions such asSecurityExceptionin sandbox environments, such as applets
-
-