Interface RemoteExecutionControlManager
- All Superinterfaces:
ExecutionControlManager
A
If the timeout elapses before a reply has been received, the request will be withdrawn if possible and
RemoteExecutionControlManager extends an
ExecutionControlManager by the means to provide a timeout for
all methods requiring an interaction with an execution session. This is
useful for a RuntimeService since the reply to a request may
take much longer than a request for an ExecutableComponent. If the timeout elapses before a reply has been received, the request will be withdrawn if possible and
false will be returned.
Due to the unsure response time, the methods without timeout should only be called from services running in the same JVM as this runtime service.
- Author:
- Ulrich Kreher
-
Method Summary
Modifier and TypeMethodDescriptionfinishActivity(SessionToken session, EBPInstanceReference activity, long timeout) Sends a finish request just likeExecutionControlManager.finishActivity(SessionToken, EBPInstanceReference)but only waits the designated time for a response to the finish request.resetActivity(SessionToken session, EBPInstanceReference activity, long timeout) Sends a reset request just likeExecutionControlManager.resetActivity(SessionToken, EBPInstanceReference)but only waits the designated time for a response to the reset request.sendSignalToActivity(SessionToken session, EBPInstanceReference activity, int signal, long timeout) Sends a signal just likeExecutionControlManager.sendSignalToActivity(SessionToken, EBPInstanceReference, int)but only waits the designated time for a response to the signal.suspendActivity(SessionToken session, EBPInstanceReference activity, long timeout) Sends a suspend request just likeExecutionControlManager.suspendActivity(SessionToken, EBPInstanceReference, boolean)but only waits the designated time for a response to the suspend request.Methods inherited from interface de.aristaflow.adept2.core.runtimemanager.ExecutionControlManager
abortActivity, finishActivity, getActivities, getActivitiesIterator, getActivityState, getAllActivities, getAllActivitiesIterator, getExecutionControlProperties, resetActivity, sendSignalToActivity, suspendActivity, waitForTermination
-
Method Details
-
suspendActivity
Boolean suspendActivity(SessionToken session, EBPInstanceReference activity, long timeout) throws InterruptedException Sends a suspend request just likeExecutionControlManager.suspendActivity(SessionToken, EBPInstanceReference, boolean)but only waits the designated time for a response to the suspend request. If the timeout elapses the request will be withdrawn if possible (the request is not notified viaMessageListener).- Parameters:
session- The session which is used to check for access rights on this method.activity- The identification of the activity to be suspended.timeout- The time in milliseconds to wait for the response of the suspend request for the designated activity.- Returns:
- The response of the executor of the activity if it responded in
time. If the timeout has elapsed before the executor responded,
falsewill be returned.nullwill be returned if the executor has terminated before retrieving the request. - Throws:
InterruptedException- If the calling thread has been interrupted while waiting for the activity to respond to the suspend request, anInterruptedExceptionwill be thrown. The request will be withdrawn if possible.IllegalArgumentException- If the activity is not suspensible (seeExecutionControlProperties.isSuspensible()) or not running (any more), anIllegalArgumentExceptionwill be thrown.
-
finishActivity
Boolean finishActivity(SessionToken session, EBPInstanceReference activity, long timeout) throws InterruptedException Sends a finish request just likeExecutionControlManager.finishActivity(SessionToken, EBPInstanceReference)but only waits the designated time for a response to the finish request. If the timeout elapses the request will be withdrawn if possible (the request is not notified viaMessageListener).- Parameters:
session- The session which is used to check for access rights on this method.activity- The identification of the activity to be finished.timeout- The time in milliseconds to wait for the response of the finish request for the designated activity.- Returns:
- The response of the executor of the activity if it responded in
time. If the timeout has elapsed before the executor responded,
falsewill be returned.nullwill be returned if the executor has terminated before retrieving the request. - Throws:
InterruptedException- If the calling thread has been interrupted while waiting for the activity to respond to the finish request, anInterruptedExceptionwill be thrown. The request will be withdrawn if possible.IllegalArgumentException- If the activity is not closable (seeExecutionControlProperties.isClosable()) or not running (any more), anIllegalArgumentExceptionwill be thrown.
-
resetActivity
Boolean resetActivity(SessionToken session, EBPInstanceReference activity, long timeout) throws InterruptedException Sends a reset request just likeExecutionControlManager.resetActivity(SessionToken, EBPInstanceReference)but only waits the designated time for a response to the reset request. If the timeout elapses the request will be withdrawn if possible (the request is not notified viaMessageListener).- Parameters:
session- The session which is used to check for access rights on this method.activity- The identification of the activity to be reset.timeout- The time in milliseconds to wait for the response of the reset request for the designated activity.- Returns:
- The response of the executor of the activity if it responded in
time. If the timeout has elapsed before the executor responded,
falsewill be returned.nullwill be returned if the executor has terminated before retrieving the request. - Throws:
InterruptedException- If the calling thread has been interrupted while waiting for the activity to respond to the reset request, anInterruptedExceptionwill be thrown. The request will be withdrawn if possible.IllegalArgumentException- If the activity is not resettable (seeExecutionControlProperties.isResettable()) or not running (any more), anIllegalArgumentExceptionwill be thrown.
-
sendSignalToActivity
Boolean sendSignalToActivity(SessionToken session, EBPInstanceReference activity, int signal, long timeout) throws InterruptedException Sends a signal just likeExecutionControlManager.sendSignalToActivity(SessionToken, EBPInstanceReference, int)but only waits the designated time for a response to the signal. If the timeout elapses the request will be withdrawn if possible (the request is not notified viaMessageListener).- Parameters:
session- The session which is used to check for access rights on this method.activity- The identification of the activity to send a signal to.signal- The control signal that should be forwarded to the affected activity.timeout- The time in milliseconds to wait for the response of the signal for the designated activity.- Returns:
- The response of the executor of the activity if it responded in
time. If the timeout has elapsed before the executor responded,
falsewill be returned.nullwill be returned if the executor has terminated before retrieving the request. - Throws:
InterruptedException- If the calling thread has been interrupted while waiting for the activity to respond to the signal, anInterruptedExceptionwill be thrown. The request will be withdrawn if possible.IllegalArgumentException- If the activity is not running (any more), anIllegalArgumentExceptionwill be thrown.
-