BATCH-1052: Moved section on SystemCommandTasklet to common-patterns.xml
This commit is contained in:
@@ -392,4 +392,24 @@
|
||||
return null;
|
||||
}</programlisting>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Executing System Commands</title>
|
||||
|
||||
<para>Many batch jobs may require that an external command be called from
|
||||
within the batch job. Such a process could be kicked off separately by the
|
||||
scheduler, but the advantage of common meta-data about the run would be
|
||||
lost. Furthermore, a multi-step job would also need to be split up into
|
||||
multiple jobs as well. </para>
|
||||
|
||||
<para>Because the need is so common, Spring Batch provides a
|
||||
<classname>Tasklet</classname> implementation for calling system
|
||||
commands:</para>
|
||||
|
||||
<programlisting> <bean class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
|
||||
<property name="command" value="echo hello" />
|
||||
<!-- 5 second timeout for the command to complete -->
|
||||
<property name="timeout" value="5000" />
|
||||
</bean></programlisting>
|
||||
</section>
|
||||
</chapter>
|
||||
|
||||
@@ -464,8 +464,8 @@
|
||||
top of a transactional resource, such as a JMS queue. In this case,
|
||||
since the queue is tied to the transaction that is rolled back, the
|
||||
messages that have been pulled from the queue will be put back on. For
|
||||
this reason, the step can be configured to not buffer the items:
|
||||
</para>
|
||||
this reason, the step can be configured to not buffer the
|
||||
items:</para>
|
||||
|
||||
<programlisting>
|
||||
<step name="step1">
|
||||
@@ -952,27 +952,6 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Executing System Commands</title>
|
||||
|
||||
<para>Many batch jobs may require that an external command be called
|
||||
from within the batch job. Such a process could be kicked off separately
|
||||
by the scheduler, but the advantage of common meta-data about the run
|
||||
would be lost. Furthermore, a multi-step job would also need to be split
|
||||
up into multiple jobs as well. Because the need is so common, Spring
|
||||
Batch provides a <classname>Tasklet</classname> implementation for
|
||||
calling system commands:</para>
|
||||
|
||||
<programlisting>
|
||||
<bean class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
|
||||
<property name="command" value="echo hello" />
|
||||
<!-- 5 second timeout for the command to complete -->
|
||||
<property name="timeout" value="5000" />
|
||||
</bean>
|
||||
|
||||
</programlisting>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user