Package org.apache.jackrabbit.oak.index
Class ThreadMonitor.AutoRegisteringThreadFactory
- java.lang.Object
-
- org.apache.jackrabbit.oak.index.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(@NotNull ThreadMonitor threadMonitor)Uses Executors.defaultThreadFactory() to create new threads.AutoRegisteringThreadFactory(@NotNull ThreadMonitor threadMonitor, @NotNull ThreadFactory delegate)
-
-
-
Constructor Detail
-
AutoRegisteringThreadFactory
public AutoRegisteringThreadFactory(@NotNull @NotNull ThreadMonitor threadMonitor, @NotNull @NotNull ThreadFactory delegate)- Parameters:
threadMonitor- The thread monitor where to register new threads.delegate- A thread factory to create new threads.
-
AutoRegisteringThreadFactory
public AutoRegisteringThreadFactory(@NotNull @NotNull 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:
newThreadin interfaceThreadFactory
-
-