org.springframework.batch.core.job
Class JobSupport

java.lang.Object
  extended by org.springframework.batch.core.job.JobSupport
All Implemented Interfaces:
Job, BeanNameAware

public class JobSupport
extends Object
implements BeanNameAware, Job

Batch domain object representing a job. Job is an explicit abstraction representing the configuration of a job specified by a developer. It should be noted that restart policy is applied to the job as a whole and not to a step.

Author:
Lucas Ward, Dave Syer

Constructor Summary
JobSupport()
          Default constructor.
JobSupport(String name)
          Convenience constructor to immediately add name (which is mandatory but not final).
 
Method Summary
 void addStep(Step step)
           
 void execute(JobExecution execution)
           
 String getName()
           
 int getStartLimit()
           
 List getSteps()
           
 boolean isRestartable()
           
 void setBeanName(String name)
          Set the name property if it is not already set.
 void setName(String name)
          Set the name property.
 void setRestartable(boolean restartable)
           
 void setStartLimit(int startLimit)
           
 void setSteps(List steps)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JobSupport

public JobSupport()
Default constructor.


JobSupport

public JobSupport(String name)
Convenience constructor to immediately add name (which is mandatory but not final).

Parameters:
name -
Method Detail

setBeanName

public void setBeanName(String name)
Set the name property if it is not already set. Because of the order of the callbacks in a Spring container the name property will be set first if it is present. Care is needed with bean definition inheritance - if a parent bean has a name, then its children need an explicit name as well, otherwise they will not be unique.

Specified by:
setBeanName in interface BeanNameAware
See Also:
BeanNameAware.setBeanName(java.lang.String)

setName

public void setName(String name)
Set the name property. Always overrides the default value if this object is a Spring bean.

See Also:
setBeanName(java.lang.String)

getName

public String getName()
Specified by:
getName in interface Job

getSteps

public List getSteps()
Specified by:
getSteps in interface Job

setSteps

public void setSteps(List steps)

addStep

public void addStep(Step step)

getStartLimit

public int getStartLimit()

setStartLimit

public void setStartLimit(int startLimit)

setRestartable

public void setRestartable(boolean restartable)

isRestartable

public boolean isRestartable()
Specified by:
isRestartable in interface Job

execute

public void execute(JobExecution execution)
             throws UnexpectedJobExecutionException
Specified by:
execute in interface Job
Throws:
UnexpectedJobExecutionException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008 SpringSource. All Rights Reserved.