org.apache.hadoop.hbase.util
Class Threads

java.lang.Object
  extended by org.apache.hadoop.hbase.util.Threads

public class Threads
extends Object

Thread Utility


Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
Threads()
           
 
Method Summary
static Thread setDaemonThreadRunning(Thread t, String name)
          Utility method that sets name, daemon status and starts passed thread.
static Thread setDaemonThreadRunning(Thread t, String name, Thread.UncaughtExceptionHandler handler)
          Utility method that sets name, daemon status and starts passed thread.
static void shutdown(Thread t)
          Shutdown passed thread using isAlive and join.
static void shutdown(Thread t, long joinwait)
          Shutdown passed thread using isAlive and join.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

Threads

public Threads()
Method Detail

setDaemonThreadRunning

public static Thread setDaemonThreadRunning(Thread t,
                                            String name)
Utility method that sets name, daemon status and starts passed thread.

Parameters:
t -
name -
Returns:
Returns the passed Thread t.

setDaemonThreadRunning

public static Thread setDaemonThreadRunning(Thread t,
                                            String name,
                                            Thread.UncaughtExceptionHandler handler)
Utility method that sets name, daemon status and starts passed thread.

Parameters:
t -
name -
handler - A handler to set on the thread. Pass null if want to use default handler.
Returns:
Returns the passed Thread t.

shutdown

public static void shutdown(Thread t)
Shutdown passed thread using isAlive and join.

Parameters:
t - Thread to shutdown

shutdown

public static void shutdown(Thread t,
                            long joinwait)
Shutdown passed thread using isAlive and join.

Parameters:
joinwait - Pass 0 if we're to wait forever.
t - Thread to shutdown


Copyright © 2010 The Apache Software Foundation