com.sleepycat.je.utilint
Class StoppableThreadFactory
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
newThread
public Thread newThread(Runnable runnable)
- Specified by:
newThread
in interface ThreadFactory
Copyright (c) 2004-2012 Oracle. All rights reserved.