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

added internal subpackages
This commit is contained in:
robokaso
2008-07-25 15:21:37 +00:00
parent 419f146da4
commit 1e39b06226
103 changed files with 240 additions and 187 deletions

View File

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

View File

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

View File

@@ -1,8 +1,9 @@
package org.springframework.batch.sample.domain.football;
package org.springframework.batch.sample.domain.football.internal;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.football.Game;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;

View File

@@ -1,8 +1,10 @@
/**
*
*/
package org.springframework.batch.sample.domain.football;
package org.springframework.batch.sample.domain.football.internal;
import org.springframework.batch.sample.domain.football.Player;
import org.springframework.batch.sample.domain.football.PlayerDao;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
/**

View File

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

View File

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

View File

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

View File

@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.sample.domain.football;
package org.springframework.batch.sample.domain.football.internal;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.football.PlayerSummary;
import org.springframework.jdbc.core.RowMapper;
/**

View File

@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.sample.domain.football;
package org.springframework.batch.sample.domain.football.internal;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.batch.sample.domain.football.PlayerSummary;
import org.springframework.jdbc.core.RowMapper;
/**

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.Address;

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.BillingInfo;

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.Customer;

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.Order;

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.LineItem;
public class OrderItemFieldSetMapper implements FieldSetMapper<LineItem> {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import java.util.ArrayList;
@@ -24,6 +24,12 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.support.AbstractItemReader;
import org.springframework.batch.sample.domain.order.Address;
import org.springframework.batch.sample.domain.order.BillingInfo;
import org.springframework.batch.sample.domain.order.Customer;
import org.springframework.batch.sample.domain.order.LineItem;
import org.springframework.batch.sample.domain.order.Order;
import org.springframework.batch.sample.domain.order.ShippingInfo;
/**
* @author peter.zozom

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -25,6 +25,11 @@ import org.springframework.batch.item.file.mapping.DefaultFieldSet;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.transform.LineAggregator;
import org.springframework.batch.item.transform.ItemTransformer;
import org.springframework.batch.sample.domain.order.Address;
import org.springframework.batch.sample.domain.order.BillingInfo;
import org.springframework.batch.sample.domain.order.Customer;
import org.springframework.batch.sample.domain.order.LineItem;
import org.springframework.batch.sample.domain.order.Order;
/**
* Converts <code>Order</code> object to a String.

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order;
package org.springframework.batch.sample.domain.order.internal;
import org.springframework.batch.item.file.mapping.FieldSet;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.sample.domain.order.ShippingInfo;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.valang;
package org.springframework.batch.sample.domain.order.internal.valang;
import java.util.Date;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.valang;
package org.springframework.batch.sample.domain.order.internal.valang;
import java.util.Iterator;
import java.util.List;

View File

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

View File

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

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.valang;
package org.springframework.batch.sample.domain.order.internal.valang;
import java.util.List;

View File

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

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.valang;
package org.springframework.batch.sample.domain.order.internal.valang;
import java.util.List;

View File

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

View File

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

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.xml;
package org.springframework.batch.sample.domain.order.internal.xml;
import org.apache.commons.lang.builder.ToStringBuilder;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.xml;
package org.springframework.batch.sample.domain.order.internal.xml;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.xml;
package org.springframework.batch.sample.domain.order.internal.xml;
import java.util.Date;
import java.util.List;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.order.xml;
package org.springframework.batch.sample.domain.order.internal.xml;
/**

View File

@@ -14,11 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.person;
package org.springframework.batch.sample.domain.person.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.item.support.AbstractItemWriter;
import org.springframework.batch.sample.domain.person.Person;

View File

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

View File

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

View File

@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
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.trade.CustomerCredit;
/**
* @author Dave Syer

View File

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

View File

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

View File

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

View File

@@ -14,11 +14,13 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.sample.domain.trade.CustomerCredit;
import org.springframework.batch.sample.domain.trade.CustomerCreditDao;
import org.springframework.beans.factory.DisposableBean;
/**

View File

@@ -1,10 +1,11 @@
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
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.Trade;
/**
* Generates configurable number of {@link Trade} items.

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.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
import java.util.ArrayList;
import java.util.List;
@@ -21,6 +21,8 @@ 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.trade.CustomerCredit;
import org.springframework.batch.sample.domain.trade.CustomerCreditDao;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
@@ -46,7 +48,7 @@ public class HibernateCreditDao extends HibernateDaoSupport implements
/*
* (non-Javadoc)
*
* @see org.springframework.batch.sample.domain.trade.CustomerCreditWriter#write(org.springframework.batch.sample.domain.CustomerCredit)
* @see org.springframework.batch.sample.domain.trade.internal.CustomerCreditWriter#write(org.springframework.batch.sample.domain.CustomerCredit)
*/
public void writeCredit(CustomerCredit customerCredit) {
if (customerCredit.getId() == failOnFlush) {

View File

@@ -13,8 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
import org.springframework.batch.sample.domain.trade.CustomerCredit;
import org.springframework.batch.sample.domain.trade.CustomerCreditDao;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/**
@@ -27,7 +29,7 @@ public class IbatisCustomerCreditDao extends SqlMapClientDaoSupport
String statementId;
/* (non-Javadoc)
* @see org.springframework.batch.sample.domain.trade.CustomerCreditWriter#write(org.springframework.batch.sample.domain.CustomerCredit)
* @see org.springframework.batch.sample.domain.trade.internal.CustomerCreditWriter#write(org.springframework.batch.sample.domain.CustomerCredit)
*/
public void writeCredit(CustomerCredit customerCredit) {

View File

@@ -14,10 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
import javax.sql.DataSource;
import org.springframework.batch.sample.domain.trade.CustomerDebit;
import org.springframework.batch.sample.domain.trade.CustomerDebitDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcOperations;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;

View File

@@ -14,10 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.batch.sample.domain.trade.Trade;
import org.springframework.batch.sample.domain.trade.TradeDao;
import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;

View File

@@ -14,11 +14,12 @@
* limitations under the License.
*/
package org.springframework.batch.sample.domain.trade;
package org.springframework.batch.sample.domain.trade.internal;
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.Trade;

View File

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

View File

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