com.sleepycat.je.utilint
Class StoppableThreadFactory

java.lang.Object
  extended by com.sleepycat.je.utilint.StoppableThreadFactory
All Implemented Interfaces:
ThreadFactory

public class StoppableThreadFactory
extends Object
implements ThreadFactory

Create a thread factory that returns threads that are legitimate StoppableThreads. Like StoppableThreads, if an environment is provided, the threads will invalidate if an exception is not handled, and are registered with the exception listener.If a logger is provided, StoppableThreads log exception information. This factory is used in conjunction with the ExecutorService and ThreadExecutorPool models.


Constructor Summary
StoppableThreadFactory(EnvironmentImpl envImpl, String threadName, Logger logger)
          This kind of StoppableThreadFactory will cause invalidation if an unhandled exception occurs.
StoppableThreadFactory(String threadName, Logger logger)
          This kind of StoppableThreadFactory will NOT cause invalidation if an unhandled exception occurs, because there is no environment provided.
 
Method Summary
 Thread newThread(Runnable runnable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoppableThreadFactory

public StoppableThreadFactory(EnvironmentImpl envImpl,
                              String threadName,
                              Logger logger)
This kind of StoppableThreadFactory will cause invalidation if an unhandled exception occurs.


StoppableThreadFactory

public StoppableThreadFactory(String threadName,
                              Logger logger)
This kind of StoppableThreadFactory will NOT cause invalidation if an unhandled exception occurs, because there is no environment provided.

Method Detail

newThread

public Thread newThread(Runnable runnable)
Specified by:
newThread in interface ThreadFactory


Copyright (c) 2004-2010 Oracle. All rights reserved.