BATCH-1368: Update docs to remove <listener class="..."/> syntax

This commit is contained in:
dhgarrette
2009-08-23 18:16:25 +00:00
parent e6819e3a47
commit d6d22d03b1
3 changed files with 53 additions and 69 deletions

View File

@@ -56,7 +56,9 @@
<programlisting>&lt;step id="simpleStep"&gt;
...
&lt;listeners&gt;
&lt;listener class="org.example...ItemFailureLoggerListener"/&gt;
&lt;listener&gt;
&lt;bean class="org.example...ItemFailureLoggerListener"/&gt;
&lt;/listener&gt;
&lt;/listeners&gt;
&lt;/step&gt;</programlisting>

View File

@@ -2,61 +2,42 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<chapter id="configureJob">
<title>Configuring and Running a Job</title>
<title>Configuring and Running a Job</title>
<para>
In
<xref linkend="domain" />
, the overall architecture design was
discussed, using the following diagram as a guide:
</para>
<para>In <xref linkend="domain" /> , the overall architecture design was
discussed, using the following diagram as a guide:</para>
<mediaobject>
<imageobject role="html">
<imagedata align="center" fileref="images/spring-batch-reference-model.png"
format="PNG" scale="100" />
</imageobject>
<mediaobject>
<imageobject role="html">
<imagedata align="center"
fileref="images/spring-batch-reference-model.png"
format="PNG" scale="100" />
</imageobject>
<imageobject role="fo">
<imagedata align="center" fileref="images/spring-batch-reference-model.png"
format="PNG" scale="55" />
</imageobject>
</mediaobject>
<imageobject role="fo">
<imagedata align="center"
fileref="images/spring-batch-reference-model.png"
format="PNG" scale="55" />
</imageobject>
</mediaobject>
<para>
While the
<classname>Job</classname>
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
<classname>Job</classname>
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
<classname>Job</classname>
.
</para>
<para>While the <classname>Job</classname> 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 <classname>Job</classname> 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 <classname>Job</classname> .</para>
<section id="configuringAJob">
<title>Configuring a Job</title>
<section id="configuringAJob">
<title>Configuring a Job</title>
<para>
There are multiple implementations of the
<link linkend="job">
<classname>Job</classname>
</link>
interface, however, the
namespace abstracts away the differences in configuration. It has only
three required dependencies: a name,
<classname>JobRepository</classname>
,
and a list of
<classname>Step</classname>
s.
</para>
<para>There are multiple implementations of the <link linkend="job">
<classname>Job</classname> </link> interface, however, the namespace
abstracts away the differences in configuration. It has only three
required dependencies: a name, <classname>JobRepository</classname> , and
a list of <classname>Step</classname> s.</para>
<programlisting>&lt;job id="footballJob"&gt;
<programlisting>&lt;job id="footballJob"&gt;
&lt;step id="playerload" parent="s1" next="gameLoad"/&gt;
&lt;step id="gameLoad" parent="s2" next="playerSummarization"/&gt;
&lt;step id="playerSummarization" parent="s3"/&gt;
@@ -145,7 +126,7 @@ catch (JobRestartException e) {
&lt;step id="gameLoad" parent="s2" next="playerSummarization"/&gt;
&lt;step id="playerSummarization" parent="s3"/&gt;
<emphasis role="bold"> &lt;listeners&gt;
&lt;listener class="org.springframework.batch.sample.SampleListener"/&gt;
&lt;listener ref="sampleListener"/&gt;
&lt;/listeners&gt;
</emphasis>&lt;/job&gt;</programlisting>
@@ -196,7 +177,7 @@ catch (JobRestartException e) {
<programlisting>&lt;job id="baseJob" abstract="true"&gt;
&lt;listeners&gt;
&lt;listener class="com.ListenerOne"/&gt;
&lt;listener ref="listenerOne"/&gt;
&lt;listeners&gt;
&lt;/job&gt;
@@ -204,7 +185,7 @@ catch (JobRestartException e) {
&lt;step id="step1" parent="standaloneStep"/&gt;
&lt;listeners merge="true"&gt;
&lt;listener class="com.ListenerTwo"/&gt;
&lt;listener ref="listenerTwo"/&gt;
&lt;listeners&gt;
&lt;/job&gt;</programlisting>
@@ -353,9 +334,10 @@ catch (JobRestartException e) {
<para>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.</para>
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.</para>
<para>However it does require a transaction manager to be defined
because there are rollback semantics within the repository, and because

View File

@@ -233,12 +233,12 @@ itemWriter.write(items);</programlisting>
<para>In the following example, the <classname>Step</classname>
"concreteStep3" will be created will two listeners:
<classname>com.ListenerOne</classname> and
<classname>com.ListenerTwo</classname>:</para>
<classname>listenerOne</classname> and
<classname>listenerTwo</classname>:</para>
<programlisting>&lt;step id="listenersParentStep" abstract="true"&gt;
&lt;listeners&gt;
&lt;listener class="com.ListenerOne"/&gt;
&lt;listener ref="listenerOne"/&gt;
&lt;listeners&gt;
&lt;/step&gt;
@@ -246,7 +246,7 @@ itemWriter.write(items);</programlisting>
&lt;tasklet&gt;
&lt;chunk reader="itemReader" writer="itemWriter" commit-interval="5"/&gt;
&lt;listeners merge="true"&gt;
&lt;listener class="com.ListenerTwo"/&gt;
&lt;listener ref="listenerTwo"/&gt;
&lt;listeners&gt;
&lt;/tasklet&gt;
&lt;/step&gt;</programlisting>
@@ -696,16 +696,16 @@ itemWriter.write(items);</programlisting>
&lt;/tasklet&gt;
&lt;/step&gt;</programlisting>
<para>An <classname>ItemReader</classname>, <classname>ItemWriter</classname>
or <classname>ItemProcessor</classname> that itself implements
one of the <classname>StepListener</classname> interfaces will
be registered automatically with the <classname>Step</classname>
if using the namespace <literal>&lt;step&gt;</literal> element,
or one of the the <classname>*StepFactoryBean</classname>
factories. This only applies to components directly injected
into the <classname>Step</classname>: if the listener is nested
inside another component, it needs to be explicitly registered
(as described above).</para>
<para>An <classname>ItemReader</classname>,
<classname>ItemWriter</classname> or
<classname>ItemProcessor</classname> that itself implements one of the
<classname>StepListener</classname> interfaces will be registered
automatically with the <classname>Step</classname> if using the
namespace <literal>&lt;step&gt;</literal> element, or one of the the
<classname>*StepFactoryBean</classname> factories. This only applies to
components directly injected into the <classname>Step</classname>: if
the listener is nested inside another component, it needs to be
explicitly registered (as described above).</para>
<para>In addition to the <classname>StepListener</classname> interfaces,
annotations are provided to address the same concerns.</para>