@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class ExecutorServiceUtils extends Object
ExecutorService operations.| Modifier and Type | Class and Description |
|---|---|
static class |
ExecutorServiceUtils.ExecutionRejectedException
Wraps the runtime
RejectedExecutionException. |
static class |
ExecutorServiceUtils.FatalRejectedExecutionException
Version of
RejectedExecutionException, which treats the error as fatal. |
| Modifier and Type | Method and Description |
|---|---|
static RejectedExecutionException |
createRuntimeException(String message,
ExecutorServiceUtils.ExecutionRejectedException cause)
Creates a runtime
RejectedExecutionException for ExecutorServiceUtils.ExecutionRejectedException. |
static void |
submitAsync(ExecutorService es,
Runnable runnable)
Submits a task to the executor service without further handling.
|
@Nonnull public static void submitAsync(@Nonnull ExecutorService es, @Nonnull Runnable runnable) throws ExecutorServiceUtils.ExecutionRejectedException
ExecutorService.submit(java.lang.Runnable) method actually expects this return value
to be handled, but this method explicitly relies on the external logic to handle the future operation.
Use on your own risk.es - Executor servicerunnable - Operation to be executedExecutorServiceUtils.ExecutionRejectedException - Execution is rejected by the executor service@Nonnull public static RejectedExecutionException createRuntimeException(@Nonnull String message, @Nonnull ExecutorServiceUtils.ExecutionRejectedException cause)
RejectedExecutionException for ExecutorServiceUtils.ExecutionRejectedException.
This version takes the ExecutorServiceUtils.ExecutionRejectedException.isFatal() value into account
and creates ExecutorServiceUtils.FatalRejectedExecutionException if required.message - Messagecause - Base non-Runtime exceptionCopyright © 2004–2020. All rights reserved.