|
||||||||||
| 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(java.lang.String poolName,
boolean daemon)
Creates a factory that will produce either daemon or non-daemon threads. |
|
| Method Summary | |
|---|---|
java.lang.Thread |
newThread(java.lang.Runnable r)
|
void |
uncaughtException(java.lang.Thread t,
java.lang.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(java.lang.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 java.lang.Thread newThread(java.lang.Runnable r)
newThread in interface java.util.concurrent.ThreadFactoryThreadFactory.newThread(Runnable)
public void uncaughtException(java.lang.Thread t,
java.lang.Throwable e)
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandlerThread.UncaughtExceptionHandler.uncaughtException(Thread, Throwable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||