Class ThreadMonitor.AutoRegisteringThreadFactory
- java.lang.Object
-
- org.apache.jackrabbit.oak.index.indexer.document.flatfile.pipelined.ThreadMonitor.AutoRegisteringThreadFactory
-
- All Implemented Interfaces:
ThreadFactory
- Enclosing class:
- ThreadMonitor
public static class ThreadMonitor.AutoRegisteringThreadFactory extends Object implements ThreadFactory
Thread factory that registers all new threads with a given thread monitor. This can be passed to an Executor, so that all of its threads will be monitored, which may be simpler than manually registering each individual thread.
-
-
Constructor Summary
Constructors Constructor Description AutoRegisteringThreadFactory(ThreadMonitor threadMonitor)
Uses Executors.defaultThreadFactory() to create new threads.AutoRegisteringThreadFactory(ThreadMonitor threadMonitor, ThreadFactory delegate)
-
-
-
Constructor Detail
-
AutoRegisteringThreadFactory
public AutoRegisteringThreadFactory(ThreadMonitor threadMonitor, ThreadFactory delegate)
- Parameters:
threadMonitor
- The thread monitor where to register new threads.delegate
- A thread factory to create new threads.
-
AutoRegisteringThreadFactory
public AutoRegisteringThreadFactory(ThreadMonitor threadMonitor)
Uses Executors.defaultThreadFactory() to create new threads.- Parameters:
threadMonitor
- The thread monitor where to register new threads.
-
-
Method Detail
-
newThread
public Thread newThread(@NotNull @NotNull Runnable r)
- Specified by:
newThread
in interfaceThreadFactory
-
-