Package org.osgi.util.promise
Class PromiseFactory.DefaultExecutors
- java.lang.Object
-
- org.osgi.util.promise.PromiseFactory.DefaultExecutors
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.concurrent.RejectedExecutionHandler
,java.util.concurrent.ThreadFactory
- Enclosing class:
- PromiseFactory
private static final class PromiseFactory.DefaultExecutors extends java.lang.Object implements java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler, java.lang.Runnable
Default executors for Promises.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PromiseFactory.DefaultExecutors.ScheduledExecutor
ScheduledThreadPoolExecutor for scheduled execution.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ThreadPoolExecutor
callbackExecutor
private static PromiseFactory.DefaultExecutors
callbacks
private java.util.concurrent.ThreadFactory
delegateThreadFactory
private static PromiseFactory.DefaultExecutors.ScheduledExecutor
scheduledExecutor
private java.util.concurrent.atomic.AtomicBoolean
shutdownHookInstalled
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultExecutors()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.util.concurrent.Executor
callbackExecutor()
java.lang.Thread
newThread(java.lang.Runnable r)
Executor threads should not prevent VM from exitingvoid
rejectedExecution(java.lang.Runnable callback, java.util.concurrent.ThreadPoolExecutor executor)
Call the callback using the caller's thread because the thread pool rejected the execution.void
run()
Shutdown hook(package private) static java.util.concurrent.ScheduledExecutorService
scheduledExecutor()
-
-
-
Field Detail
-
callbacks
private static final PromiseFactory.DefaultExecutors callbacks
-
scheduledExecutor
private static final PromiseFactory.DefaultExecutors.ScheduledExecutor scheduledExecutor
-
callbackExecutor
private static final java.util.concurrent.ThreadPoolExecutor callbackExecutor
-
shutdownHookInstalled
private final java.util.concurrent.atomic.AtomicBoolean shutdownHookInstalled
-
delegateThreadFactory
private final java.util.concurrent.ThreadFactory delegateThreadFactory
-
-
Method Detail
-
callbackExecutor
static java.util.concurrent.Executor callbackExecutor()
-
scheduledExecutor
static java.util.concurrent.ScheduledExecutorService scheduledExecutor()
-
newThread
public java.lang.Thread newThread(java.lang.Runnable r)
Executor threads should not prevent VM from exiting- Specified by:
newThread
in interfacejava.util.concurrent.ThreadFactory
-
rejectedExecution
public void rejectedExecution(java.lang.Runnable callback, java.util.concurrent.ThreadPoolExecutor executor)
Call the callback using the caller's thread because the thread pool rejected the execution.- Specified by:
rejectedExecution
in interfacejava.util.concurrent.RejectedExecutionHandler
-
run
public void run()
Shutdown hook- Specified by:
run
in interfacejava.lang.Runnable
-
-