1 /* 2 * Copyright 2007 The Kuali Foundation 3 * 4 * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php 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 package org.kuali.ole.sys.batch; 17 18 import java.util.Date; 19 20 public interface Step { 21 /** 22 * Perform this step of a batch job. 23 * 24 * @param jobName the name of the job running the step 25 * @param jobRunDate the time/date the job is executed 26 * @return true if successful and continue the job, false if successful and stop the job 27 * @throws Throwable if unsuccessful 28 */ 29 public boolean execute(String jobName, Date jobRunDate) throws InterruptedException; 30 31 /** 32 * Return id of this step spring bean. 33 * 34 * @return The name of this step. 35 */ 36 public String getName(); 37 38 /** 39 * Call to attempt to interrupt a step in the middle of processing. Note that this only has an effect if the step in question 40 * checks its interrupted status. 41 */ 42 public void interrupt(); 43 44 public boolean isInterrupted(); 45 46 public void setInterrupted(boolean interrupted); 47 }