From d6d22d03b189d609b529249564f9528880f5ac95 Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Sun, 23 Aug 2009 18:16:25 +0000 Subject: [PATCH] BATCH-1368: Update docs to remove syntax --- .../docbook/reference/common-patterns.xml | 4 +- src/site/docbook/reference/job.xml | 90 ++++++++----------- src/site/docbook/reference/step.xml | 28 +++--- 3 files changed, 53 insertions(+), 69 deletions(-) diff --git a/src/site/docbook/reference/common-patterns.xml b/src/site/docbook/reference/common-patterns.xml index d55615cf6..6976c696b 100644 --- a/src/site/docbook/reference/common-patterns.xml +++ b/src/site/docbook/reference/common-patterns.xml @@ -56,7 +56,9 @@ <step id="simpleStep"> ... <listeners> - <listener class="org.example...ItemFailureLoggerListener"/> + <listener> + <bean class="org.example...ItemFailureLoggerListener"/> + </listener> </listeners> </step> diff --git a/src/site/docbook/reference/job.xml b/src/site/docbook/reference/job.xml index 36cfbe127..2a1c4f981 100644 --- a/src/site/docbook/reference/job.xml +++ b/src/site/docbook/reference/job.xml @@ -2,61 +2,42 @@ - Configuring and Running a Job + Configuring and Running a Job - - In - - , the overall architecture design was - discussed, using the following diagram as a guide: - + In , the overall architecture design was + discussed, using the following diagram as a guide: - - - - + + + + - - - - + + + + - - While the - Job - object may seem like a simple - container for steps, there are many configuration options of which a - developers must be aware . Furthermore, there are many considerations for - how a - Job - will be run and how its meta-data will be - stored during that run. This chapter will explain the various configuration - options and runtime concerns of a - Job - . - + While the Job object may seem like a simple + container for steps, there are many configuration options of which a + developers must be aware . Furthermore, there are many considerations for + how a Job will be run and how its meta-data will be + stored during that run. This chapter will explain the various configuration + options and runtime concerns of a Job . -
- Configuring a Job +
+ Configuring a Job - - There are multiple implementations of the - - Job - - interface, however, the - namespace abstracts away the differences in configuration. It has only - three required dependencies: a name, - JobRepository - , - and a list of - Step - s. - + There are multiple implementations of the + Job interface, however, the namespace + abstracts away the differences in configuration. It has only three + required dependencies: a name, JobRepository , and + a list of Step s. - <job id="footballJob"> + <job id="footballJob"> <step id="playerload" parent="s1" next="gameLoad"/> <step id="gameLoad" parent="s2" next="playerSummarization"/> <step id="playerSummarization" parent="s3"/> @@ -145,7 +126,7 @@ catch (JobRestartException e) { <step id="gameLoad" parent="s2" next="playerSummarization"/> <step id="playerSummarization" parent="s3"/> <listeners> - <listener class="org.springframework.batch.sample.SampleListener"/> + <listener ref="sampleListener"/> </listeners> </job> @@ -196,7 +177,7 @@ catch (JobRestartException e) { <job id="baseJob" abstract="true"> <listeners> - <listener class="com.ListenerOne"/> + <listener ref="listenerOne"/> <listeners> </job> @@ -204,7 +185,7 @@ catch (JobRestartException e) { <step id="step1" parent="standaloneStep"/> <listeners merge="true"> - <listener class="com.ListenerTwo"/> + <listener ref="listenerTwo"/> <listeners> </job> @@ -353,9 +334,10 @@ catch (JobRestartException e) { Note that the in-memory repository is volatile and so does not allow restart between JVM instances. It also cannot guarantee that two - job instances with the same parameters are launched simultaneously, and - is not suitable for use in a multi-threaded Job, or a locally partitioned Step. So - use the database version of the repository wherever you need those features. + job instances with the same parameters are launched simultaneously, and + is not suitable for use in a multi-threaded Job, or a locally + partitioned Step. So use the database version of the repository wherever + you need those features. However it does require a transaction manager to be defined because there are rollback semantics within the repository, and because diff --git a/src/site/docbook/reference/step.xml b/src/site/docbook/reference/step.xml index f297d72d0..30084921e 100644 --- a/src/site/docbook/reference/step.xml +++ b/src/site/docbook/reference/step.xml @@ -233,12 +233,12 @@ itemWriter.write(items); In the following example, the Step "concreteStep3" will be created will two listeners: - com.ListenerOne and - com.ListenerTwo: + listenerOne and + listenerTwo: <step id="listenersParentStep" abstract="true"> <listeners> - <listener class="com.ListenerOne"/> + <listener ref="listenerOne"/> <listeners> </step> @@ -246,7 +246,7 @@ itemWriter.write(items); <tasklet> <chunk reader="itemReader" writer="itemWriter" commit-interval="5"/> <listeners merge="true"> - <listener class="com.ListenerTwo"/> + <listener ref="listenerTwo"/> <listeners> </tasklet> </step> @@ -696,16 +696,16 @@ itemWriter.write(items); </tasklet> </step> - An ItemReader, ItemWriter - or ItemProcessor that itself implements - one of the StepListener interfaces will - be registered automatically with the Step - if using the namespace <step> element, - or one of the the *StepFactoryBean - factories. This only applies to components directly injected - into the Step: if the listener is nested - inside another component, it needs to be explicitly registered - (as described above). + An ItemReader, + ItemWriter or + ItemProcessor that itself implements one of the + StepListener interfaces will be registered + automatically with the Step if using the + namespace <step> element, or one of the the + *StepFactoryBean factories. This only applies to + components directly injected into the Step: if + the listener is nested inside another component, it needs to be + explicitly registered (as described above). In addition to the StepListener interfaces, annotations are provided to address the same concerns.