001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.sys.batch; 017 018 import org.kuali.rice.kns.service.DateTimeService; 019 import org.kuali.rice.kns.service.ParameterService; 020 import org.springframework.beans.factory.BeanNameAware; 021 022 public abstract class AbstractStep implements Step, BeanNameAware { 023 private String name; 024 private ParameterService parameterService; 025 private DateTimeService dateTimeService; 026 private boolean interrupted = false; 027 028 /** 029 * Sets the bean name 030 * 031 * @param name String that contains the bean name 032 * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) 033 */ 034 public void setBeanName(String name) { 035 this.name = name; 036 } 037 038 /** 039 * Gets the name attribute. 040 * 041 * @return Returns the name. 042 */ 043 public String getName() { 044 return name; 045 } 046 047 protected ParameterService getParameterService() { 048 return parameterService; 049 } 050 051 public void setParameterService(ParameterService parameterService) { 052 this.parameterService = parameterService; 053 } 054 055 /** 056 * Gets the dateTimeService attribute. 057 * 058 * @return Returns the dateTimeService. 059 */ 060 protected DateTimeService getDateTimeService() { 061 return dateTimeService; 062 } 063 064 /** 065 * Sets the dateTimeService attribute value. 066 * 067 * @param dateTimeService The dateTimeService to set. 068 */ 069 public void setDateTimeService(DateTimeService dateTimeService) { 070 this.dateTimeService = dateTimeService; 071 } 072 073 /** 074 * Returns the boolean value of the interrupted flag 075 * 076 * @return boolean 077 * @see org.kuali.kfs.sys.batch.Step#isInterrupted() 078 */ 079 public boolean isInterrupted() { 080 return interrupted; 081 } 082 083 /** 084 * Sets the interruped flag 085 * 086 * @param interrupted 087 * @see org.kuali.kfs.sys.batch.Step#setInterrupted(boolean) 088 */ 089 public void setInterrupted(boolean interrupted) { 090 this.interrupted = interrupted; 091 } 092 093 /** 094 * Initializes the interrupted flag 095 * 096 * @see org.kuali.kfs.sys.batch.Step#interrupt() 097 */ 098 public void interrupt() { 099 this.interrupted = true; 100 } 101 }