Strategy interface for determining the exit code returned from a JetLeaf application or a process.
This is typically used when the application is shutting down due to an error, and a custom exit code should be returned to the operating system.
Classes implementing this interface can be plugged into the JetLeaf runtime, allowing them to determine a meaningful exit code based on the state of the application or the error encountered.
Example:
class MyExitCodeGenerator implements ExitCodeGenerator {
@override
int getExitCode() {
// Return 1 to indicate error
return 1;
}
@override
String getPackageName() => "test";
}
You can register this generator during the application context setup or inside an error-handling pipeline.
See also: ApplicationExitHandler
, SystemExit
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getExitCode(
) → int - Returns the exit code that should be used to terminate the application.
-
getPackageName(
) → String -
Represents an abstraction for identifying the package that an object,
resource, or service belongs to.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited