public class CICSExecutorService
extends java.lang.Object
implements java.util.concurrent.ExecutorService
The CICSExecutorService provides a way to run work on a separate CICS capable thread. It provisions a new CICS Task and a new T8 TCB on which to run. This service is only available in OSGi and Liberty environments. The service takes a Callable or Runnable object.
| Modifier and Type | Class and Description |
|---|---|
static class |
CICSExecutorService.RejectedWorkPolicy
Enum of ways to Handle rejected workload
|
| Constructor and Description |
|---|
CICSExecutorService()
Internal CICS use-only.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable usersRunnable) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) |
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isTerminated() |
static <T> java.util.concurrent.Future<T> |
runAsCICS(java.util.concurrent.Callable<T> theWork)
Executes a
Callable on a new JCICS enabled Thread. |
static void |
runAsCICS(java.lang.Runnable theWork)
Executes a
Runnable on a new JCICS enabled Thread. |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task) |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task) |
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result) |
public CICSExecutorService()
This class should not be constructed in application code.
public static void runAsCICS(java.lang.Runnable theWork)
Runnable on a new JCICS enabled Thread.
Use this method if you wish to start CICS work on another Thread
from within the JVM.theWork - - the Runnable to executepublic static <T> java.util.concurrent.Future<T> runAsCICS(java.util.concurrent.Callable<T> theWork)
Callable on a new JCICS enabled Thread.
Use this method if you wish to start CICS work on another Thread
from within the JVM and receive a Future object allowing you to determine
when that work has completed.
To receive a result from the Callable, ensure it returns a type from the
call() method, and when the Future object indicates it has completed Future.isDone(),
invoke the Future.get() method to receive the response.T - Object typetheWork - - the Callable to executepublic boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
awaitTermination in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
throws java.lang.InterruptedException
invokeAll in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
invokeAll in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
invokeAny in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
invokeAny in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionpublic boolean isShutdown()
isShutdown in interface java.util.concurrent.ExecutorServicepublic boolean isTerminated()
isTerminated in interface java.util.concurrent.ExecutorServicepublic void shutdown()
shutdown in interface java.util.concurrent.ExecutorServicepublic java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow in interface java.util.concurrent.ExecutorServicepublic <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit in interface java.util.concurrent.ExecutorServicepublic java.util.concurrent.Future<?> submit(java.lang.Runnable task)
submit in interface java.util.concurrent.ExecutorServicepublic <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task,
T result)
submit in interface java.util.concurrent.ExecutorServicepublic void execute(java.lang.Runnable usersRunnable)
execute in interface java.util.concurrent.Executor