Add basic JSR-352 configuration samples

* Inline class references
* batch.xml references
* Spring bean references
This commit is contained in:
Chris Schaefer
2014-04-16 17:54:30 -04:00
parent 9d17a3d088
commit ab293b57fb
13 changed files with 438 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<job id="batchXmlConfigSample" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
<step id="step1" next="step2">
<chunk>
<reader ref="reader"/>
<processor ref="processor"/>
<writer ref="writer"/>
</chunk>
</step>
<step id="step2">
<batchlet ref="batchlet">
<properties>
<property name="remoteServiceURL" value="#{jobParameters['remoteServiceURL']}"/>
</properties>
</batchlet>
</step>
</job>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<job id="inlineConfigSample" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
<step id="step1" next="step2">
<chunk>
<reader ref="org.springframework.batch.sample.jsr352.JsrSampleItemReader"/>
<processor ref="org.springframework.batch.sample.jsr352.JsrSampleItemProcessor"/>
<writer ref="org.springframework.batch.sample.jsr352.JsrSampleItemWriter"/>
</chunk>
</step>
<step id="step2">
<batchlet ref="org.springframework.batch.sample.jsr352.JsrSampleBatchlet">
<properties>
<property name="remoteServiceURL" value="#{jobParameters['remoteServiceURL']}"/>
</properties>
</batchlet>
</step>
</job>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<job id="springConfigSample" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
<step id="step1" next="step2">
<chunk>
<reader ref="itemReader"/>
<processor ref="itemProcessor"/>
<writer ref="itemWriter"/>
</chunk>
</step>
<step id="step2">
<batchlet ref="serviceBatchet">
<properties>
<property name="remoteServiceURL" value="#{jobParameters['remoteServiceURL']}"/>
</properties>
</batchlet>
</step>
</job>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Use different ref names to avoid picking up ref's with the same name from batch.xml if desired -->
<import resource="springConfigSample.xml"/>
<!-- Plug in an existing Spring Batch ItemReader component as your JSR-352 ItemReader -->
<bean id="itemReader" class="org.springframework.batch.item.support.ListItemReader" scope="step">
<constructor-arg>
<list>
<value>John</value>
<value>Joe</value>
<value>Mark</value>
<value>Jane</value>
</list>
</constructor-arg>
</bean>
<!-- Mix in JSR-352 ItemProcessor and ItemWriter implementations -->
<bean id="itemProcessor" class="org.springframework.batch.sample.jsr352.JsrSampleItemProcessor" scope="step"/>
<bean id="itemWriter" class="org.springframework.batch.sample.jsr352.JsrSampleItemWriter" scope="step"/>
<!-- Plug in an existing Spring Batch Tasklet to use for your JSR-352 Batchlet -->
<bean id="serviceBatchet" class="org.springframework.batch.sample.jsr352.JsrSampleTasklet" scope="step"/>
</beans>

View File

@@ -0,0 +1,6 @@
<batch-artifacts xmlns="http://xmlns.jcp.org/xml/ns/javaee">
<ref id="reader" class="org.springframework.batch.sample.jsr352.JsrSampleItemReader"/>
<ref id="processor" class="org.springframework.batch.sample.jsr352.JsrSampleItemProcessor"/>
<ref id="writer" class="org.springframework.batch.sample.jsr352.JsrSampleItemWriter"/>
<ref id="batchlet" class="org.springframework.batch.sample.jsr352.JsrSampleBatchlet"/>
</batch-artifacts>

View File

@@ -19,4 +19,4 @@ batch.jdbc.pool.size=6
batch.grid.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE
batch.data.source.init=true