1 /*
2 * Copyright 2006-2007 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.springframework.batch.core.launch.support;
18
19 /**
20 *
21 * This interface should be implemented when an environment calling the batch
22 * framework has specific requirements regarding the operating system process
23 * return status.
24 *
25 * @author Stijn Maller
26 * @author Lucas Ward
27 * @author Dave Syer
28 */
29 public interface ExitCodeMapper {
30
31 static int JVM_EXITCODE_COMPLETED = 0;
32
33 static int JVM_EXITCODE_GENERIC_ERROR = 1;
34
35 static int JVM_EXITCODE_JOB_ERROR = 2;
36
37 public static final String NO_SUCH_JOB = "NO_SUCH_JOB";
38
39 public static final String JOB_NOT_PROVIDED = "JOB_NOT_PROVIDED";
40
41 /**
42 * Convert the exit code from String into an integer that the calling
43 * environment as an operating system can interpret as an exit status.
44 * @param exitCode The exit code which is used internally.
45 * @return The corresponding exit status as known by the calling
46 * environment.
47 */
48 public int intValue(String exitCode);
49
50 }