public class SimpleJvmExitCodeMapper extends java.lang.Object implements ExitCodeMapper
ExitCodeMapper
that can be configured through a
map from batch exit codes (String) to integer results. Some default entries
are set up to recognise common cases. Any that are injected are added to
these.Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
JVM_EXITCODE_COMPLETED, JVM_EXITCODE_FORCE_KILLED, JVM_EXITCODE_GENERIC_ERROR, JVM_EXITCODE_INVALID_CONFIG_FILE, JVM_EXITCODE_INVALID_CONTAINER_EXEC_PERMISSIONS, JVM_EXITCODE_INVALID_CONTAINER_PID, JVM_EXITCODE_INVALID_USER_NAME, JVM_EXITCODE_TERMINATED, JVM_EXITCODE_UNABLE_TO_EXECUTE_CONTAINER_SCRIPT, JVM_EXITCODE_WRITE_CGROUP_FAILED
Constructor and Description |
---|
SimpleJvmExitCodeMapper() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Integer> |
getMapping() |
int |
intValue(java.lang.Boolean exitCode)
Convert the exit code from Boolean into an integer that the calling
environment as an operating system can interpret as an exit status.
|
int |
intValue(java.lang.String exitCode)
Get the operating system exit status that matches a certain Batch
Framework Exitcode
|
void |
setMapping(java.util.Map<java.lang.String,java.lang.Integer> exitCodeMap)
Supply the ExitCodeMappings
|
public java.util.Map<java.lang.String,java.lang.Integer> getMapping()
public void setMapping(java.util.Map<java.lang.String,java.lang.Integer> exitCodeMap)
exitCodeMap
- A set of mappings between environment specific exit codes and
batch framework internal exit codespublic int intValue(java.lang.String exitCode)
intValue
in interface ExitCodeMapper
exitCode
- The exitcode of the Batch Job as known by the Batch Frameworkpublic int intValue(java.lang.Boolean exitCode)
ExitCodeMapper
intValue
in interface ExitCodeMapper
exitCode
- The exit code which is used internally.