From 455cc6778083107f7ef979c1f711552eebf59e02 Mon Sep 17 00:00:00 2001 From: lucasward Date: Thu, 20 Sep 2007 03:01:10 +0000 Subject: [PATCH] IN PROGRESS - issue BATCH-24: Provide exit code for job executed as a main method http://opensource.atlassian.com/projects/spring/browse/BATCH-24 JvmSystemExiter was in test instead of main. --- .../bootstrap/support/JvmSystemExiter.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 execution/src/main/java/org/springframework/batch/execution/bootstrap/support/JvmSystemExiter.java diff --git a/execution/src/main/java/org/springframework/batch/execution/bootstrap/support/JvmSystemExiter.java b/execution/src/main/java/org/springframework/batch/execution/bootstrap/support/JvmSystemExiter.java new file mode 100644 index 000000000..1f2d4fc04 --- /dev/null +++ b/execution/src/main/java/org/springframework/batch/execution/bootstrap/support/JvmSystemExiter.java @@ -0,0 +1,39 @@ +/* + * Copyright 2006-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.batch.execution.bootstrap.support; + +import org.springframework.batch.execution.bootstrap.SystemExiter; + +/** + * Implementation of the {@link SystemExiter} interface + * that calls the standards System.exit method. It should + * be noted that there will be no unit tests for this class, + * since there is only one line of actual code, that would only + * be testable by mocking System or Runtime. + * + * @author Lucas Ward + * + */ +public class JvmSystemExiter implements SystemExiter { + + /* (non-Javadoc) + * @see org.springframework.batch.execution.bootstrap.SystemExiter#exit(int) + */ + public void exit(int status) { + System.exit(status); + } + +}