Class ProcessTerminationException

All Implemented Interfaces:
Serializable

public class ProcessTerminationException extends SpecialException
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 Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version for this control-flow exception.
      See Also:
    • exitCode

      private final int exitCode
      Exit code that the host should use when terminating execution.
  • Constructor Details

    • ProcessTerminationException

      public ProcessTerminationException(String message, int exitCode)
      Creates a termination request with a detail message and exit code.
      Parameters:
      message - message to expose to the host
      exitCode - desired process exit code
    • ProcessTerminationException

      public ProcessTerminationException(String message, Throwable cause, int exitCode)
      Creates a termination request with a detail message, cause, and exit code.
      Parameters:
      message - message to expose to the host
      cause - underlying cause
      exitCode - 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