Class StopHelper


  • public class StopHelper
    extends Object
    Helper class for stopping.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • StopHelper

        public StopHelper()
    • Method Detail

      • getStopRestrictor

        protected static Actor getStopRestrictor​(Actor context)
        Returns the enclosing StopRestrictor.
        Parameters:
        context - the flow context
        Returns:
        the restrictor
      • getRoot

        protected static Actor getRoot​(Actor context)
        Returns the root actor.
        Parameters:
        context - the flow context
        Returns:
        the restrictor
      • getStopActor

        public static Actor getStopActor​(Actor context,
                                         StopMode mode)
        Determines the actor to call the stopExecution method on.
        Parameters:
        context - the flow context
        mode - the stop mode to use
        Returns:
        the actor
      • stop

        public static String stop​(Actor context,
                                  StopMode mode)
        Stops the flow using the specified stop mode, with no message.
        Parameters:
        context - the flow context
        mode - the stop mode to use
        Returns:
        null if successful, otherwise error message
      • stop

        public static String stop​(Actor context,
                                  StopMode mode,
                                  String message)
        Stops the flow using the specified stop mode, with no message.
        Parameters:
        context - the flow context
        mode - the stop mode to use
        message - the stop message, can be null
        Returns:
        null if successful, otherwise error message