org.restlet.engine.log
Class LoggingThreadFactory

java.lang.Object
  extended by org.restlet.engine.log.LoggingThreadFactory
All Implemented Interfaces:
java.util.concurrent.ThreadFactory

public class LoggingThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory

Thread factory that logs uncaught exceptions thrown by the created threads.

Author:
Jerome Louvel

Constructor Summary
LoggingThreadFactory(java.util.logging.Logger logger)
          Constructor.
LoggingThreadFactory(java.util.logging.Logger logger, boolean daemon)
          Constructor.
 
Method Summary
 java.lang.Thread newThread(java.lang.Runnable r)
          Creates a new thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingThreadFactory

public LoggingThreadFactory(java.util.logging.Logger logger)
Constructor.

Parameters:
logger - The associated logger.

LoggingThreadFactory

public LoggingThreadFactory(java.util.logging.Logger logger,
                            boolean daemon)
Constructor.

Parameters:
logger - The associated logger.
daemon - Indicates if threads should be created as daemons.
Method Detail

newThread

public java.lang.Thread newThread(java.lang.Runnable r)
Creates a new thread.

Specified by:
newThread in interface java.util.concurrent.ThreadFactory
Parameters:
r - The runnable task.


Copyright © 2005-2013 Restlet S.A.S..