Author: buildbot
Date: Tue Jun 12 08:18:11 2012
New Revision: 821373

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/springbatch.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/springbatch.html
==============================================================================
--- websites/production/camel/content/springbatch.html (original)
+++ websites/production/camel/content/springbatch.html Tue Jun 12 08:18:11 2012
@@ -119,7 +119,7 @@ spring-batch:jobName[?options]
 
 <h3><a shape="rect" name="SpringBatch-Examples"></a>Examples</h3>
 
-<p>Triggering Spring Batch job execution:</p>
+<p>Triggering the Spring Batch job execution:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
 <pre class="code-java">
@@ -127,7 +127,7 @@ from(<span class="code-quote">"direct:st
 </pre>
 </div></div>
 
-<p>Triggering Spring Batch job execution with the <tt>JabLauncher</tt> set 
explicitly. </p>
+<p>Triggering the Spring Batch job execution with the <tt>JobLauncher</tt> set 
explicitly. </p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
 <pre class="code-java">
@@ -137,7 +137,7 @@ from(<span class="code-quote">"direct:st
 
 <h3><a shape="rect" name="SpringBatch-Supportclasses"></a>Support classes</h3>
 
-<p>Apart from the Component, Camel Spring Batch provides also support classes 
to hook into Spring Batch infrastructure.</p>
+<p>Apart from the Component, Camel Spring Batch provides also support classes, 
which can be used to hook into Spring Batch infrastructure.</p>
 
 <h4><a shape="rect" name="SpringBatch-CamelItemReader"></a>CamelItemReader</h4>
 
@@ -164,7 +164,7 @@ from(<span class="code-quote">"direct:st
 
 <h4><a shape="rect" name="SpringBatch-CamelItemWriter"></a>CamelItemWriter</h4>
 
-<p><tt>CamelItemWriter</tt> has similar purpose as <tt>CamelItemReader</tt>, 
but it is dedicated to write chunk of processed </p>
+<p><tt>CamelItemWriter</tt> has similar purpose as <tt>CamelItemReader</tt>, 
but it is dedicated to write chunk of the processed data.</p>
 
 <p>For example the snippet below configures Spring Batch to read data from JMS 
queue.</p>
 
@@ -183,6 +183,68 @@ from(<span class="code-quote">"direct:st
   <span class="code-tag">&lt;/batch:step&gt;</span>
 <span class="code-tag">&lt;/batch:job&gt;</span>
 </pre>
+</div></div>
+
+<h4><a shape="rect" 
name="SpringBatch-CamelItemProcessor"></a>CamelItemProcessor</h4>
+
+<p><tt>CamelItemProcessor</tt> is the implementation of Spring Batch 
<tt>org.springframework.batch.item.ItemProcessor</tt> interface. The latter 
implementation relays on <a shape="rect" class="external-link" 
href="http://camel.apache.org/request-reply.html";>Request Reply pattern</a> to 
delegate the processing of the batch item to the Camel infrastructure. The item 
to process is sent to the Camel endpoint as the body of the message.</p>
+
+<p>For example the snippet below performs simple processing of the batch item 
using the <a shape="rect" class="external-link" 
href="http://camel.apache.org/direct.html";>Direct endpoint </a> and the <a 
shape="rect" class="external-link" 
href="http://camel.apache.org/simple.html";>Simple expression language </a>.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
+<pre class="code-xml">
+<span class="code-tag">&lt;camel:camelContext&gt;</span>
+  <span class="code-tag">&lt;camel:route&gt;</span>
+    <span class="code-tag">&lt;camel:from uri=<span 
class="code-quote">"direct:processor"</span>/&gt;</span>
+    <span class="code-tag">&lt;camel:setExchangePattern pattern=<span 
class="code-quote">"InOut"</span>/&gt;</span>
+    <span class="code-tag">&lt;camel:setBody&gt;</span>
+      <span class="code-tag">&lt;camel:simple&gt;</span>Processed ${body}<span 
class="code-tag">&lt;/camel:simple&gt;</span>
+    <span class="code-tag">&lt;/camel:setBody&gt;</span>
+  <span class="code-tag">&lt;/camel:route&gt;</span>
+<span class="code-tag">&lt;/camel:camelContext&gt;</span>
+
+<span class="code-tag">&lt;bean id=<span 
class="code-quote">"camelProcessor"</span> class=<span 
class="code-quote">"org.apache.camel.component.spring.batch.support.CamelItemProcessor"</span>&gt;</span>
+  <span class="code-tag">&lt;constructor-arg ref=<span 
class="code-quote">"producerTemplate"</span>/&gt;</span>
+  <span class="code-tag">&lt;constructor-arg value=<span 
class="code-quote">"direct:processor"</span>/&gt;</span>
+<span class="code-tag">&lt;/bean&gt;</span>
+
+<span class="code-tag">&lt;batch:job id=<span 
class="code-quote">"myJob"</span>&gt;</span>
+  <span class="code-tag">&lt;batch:step id=<span 
class="code-quote">"step"</span>&gt;</span>
+    <span class="code-tag">&lt;batch:tasklet&gt;</span>
+      <span class="code-tag">&lt;batch:chunk reader=<span 
class="code-quote">"someReader"</span> writer=<span 
class="code-quote">"someWriter"</span> processor=<span 
class="code-quote">"camelProcessor"</span> commit-interval=<span 
class="code-quote">"100"</span>/&gt;</span>
+    <span class="code-tag">&lt;/batch:tasklet&gt;</span>
+  <span class="code-tag">&lt;/batch:step&gt;</span>
+<span class="code-tag">&lt;/batch:job&gt;</span>
+</pre>
+</div></div>
+
+
+<h4><a shape="rect" 
name="SpringBatch-CamelJobExecutionListener"></a>CamelJobExecutionListener</h4>
+
+<p><tt>CamelJobExecutionListener</tt> is the implementation of the 
<tt>org.springframework.batch.core.JobExecutionListener</tt> interface sending 
job execution events to the Camel endpoint.</p>
+
+<p>The <tt>org.springframework.batch.core.JobExecution</tt> instance produced 
by the Spring Batch is sent as a body of the message. To distinguish between 
before- and after-callbacks <tt>SPRING_BATCH_JOB_EVENT_TYPE</tt> header is set 
to the <tt>BEFORE</tt> or <tt>AFTER</tt> value.</p>
+
+<p>The example snippet below sends Spring Batch job execution events to the 
JMS queue.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
+<pre class="code-xml">
+<span class="code-tag">&lt;bean id=<span 
class="code-quote">"camelJobExecutionListener"</span> class=<span 
class="code-quote">"org.apache.camel.component.spring.batch.support.CamelJobExecutionListener"</span>&gt;</span>
+  <span class="code-tag">&lt;constructor-arg ref=<span 
class="code-quote">"producerTemplate"</span>/&gt;</span>
+  <span class="code-tag">&lt;constructor-arg value=<span 
class="code-quote">"jms:batchEventsBus"</span>/&gt;</span>
+<span class="code-tag">&lt;/bean&gt;</span>
+
+<span class="code-tag">&lt;batch:job id=<span 
class="code-quote">"myJob"</span>&gt;</span>
+  <span class="code-tag">&lt;batch:step id=<span 
class="code-quote">"step"</span>&gt;</span>
+    <span class="code-tag">&lt;batch:tasklet&gt;</span>
+      <span class="code-tag">&lt;batch:chunk reader=<span 
class="code-quote">"someReader"</span> writer=<span 
class="code-quote">"someWriter"</span> commit-interval=<span 
class="code-quote">"100"</span>/&gt;</span>
+    <span class="code-tag">&lt;/batch:tasklet&gt;</span>
+  <span class="code-tag">&lt;/batch:step&gt;</span>
+  <span class="code-tag">&lt;batch:listeners&gt;</span>
+    <span class="code-tag">&lt;batch:listener ref=<span 
class="code-quote">"camelJobExecutionListener"</span>/&gt;</span>
+  <span class="code-tag">&lt;/batch:listeners&gt;</span>
+<span class="code-tag">&lt;/batch:job&gt;</span>
+</pre>
 </div></div></div>
         </td>
         <td valign="top">


Reply via email to