Package adams.flow.core
Class StopHelper
- java.lang.Object
-
- adams.flow.core.StopHelper
-
public class StopHelper extends Object
Helper class for stopping.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description StopHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Actor
getRoot(Actor context)
Returns the root actor.static Actor
getStopActor(Actor context, StopMode mode)
Determines the actor to call the stopExecution method on.protected static Actor
getStopRestrictor(Actor context)
Returns the enclosingStopRestrictor
.static String
stop(Actor context, StopMode mode)
Stops the flow using the specified stop mode, with no message.static String
stop(Actor context, StopMode mode, String message)
Stops the flow using the specified stop mode, with no message.
-
-
-
Method Detail
-
getStopRestrictor
protected static Actor getStopRestrictor(Actor context)
Returns the enclosingStopRestrictor
.- 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 contextmode
- 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 contextmode
- 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 contextmode
- the stop mode to usemessage
- the stop message, can be null- Returns:
- null if successful, otherwise error message
-
-