IN PROGRESS - issue BATCH-127: Allow job configuration to control re-entrant behavior
http://opensource.atlassian.com/projects/spring/browse/BATCH-127 Refactor JobRepository.findOrCreateJob() to return JobExecution.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/samples"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="spring-batch-samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--url jdbc:hsqldb:hsql://localhost:9005/samples"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/samples"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="spring-batch-samples"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
|
||||
14
spring-batch-samples/.settings/jmxLauncher.launch
Normal file
14
spring-batch-samples/.settings/jmxLauncher.launch
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<stringAttribute key="bad_container_name" value="\spring-batch-samples\.settings\j"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/spring-batch-samples/src/test/java/org/springframework/batch/sample/TaskExecutorLauncher.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.springframework.batch.sample.TaskExecutorLauncher"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="spring-batch-samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcom.sun.management.jmxremote"/>
|
||||
</launchConfiguration>
|
||||
@@ -10,6 +10,6 @@
|
||||
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
|
||||
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;core&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;classpathContainer path=&quot;org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.classpathContainer"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;execution&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;infrastructure&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.springframework.batch.execution.bootstrap.support.BatchCommandLineLauncher"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="spring-batch-samples"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djob.configuration.path=jobs/footballJob.xml -Djob.name=footballjob"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Placeholders batch.*
|
||||
# for HSQLDB:
|
||||
batch.jdbc.driver=org.hsqldb.jdbcDriver
|
||||
batch.jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true
|
||||
# batch.jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true
|
||||
# use this one for a separate server process (so you can inspect the results)
|
||||
# batch.jdbc.url=jdbc:hsqldb:hsql://localhost:9005/samples
|
||||
batch.jdbc.url=jdbc:hsqldb:hsql://localhost:9005/samples
|
||||
batch.jdbc.user=sa
|
||||
batch.jdbc.password=
|
||||
batch.schema=
|
||||
|
||||
@@ -33,17 +33,17 @@ INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 1000
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID char(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME varchar(35) not null,
|
||||
FIRST_NAME varchar(25) not null,
|
||||
POS varchar(10),
|
||||
YEAR_OF_BIRTH BIGINT not null,
|
||||
YEAR_DRAFTED BIGINT not null);
|
||||
YEAR_DRAFTED BIGINT not null
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR BIGINT not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK BIGINT not null,
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
@@ -72,4 +72,5 @@ CREATE TABLE PLAYER_SUMMARY (
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL );
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
);
|
||||
@@ -33,17 +33,17 @@ INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 1000
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID char(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME varchar(35) not null,
|
||||
FIRST_NAME varchar(25) not null,
|
||||
POS varchar(10),
|
||||
YEAR_OF_BIRTH BIGINT not null,
|
||||
YEAR_DRAFTED BIGINT not null);
|
||||
YEAR_DRAFTED BIGINT not null
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR BIGINT not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK BIGINT not null,
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
@@ -72,4 +72,5 @@ CREATE TABLE PLAYER_SUMMARY (
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL );
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
);
|
||||
@@ -37,7 +37,6 @@ INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 1000
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID char(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME varchar(35) not null,
|
||||
@@ -48,7 +47,7 @@ CREATE TABLE PLAYERS (
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR BIGINT not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK BIGINT not null,
|
||||
@@ -66,7 +65,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
|
||||
@@ -33,17 +33,17 @@ INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 1000
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID char(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME varchar(35) not null,
|
||||
FIRST_NAME varchar(25) not null,
|
||||
POS varchar(10),
|
||||
YEAR_OF_BIRTH NUMBER(38) not null,
|
||||
YEAR_DRAFTED NUMBER(38) not null);
|
||||
YEAR_DRAFTED NUMBER(38) not null
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR NUMBER(38) not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK NUMBER(38) not null,
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR NUMBER(38) NOT NULL,
|
||||
COMPLETES NUMBER(38) NOT NULL ,
|
||||
ATTEMPTS NUMBER(38) NOT NULL ,
|
||||
@@ -72,4 +72,5 @@ CREATE TABLE PLAYER_SUMMARY (
|
||||
RUSH_YARDS NUMBER(38) NOT NULL ,
|
||||
RECEPTIONS NUMBER(38) NOT NULL ,
|
||||
RECEPTIONS_YARDS NUMBER(38) NOT NULL ,
|
||||
TOTAL_TD NUMBER(38) NOT NULL );
|
||||
TOTAL_TD NUMBER(38) NOT NULL
|
||||
);
|
||||
@@ -33,17 +33,17 @@ INSERT INTO customer (id, version, name, credit) VALUES (2, 0, 'customer2', 1000
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (3, 0, 'customer3', 100000);
|
||||
INSERT INTO customer (id, version, name, credit) VALUES (4, 0, 'customer4', 100000);
|
||||
|
||||
|
||||
CREATE TABLE PLAYERS (
|
||||
PLAYER_ID char(8) NOT NULL PRIMARY KEY,
|
||||
LAST_NAME varchar(35) not null,
|
||||
FIRST_NAME varchar(25) not null,
|
||||
POS varchar(10),
|
||||
YEAR_OF_BIRTH BIGINT not null,
|
||||
YEAR_DRAFTED BIGINT not null);
|
||||
YEAR_DRAFTED BIGINT not null
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR BIGINT not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK BIGINT not null,
|
||||
@@ -61,7 +61,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR BIGINT NOT NULL,
|
||||
COMPLETES BIGINT NOT NULL ,
|
||||
ATTEMPTS BIGINT NOT NULL ,
|
||||
@@ -72,4 +72,5 @@ CREATE TABLE PLAYER_SUMMARY (
|
||||
RUSH_YARDS BIGINT NOT NULL ,
|
||||
RECEPTIONS BIGINT NOT NULL ,
|
||||
RECEPTIONS_YARDS BIGINT NOT NULL ,
|
||||
TOTAL_TD BIGINT NOT NULL );
|
||||
TOTAL_TD BIGINT NOT NULL
|
||||
);
|
||||
@@ -114,13 +114,9 @@
|
||||
</bean>
|
||||
|
||||
<bean id="playerFileInputSource"
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource">
|
||||
<property name="resource">
|
||||
<bean
|
||||
class="org.springframework.core.io.ClassPathResource">
|
||||
<constructor-arg value="data/footballjob/input/player.csv" />
|
||||
</bean>
|
||||
</property>
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="resource" value="classpath:data/footballjob/input/player.csv" />
|
||||
<property name="tokenizer">
|
||||
<bean
|
||||
class="org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer">
|
||||
@@ -135,13 +131,9 @@
|
||||
</bean>
|
||||
|
||||
<bean id="gameFileInputSource"
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource">
|
||||
<property name="resource">
|
||||
<bean
|
||||
class="org.springframework.core.io.ClassPathResource">
|
||||
<constructor-arg value="data/footballjob/input/games.csv" />
|
||||
</bean>
|
||||
</property>
|
||||
class="org.springframework.batch.io.file.support.DefaultFlatFileInputSource" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="resource" value="classpath:data/footballjob/input/games.csv"/>
|
||||
<property name="tokenizer">
|
||||
<bean
|
||||
class="org.springframework.batch.io.file.support.transform.DelimitedLineTokenizer">
|
||||
@@ -156,7 +148,8 @@
|
||||
</bean>
|
||||
|
||||
<bean id="playerSummarizationSource"
|
||||
class="org.springframework.batch.io.cursor.JdbcCursorInputSource">
|
||||
class="org.springframework.batch.io.cursor.JdbcCursorInputSource" scope="step">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="dataSource" ref="dataSource" />
|
||||
<property name="mapper">
|
||||
<bean
|
||||
|
||||
@@ -34,7 +34,7 @@ CREATE TABLE PLAYERS (
|
||||
);
|
||||
|
||||
CREATE TABLE GAMES (
|
||||
PLAYER_ID char(8) not null PRIMARY KEY,
|
||||
PLAYER_ID char(8) not null,
|
||||
YEAR ${BIGINT} not null,
|
||||
TEAM char(3) not null,
|
||||
WEEK ${BIGINT} not null,
|
||||
@@ -52,7 +52,7 @@ CREATE TABLE GAMES (
|
||||
);
|
||||
|
||||
CREATE TABLE PLAYER_SUMMARY (
|
||||
ID CHAR(8) NOT NULL PRIMARY KEY,
|
||||
ID CHAR(8) NOT NULL,
|
||||
YEAR ${BIGINT} NOT NULL,
|
||||
COMPLETES ${BIGINT} NOT NULL ,
|
||||
ATTEMPTS ${BIGINT} NOT NULL ,
|
||||
|
||||
@@ -50,7 +50,9 @@ public class TaskExecutorLauncher {
|
||||
};
|
||||
}).start();
|
||||
|
||||
System.out.println("Started application. Please connect using JMX.");
|
||||
System.out
|
||||
.println("Started application. "
|
||||
+ "Please connect using JMX (remember to use -Dcom.sun.management.jmxremote if you can't see anything in Jconsole).");
|
||||
System.in.read();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user