|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.spring.batch.BatchLauncher
Advanced batch launcher.
CommandLineJobRunner
Field Summary | |
protected LauncherConfiguration |
cfg
|
protected ArgumentParser |
cmdParser
|
protected Properties |
configurationProperties
|
protected ConfigurableApplicationContext |
context
|
static int |
ERROR
|
protected Logger |
log
|
protected LogConfigurator |
logConfigurator
instance in charge of configuring log4j. |
static int |
OK
|
protected PropertiesLoader |
propertiesLoader
An instance used to load properties used in spring context. |
static int |
STOP
|
Constructor Summary | |
BatchLauncher()
|
Method Summary | |
protected File |
computeBatchHome()
Computes the batch home directory. |
protected File |
computeConfDir()
Computes the configuration directory. |
void |
exit(int status)
Exit the batch, with the given code. |
int |
init(String[] args)
parses the command line arguments and initializes logging, loads properties, and initializes spring context. |
protected void |
initContext()
Initialize Spring context. |
protected void |
initLog4j()
Initialize log4j. |
protected void |
loadProperties()
Initialize properties. |
static void |
main(String[] args)
The entry point. |
int |
run()
Manages operations according the command line parameters. |
protected int |
runJob()
Run the spring job. |
protected int |
runResourceValidations()
Run the resources validations. |
protected int |
runVersion()
Print the batch version. |
void |
setExitCodeMapper(ExitCodeMapper exitCodeMapper)
Injection setter for the ExitCodeMapper . |
void |
setJobLocator(JobLocator jobLocator)
Injection setter for the JobLocator . |
void |
setJobParametersConverter(JobParametersConverter jobParametersConverter)
Injection setter for the JobParametersConverter . |
void |
setLauncher(JobLauncher launcher)
Injection setter for the JobLauncher . |
void |
setLog4jConfigurator(LogConfigurator logConfigurator)
Setter for the LogConfigurator .
|
void |
setPropertiesLoader(PropertiesLoader propertiesLoader)
Setter for the PropertiesLoader .
|
void |
setResourceValidationRunner(ResourceValidationRunner resourceValidationRunner)
Injection setter for the ResourceValidationRunner . |
void |
setSystemExiter(SystemExiter systemExiter)
Injection setter for the SystemExiter . |
void |
setVersionProvider(VersionProvider versionProvider)
Injection setter for the VersionProvider . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OK
public static final int ERROR
public static final int STOP
protected Logger log
protected LogConfigurator logConfigurator
protected PropertiesLoader propertiesLoader
protected LauncherConfiguration cfg
protected Properties configurationProperties
protected ConfigurableApplicationContext context
protected ArgumentParser cmdParser
Constructor Detail |
public BatchLauncher()
Method Detail |
public void setLog4jConfigurator(LogConfigurator logConfigurator)
LogConfigurator
.
Instance of this class must not be wired by spring.
logConfigurator
- the logConfigurator to setpublic void setPropertiesLoader(PropertiesLoader propertiesLoader)
PropertiesLoader
.
Instance of this class must not be wired by spring.
propertiesLoader
- the propertiesLoader to setpublic void setExitCodeMapper(ExitCodeMapper exitCodeMapper)
ExitCodeMapper
.
exitCodeMapper
- the exitCodeMapper to setpublic void setLauncher(JobLauncher launcher)
JobLauncher
.
launcher
- the launcher to setpublic void setJobLocator(JobLocator jobLocator)
JobLocator
.
jobLocator
- the jobLocator to setpublic void setSystemExiter(SystemExiter systemExiter)
SystemExiter
.
systemExiter
- the systemExiter to setpublic void setJobParametersConverter(JobParametersConverter jobParametersConverter)
JobParametersConverter
.
jobParametersConverter
- the jobParametersConverter to setpublic void setResourceValidationRunner(ResourceValidationRunner resourceValidationRunner)
ResourceValidationRunner
.
resourceValidationRunner
- the resourceValidationRunner to setpublic void setVersionProvider(VersionProvider versionProvider)
VersionProvider
.
versionProvider
- the versionProvider to setpublic int init(String[] args)
args
- the command line arguments.
protected void initLog4j()
protected void loadProperties() throws IOException
IOException
- when an io error occurs.protected void initContext()
protected int runJob()
protected int runResourceValidations()
protected int runVersion()
protected File computeBatchHome()
${batch.name}.home
, then for the environment
variable: ${batch.name}.toUpperCase()_HOME
, and
finally the current directory.
protected File computeConfDir()
${batch.home}/conf
is used, else the command line
argument is used.
public int run()
public void exit(int status)
status
- an exit code value.public static void main(String[] args)
args
- the command line parameters.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |