Package org.apache.mina.util
Class NamePreservingRunnable
java.lang.Object
org.apache.mina.util.NamePreservingRunnable
- All Implemented Interfaces:
Runnable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNamePreservingRunnable(Runnable runnable, String newName) Creates a new instance of NamePreservingRunnable. -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Run the runnable after having renamed the current thread's name to the new name.private voidWrapsThread.setName(String)to catch a possibleExceptions such asSecurityExceptionin sandbox environments, such as applets
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
newName
The runnable name -
runnable
The runnable task
-
-
Constructor Details
-
NamePreservingRunnable
Creates a new instance of NamePreservingRunnable.- Parameters:
runnable- The underlying runnablenewName- The runnable's name
-
-
Method Details
-
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. -
setName
WrapsThread.setName(String)to catch a possibleExceptions such asSecurityExceptionin sandbox environments, such as applets
-