com.ibm.cics.server

Class CICSExecutorService

  • java.lang.Object
    • com.ibm.cics.server.CICSExecutorService
  • All Implemented Interfaces:
    java.util.concurrent.Executor, java.util.concurrent.ExecutorService


    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.

    Since CICS TS version:
    5.1
    Since package version:
    1.401.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      CICSExecutorService()
      Standard no-arg constructor for Declarative Services
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CICSExecutorService

        public CICSExecutorService()
        Standard no-arg constructor for Declarative Services
    • Method Detail

      • runAsCICS

        public static void runAsCICS(java.lang.Runnable theWork)
        Executes a Runnable on a new JCICS enabled Thread. Use this method if you wish to start CICS work on another Thread from within the JVM.
        Parameters:
        theWork - - the Runnable to execute
        Since CICS TS version:
        5.1
        Since package version:
        1.401.0
      • runAsCICS

        public static <T> java.util.concurrent.Future<T> runAsCICS(java.util.concurrent.Callable<T> theWork)
        Executes a 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.
        Type Parameters:
        T - Object type
        Parameters:
        theWork - - the Callable to execute
        Returns:
        the Future object
        Since CICS TS version:
        5.3
        Since package version:
        1.601.0
      • awaitTermination

        public boolean awaitTermination(long timeout,
                                        java.util.concurrent.TimeUnit unit)
                                 throws java.lang.InterruptedException
        Specified by:
        awaitTermination in interface java.util.concurrent.ExecutorService
        Throws:
        java.lang.InterruptedException
      • invokeAll

        public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
                                                                     throws java.lang.InterruptedException
        Specified by:
        invokeAll in interface java.util.concurrent.ExecutorService
        Throws:
        java.lang.InterruptedException
      • invokeAll

        public <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
        Specified by:
        invokeAll in interface java.util.concurrent.ExecutorService
        Throws:
        java.lang.InterruptedException
      • invokeAny

        public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
                        throws java.lang.InterruptedException,
                               java.util.concurrent.ExecutionException
        Specified by:
        invokeAny in interface java.util.concurrent.ExecutorService
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • invokeAny

        public <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
        Specified by:
        invokeAny in interface java.util.concurrent.ExecutorService
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface java.util.concurrent.ExecutorService
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface java.util.concurrent.ExecutorService
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface java.util.concurrent.ExecutorService
      • shutdownNow

        public java.util.List<java.lang.Runnable> shutdownNow()
        Specified by:
        shutdownNow in interface java.util.concurrent.ExecutorService
      • submit

        public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • submit

        public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • submit

        public <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task,
                                                         T result)
        Specified by:
        submit in interface java.util.concurrent.ExecutorService
      • execute

        public void execute(java.lang.Runnable usersRunnable)
        Specified by:
        execute in interface java.util.concurrent.Executor