public final class AsyncServiceImpl extends API implements AsyncService
AsyncService, provides the Java interfaces
to three of the CICS Asynchronous API commands:
AsyncService.BlockingAction| Constructor and Description |
|---|
AsyncServiceImpl()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
freeChild(ChildResponse childResponse)
Free the CICS memory object representing the specified child.
|
void |
freeChild(java.util.concurrent.Future<ChildResponse> future)
Free the CICS memory object representing the specified child such that
future invocations of
Future.get() against this child (if
Future.get() has not already been issued) will fail. |
ChildResponse |
getAny()
Get the results (in the form of a
ChildResponse object) of the
first child task which returns to the issuing task. |
ChildResponse |
getAny(AsyncService.BlockingAction blockingAction)
Get the results (in the form of a
ChildResponse object) of the
first child task which returns to the issuing task. |
ChildResponse |
getAny(long timeout,
java.util.concurrent.TimeUnit unit)
Get the results (in the form of a
ChildResponse object) of the
first child task which returns to the issuing task. |
java.util.concurrent.Future<ChildResponse> |
runTransactionId(java.lang.String transactionId)
Start a child CICS task asynchronously, returning a
Future object. |
java.util.concurrent.Future<ChildResponse> |
runTransactionId(java.lang.String tranId,
Channel channel)
Start a child CICS task asynchronously, passing a
Channel, and
returning a Future object. |
getCICSServerApiVersionpublic java.util.concurrent.Future<ChildResponse> runTransactionId(java.lang.String tranId, Channel channel) throws InvalidRequestException, InvalidTransactionIdException, ChannelErrorException, NotAuthorisedException, ResourceDisabledException, StartFailedException
Channel, and
returning a Future object.
A Channel must be specified if you expect to get a channel back
from the child.
runTransactionId in interface AsyncServicetranId - the identifier of the local transaction to be startedchannel - the Channel object to be passed (copied) to the
child task. If this is null, no channel will be passed to the
child taskFuture object with a promise to deliver a
ChildResponse objectInvalidRequestException - the started transaction is not
shutdown-enabled and the CICS region is in the process of shutting
down, or this method was run during transaction terminationInvalidTransactionIdException - the transaction identifier specified
is not defined to CICS, or is defined as remoteChannelErrorException - the channel specified contains an incorrect
character or combination of charactersNotAuthorisedException - the user associated with the issuing task is
not authorized to run the child taskResourceDisabledException - the specified transaction is disabledStartFailedException - transaction start has been prevented because
its associated TRANCLASS has reached the purge threshold and
PURGEACTION(DISCARD) has been set on the TRANCLASSpublic java.util.concurrent.Future<ChildResponse> runTransactionId(java.lang.String transactionId) throws InvalidRequestException, InvalidTransactionIdException, NotAuthorisedException, ResourceDisabledException, StartFailedException
Future object.runTransactionId in interface AsyncServicetransactionId - the identifier of the local transaction to be startedFuture object with a promise to deliver a
ChildResponse objectInvalidRequestException - the started transaction is not
shutdown-enabled and the CICS region is in the process of shutting
down, or this method was run during transaction terminationInvalidTransactionIdException - the transaction identifier specified
is not defined to CICS, or is defined as remoteNotAuthorisedException - the user associated with the issuing task is
not authorized to run the child taskResourceDisabledException - the specified transaction is disabledStartFailedException - start failedpublic ChildResponse getAny() throws InvalidRequestException, NotFoundException
ChildResponse object) of the
first child task which returns to the issuing task.
This method will block the current thread until a child task completes.
getAny in interface AsyncServiceChildResponse object representing the results of the
first returned child taskInvalidRequestException - the parent has no childrenNotFoundException - no unfetched children were foundpublic ChildResponse getAny(AsyncService.BlockingAction blockingAction) throws InvalidRequestException, NotFinishedException, NotFoundException
ChildResponse object) of the
first child task which returns to the issuing task.
This method will block the current thread until a child task completes,
unless AsyncService.BlockingAction.NOSUSPEND is chosen as the argument.
getAny in interface AsyncServiceblockingAction - the choice of blocking action enumerated by
AsyncService.BlockingAction; defaults to AsyncService.BlockingAction.SUSPEND
if null is passedChildResponse object representing the results of the
first returned child taskInvalidRequestException - the parent has no childrenNotFinishedException - no children have completedNotFoundException - no unfetched children were foundpublic ChildResponse getAny(long timeout, java.util.concurrent.TimeUnit unit) throws InvalidRequestException, NotFinishedException, NotFoundException
ChildResponse object) of the
first child task which returns to the issuing task.
This method will block the current thread until the child task completes, or the timeout expires. A maximum time of 4080000 milliseconds is supported.
getAny in interface AsyncServicetimeout - the maximum time to waitunit - the time unit of the timeout argumentChildResponse object representing the results of the
first returned child taskInvalidRequestException - the parent has no children, or the timeout
value is not validNotFinishedException - no children have completed within the interval
specifiedNotFoundException - no unfetched children were foundpublic void freeChild(ChildResponse childResponse) throws InvalidRequestException
freeChild in interface AsyncServicechildResponse - object representing a returned child's resultsInvalidRequestException - the ChildResponse object does not
represent a valid childpublic void freeChild(java.util.concurrent.Future<ChildResponse> future) throws InvalidRequestException
Future.get() against this child (if
Future.get() has not already been issued) will fail.
AsyncService.getAny() will no longer return this child.freeChild in interface AsyncServicefuture - a Future object returned by
AsyncService.runTransactionId(String)InvalidRequestException - the Future object does not
represent a valid child