Package org.machanism.machai.gw.tools
Class ProcessTerminationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.machanism.machai.process.tools.SpecialException
org.machanism.machai.gw.tools.ProcessTerminationException
- All Implemented Interfaces:
Serializable
Runtime control-flow exception that requests host application termination.
The host should use getExitCode() when completing termination.
This exception represents an intentional workflow transition rather than an
ordinary application failure.
- Author:
- Viktor Tovstyi
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intExit code that the host should use when terminating execution.private static final longSerialization version for this control-flow exception. -
Constructor Summary
ConstructorsConstructorDescriptionProcessTerminationException(int exitCode) Creates a termination request with an exit code and no detail message.ProcessTerminationException(String message, int exitCode) Creates a termination request with a detail message and exit code.ProcessTerminationException(String message, Throwable cause, int exitCode) Creates a termination request with a detail message, cause, and exit code. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the exit code the host should use for termination.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version for this control-flow exception.- See Also:
-
exitCode
private final int exitCodeExit code that the host should use when terminating execution.
-
-
Constructor Details
-
ProcessTerminationException
Creates a termination request with a detail message and exit code.- Parameters:
message- message to expose to the hostexitCode- desired process exit code
-
ProcessTerminationException
Creates a termination request with a detail message, cause, and exit code.- Parameters:
message- message to expose to the hostcause- underlying causeexitCode- desired process exit code
-
ProcessTerminationException
public ProcessTerminationException(int exitCode) Creates a termination request with an exit code and no detail message.- Parameters:
exitCode- desired process exit code
-
-
Method Details
-
getExitCode
public int getExitCode()Returns the exit code the host should use for termination.- Returns:
- desired process exit code
-