com.jolbox.bonecp
Class CustomThreadFactory
java.lang.Object
com.jolbox.bonecp.CustomThreadFactory
- All Implemented Interfaces:
- java.lang.Thread.UncaughtExceptionHandler, java.util.concurrent.ThreadFactory
public class CustomThreadFactory
- extends java.lang.Object
- implements java.util.concurrent.ThreadFactory, java.lang.Thread.UncaughtExceptionHandler
Helper class just for executor service to provide a fancier name for debugging + catch for thread exceptions.
- Author:
- wallacew
|
Constructor Summary |
CustomThreadFactory(java.lang.String threadName,
boolean daemon)
Default constructor. |
|
Method Summary |
java.lang.Thread |
newThread(java.lang.Runnable r)
|
void |
uncaughtException(java.lang.Thread thread,
java.lang.Throwable throwable)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomThreadFactory
public CustomThreadFactory(java.lang.String threadName,
boolean daemon)
- Default constructor.
- Parameters:
threadName - name for thread.daemon - set/unset daemon thread
newThread
public java.lang.Thread newThread(java.lang.Runnable r)
-
- Specified by:
newThread in interface java.util.concurrent.ThreadFactory
- See Also:
ThreadFactory.newThread(java.lang.Runnable)
uncaughtException
public void uncaughtException(java.lang.Thread thread,
java.lang.Throwable throwable)
-
- Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler
- See Also:
Thread.UncaughtExceptionHandler.uncaughtException(java.lang.Thread, java.lang.Throwable)
Copyright © 2009-2011 JolBox. All Rights Reserved.