java.util.concurrent.Executor , ExecutorService,
and java.util.concurrent.ThreadFactory .
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | MoreExecutors.Application
Represents the current application to register shutdown hooks. |
| private static class | |
| private static class | |
| private static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | addDelayedShutdownHook(ExecutorService
ExecutorService which uses daemon threads service, Duration how long to wait for the executor to finish before terminating the
JVM terminationTimeout)Add a shutdown hook to wait for thread completion in the given |
| public static void | addDelayedShutdownHook(ExecutorService
ExecutorService which uses daemon threads service, long how long to wait for the executor to finish before terminating the
JVM terminationTimeout, TimeUnit unit of time for the time parameter timeUnit)Add a shutdown hook to wait for thread completion in the given |
| public static Executor | directExecutor()
Returns an |
| public static ExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor, Duration how long to wait for the executor to finish before terminating the
JVM terminationTimeout)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application is complete. |
| public static ExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor, long how long to wait for the executor to finish before terminating the
JVM terminationTimeout, TimeUnit unit of time for the time parameter timeUnit)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application is complete. |
| public static ExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application is complete. |
| public static ScheduledExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor, Duration how long to wait for the executor to finish before terminating the
JVM terminationTimeout)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when the application is complete. |
| public static ScheduledExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor, long how long to wait for the executor to finish before terminating the
JVM terminationTimeout, TimeUnit unit of time for the time parameter timeUnit)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when the application is complete. |
| public static ScheduledExecutorService | Returns: an unmodifiable version of the input which will not hang the JVMthe executor to modify to make sure it exits when the application is finished executor)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when the application is complete. |
| pack-priv static <T extends @Nullable Object> T | invokeAnyImpl(ListeningExecutorService executorService, Collection<? extends Callable<T>> tasks, boolean timed, Duration timeout)
An implementation of |
| pack-priv static <T extends @Nullable Object> T | invokeAnyImpl(ListeningExecutorService executorService, Collection<? extends Callable<T>> tasks, boolean timed, long timeout, TimeUnit unit)
An implementation of |
| private static boolean | |
| public static ListeningExecutorService | listeningDecorator(ExecutorService delegate)
Creates an |
| public static ListeningScheduledExecutorService | listeningDecorator(ScheduledExecutorService delegate)
Creates a |
| public static ListeningExecutorService | newDirectExecutorService()
Creates an executor service that runs each task in the thread that invokes |
| public static Executor | newSequentialExecutor(Executor delegate)
Returns an |
| pack-priv static Thread | newThread(String name, Runnable runnable)
Creates a thread using |
| public static ThreadFactory | |
| pack-priv static Executor | rejectionPropagatingExecutor(final Executor delegate, final AbstractFuture<?> future)
Returns an Executor that will propagate |
| pack-priv static Executor | renamingDecorator(final Executor
The executor to decorate executor, final Supplier<String> The source of names for each task nameSupplier)Creates an The names are retrieved from the |
| pack-priv static ExecutorService | renamingDecorator(final ExecutorService
The executor to decorate service, final Supplier<String> The source of names for each task nameSupplier)Creates an The names are retrieved from the |
| pack-priv static ScheduledExecutorService | renamingDecorator(final ScheduledExecutorService
The executor to decorate service, final Supplier<String> The source of names for each task nameSupplier)Creates a The names are retrieved from the |
| public static boolean | Returns: true if the ExecutorService was terminated successfully, false
if the call timed out or was interruptedthe service, Duration ExecutorService to shut downthe maximum time to wait for the timeout)ExecutorService to terminateShuts down the given executor service gradually, first disabling new submissions and later, if necessary, cancelling remaining tasks. |
| public static boolean | Returns: true if the ExecutorService was terminated successfully, false
if the call timed out or was interruptedthe service, long ExecutorService to shut downthe maximum time to wait for the timeout, TimeUnit ExecutorService to terminatethe time unit of the timeout argument unit)Shuts down the given executor service gradually, first disabling new submissions and later, if necessary, cancelling remaining tasks. |
| private static <T extends @Nullable Object> ListenableFuture | submitAndAddQueueListener(ListeningExecutorService executorService, Callable<T> task, final BlockingQueue<Future<T>> queue)
Submits the task and adds a listener that adds the future to |
| private static void |