Interface RemoteExecutionControlManager
-
- All Superinterfaces:
ExecutionControlManager
public interface RemoteExecutionControlManager extends ExecutionControlManager
ARemoteExecutionControlManager
extends anExecutionControlManager
by the means to provide a timeout for all methods requiring an interaction with an execution session. This is useful for aRuntimeService
since the reply to a request may take much longer than a request for anExecutableComponent
.
If the timeout elapses before a reply has been received, the request will be withdrawn if possible andfalse
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Boolean
finishActivity(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.Boolean
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.Boolean
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.Boolean
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 Detail
-
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,
false
will be returned.null
will 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, anInterruptedException
will be thrown. The request will be withdrawn if possible.IllegalArgumentException
- If the activity is not suspensible (seeExecutionControlProperties.isSuspensible()
) or not running (any more), anIllegalArgumentException
will 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,
false
will be returned.null
will 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, anInterruptedException
will be thrown. The request will be withdrawn if possible.IllegalArgumentException
- If the activity is not closable (seeExecutionControlProperties.isClosable()
) or not running (any more), anIllegalArgumentException
will 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,
false
will be returned.null
will 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, anInterruptedException
will be thrown. The request will be withdrawn if possible.IllegalArgumentException
- If the activity is not resettable (seeExecutionControlProperties.isResettable()
) or not running (any more), anIllegalArgumentException
will 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,
false
will be returned.null
will 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, anInterruptedException
will be thrown. The request will be withdrawn if possible.IllegalArgumentException
- If the activity is not running (any more), anIllegalArgumentException
will be thrown.
-
-