org.apache.mina.util

## Class NamePreservingRunnable

- java.lang.Object
- - org.apache.mina.util.NamePreservingRunnable

- All Implemented Interfaces:
    Runnable

      public class NamePreservingRunnable
      extends Object
      implements Runnable

  A `Runnable` wrapper that preserves the name of the thread after the runnable is complete (for `Runnable`s that change the name of the Thread they use.)
  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamePreservingRunnable(Runnable runnable, String newName)` Creates a new instance of NamePreservingRunnable.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()` Run the runnable after having renamed the current thread's name to the new name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NamePreservingRunnable

          public NamePreservingRunnable(Runnable runnable,
                                String newName)

      Creates a new instance of NamePreservingRunnable.
      Parameters:
        `runnable` - The underlying runnable
        `newName` - The runnable's name

  - ### 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:
        `run` in interface `Runnable`

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.