IN PROGRESS - BATCH-693: Refactor samples along domain contours

moved generic domain-agnostic classes into common package
This commit is contained in:
robokaso
2008-07-25 08:52:39 +00:00
parent 8839d6e2f0
commit eaa407a01d
21 changed files with 26 additions and 20 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.common;
import org.springframework.batch.item.support.AbstractItemWriter;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample;
package org.springframework.batch.sample.common;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.tasklet;
package org.springframework.batch.sample.common;
import org.springframework.batch.repeat.ExitStatus;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.item.reader;
package org.springframework.batch.sample.common;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -16,7 +16,6 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ReaderNotOpenException;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.item.writer.StagingItemWriter;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.RowMapper;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.common;
import java.io.Serializable;
import java.sql.PreparedStatement;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.tasklet;
package org.springframework.batch.sample.common;
/**
* Exception indicating failed execution of system command.

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.tasklet;
package org.springframework.batch.sample.common;
import java.io.File;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.tasklet;
package org.springframework.batch.sample.common;
import org.springframework.batch.repeat.ExitStatus;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.exception.handler;
package org.springframework.batch.sample.football;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -30,7 +30,7 @@
</bean>
</property>
<property name="itemWriter">
<bean id="writer" class="org.springframework.batch.sample.item.writer.DummyItemWriter" />
<bean id="writer" class="org.springframework.batch.sample.common.DummyItemWriter" />
</property>
</bean>
</property>

View File

@@ -27,7 +27,7 @@
</property>
<property name="itemWriter">
<bean
class="org.springframework.batch.sample.item.writer.StagingItemWriter">
class="org.springframework.batch.sample.common.StagingItemWriter">
<property name="dataSource"
ref="dataSource" />
<property name="lobHandler"
@@ -48,7 +48,7 @@
</property>
<property name="itemReader">
<bean
class="org.springframework.batch.sample.item.reader.StagingItemReader">
class="org.springframework.batch.sample.common.StagingItemReader">
<property name="lobHandler"
ref="lobHandler" />
<property name="dataSource"

View File

@@ -33,7 +33,7 @@
<bean id="executeSystemCommand" parent="taskletStep">
<property name="tasklet">
<bean
class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
class="org.springframework.batch.sample.common.SystemCommandTasklet">
<property name="command" value="java -version" />
<!-- 5 second timeout for the command to complete -->
<property name="timeout" value="5000" />

View File

@@ -8,7 +8,7 @@
<import resource="classpath:data-source-context.xml" />
<bean id="processor"
class="org.springframework.batch.sample.item.writer.StagingItemWriter">
class="org.springframework.batch.sample.common.StagingItemWriter">
<property name="incrementer">
<bean id="jobIncrementer" parent="incrementerParent">
<property name="incrementerName"
@@ -19,7 +19,7 @@
</bean>
<bean id="provider"
class="org.springframework.batch.sample.item.reader.StagingItemReader">
class="org.springframework.batch.sample.common.StagingItemReader">
<property name="dataSource" ref="dataSource" />
</bean>

View File

@@ -143,7 +143,7 @@ xmlStaxJob | | | x | | | | | | x | | | | | | | |
<bean id="executeSystemCommand" parent="taskletStep">
<property name="tasklet">
<bean
class="org.springframework.batch.sample.tasklet.SystemCommandTasklet">
class="org.springframework.batch.sample.common.SystemCommandTasklet">
<property name="command" value="echo hello" />
<!-- 5 second timeout for the command to complete -->
<property name="timeout" value="5000" />

View File

@@ -4,7 +4,7 @@ import static org.junit.Assert.*;
import javax.sql.DataSource;
import org.springframework.batch.sample.item.writer.StagingItemWriter;
import org.springframework.batch.sample.common.StagingItemWriter;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;

View File

@@ -11,7 +11,8 @@ import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.sample.item.writer.StagingItemWriter;
import org.springframework.batch.sample.common.StagingItemReader;
import org.springframework.batch.sample.common.StagingItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;

View File

@@ -26,6 +26,7 @@ import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.sample.common.StagingItemWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.core.JdbcTemplate;

View File

@@ -4,6 +4,7 @@ import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.ConfigurableSystemProcessExitCodeMapper;
import java.util.HashMap;
import java.util.Map;

View File

@@ -4,6 +4,7 @@ import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.SimpleSystemProcessExitCodeMapper;
/**
* Tests for {@link SimpleSystemProcessExitCodeMapper}.

View File

@@ -11,6 +11,9 @@ import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.sample.common.SystemCommandException;
import org.springframework.batch.sample.common.SystemCommandTasklet;
import org.springframework.batch.sample.common.SystemProcessExitCodeMapper;
import org.springframework.util.Assert;
import java.io.File;