1 19 package org.apache.mina.util; 20 21 28 public class NamePreservingRunnable implements Runnable { 29 private final Runnable runnable; 30 31 public NamePreservingRunnable(Runnable runnable) { 32 this.runnable = runnable; 33 } 34 35 public void run() { 36 String name = Thread.currentThread().getName(); 37 38 try { 39 runnable.run(); 40 } finally { 41 Thread.currentThread().setName(name); 42 } 43 } 44 } 45 | Popular Tags |