|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.util.LoggingThreadFactory
public class LoggingThreadFactory
This thread factory just adds a Thread.UncaughtExceptionHandler to threads it creates so that there are logs of the
exceptions that cause threads to die.
Use this class when providing a thread factory to threadpools.
This factory's constructor can be told to create daemon or non-daemon threads.
| Constructor Summary | |
|---|---|
LoggingThreadFactory(String poolName,
boolean daemon)
Creates a factory that will produce either daemon or non-daemon threads. |
|
| Method Summary | |
|---|---|
Thread |
newThread(Runnable r)
|
void |
uncaughtException(Thread t,
Throwable e)
This simply logs the exception via this factory's logger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoggingThreadFactory(String poolName,
boolean daemon)
false for the daemon parameter; if you do, make sure your thread pool and all its threads
created by this factory are properly shutdown; otherwise you could prevent the VM from exiting properly.
poolName - the name of the thread pool that will be using this factorydaemon - if true, the factory will create daemon threads; false for non-daemon
threads| Method Detail |
|---|
public Thread newThread(Runnable r)
newThread in interface ThreadFactoryThreadFactory.newThread(Runnable)
public void uncaughtException(Thread t,
Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandlerThread.UncaughtExceptionHandler.uncaughtException(Thread, Throwable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||