You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by rm...@apache.org on 2013/11/05 08:38:48 UTC

[11/62] Importing JBatch Reference Implementation from IBM. We'll fork it but this commit is to keep a track of what we forked.

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/SplitExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/SplitExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/SplitExtraCode.java
new file mode 100755
index 0000000..03e8411
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/SplitExtraCode.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2013 International Business Machines Corp.
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Appended by build tooling.
+ */
+
+public List<com.ibm.jbatch.container.jsl.TransitionElement> getTransitionElements() {
+    return new ArrayList<com.ibm.jbatch.container.jsl.TransitionElement>();
+}
+    
+/*
+ * Appended by build tooling.
+ */
+public String toString() {
+	StringBuffer buf = new StringBuffer(100);
+	buf.append("Split: id=" + id);
+	buf.append("\nContained Flows: \n");
+	if (flows == null) {
+		buf.append("<none>");
+	} else {
+		int i = 0;
+		for ( Flow f : flows) {
+			buf.append("flow[" + i + "]:" + f + "\n");
+			i++;
+		}
+	}
+	buf.append("\nnextFromAttribute =" + nextFromAttribute);
+	return buf.toString();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StepExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StepExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StepExtraCode.java
new file mode 100755
index 0000000..0c370dc
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StepExtraCode.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright 2013 International Business Machines Corp.
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+    /*
+     * Appended by build tooling.
+     */
+	public String toString() {
+	    StringBuffer buf = new StringBuffer(100);
+	    buf.append("Step: id=" + id);
+	    buf.append(", startLimit=" + startLimit);
+	    buf.append(", allowStartIfComplete=" + allowStartIfComplete);
+	    buf.append("\nnextFromAttribute =" + nextFromAttribute);
+		buf.append("\nTransition elements: \n");
+		if (transitionElements == null) {
+			buf.append("<none>");
+		} else {
+			int j = 0;
+			for ( com.ibm.jbatch.container.jsl.TransitionElement e : transitionElements) {
+				buf.append("transition element[" + j + "]:" + e + "\n");
+				j++;
+			}
+		}
+	    buf.append("\nProperties = " + com.ibm.jbatch.jsl.util.PropertiesToStringHelper.getString(properties));
+	    buf.append("\n");
+	    if (batchlet != null) {
+	    	buf.append("Contains batchlet=" + batchlet);
+	    }
+	    if (chunk != null) {
+	    	buf.append("Contains chunk=" + chunk);
+	    }
+	    return buf.toString();
+    }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StopExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StopExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StopExtraCode.java
new file mode 100755
index 0000000..1a79ff1
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/StopExtraCode.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright 2013 International Business Machines Corp.
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+    /*
+     * Appended by build tooling.
+     */
+	public String toString() {
+	    StringBuffer buf = new StringBuffer(40);
+	    buf.append("Stop: restart =" + restart + ", on = " + on + ", exit-status = " + exitStatus);
+	    return buf.toString();
+    }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/_README.txt
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/_README.txt b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/_README.txt
new file mode 100755
index 0000000..b3bf2f1
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/_README.txt
@@ -0,0 +1 @@
+More convenient to use .java extensions for the files in this directory so we get syntax highlighting in the editor.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/META-INF/MANIFEST.MF b/JSR352.RI.SPI/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..4099564
--- /dev/null
+++ b/JSR352.RI.SPI/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: com.ibm.jbatch-ri-spi
+Bundle-SymbolicName: com.ibm.jbatch-ri-spi
+Bundle-Version: 1.0
+Export-Package: com.ibm.jbatch.spi

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/build.properties
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/build.properties b/JSR352.RI.SPI/build.properties
new file mode 100755
index 0000000..a12d47e
--- /dev/null
+++ b/JSR352.RI.SPI/build.properties
@@ -0,0 +1,3 @@
+source.. = src/
+bin.includes = META-INF/,\
+               .

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/pom.xml
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/pom.xml b/JSR352.RI.SPI/pom.xml
new file mode 100755
index 0000000..eabf609
--- /dev/null
+++ b/JSR352.RI.SPI/pom.xml
@@ -0,0 +1,68 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>javax.batch</groupId>
+        <artifactId>jbatch</artifactId>
+        <version>1.0</version>
+    </parent>
+    <groupId>com.ibm.jbatch</groupId>
+    <artifactId>com.ibm.jbatch-ri-spi</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0</version>
+	<dependencies>
+		<dependency>
+			<groupId>javax.batch</groupId>
+			<artifactId>javax.batch-api</artifactId>
+			<version>1.0</version>
+			<scope>compile</scope>
+		</dependency>
+	</dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>generate-sources</phase>
+						<goals><goal>add-source</goal></goals>
+						<configuration>
+							<sources>
+								<source>src</source>
+							</sources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchJobUtil.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchJobUtil.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchJobUtil.java
new file mode 100755
index 0000000..0e7dc21
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchJobUtil.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+/**
+ *
+ * Implemented by the jbatch 352 RI to allow the host environment to
+ * instruct the RI to purge job repository entries associated with 
+ * a given "owner".
+ * 
+ * @author skurz
+ */
+public interface BatchJobUtil {
+
+    /**
+     * This method will purge all JobExecution, JobInstance, and job
+     * data "owned" by a given "tag".   Job purge only happens, however,
+     * if there are no other JobInstance(s) "owned" by other "tag"(s).
+     * 
+     * It does not guarantee a consistent view of the job repository,
+     * so this method should only be issued when no jobs are being executed
+     * "owned by" this tag.   If this type of external synchronization is not
+     * used, the behavior is undefined.
+     * 
+     * @param tag A "tag" (or "app name", generically speaking).
+     */ 
+    public void purgeOwnedRepositoryData(String tag);
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSPIManager.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSPIManager.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSPIManager.java
new file mode 100755
index 0000000..561d70b
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSPIManager.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ibm.jbatch.spi;
+
+import java.util.logging.Logger;
+
+public final class BatchSPIManager {
+
+	private final static String sourceClass = BatchSPIManager.class.getName();
+	private final static Logger logger = Logger.getLogger(sourceClass);
+
+	private BatchSPIManager() {}
+	
+	// Eager init OK.
+	private static final BatchSPIManager INSTANCE = new BatchSPIManager();
+
+	/**
+	 * @return singleton instance
+	 */
+	public static BatchSPIManager getInstance() {
+		return INSTANCE;
+	}
+
+	private BatchJobUtil batchJobUtil = null;
+	
+	private BatchSecurityHelper batchSecurityHelper = null;
+	
+	private ExecutorServiceProvider executorServiceProvider = null;
+
+	/**
+	 * @return The most recently set BatchJobUtil
+	 */
+	public BatchJobUtil getBatchJobUtil() {
+		return batchJobUtil;
+	}
+	
+	/**
+	 * @return The most recently set BatchSecurityHelper
+	 */
+	public BatchSecurityHelper getBatchSecurityHelper() {
+		return batchSecurityHelper;
+	}
+
+	/**
+	 * @return The most recently set ExecutorServiceProvider 
+	 */
+	public ExecutorServiceProvider getExecutorServiceProvider() {
+		return executorServiceProvider;
+	}
+
+	/**
+	 * May be called at any point and will be immediately reflected in the singleton,
+	 * i.e. getBatchJobUtil() will return this.
+	 * @param helper impl
+	 */
+	public void registerBatchJobUtil(BatchJobUtil helper) {
+		this.batchJobUtil = helper;
+	}
+	
+	/**
+	 * May be called at any point and will be immediately reflected in the singleton,
+	 * i.e. getBatchSecurityHelper() will return this.
+	 * @param helper impl
+	 */
+	public void registerBatchSecurityHelper(BatchSecurityHelper helper) {
+		this.batchSecurityHelper = helper;
+	}
+	
+	/**
+	 * May be called at any point and will be immediately reflected in the singleton,
+	 * i.e. getExecutorServiceProvider() will return this.
+	 * @param provider impl
+	 */
+	public void registerExecutorServiceProvider(ExecutorServiceProvider provider) {
+		this.executorServiceProvider = provider;
+	}
+	
+	private final byte[] databaseConfigurationCompleteLock = new byte[0];
+	private Boolean databaseConfigurationComplete = Boolean.FALSE;
+	
+    private DatabaseConfigurationBean dataBaseConfigurationBean = null;
+
+    /**
+     * This is not the method that the 352 RI will call to get the 
+     * final configuration, and lock off further updates.  This is just
+     * a normal getter which is more use while the configuration is still
+     * being set, before it is hardened.
+     * 
+     * @return the last-set DatabaseConfigurationBean
+     * 
+     * @see getFinalDatabaseConfiguration()
+     */
+	public DatabaseConfigurationBean getDataBaseConfigurationBean() {
+		return dataBaseConfigurationBean;
+	}
+
+	/**
+     * This only will have an impact if the batch container has not already hardened its
+     * persistent store database configuration.   There is no ability to dynamically update
+     * the configuration, so if this call comes in after the lazy initialization, it is too late.
+     * @param bean 
+     * @throws DatabaseAlreadyInitializedException If configuration has already been queried by the batch runtime. 
+     */
+	public void registerDatabaseConfigurationBean(DatabaseConfigurationBean bean) 
+			throws DatabaseAlreadyInitializedException { 
+		synchronized (databaseConfigurationCompleteLock) {
+			if (!databaseConfigurationComplete) {
+				this.dataBaseConfigurationBean = bean;
+			} else {
+				throw new DatabaseAlreadyInitializedException("Tried to set database configuration but it's too late, since configuration has already been hardened.");
+			}
+		}
+	}
+	
+	/**
+	 * Called by the core batch runtime at the point when it is ready to harden the database
+	 * configuration.
+	 * 
+	 * @return The batch runtime database configuration, if set, or <b>null</b> if not set.
+	 */
+	public DatabaseConfigurationBean getFinalDatabaseConfiguration() {
+		synchronized (databaseConfigurationCompleteLock) {
+			databaseConfigurationComplete = Boolean.TRUE;
+			return dataBaseConfigurationBean;
+		}
+	}
+	
+	/*  This is commented out so it doesn't trigger loading of ServicesManagerImpl.   It's included
+	 * as a comment to show that we have the capability in the services manager impl to support
+	 * getting feedback on whether the initialization has completed or not. 
+	 * 
+     * This method is not currently expected to be used by Glassfish, since it will 
+     * force a load of the rest of the batch runtime.  It has the virtue of throwing an 
+     * exception if initialization of the batch runtime database has already been performed,
+     * in which case the bean passed as input is ignored.
+     * @param bean 
+     
+	public void initalizeDatabaseConfigurationBean(DatabaseConfigurationBean bean) 
+			{
+		ServicesManagerImpl servicesMgr = ServicesManagerImpl.getInstance();
+		servicesMgr.initalizeDatabaseConfigurationBean(bean);
+	}
+	*/
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSecurityHelper.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSecurityHelper.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSecurityHelper.java
new file mode 100755
index 0000000..fe19ccc
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/BatchSecurityHelper.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+/**
+ * 
+ * Implemented by the host environment to allow the 'jbatch' 352 RI to get 
+ * the "current" tag (here a generalized term for something like the current
+ * "application), and whether the tag is "admin"-authorized or not.
+ *
+ * @author skurz
+ */
+public interface BatchSecurityHelper {
+	/**
+	 * @return The current "tag" (or "app name", generically speaking).
+	 */
+    public String getCurrentTag();
+    
+    /**
+     * @param tag A "tag" (or "app name", generically speaking).
+     * @return true if the "tag" is associated with an app recognized as 
+     *              authorized for administrator-level read permissions.
+     */
+    public boolean isAdmin(String tag);
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseAlreadyInitializedException.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseAlreadyInitializedException.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseAlreadyInitializedException.java
new file mode 100755
index 0000000..315921c
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseAlreadyInitializedException.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+public class DatabaseAlreadyInitializedException extends Exception {
+
+	public DatabaseAlreadyInitializedException() {
+		// TODO Auto-generated constructor stub
+	}
+
+	public DatabaseAlreadyInitializedException(String message) {
+		super(message);
+		// TODO Auto-generated constructor stub
+	}
+
+	public DatabaseAlreadyInitializedException(Throwable cause) {
+		super(cause);
+		// TODO Auto-generated constructor stub
+	}
+
+	public DatabaseAlreadyInitializedException(String message, Throwable cause) {
+		super(message, cause);
+		// TODO Auto-generated constructor stub
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseConfigurationBean.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseConfigurationBean.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseConfigurationBean.java
new file mode 100755
index 0000000..b7c0307
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/DatabaseConfigurationBean.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+public class DatabaseConfigurationBean {
+	
+	protected String jndiName = "";
+	protected String jdbcDriver = "";
+	protected String dbUser = "";
+	protected String dbPassword = "";
+	protected String jdbcUrl = "";
+	protected String schema = "";
+	
+	public String getSchema() {
+		return this.schema;
+	}
+	
+	public void setSchema(String schema) {
+		this.schema = schema;
+	}
+	
+	public String getJndiName() {
+		return this.jndiName;
+	}
+
+	public String getJdbcDriver() {
+		return this.jdbcDriver;
+	}
+
+	public String getDbUser() {
+		return this.dbUser;
+	}
+
+	public String getDbPassword() {
+		return this.dbPassword;
+	}
+	
+	public void setJdbcDriver(String jdbcDriver) {
+		this.jdbcDriver = jdbcDriver;
+	}
+
+	public void setJndiName(String jndiName) {
+		this.jndiName = jndiName;
+	}
+	
+	public void setDbUser(String dbUser) {
+		this.dbUser = dbUser;
+	}
+	public String getJdbcUrl() {
+		return jdbcUrl;
+	}
+
+	public void setJdbcUrl(String jdbcUrl) {
+		this.jdbcUrl = jdbcUrl;
+	}
+
+	public void setDbPassword(String dbPassword) {
+		this.dbPassword = dbPassword;
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/ExecutorServiceProvider.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/ExecutorServiceProvider.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/ExecutorServiceProvider.java
new file mode 100755
index 0000000..7a523f4
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/ExecutorServiceProvider.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * 
+ * Provides an ExecutorService managed by the provider to the caller.
+ */
+public interface ExecutorServiceProvider {
+	/**
+	 * @return ExecutorService
+	 */
+	public ExecutorService getExecutorService();
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/TaggedJobExecution.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/TaggedJobExecution.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/TaggedJobExecution.java
new file mode 100755
index 0000000..a5469f5
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/TaggedJobExecution.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.spi;
+
+/**
+ * SPI allowing getting of the "owning tag" associated with a JobExecution
+ */
+public interface TaggedJobExecution {
+	/**
+	 * @return tag name associated with this object instance.
+	 */
+	public String getTagName();
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.RI.SPI/src/com/ibm/jbatch/spi/package-info.java
----------------------------------------------------------------------
diff --git a/JSR352.RI.SPI/src/com/ibm/jbatch/spi/package-info.java b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/package-info.java
new file mode 100755
index 0000000..4e08db2
--- /dev/null
+++ b/JSR352.RI.SPI/src/com/ibm/jbatch/spi/package-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2013 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+/**
+ * The SPIs in this package are generally involved with the 
+ * interaction between the batch runtime and the host environment.
+ * 
+ * There are not a lot of SPIs altogether currently, so they are basically
+ * all lumped together into one package.   They involve things like
+ * allowing the host environment to configure the database and thread pool
+ * used by the batch runtime.  Also things like the batch runtime getting
+ * current "security context" from the host environment. 
+ */
+package com.ibm.jbatch.spi;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/.project
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/.project b/JSR352.Runtime/.project
new file mode 100755
index 0000000..eca4fff
--- /dev/null
+++ b/JSR352.Runtime/.project
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JSR352.Runtime</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/.settings/org.eclipse.jdt.core.prefs b/JSR352.Runtime/.settings/org.eclipse.jdt.core.prefs
new file mode 100755
index 0000000..36147c9
--- /dev/null
+++ b/JSR352.Runtime/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed Feb 01 19:09:17 EST 2012
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/.settings/org.eclipse.wst.common.component
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/.settings/org.eclipse.wst.common.component b/JSR352.Runtime/.settings/org.eclipse.wst.common.component
new file mode 100755
index 0000000..d51080e
--- /dev/null
+++ b/JSR352.Runtime/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="JSR352.Runtime">
+        <wb-resource deploy-path="/" source-path="/src"/>
+        <wb-resource deploy-path="/" source-path="/resources"/>
+        <wb-resource deploy-path="/" source-path="/testJunits"/>
+    </wb-module>
+</project-modules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/.settings/org.eclipse.wst.common.project.facet.core.xml
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/.settings/org.eclipse.wst.common.project.facet.core.xml b/JSR352.Runtime/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100755
index 0000000..7ba6051
--- /dev/null
+++ b/JSR352.Runtime/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <fixed facet="java"/>
+  <fixed facet="jst.utility"/>
+  <installed facet="java" version="1.6"/>
+  <installed facet="jst.utility" version="1.0"/>
+</faceted-project>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/JSR352.Runtime.launch
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/JSR352.Runtime.launch b/JSR352.Runtime/JSR352.Runtime.launch
new file mode 100755
index 0000000..5f6549c
--- /dev/null
+++ b/JSR352.Runtime/JSR352.Runtime.launch
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/JSR352.Runtime"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=JSR352.Runtime"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;JSR352.Runtime&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry internalArchive=&quot;/JSR352.Runtime/testArtifactsBin&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;JSR352.Runtime&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;"/>
+<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;runtimeClasspathEntry internalArchive=&quot;/JSR352.BinaryDependencies/shipped/derby/lib/derby.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="JSR352.Runtime"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dderby.system.home=C:/AAA/work/tmp/db111nqj"/>
+</launchConfiguration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/META-INF/MANIFEST.MF b/JSR352.Runtime/META-INF/MANIFEST.MF
new file mode 100755
index 0000000..ce4e69d
--- /dev/null
+++ b/JSR352.Runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: com.ibm.jbatch-ri-runtime
+Bundle-SymbolicName: com.ibm.jbatch-ri-runtime
+Bundle-Version: 1.0
+Export-Package: com.ibm.jbatch.container,
+ com.ibm.jbatch.container.api.impl,
+ com.ibm.jbatch.container.artifact.proxy,
+ com.ibm.jbatch.container.exception,
+ com.ibm.jbatch.container.jobinstance,
+ com.ibm.jbatch.container.status,
+ com.ibm.jbatch.container.util,
+ com.ibm.jbatch.container.validation,
+ com.ibm.jbatch.spi.services
+Import-Package: com.ibm.jbatch.container.jsl,
+ com.ibm.jbatch.container.jsl.impl,
+ com.ibm.jbatch.container.modelresolver,
+ com.ibm.jbatch.jsl.model,
+ com.ibm.jbatch.spi,
+ com.ibm.websphere.asynchbeans;resolution:=optional,
+ javax.batch.api,
+ javax.batch.api.chunk,
+ javax.batch.api.chunk.listener,
+ javax.batch.api.listener,
+ javax.batch.api.partition,
+ javax.batch.operations,
+ javax.batch.runtime,
+ javax.batch.runtime.context,
+ javax.enterprise.context.spi;resolution:=optional,
+ javax.enterprise.inject.spi;resolution:=optional,
+ javax.transaction;version="1.1.0";resolution:=optional

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/build.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/build.properties b/JSR352.Runtime/build.properties
new file mode 100755
index 0000000..4836d82
--- /dev/null
+++ b/JSR352.Runtime/build.properties
@@ -0,0 +1,4 @@
+source.. = src/,\
+           resources/
+bin.includes = META-INF/,\
+               .

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/jee-properties/batch-config.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/jee-properties/batch-config.properties b/JSR352.Runtime/jee-properties/batch-config.properties
new file mode 100755
index 0000000..fd5e36c
--- /dev/null
+++ b/JSR352.Runtime/jee-properties/batch-config.properties
@@ -0,0 +1,30 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+# This file is intended for finer-grained configuration of the batch runtime,
+# e.g. JDBC driver and JDBC URL, not something more fundamental like is this
+# configured for an SE or EE environment.
+##
+
+# Configured to work out of the box in Glassfish, so no examples are shown.
+#JNDI_NAME=jdbc/batch
+# Embedded
+
+# Network Server
+#  JDBC_URL=jdbc:derby://localhost:1621/tckdb;create=true
+#  JDBC_DRIVER=org.apache.derby.jdbc.ClientDriver

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/jee-properties/batch-services.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/jee-properties/batch-services.properties b/JSR352.Runtime/jee-properties/batch-services.properties
new file mode 100755
index 0000000..312f6d1
--- /dev/null
+++ b/JSR352.Runtime/jee-properties/batch-services.properties
@@ -0,0 +1,28 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+# This file is intended for configuration of the batch runtime by an integrator of
+# the runtime into a particular project or environment.  E.g. this is not where
+# you would perform a finer configuration of something like a thread pool size, but
+# a more fundamental configuration, like do I want to use JDBC persistence (used by
+# default) or in-memory persistence for the JobExecution tables. 
+##
+
+# Configured "out of the box" for the Glassfish environment, using CDI
+CONTAINER_ARTIFACT_FACTORY_SERVICE=com.ibm.jbatch.container.services.impl.CDIBatchArtifactFactoryImpl
+BATCH_THREADPOOL_SERVICE=com.ibm.jbatch.container.services.impl.SPIDelegatingThreadPoolServiceImpl

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/notShipped.SQLQueries/jsr352-queries.sql
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/notShipped.SQLQueries/jsr352-queries.sql b/JSR352.Runtime/notShipped.SQLQueries/jsr352-queries.sql
new file mode 100755
index 0000000..48678f6
--- /dev/null
+++ b/JSR352.Runtime/notShipped.SQLQueries/jsr352-queries.sql
@@ -0,0 +1,59 @@
+SET SCHEMA jbatch;
+
+-- job instance
+SELECT jobinstanceid FROM jbatch.jobinstancedata WHERE id = '56888'
+
+-- job execs
+SELECT jobexecid FROM jbatch.executioninstancedata WHERE jobinstanceid = '56888'
+-- returns 56889
+
+-- job exec steps
+SELECT * FROM jbatch.stepexecutioninstancedata WHERE jobexecid = '56889'
+
+-- other queries
+
+-- job instance with multiple executions
+SELECT A.jobinstanceid, A.id AS jobexecid, A.exitstatus 
+FROM jbatch.executioninstancedata AS A JOIN 
+	(SELECT jobinstanceid, COUNT(*) total 
+	FROM jbatch.executioninstancedata 
+	GROUP BY jobinstanceid 
+	HAVING COUNT(*) > 1) AS B
+ON A.jobinstanceid = B.jobinstanceid
+ORDER BY A.jobinstanceid, jobexecid
+
+
+SELECT A.id, batchstatus 
+FROM executioninstancedata AS A INNER JOIN jobinstancedata AS B
+	ON A.jobinstanceid = B.id 
+WHERE A.batchstatus = 'STARTED'
+	AND B.name = 'job1'
+	AND B.apptag = 'dummy'
+	
+select distinct id, name from jobinstancedata where name = 'job1'
+
+-- experimenting with purge
+
+select count(*) from JBATCH.JOBINSTANCEDATA
+select count(*) from JBATCH.EXECUTIONINSTANCEDATA
+select count(*) from JBATCH.STEPEXECUTIONINSTANCEDATA
+
+DELETE FROM jbatch.jobinstancedata WHERE apptag = 'foo';
+
+DELETE FROM JBATCH.EXECUTIONINSTANCEDATA
+WHERE id IN (
+	SELECT B.id FROM jbatch.jobinstancedata AS A INNER JOIN jbatch.executioninstancedata AS B
+		ON A.id = B.jobinstanceid
+	WHERE A.apptag = 'foo'
+)
+DELETE FROM JBATCH.STEPEXECUTIONINSTANCEDATA
+WHERE id IN (
+	SELECT C.id FROM jbatch.jobinstancedata AS A INNER JOIN jbatch.executioninstancedata AS B
+		ON A.id = B.jobinstanceid INNER JOIN jbatch.stepexecutioninstancedata AS C
+		ON B.id = C.jobexecid
+	WHERE A.apptag = 'foo'
+)
+
+SELECT A.apptag FROM jobinstancedata A INNER JOIN executioninstancedata B ON A.jobinstanceid = B.jobinstanceid
+WHERE B.jobexecid = 1
+

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/pom.xml
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/pom.xml b/JSR352.Runtime/pom.xml
new file mode 100755
index 0000000..3f8b275
--- /dev/null
+++ b/JSR352.Runtime/pom.xml
@@ -0,0 +1,132 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>javax.batch</groupId>
+        <artifactId>jbatch</artifactId>
+        <version>1.0</version>
+    </parent>
+    <groupId>com.ibm.jbatch</groupId>
+    <artifactId>com.ibm.jbatch-runtime</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0</version>
+	<dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.10</version>
+            <scope>test</scope>
+        </dependency>
+		<dependency>
+			<groupId>javax.batch</groupId>
+			<artifactId>javax.batch-api</artifactId>
+			<version>1.0</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.ibm.jbatch</groupId>
+			<artifactId>com.ibm.jbatch-model</artifactId>
+			<version>1.0</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.ibm.jbatch</groupId>
+			<artifactId>com.ibm.jbatch-ri-spi</artifactId>
+			<version>1.0</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.enterprise</groupId>
+			<artifactId>cdi-api</artifactId>
+			<version>1.1-20121030</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.weld.se</groupId>
+			<artifactId>weld-se</artifactId>
+			<version>2.0.0.Alpha3</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.transaction</groupId>
+			<artifactId>jta</artifactId>
+			<version>1.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.codehaus.fabric3.api</groupId>
+			<artifactId>commonj</artifactId>
+			<version>1.1.1</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+
+    <build>
+		<resources>
+			<resource>
+				<directory>resources</directory>
+			</resource>
+		</resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>2.0.2</version>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>generate-sources</phase>
+						<goals><goal>add-source</goal></goals>
+						<configuration>
+							<sources>
+								<source>src</source>
+							</sources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>validate</phase>
+						<configuration>
+							<tasks>
+								<copy overwrite="true" file="jee-properties/batch-config.properties" tofile="resources/META-INF/services/batch-config.properties"/>
+								<copy overwrite="true" file="jee-properties/batch-services.properties" tofile="resources/META-INF/services/batch-services.properties"/>
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+        </plugins>
+    </build>
+</project>
+

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/META-INF/services/batch-config.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/META-INF/services/batch-config.properties b/JSR352.Runtime/resources/META-INF/services/batch-config.properties
new file mode 100644
index 0000000..fd5e36c
--- /dev/null
+++ b/JSR352.Runtime/resources/META-INF/services/batch-config.properties
@@ -0,0 +1,30 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+# This file is intended for finer-grained configuration of the batch runtime,
+# e.g. JDBC driver and JDBC URL, not something more fundamental like is this
+# configured for an SE or EE environment.
+##
+
+# Configured to work out of the box in Glassfish, so no examples are shown.
+#JNDI_NAME=jdbc/batch
+# Embedded
+
+# Network Server
+#  JDBC_URL=jdbc:derby://localhost:1621/tckdb;create=true
+#  JDBC_DRIVER=org.apache.derby.jdbc.ClientDriver

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/META-INF/services/batch-services.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/META-INF/services/batch-services.properties b/JSR352.Runtime/resources/META-INF/services/batch-services.properties
new file mode 100644
index 0000000..312f6d1
--- /dev/null
+++ b/JSR352.Runtime/resources/META-INF/services/batch-services.properties
@@ -0,0 +1,28 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+# This file is intended for configuration of the batch runtime by an integrator of
+# the runtime into a particular project or environment.  E.g. this is not where
+# you would perform a finer configuration of something like a thread pool size, but
+# a more fundamental configuration, like do I want to use JDBC persistence (used by
+# default) or in-memory persistence for the JobExecution tables. 
+##
+
+# Configured "out of the box" for the Glassfish environment, using CDI
+CONTAINER_ARTIFACT_FACTORY_SERVICE=com.ibm.jbatch.container.services.impl.CDIBatchArtifactFactoryImpl
+BATCH_THREADPOOL_SERVICE=com.ibm.jbatch.container.services.impl.SPIDelegatingThreadPoolServiceImpl

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/META-INF/services/javax.batch.operations.JobOperator
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/META-INF/services/javax.batch.operations.JobOperator b/JSR352.Runtime/resources/META-INF/services/javax.batch.operations.JobOperator
new file mode 100755
index 0000000..8163392
--- /dev/null
+++ b/JSR352.Runtime/resources/META-INF/services/javax.batch.operations.JobOperator
@@ -0,0 +1 @@
+com.ibm.jbatch.container.api.impl.JobOperatorImpl
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/JSR352.Runtime/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100755
index 0000000..08d706b
--- /dev/null
+++ b/JSR352.Runtime/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1 @@
+com.ibm.jbatch.container.cdi.BatchCDIInjectionExtension
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-db2.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-db2.ddl b/JSR352.Runtime/resources/ddls/jsr352-db2.ddl
new file mode 100755
index 0000000..5bae8ae
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-db2.ddl
@@ -0,0 +1,75 @@
+
+DROP TABLE JOBSTATUS;
+
+DROP TABLE STEPSTATUS;
+
+DROP TABLE CHECKPOINTDATA;
+
+DROP TABLE JOBINSTANCEDATA;
+
+DROP TABLE EXECUTIONINSTANCEDATA;
+
+DROP TABLE STEPEXECUTIONINSTANCEDATA;
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT JOBINSTANCE_PK PRIMARY KEY,
+  name		VARCHAR(512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT JOBEXECUTION_PK PRIMARY KEY,
+  jobinstanceid BIGINT,
+  createtime	TIMESTAMP,
+  starttime		TIMESTAMP,
+  endtime		TIMESTAMP,
+  updatetime	TIMESTAMP,
+  parameters	BLOB,
+  batchstatus		VARCHAR(512),
+  exitstatus		VARCHAR(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+  );
+  
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+	stepexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT STEPEXECUTION_PK PRIMARY KEY,
+	jobexecid	BIGINT,
+	batchstatus         VARCHAR(512),
+    exitstatus			VARCHAR(512),
+    stepname			VARCHAR(512),
+	readcount			INTEGER,
+	writecount			INTEGER,
+	commitcount         INTEGER,
+	rollbackcount		INTEGER,
+	readskipcount		INTEGER,
+	processskipcount	INTEGER,
+	filtercount			INTEGER,
+	writeskipcount		INTEGER,
+	startTime           TIMESTAMP,
+	endTime             TIMESTAMP,
+	persistentData		BLOB,
+	CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+); 
+
+CREATE TABLE JOBSTATUS (
+  id BIGINT CONSTRAINT JOBSTATUS_PK PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE STEPSTATUS(
+  id BIGINT CONSTRAINT STEPSTATUS_PK PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		VARCHAR(512),
+  obj		BLOB
+);
+
+CREATE INDEX CHK_INDEX ON CHECKPOINTDATA(id);
+
+
+
+ 
+  

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-derby.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-derby.ddl b/JSR352.Runtime/resources/ddls/jsr352-derby.ddl
new file mode 100755
index 0000000..1a2eb2a
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-derby.ddl
@@ -0,0 +1,60 @@
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT JOBINSTANCE_PK PRIMARY KEY,
+  name		VARCHAR(512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT JOBEXECUTION_PK PRIMARY KEY,
+  jobinstanceid BIGINT,
+  createtime	TIMESTAMP,
+  starttime		TIMESTAMP,
+  endtime		TIMESTAMP,
+  updatetime	TIMESTAMP,
+  parameters	BLOB,
+  batchstatus		VARCHAR(512),
+  exitstatus		VARCHAR(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+  );
+  
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+	stepexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) CONSTRAINT STEPEXECUTION_PK PRIMARY KEY,
+	jobexecid	BIGINT,
+	batchstatus         VARCHAR(512),
+    exitstatus			VARCHAR(512),
+    stepname			VARCHAR(512),
+	readcount			INTEGER,
+	writecount			INTEGER,
+	commitcount         INTEGER,
+	rollbackcount		INTEGER,
+	readskipcount		INTEGER,
+	processskipcount	INTEGER,
+	filtercount			INTEGER,
+	writeskipcount		INTEGER,
+	startTime           TIMESTAMP,
+	endTime             TIMESTAMP,
+	persistentData		BLOB,
+	CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+); 
+
+CREATE TABLE JOBSTATUS (
+  id BIGINT CONSTRAINT JOBSTATUS_PK PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE STEPSTATUS(
+  id BIGINT CONSTRAINT STEPSTATUS_PK PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		VARCHAR(512),
+  obj		BLOB
+);
+
+CREATE INDEX CHK_INDEX ON CHECKPOINTDATA(id);
+
+  

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-ms-sqlserver.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-ms-sqlserver.ddl b/JSR352.Runtime/resources/ddls/jsr352-ms-sqlserver.ddl
new file mode 100755
index 0000000..3375e4a
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-ms-sqlserver.ddl
@@ -0,0 +1,70 @@
+
+DROP TABLE JOBSTATUS;
+
+DROP TABLE STEPSTATUS;
+
+DROP TABLE CHECKPOINTDATA;
+
+DROP TABLE JOBINSTANCEDATA;
+
+DROP TABLE EXECUTIONINSTANCEDATA;
+
+DROP TABLE STEPEXECUTIONINSTANCEDATA;
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid   BIGINT NOT NULL PRIMARY KEY IDENTITY,
+  name    VARCHAR(512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid  BIGINT NOT NULL PRIMARY KEY IDENTITY, 
+  jobinstanceid BIGINT,
+  createtime  DATETIME,
+  starttime   DATETIME,
+  endtime   DATETIME,
+  updatetime  DATETIME,
+  parameters  VARBINARY,
+  batchstatus   VARCHAR(512),
+  exitstatus    VARCHAR(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+);
+
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+  stepexecid BIGINT NOT NULL PRIMARY KEY IDENTITY, 
+  jobexecid BIGINT,
+  batchstatus         VARCHAR(512),
+    exitstatus      VARCHAR(512),
+    stepname      VARCHAR(512),
+  readcount       INTEGER,
+  writecount      INTEGER,
+  commitcount     INTEGER,
+  rollbackcount   INTEGER,
+  readskipcount   INTEGER,
+  processskipcount  INTEGER,
+  filtercount       INTEGER,
+  writeskipcount    INTEGER,
+  startTime           DATETIME,
+  endTime             DATETIME,
+  persistentData    VARBINARY,
+  CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+);  
+
+CREATE TABLE JOBSTATUS (
+  id		BIGINT NOT NULL PRIMARY KEY,
+  obj		VARBINARY,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE STEPSTATUS(
+  id		BIGINT NOT NULL PRIMARY KEY,
+  obj		VARBINARY,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		VARCHAR(512),
+  obj		VARBINARY
+);
+
+  

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-mysql.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-mysql.ddl b/JSR352.Runtime/resources/ddls/jsr352-mysql.ddl
new file mode 100755
index 0000000..1aac40f
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-mysql.ddl
@@ -0,0 +1,58 @@
+
+CREATE TABLE IF NOT EXISTS JOBINSTANCEDATA(
+  jobinstanceid   BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  name    VARCHAR(512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE IF NOT EXISTS EXECUTIONINSTANCEDATA(
+  jobexecid     BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  jobinstanceid BIGINT,
+  createtime  TIMESTAMP,
+  starttime   TIMESTAMP,
+  endtime   TIMESTAMP,
+  updatetime  TIMESTAMP,
+  parameters  BLOB,
+  batchstatus   VARCHAR(512),
+  exitstatus    VARCHAR(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+  );
+  
+CREATE TABLE IF NOT EXISTS STEPEXECUTIONINSTANCEDATA(
+  stepexecid    BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  jobexecid BIGINT,
+  batchstatus       VARCHAR(512),
+  exitstatus      VARCHAR(512),
+  stepname        VARCHAR(512),
+  readcount         INT,
+  writecount        INT,
+  commitcount       INT,
+  rollbackcount     INT,
+  readskipcount     INT,
+  processskipcount  INT,
+  filtercount       INT,
+  writeskipcount    INT,
+  startTime           TIMESTAMP,
+  endTime             TIMESTAMP,
+  persistentData    BLOB,
+  CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+);  
+
+CREATE TABLE IF NOT EXISTS JOBSTATUS (
+  id		BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+  obj   BLOB,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS STEPSTATUS(
+  id		BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, 
+  obj   BLOB,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE IF NOT EXISTS CHECKPOINTDATA(
+  id		VARCHAR(512),
+  obj		BLOB
+);
+
+  

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-oracle.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-oracle.ddl b/JSR352.Runtime/resources/ddls/jsr352-oracle.ddl
new file mode 100755
index 0000000..c55e734
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-oracle.ddl
@@ -0,0 +1,90 @@
+
+DROP TABLE JOBSTATUS;
+DROP TABLE STEPSTATUS;
+DROP TABLE CHECKPOINTDATA;
+DROP TABLE JOBINSTANCEDATA;
+DROP TABLE EXECUTIONINSTANCEDATA;
+DROP TABLE STEPEXECUTIONINSTANCEDATA;
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid		NUMBER(19,0) PRIMARY KEY,
+  name		VARCHAR2(512), 
+  apptag VARCHAR(512)
+);
+CREATE SEQUENCE JOBINSTANCEDATA_SEQ;
+
+CREATE OR REPLACE TRIGGER JOBINSTANCEDATA_TRG
+BEFORE INSERT ON JOBINSTANCEDATA
+FOR EACH ROW
+BEGIN
+  SELECT JOBINSTANCEDATA_SEQ.nextval INTO :new.jobinstanceid FROM dual;
+END;
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid			NUMBER(19,0) PRIMARY KEY,
+  jobinstanceid	NUMBER(19,0),
+  createtime	TIMESTAMP,
+  starttime		TIMESTAMP,
+  endtime		TIMESTAMP,
+  updatetime	TIMESTAMP,
+  parameters	BLOB,
+  batchstatus		VARCHAR2(512),
+  exitstatus		VARCHAR2(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+);
+CREATE SEQUENCE EXECUTIONINSTANCEDATA_SEQ;
+
+CREATE OR REPLACE TRIGGER EXECUTIONINSTANCEDATA_TRG
+BEFORE INSERT ON EXECUTIONINSTANCEDATA
+FOR EACH ROW
+BEGIN
+  SELECT EXECUTIONINSTANCEDATA_SEQ.nextval INTO :new.jobexecid FROM dual;
+END;
+  
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+	stepexecid			NUMBER(19,0) PRIMARY KEY,
+	jobexecid	NUMBER(19,0),
+	batchstatus         VARCHAR2(512),
+    exitstatus			VARCHAR2(512),
+    stepname			VARCHAR2(512),
+	readcount			NUMBER(11, 0),
+	writecount			NUMBER(11, 0),
+	commitcount         NUMBER(11, 0),
+	rollbackcount		NUMBER(11, 0),
+	readskipcount		NUMBER(11, 0),
+	processskipcount	NUMBER(11, 0),
+	filtercount			NUMBER(11, 0),
+	writeskipcount		NUMBER(11, 0),
+	startTime           TIMESTAMP,
+	endTime             TIMESTAMP,
+	persistentData		BLOB,
+	CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+);
+CREATE SEQUENCE STEPEXECUTIONINSTANCEDATA_SEQ;
+
+CREATE OR REPLACE TRIGGER STEPEXECUTIONINSTANCEDATA_TRG
+BEFORE INSERT ON STEPEXECUTIONINSTANCEDATA
+FOR EACH ROW
+BEGIN
+  SELECT STEPEXECUTIONINSTANCEDATA_SEQ.nextval INTO :new.stepexecid FROM dual;
+END;
+
+CREATE TABLE JOBSTATUS (
+  id		NUMBER(19,0) PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE STEPSTATUS(
+  id		NUMBER(19,0) PRIMARY KEY,
+  obj		BLOB,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		VARCHAR2(512),
+  obj		BLOB
+);
+
+
+  

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-postgresql.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-postgresql.ddl b/JSR352.Runtime/resources/ddls/jsr352-postgresql.ddl
new file mode 100755
index 0000000..2e1716c
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-postgresql.ddl
@@ -0,0 +1,66 @@
+
+DROP TABLE JOBSTATUS;
+
+DROP TABLE STEPSTATUS;
+
+DROP TABLE CHECKPOINTDATA;
+
+DROP TABLE JOBINSTANCEDATA;
+
+DROP TABLE EXECUTIONINSTANCEDATA;
+
+DROP TABLE STEPEXECUTIONINSTANCEDATA;
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid		serial not null PRIMARY KEY,
+  name		character varying (512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid		serial not null PRIMARY KEY,
+  jobinstanceid	bigint not null REFERENCES JOBINSTANCEDATA (jobinstanceid),
+  createtime	timestamp,
+  starttime		timestamp,
+  endtime		timestamp,
+  updatetime	timestamp,
+  parameters	bytea,
+  batchstatus		character varying (512),
+  exitstatus		character varying (512)
+);
+  
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+	stepexecid			serial not null PRIMARY KEY,
+	jobexecid			bigint not null REFERENCES EXECUTIONINSTANCEDATA (jobexecid),
+	batchstatus         character varying (512),
+    exitstatus			character varying (512),
+    stepname			character varying (512),
+	readcount			integer,
+	writecount			integer,
+	commitcount         integer,
+	rollbackcount		integer,
+	readskipcount		integer,
+	processskipcount	integer,
+	filtercount			integer,
+	writeskipcount		integer,
+	startTime           timestamp,
+	endTime             timestamp,
+	persistentData		bytea
+); 
+
+CREATE TABLE JOBSTATUS (
+  id		bigint not null REFERENCES JOBINSTANCEDATA (jobinstanceid),
+  obj		bytea
+);
+
+CREATE TABLE STEPSTATUS(
+  id		bigint not null REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid),
+  obj		bytea
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		character varying (512),
+  obj		bytea
+);
+
+ 

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/resources/ddls/jsr352-sybase-ace.ddl
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/resources/ddls/jsr352-sybase-ace.ddl b/JSR352.Runtime/resources/ddls/jsr352-sybase-ace.ddl
new file mode 100755
index 0000000..24d3eb2
--- /dev/null
+++ b/JSR352.Runtime/resources/ddls/jsr352-sybase-ace.ddl
@@ -0,0 +1,69 @@
+
+DROP TABLE JOBSTATUS;
+
+DROP TABLE STEPSTATUS;
+
+DROP TABLE CHECKPOINTDATA;
+
+DROP TABLE JOBINSTANCEDATA;
+
+DROP TABLE EXECUTIONINSTANCEDATA;
+
+DROP TABLE STEPEXECUTIONINSTANCEDATA;
+
+CREATE TABLE JOBINSTANCEDATA(
+  jobinstanceid    BIGINT NOT NULL PRIMARY KEY IDENTITY,
+  name    VARCHAR(512), 
+  apptag VARCHAR(512)
+);
+
+CREATE TABLE EXECUTIONINSTANCEDATA(
+  jobexecid     BIGINT NOT NULL PRIMARY KEY IDENTITY, 
+  jobinstanceid BIGINT,
+  createtime  DATETIME,
+  starttime   DATETIME,
+  endtime   DATETIME,
+  updatetime  DATETIME,
+  parameters  VARBINARY,
+  batchstatus   VARCHAR(512),
+  exitstatus    VARCHAR(512),
+  CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid)
+);
+
+CREATE TABLE STEPEXECUTIONINSTANCEDATA(
+  stepexecid     BIGINT NOT NULL PRIMARY KEY IDENTITY, 
+  jobexecid      BIGINT, 
+  batchstatus         VARCHAR(512),
+    exitstatus      VARCHAR(512),
+    stepname      VARCHAR(512),
+  readcount           INTEGER,
+  writecount          INTEGER,
+  commitcount         INTEGER,
+  rollbackcount       INTEGER,
+  readskipcount       INTEGER,
+  processskipcount    INTEGER,
+  filtercount         INTEGER,
+  writeskipcount      INTEGER,
+  startTime           DATETIME,
+  endTime             DATETIME,
+  persistentData    VARBINARY,
+  CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid)
+);  
+  
+CREATE TABLE JOBSTATUS (
+  id		BIGINT NOT NULL PRIMARY KEY IDENTITY,
+  obj		VARBINARY,
+  CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
+);
+
+CREATE TABLE STEPSTATUS(
+  id		BIGINT NOT NULL PRIMARY KEY IDENTITY,
+  obj		VARBINARY,
+  CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
+);
+
+CREATE TABLE CHECKPOINTDATA(
+  id		VARCHAR(512),
+  obj		VARBINARY
+);
+

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/se-properties/META-INF/services/batch-config.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/se-properties/META-INF/services/batch-config.properties b/JSR352.Runtime/se-properties/META-INF/services/batch-config.properties
new file mode 100755
index 0000000..33ced60
--- /dev/null
+++ b/JSR352.Runtime/se-properties/META-INF/services/batch-config.properties
@@ -0,0 +1,18 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+JDBC_DRIVER=org.apache.derby.jdbc.EmbeddedDriver
+JDBC_URL=jdbc:derby:RUNTIMEDB;create=true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/se-properties/META-INF/services/batch-services.properties
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/se-properties/META-INF/services/batch-services.properties b/JSR352.Runtime/se-properties/META-INF/services/batch-services.properties
new file mode 100755
index 0000000..4a36d79
--- /dev/null
+++ b/JSR352.Runtime/se-properties/META-INF/services/batch-services.properties
@@ -0,0 +1,17 @@
+#
+# Copyright 2013 International Business Machines Corp.
+#
+# See the NOTICE file distributed with this work for additional information
+# regarding copyright ownership. Licensed under the Apache License,
+# Version 2.0 (the "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+J2SE_MODE=true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/src/com/ibm/jbatch/container/IController.java
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/src/com/ibm/jbatch/container/IController.java b/JSR352.Runtime/src/com/ibm/jbatch/container/IController.java
new file mode 100755
index 0000000..8dd7979
--- /dev/null
+++ b/JSR352.Runtime/src/com/ibm/jbatch/container/IController.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2012 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.container;
+
+import java.util.List;
+
+public interface IController {
+    
+    public void stop();
+    
+    public List<Long> getLastRunStepExecutions();
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/src/com/ibm/jbatch/container/IExecutionElementController.java
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/src/com/ibm/jbatch/container/IExecutionElementController.java b/JSR352.Runtime/src/com/ibm/jbatch/container/IExecutionElementController.java
new file mode 100755
index 0000000..13cc4bb
--- /dev/null
+++ b/JSR352.Runtime/src/com/ibm/jbatch/container/IExecutionElementController.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2012 International Business Machines Corp.
+ * 
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License, 
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+package com.ibm.jbatch.container;
+
+import com.ibm.jbatch.container.status.ExecutionStatus;
+
+public interface IExecutionElementController extends IController {
+    
+    public ExecutionStatus execute();
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.Runtime/src/com/ibm/jbatch/container/IThreadRootController.java
----------------------------------------------------------------------
diff --git a/JSR352.Runtime/src/com/ibm/jbatch/container/IThreadRootController.java b/JSR352.Runtime/src/com/ibm/jbatch/container/IThreadRootController.java
new file mode 100755
index 0000000..eb11232
--- /dev/null
+++ b/JSR352.Runtime/src/com/ibm/jbatch/container/IThreadRootController.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright 2012 International Business Machines Corp.
+ *
+ * See the NOTICE file distributed with this work for additional information
+ * regarding copyright ownership. Licensed under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.ibm.jbatch.container;
+
+import com.ibm.jbatch.container.status.ExecutionStatus;
+
+public interface IThreadRootController extends IController {
+
+	public ExecutionStatus originateExecutionOnThread();
+}