com.jolbox.bonecp
Class CustomThreadFactory

java.lang.Object
  extended by com.jolbox.bonecp.CustomThreadFactory
All Implemented Interfaces:
Thread.UncaughtExceptionHandler, ThreadFactory

public class CustomThreadFactory
extends Object
implements ThreadFactory, Thread.UncaughtExceptionHandler

Helper class just for executor service to provide a fancier name for debugging + catch for thread exceptions.

Author:
wallacew

Constructor Summary
CustomThreadFactory(String threadName, boolean daemon)
          Default constructor.
 
Method Summary
 Thread newThread(Runnable r)
          
 void uncaughtException(Thread thread, Throwable throwable)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomThreadFactory

public CustomThreadFactory(String threadName,
                           boolean daemon)
Default constructor.

Parameters:
threadName - name for thread.
daemon - set/unset daemon thread
Method Detail

newThread

public Thread newThread(Runnable r)

Specified by:
newThread in interface ThreadFactory
See Also:
ThreadFactory.newThread(java.lang.Runnable)

uncaughtException

public void uncaughtException(Thread thread,
                              Throwable throwable)

Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler
See Also:
Thread.UncaughtExceptionHandler.uncaughtException(java.lang.Thread, java.lang.Throwable)


Copyright © 2009-2011 JolBox. All Rights Reserved.