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

This commit is contained in:
robokaso
2008-07-25 09:27:12 +00:00
parent 37b158f8b0
commit d79a284f8c
78 changed files with 105 additions and 111 deletions

View File

@@ -19,7 +19,7 @@ package org.springframework.batch.sample.advice;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;
import org.springframework.batch.sample.domain.Trade;
import org.springframework.batch.sample.trade.Trade;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.item.reader;
package org.springframework.batch.sample.common;
import org.springframework.batch.core.UnexpectedJobExecutionException;

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.common;
import java.util.ArrayList;
import java.util.List;

View File

@@ -16,7 +16,7 @@
package org.springframework.batch.sample.dao;
import org.springframework.batch.sample.domain.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCredit;
/**
* Interface for writing customer's credit information to output.

View File

@@ -16,7 +16,7 @@
package org.springframework.batch.sample.dao;
import org.springframework.batch.sample.domain.CustomerDebit;
import org.springframework.batch.sample.trade.CustomerDebit;
/**
* Interface for writing {@link CustomerDebitDao} object to arbitrary output.

View File

@@ -19,7 +19,7 @@ package org.springframework.batch.sample.dao;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCredit;
import org.springframework.beans.factory.DisposableBean;
/**

View File

@@ -21,7 +21,7 @@ import java.util.List;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.RepeatListener;
import org.springframework.batch.sample.domain.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCredit;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.batch.sample.dao;
import org.springframework.batch.sample.domain.CustomerCredit;
import org.springframework.batch.sample.trade.CustomerCredit;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/**

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.sample.dao;
import javax.sql.DataSource;
import org.springframework.batch.sample.domain.CustomerDebit;
import org.springframework.batch.sample.trade.CustomerDebit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcOperations;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.sample.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.sample.domain.Trade;
import org.springframework.batch.sample.trade.Trade;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;

View File

@@ -16,7 +16,7 @@
package org.springframework.batch.sample.dao;
import org.springframework.batch.sample.domain.Trade;
import org.springframework.batch.sample.trade.Trade;
/**
* Interface for writing a Trade object to an arbitrary output.

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.football;
import java.io.Serializable;

View File

@@ -2,7 +2,6 @@ package org.springframework.batch.sample.football;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Game;
public class GameFieldSetMapper implements FieldSetMapper<Game> {

View File

@@ -3,7 +3,6 @@ package org.springframework.batch.sample.football;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.Game;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

View File

@@ -3,7 +3,6 @@
*/
package org.springframework.batch.sample.football;
import org.springframework.batch.sample.domain.Player;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
/**

View File

@@ -3,7 +3,6 @@ package org.springframework.batch.sample.football;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.PlayerSummary;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
public class JdbcPlayerSummaryDao extends JdbcDaoSupport implements ItemWriter<PlayerSummary> {

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.football;
import java.io.Serializable;

View File

@@ -1,6 +1,5 @@
package org.springframework.batch.sample.football;
import org.springframework.batch.sample.domain.Player;
/**
* Interface for writing {@link Player} objects to arbitrary output.

View File

@@ -2,7 +2,6 @@ package org.springframework.batch.sample.football;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.Player;
public class PlayerFieldSetMapper implements FieldSetMapper<Player> {

View File

@@ -1,7 +1,6 @@
package org.springframework.batch.sample.football;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.domain.Player;
public class PlayerItemWriter extends AbstractItemWriter<Player> {

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.football;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

View File

@@ -18,7 +18,6 @@ package org.springframework.batch.sample.football;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.PlayerSummary;
import org.springframework.jdbc.core.RowMapper;
/**

View File

@@ -18,7 +18,6 @@ package org.springframework.batch.sample.football;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.PlayerSummary;
import org.springframework.jdbc.core.RowMapper;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.trade;
import java.math.BigDecimal;

View File

@@ -1,10 +1,9 @@
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.trade;
import java.math.BigDecimal;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.dao.CustomerCreditDao;
import org.springframework.batch.sample.domain.CustomerCredit;
/**
* Increases customer's credit by fixed amount.

View File

@@ -1,9 +1,8 @@
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.trade;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.CustomerCredit;
import org.springframework.jdbc.core.RowMapper;
public class CustomerCreditRowMapper implements RowMapper {

View File

@@ -13,14 +13,13 @@
* 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.trade;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import org.springframework.batch.item.database.ItemPreparedStatementSetter;
import org.springframework.batch.sample.domain.CustomerCredit;
/**
* @author Dave Syer

View File

@@ -14,11 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.trade;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.dao.CustomerCreditDao;
import org.springframework.batch.sample.domain.CustomerCredit;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.trade;
import java.math.BigDecimal;

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.trade;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.CustomerDebit;
import org.springframework.jdbc.core.RowMapper;

View File

@@ -14,12 +14,10 @@
* limitations under the License.
*/
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.trade;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.dao.CustomerDebitDao;
import org.springframework.batch.sample.domain.CustomerDebit;
import org.springframework.batch.sample.domain.Trade;
/**

View File

@@ -1,11 +1,10 @@
package org.springframework.batch.sample.item.reader;
package org.springframework.batch.sample.trade;
import java.math.BigDecimal;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.MarkFailedException;
import org.springframework.batch.item.ResetFailedException;
import org.springframework.batch.sample.domain.Trade;
/**
* Generates configurable number of {@link Trade} items.

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain;
package org.springframework.batch.sample.trade;
import java.io.Serializable;
import java.math.BigDecimal;

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.trade;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.support.AggregateItemReader;
import org.springframework.batch.sample.domain.Trade;

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.mapping;
package org.springframework.batch.sample.trade;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.Trade;
import org.springframework.jdbc.core.RowMapper;
public class TradeRowMapper implements RowMapper {

View File

@@ -14,13 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.item.writer;
package org.springframework.batch.sample.trade;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.dao.TradeDao;
import org.springframework.batch.sample.domain.Trade;
/**
* Delegates the actual writing to custom DAO delegate. Allows configurable