Interface RemoteExecutionControlManager

  • All Superinterfaces:
    ExecutionControlManager

    public interface RemoteExecutionControlManager
    extends ExecutionControlManager
    A 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 Detail

      • suspendActivity

        Boolean suspendActivity​(SessionToken session,
                                EBPInstanceReference activity,
                                long timeout)
                         throws InterruptedException
        Sends a suspend request just like ExecutionControlManager.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 via MessageListener).
        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, an InterruptedException will be thrown. The request will be withdrawn if possible.
        IllegalArgumentException - If the activity is not suspensible (see ExecutionControlProperties.isSuspensible()) or not running (any more), an IllegalArgumentException will be thrown.
      • finishActivity

        Boolean finishActivity​(SessionToken session,
                               EBPInstanceReference activity,
                               long timeout)
                        throws InterruptedException
        Sends a finish request just like ExecutionControlManager.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 via MessageListener).
        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, an InterruptedException will be thrown. The request will be withdrawn if possible.
        IllegalArgumentException - If the activity is not closable (see ExecutionControlProperties.isClosable()) or not running (any more), an IllegalArgumentException will be thrown.
      • resetActivity

        Boolean resetActivity​(SessionToken session,
                              EBPInstanceReference activity,
                              long timeout)
                       throws InterruptedException
        Sends a reset request just like ExecutionControlManager.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 via MessageListener).
        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, an InterruptedException will be thrown. The request will be withdrawn if possible.
        IllegalArgumentException - If the activity is not resettable (see ExecutionControlProperties.isResettable()) or not running (any more), an IllegalArgumentException will be thrown.
      • sendSignalToActivity

        Boolean sendSignalToActivity​(SessionToken session,
                                     EBPInstanceReference activity,
                                     int signal,
                                     long timeout)
                              throws InterruptedException
        Sends a signal just like ExecutionControlManager.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 via MessageListener).
        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, an InterruptedException will be thrown. The request will be withdrawn if possible.
        IllegalArgumentException - If the activity is not running (any more), an IllegalArgumentException will be thrown.