public interface AsyncService
Modifier and Type | Interface and Description |
---|---|
static class |
AsyncService.BlockingAction
Enumeration of possible blocking actions for
getAny(BlockingAction) . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
Copyright statement.
|
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 transactionId,
Channel channel)
Start a child CICS task asynchronously, passing a
Channel , and
returning a Future object. |
static final java.lang.String COPYRIGHT
java.util.concurrent.Future<ChildResponse> runTransactionId(java.lang.String transactionId, Channel channel) throws InvalidRequestException, InvalidTransactionIdException, ChannelErrorException, NotAuthorisedException, ResourceDisabledException
Channel
, and
returning a Future
object.
A Channel
must be specified if you expect to get a channel back
from the child.
transactionId
- 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
objectResourceDisabledException
- the specified transaction is disabledNotAuthorisedException
- the user associated with the issuing task is
not authorized to run the child taskChannelErrorException
- the channel specified contains an incorrect
character or combination of charactersInvalidTransactionIdException
- the transaction identifier specified
is not defined to CICS, or is defined as remoteInvalidRequestException
- 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 terminationjava.util.concurrent.Future<ChildResponse> runTransactionId(java.lang.String transactionId) throws InvalidRequestException, InvalidTransactionIdException, NotAuthorisedException, ResourceDisabledException
Future
object.transactionId
- the identifier of the local transaction to be startedFuture
object with a promise to deliver a
ChildResponse
objectResourceDisabledException
- the specified transaction is disabledNotAuthorisedException
- the user associated with the issuing task is
not authorized to run the child taskInvalidTransactionIdException
- the transaction identifier specified
is not defined to CICS, or is defined as remoteInvalidRequestException
- 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 terminationChildResponse 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.
ChildResponse
object representing the results of the
first returned child taskInvalidRequestException
- the parent has no childrenNotFoundException
- no unfetched children were foundChildResponse 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.
timeout
- 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 foundChildResponse 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.
blockingAction
- 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 foundvoid freeChild(ChildResponse childResponse) throws InvalidRequestException
childResponse
- object representing a returned child's resultsInvalidRequestException
- the ChildResponse
object does not
represent a valid childvoid freeChild(java.util.concurrent.Future<ChildResponse> future) throws InvalidRequestException
Future.get()
against this child (if
Future.get()
has not already been issued) will fail.
getAny()
will no longer return this child.future
- a Future
object returned by
runTransactionId(String)
InvalidRequestException
- the Future
object does not
represent a valid child