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.RunnableDefault executors for Promises.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPromiseFactory.DefaultExecutors.ScheduledExecutorScheduledThreadPoolExecutor for scheduled execution.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ThreadPoolExecutorcallbackExecutorprivate static PromiseFactory.DefaultExecutorscallbacksprivate java.util.concurrent.ThreadFactorydelegateThreadFactoryprivate static PromiseFactory.DefaultExecutors.ScheduledExecutorscheduledExecutorprivate java.util.concurrent.atomic.AtomicBooleanshutdownHookInstalled
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultExecutors()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.util.concurrent.ExecutorcallbackExecutor()java.lang.ThreadnewThread(java.lang.Runnable r)Executor threads should not prevent VM from exitingvoidrejectedExecution(java.lang.Runnable callback, java.util.concurrent.ThreadPoolExecutor executor)Call the callback using the caller's thread because the thread pool rejected the execution.voidrun()Shutdown hook(package private) static java.util.concurrent.ScheduledExecutorServicescheduledExecutor()
-
-
-
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:
newThreadin 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:
rejectedExecutionin interfacejava.util.concurrent.RejectedExecutionHandler
-
run
public void run()
Shutdown hook- Specified by:
runin interfacejava.lang.Runnable
-
-