org.restlet.engine.log
Class LoggingThreadFactory

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

public class LoggingThreadFactory
extends Object
implements ThreadFactory

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

Author:
Jerome Louvel

Constructor Summary
LoggingThreadFactory(Logger logger)
          Constructor.
LoggingThreadFactory(Logger logger, boolean daemon)
          Constructor.
 
Method Summary
 Thread newThread(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(Logger logger)
Constructor.

Parameters:
logger - The associated logger.

LoggingThreadFactory

public LoggingThreadFactory(Logger logger,
                            boolean daemon)
Constructor.

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

newThread

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

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


Copyright © 2005-2013 Restlet.