Package jade.core.behaviours
Class OutcomeManager
- java.lang.Object
-
- jade.core.behaviours.OutcomeManager
-
- All Implemented Interfaces:
Serializable
public class OutcomeManager extends Object implements Serializable
Utility class to manage the outcome of a behaviour in a uniform way- Author:
- Giovanni Caire
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OutcomeManager(Behaviour bh)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(String msg, Exception e)Mark the behaviour holding this OutcomeManager as failed and store the error-message that can then be retrieved by means of thegetErrorMsg()methodStringgetErrorMsg()Retrieve the error-message providing details about the reason of failure of the behaviour holding this OutcomeManager .intgetExitCode()Retrieve the exit-code that indicates whether the behaviour holding this OutcomeManager succeeded (OK) or failed (KO)booleanisSuccessful()voidpropagateError(String msg)Used to propagate an already logged error through a hierarchy of behaviours
-
-
-
Field Detail
-
OK
public static final int OK
- See Also:
- Constant Field Values
-
KO
public static final int KO
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OutcomeManager
public OutcomeManager(Behaviour bh)
-
-
Method Detail
-
getExitCode
public int getExitCode()
Retrieve the exit-code that indicates whether the behaviour holding this OutcomeManager succeeded (OK) or failed (KO)- Returns:
- The exit-code that indicates whether the behaviour holding this OutcomeManager succeeded (
OK) or failed (KO)
-
isSuccessful
public boolean isSuccessful()
-
getErrorMsg
public String getErrorMsg()
Retrieve the error-message providing details about the reason of failure of the behaviour holding this OutcomeManager .- Returns:
- The error-message providing details about the reason of failure of the behaviour holding this OutcomeManager or null if the behaviour succeeded
-
error
public void error(String msg, Exception e)
Mark the behaviour holding this OutcomeManager as failed and store the error-message that can then be retrieved by means of thegetErrorMsg()method- Parameters:
msg- The error message.e- The Exception, if any, that caused the behaviour to fail
-
propagateError
public void propagateError(String msg)
Used to propagate an already logged error through a hierarchy of behaviours
-
-