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:49 UTC

[12/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/src/main/java/com/ibm/jbatch/container/modelresolver/impl/ListenerPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/ListenerPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/ListenerPropertyResolverImpl.java
new file mode 100755
index 0000000..c8790c7
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/ListenerPropertyResolverImpl.java
@@ -0,0 +1,44 @@
+/*
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+import com.ibm.jbatch.jsl.model.Listener;
+
+
+public class ListenerPropertyResolverImpl extends AbstractPropertyResolver<Listener> {
+
+
+    public ListenerPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+    public Listener substituteProperties(final Listener listener, final Properties submittedProps, final Properties parentProps) {
+        //resolve all the properties used in attributes and update the JAXB model
+        listener.setRef(this.replaceAllProperties(listener.getRef(), submittedProps, parentProps));
+
+        // Resolve all the properties defined for this listener
+        if (listener.getProperties() != null) {
+            this.resolveElementProperties(listener.getProperties().getPropertyList(), submittedProps, parentProps);
+        }
+
+        return listener;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionMapperPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionMapperPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionMapperPropertyResolverImpl.java
new file mode 100755
index 0000000..bcd8e69
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionMapperPropertyResolverImpl.java
@@ -0,0 +1,55 @@
+/**
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+import com.ibm.jbatch.jsl.model.PartitionMapper;
+
+
+public class PartitionMapperPropertyResolverImpl extends
+		AbstractPropertyResolver<PartitionMapper> {
+
+	public PartitionMapperPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+	public PartitionMapper substituteProperties(PartitionMapper partitionMapper,
+			Properties submittedProps, Properties parentProps) {
+		
+		/*
+		<xs:complexType name="PartitionMapper">
+			<xs:sequence>
+				<xs:element name="properties" type="jsl:Properties" minOccurs="0" maxOccurs="1" />
+			</xs:sequence>
+			<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+		</xs:complexType>
+		*/
+		
+		partitionMapper.setRef(this.replaceAllProperties(partitionMapper.getRef(), submittedProps, parentProps));
+		
+        // Resolve all the properties defined for this step
+		Properties currentProps = parentProps;
+        if (partitionMapper.getProperties() != null) {
+            currentProps = this.resolveElementProperties(partitionMapper.getProperties().getPropertyList(), submittedProps, parentProps);
+        }
+		
+		return partitionMapper;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPlanPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPlanPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPlanPropertyResolverImpl.java
new file mode 100755
index 0000000..df3aecc
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPlanPropertyResolverImpl.java
@@ -0,0 +1,75 @@
+/**
+ * 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.modelresolver.impl;
+
+import java.util.List;
+import java.util.Properties;
+
+import com.ibm.jbatch.jsl.model.JSLProperties;
+import com.ibm.jbatch.jsl.model.PartitionPlan;
+
+
+public class PartitionPlanPropertyResolverImpl extends
+		AbstractPropertyResolver<PartitionPlan> {
+
+	public PartitionPlanPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+	public PartitionPlan substituteProperties(PartitionPlan partitionPlan,
+			Properties submittedProps, Properties parentProps) {
+    
+		/*
+		<xs:complexType name="PartitionPlan">
+			<xs:sequence>
+				<xs:element name="properties" type="jsl:Properties" minOccurs="0" maxOccurs="unbounded" />
+			</xs:sequence>
+			<xs:attribute name="instances" use="optional" type="xs:string" />
+			<xs:attribute name="threads" use="optional" type="xs:string" />
+		</xs:complexType>
+		*/
+		
+		partitionPlan.setPartitions(this.replaceAllProperties(partitionPlan.getPartitions(), submittedProps, parentProps));
+		partitionPlan.setThreads(this.replaceAllProperties(partitionPlan.getThreads(), submittedProps, parentProps));
+		
+        // Resolve all the properties defined for this plan
+		Properties currentProps = parentProps;
+        if (partitionPlan.getProperties() != null) {
+        	
+        	List<JSLProperties> jslProps = partitionPlan.getProperties();
+        	
+        	if (jslProps != null) {
+        		for (JSLProperties jslProp : jslProps) {
+        		    //for partition properties perform substitution on the partition attribute
+        		    if (jslProp.getPartition() != null) {
+        		        jslProp.setPartition(this.replaceAllProperties(jslProp.getPartition(), submittedProps, parentProps));
+        		    }
+                    currentProps = this.resolveElementProperties(jslProp.getPropertyList(), submittedProps, parentProps);            		
+            	}	
+        	}
+        	
+        	
+
+        }
+		
+		return partitionPlan;
+		
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPropertyResolverImpl.java
new file mode 100755
index 0000000..29ccf8d
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionPropertyResolverImpl.java
@@ -0,0 +1,71 @@
+/*
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+
+import com.ibm.jbatch.container.modelresolver.PropertyResolverFactory;
+import com.ibm.jbatch.jsl.model.Partition;
+
+public class PartitionPropertyResolverImpl extends AbstractPropertyResolver<Partition> {
+
+
+
+    public PartitionPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+    public Partition substituteProperties(final Partition partition, final Properties submittedProps, final Properties parentProps) {
+    	/**
+			<xs:complexType name="Partition">
+				<xs:sequence>
+				    <xs:element name="mapper" type="jsl:PartitionMapper" minOccurs="0" maxOccurs="1" />
+				    <xs:element name="plan" type="jsl:PartitionPlan" minOccurs="0" maxOccurs="1" />
+					<xs:element name="collector" type="jsl:Collector" minOccurs="0" maxOccurs="1"/>
+					<xs:element name="analyzer" type="jsl:Analyzer" minOccurs="0" maxOccurs="1"/>
+					<xs:element name="reducer " type="jsl:PartitionReducer" minOccurs="0" maxOccurs="1"/>
+				</xs:sequence>
+			</xs:complexType>
+    	 */
+    	
+        // Resolve all the properties defined for a partition
+        if (partition.getMapper() != null) {
+        	PropertyResolverFactory.createPartitionMapperPropertyResolver(this.isPartitionedStep).substituteProperties(partition.getMapper(), submittedProps, null);
+        }
+    	
+        if (partition.getPlan() != null) {
+        	PropertyResolverFactory.createPartitionPlanPropertyResolver(this.isPartitionedStep).substituteProperties(partition.getPlan(), submittedProps, null);
+        }
+        
+        if (partition.getCollector() != null) {
+        	PropertyResolverFactory.createCollectorPropertyResolver(this.isPartitionedStep).substituteProperties(partition.getCollector(), submittedProps, null);
+        }
+        
+        if (partition.getAnalyzer() != null) {
+        	PropertyResolverFactory.createAnalyzerPropertyResolver(this.isPartitionedStep).substituteProperties(partition.getAnalyzer(), submittedProps, null);
+        }
+        
+        if (partition.getReducer() != null) {
+        	PropertyResolverFactory.createPartitionReducerPropertyResolver(this.isPartitionedStep).substituteProperties(partition.getReducer(), submittedProps, null);
+        }
+        
+        return partition;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionReducerPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionReducerPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionReducerPropertyResolverImpl.java
new file mode 100755
index 0000000..0d4826a
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/PartitionReducerPropertyResolverImpl.java
@@ -0,0 +1,55 @@
+/*
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+import com.ibm.jbatch.jsl.model.PartitionReducer;
+
+
+public class PartitionReducerPropertyResolverImpl extends
+		AbstractPropertyResolver<PartitionReducer> {
+
+	public PartitionReducerPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+	
+
+	@Override
+	public PartitionReducer substituteProperties(PartitionReducer reducer,
+			Properties submittedProps, Properties parentProps) {
+        /*
+	    <xs:complexType name="Collector">
+            <xs:sequence>
+                <xs:element name="properties" type="jsl:Properties" minOccurs="0" maxOccurs="1" />
+            </xs:sequence>
+            <xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+        </xs:complexType>
+        */
+	    
+        //resolve all the properties used in attributes and update the JAXB model
+	    reducer.setRef(this.replaceAllProperties(reducer.getRef(), submittedProps, parentProps));
+
+        // Resolve all the properties defined for this artifact
+        if (reducer.getProperties() != null) {
+            this.resolveElementProperties(reducer.getProperties().getPropertyList(), submittedProps, parentProps);
+        }
+
+        return reducer;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/SplitPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/SplitPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/SplitPropertyResolverImpl.java
new file mode 100755
index 0000000..97d4771
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/SplitPropertyResolverImpl.java
@@ -0,0 +1,48 @@
+/*
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+import com.ibm.jbatch.container.modelresolver.PropertyResolverFactory;
+import com.ibm.jbatch.jsl.model.Flow;
+import com.ibm.jbatch.jsl.model.Split;
+
+public class SplitPropertyResolverImpl extends AbstractPropertyResolver<Split> {
+
+
+
+    public SplitPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+    public Split substituteProperties(final Split split, final Properties submittedProps, final Properties parentProps) {
+        // resolve all the properties used in attributes and update the JAXB model
+    	split.setId(this.replaceAllProperties(split.getId(), submittedProps, parentProps));
+    	split.setNextFromAttribute(this.replaceAllProperties(split.getNextFromAttribute(), submittedProps, parentProps));
+    	
+        // Resolve all the properties defined for this step
+    	Properties currentProps = parentProps;
+        for (final Flow flow : split.getFlows()) {
+        	PropertyResolverFactory.createFlowPropertyResolver(this.isPartitionedStep).substituteProperties(flow, submittedProps, currentProps);
+        }
+    	
+        return split;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/StepPropertyResolverImpl.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/StepPropertyResolverImpl.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/StepPropertyResolverImpl.java
new file mode 100755
index 0000000..43ccc37
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/container/modelresolver/impl/StepPropertyResolverImpl.java
@@ -0,0 +1,85 @@
+/*
+ * 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.modelresolver.impl;
+
+import java.util.Properties;
+
+import com.ibm.jbatch.container.jsl.TransitionElement;
+import com.ibm.jbatch.container.modelresolver.PropertyResolverFactory;
+import com.ibm.jbatch.jsl.model.Listener;
+import com.ibm.jbatch.jsl.model.Step;
+
+
+public class StepPropertyResolverImpl extends AbstractPropertyResolver<Step> {
+
+    public StepPropertyResolverImpl(boolean isPartitionStep) {
+		super(isPartitionStep);
+	}
+
+	@Override
+    public Step substituteProperties(final Step step, final Properties submittedProps, final Properties parentProps) {
+
+        // resolve all the properties used in attributes and update the JAXB
+        // model
+        step.setId(this.replaceAllProperties(step.getId(), submittedProps, parentProps));
+
+        step.setAllowStartIfComplete(this.replaceAllProperties(step.getAllowStartIfComplete(), submittedProps, parentProps));
+        step.setNextFromAttribute(this.replaceAllProperties(step.getNextFromAttribute(), submittedProps, parentProps));
+        step.setStartLimit(this.replaceAllProperties(step.getStartLimit(), submittedProps, parentProps));
+
+        // Resolve all the properties defined for this step
+        Properties currentProps = parentProps;
+        if (step.getProperties() != null) {
+            currentProps = this.resolveElementProperties(step.getProperties().getPropertyList(), submittedProps, parentProps);
+        }
+        
+        // Resolve partition
+        if (step.getPartition() != null) {
+            PropertyResolverFactory.createPartitionPropertyResolver(this.isPartitionedStep).substituteProperties(step.getPartition(), submittedProps, currentProps);
+        }
+
+        // Resolve Listener properties, this is list of listeners List<Listener>
+        if (step.getListeners() != null) {
+            for (final Listener listener : step.getListeners().getListenerList()) {
+                PropertyResolverFactory.createListenerPropertyResolver(this.isPartitionedStep).substituteProperties(listener, submittedProps, currentProps);
+            }
+        }
+        
+        if (step.getTransitionElements() != null) {
+            for (final TransitionElement controlElement : step.getTransitionElements()) {
+                PropertyResolverFactory.createTransitionElementPropertyResolver(this.isPartitionedStep).substituteProperties(controlElement, submittedProps, currentProps);
+            }
+        }
+        
+        
+        
+        
+
+        // Resolve Batchlet properties
+        if (step.getBatchlet() != null) {
+            PropertyResolverFactory.createBatchletPropertyResolver(this.isPartitionedStep).substituteProperties(step.getBatchlet(), submittedProps, currentProps);
+        }
+
+        // Resolve Chunk properties
+        if (step.getChunk() != null) {
+            PropertyResolverFactory.createChunkPropertyResolver(this.isPartitionedStep).substituteProperties(step.getChunk(), submittedProps, currentProps);
+        }
+
+        return step;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLLoader.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLLoader.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLLoader.java
new file mode 100755
index 0000000..2c00eb7
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLLoader.java
@@ -0,0 +1,102 @@
+/*
+ * 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.jsl.util;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.logging.Logger;
+
+public class JSLLoader {
+
+    private final static Logger logger = Logger.getLogger(JSLLoader.class.getName());
+
+    // Holds a list of job.xml files
+    private Set<URI> jobFilelist = Collections.synchronizedSet(new LinkedHashSet<URI>());
+
+    public static final String JOBS_FOLDER = "META-INF/jobs";
+
+    public void traverseJobPath() {
+
+    }
+
+    /**
+     * 
+     * @param rootURL
+     *            the jar file associated with this batch application
+     * @return list of batch artifact files
+     * @throws IOException
+     * @throws FileNotFoundException
+     * @throws URISyntaxException
+     * @throws URISyntaxException
+     */
+    public Set<URI> getArtifacts(final URL rootURL) throws FileNotFoundException, IOException, URISyntaxException {
+
+        JarFile jarfile = new JarFile(new File(rootURL.toURI()));
+
+        Enumeration<JarEntry> jarEntries = jarfile.entries();
+        if (jarEntries == null) {
+            throw new IllegalArgumentException();
+        }
+
+        while (jarEntries.hasMoreElements()) {
+            String entry = jarEntries.nextElement().getName();
+            if (entry.startsWith(JOBS_FOLDER) && !(entry.endsWith("/"))) {
+                jobFilelist.add(new URI(null, entry, null));
+
+            }
+        }
+        return jobFilelist;
+    }
+
+    private Set<URI> getFolderArtifacts(File directory) throws FileNotFoundException, IOException, URISyntaxException {
+
+        //Get all the xml files in the directory
+        File[] xmlFiles = directory.listFiles(new XMLFilenameFilter());
+
+        for (File file : xmlFiles) {
+            jobFilelist.add(file.toURI());
+        }
+
+        return jobFilelist;
+    }
+
+
+
+    private class XMLFilenameFilter implements FilenameFilter {
+
+        @Override
+        public boolean accept(File dir, String fileName) {
+
+            if (fileName.endsWith(".xml")) {
+                return true;
+            }
+            return false;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLValidationEventHandler.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLValidationEventHandler.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLValidationEventHandler.java
new file mode 100755
index 0000000..2661f76
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/JSLValidationEventHandler.java
@@ -0,0 +1,59 @@
+/*
+ * 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.jsl.util;
+
+import java.util.logging.Logger;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+
+public class JSLValidationEventHandler implements ValidationEventHandler {
+    
+	private static final String CLASSNAME = JSLValidationEventHandler.class.getName();
+
+	private final static Logger logger = Logger.getLogger(CLASSNAME);
+    
+    private boolean eventOccurred = false;
+    
+    public boolean handleEvent(ValidationEvent event) {
+    	StringBuffer buf = new StringBuffer(150);
+        buf.append("\nMESSAGE: " + event.getMessage());
+        buf.append("\nSEVERITY: " + event.getSeverity());
+        buf.append("\nLINKED EXC: " + event.getLinkedException());
+        buf.append("\nLOCATOR INFO:\n------------");
+        
+        buf.append("\n  COLUMN NUMBER:  " + event.getLocator().getColumnNumber());
+        buf.append("\n  LINE NUMBER:  " + event.getLocator().getLineNumber());
+        buf.append("\n  OFFSET:  " + event.getLocator().getOffset());
+        buf.append("\n  CLASS:  " + event.getLocator().getClass());
+        buf.append("\n  NODE:  " + event.getLocator().getNode());
+        buf.append("\n  OBJECT:  " + event.getLocator().getObject());
+        buf.append("\n  URL:  " + event.getLocator().getURL());
+        
+        logger.warning("JSL invalid per XSD, details: " + buf.toString());
+        
+        eventOccurred = true;
+        
+        // Allow more parsing feedback 
+        return true;
+    }
+
+    public boolean eventOccurred() {
+        return eventOccurred;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/PropertiesToStringHelper.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/PropertiesToStringHelper.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/PropertiesToStringHelper.java
new file mode 100755
index 0000000..164034a
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/PropertiesToStringHelper.java
@@ -0,0 +1,37 @@
+/*
+ * 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.jsl.util;
+
+import com.ibm.jbatch.jsl.model.JSLProperties;
+import com.ibm.jbatch.jsl.model.Property;
+
+/**
+ * @author skurz
+ *
+ */
+public class PropertiesToStringHelper {
+
+	public static String getString(JSLProperties props) {
+		if (props == null) return null;
+		
+		StringBuffer buf = new StringBuffer(150);
+		for (Property prop : props.getPropertyList()) {
+			buf.append("name=" + prop.getName() + ",value=" + prop.getValue() + "\n");
+		}
+		return buf.toString();
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/ValidatorHelper.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/ValidatorHelper.java b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/ValidatorHelper.java
new file mode 100755
index 0000000..2a297b8
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/java/com/ibm/jbatch/jsl/util/ValidatorHelper.java
@@ -0,0 +1,47 @@
+/*
+ * 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.jsl.util;
+
+import java.net.URL;
+
+import javax.xml.XMLConstants;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.xml.sax.SAXException;
+
+public class ValidatorHelper {
+
+    public final static String SCHEMA_LOCATION = "xsd/jobXML_1_0.xsd";
+    
+    private static Schema schema = null;
+    
+    private static SchemaFactory sf = 
+        SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);              
+
+    public static Schema getXJCLSchema() {
+        if (schema == null) {
+            try {
+                URL url = ValidatorHelper.class.getResource("/" + SCHEMA_LOCATION);
+                schema = sf.newSchema(url);
+            } catch (SAXException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return schema;        
+    }     
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/resources/xsd/batchXML_1_0.xsd
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/resources/xsd/batchXML_1_0.xsd b/JSR352.JobXML.Model/src/main/resources/xsd/batchXML_1_0.xsd
new file mode 100755
index 0000000..7982a88
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/resources/xsd/batchXML_1_0.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+	targetNamespace="http://xmlns.jcp.org/xml/ns/javaee" xmlns:jbatch="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+
+	<xs:element name="batch-artifacts" type="jbatch:BatchArtifacts" />
+
+	<xs:complexType name="BatchArtifacts">
+		<xs:sequence>
+			<xs:element name="ref" type="jbatch:BatchArtifactRef" minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="BatchArtifactRef">
+		<xs:attribute name="id" use="required" type="xs:string" />
+		<xs:attribute name="class" use="required" type="xs:string" />
+	</xs:complexType>
+
+</xs:schema>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xjb
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xjb b/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xjb
new file mode 100755
index 0000000..7536588
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xjb
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jaxb:bindings
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    jaxb:version="2.1">
+
+    <jaxb:bindings schemaLocation="jobXML_1_0.xsd" node="/xsd:schema">
+        <jaxb:schemaBindings >
+          <jaxb:package name="com.ibm.jbatch.jsl.model"/>
+        </jaxb:schemaBindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Step']/xsd:attribute[@name='next']">
+            <jaxb:property name="nextFromAttribute"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Split']/xsd:attribute[@name='next']">
+            <jaxb:property name="nextFromAttribute"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Flow']/xsd:attribute[@name='next']">
+            <jaxb:property name="nextFromAttribute"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Job']">
+            <jaxb:class name="JSLJob"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Job']/xsd:sequence/xsd:choice[1]">
+            <jaxb:property name="executionElements">
+                <jaxb:baseType name="com.ibm.jbatch.container.jsl.ExecutionElement"/>
+             </jaxb:property>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Decision']/xsd:sequence/xsd:group[1]">
+            <jaxb:property name="transitionElements">
+                <jaxb:baseType name="com.ibm.jbatch.container.jsl.TransitionElement"/>
+             </jaxb:property>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Step']/xsd:sequence/xsd:group[1]">
+            <jaxb:property name="transitionElements">
+                <jaxb:baseType name="com.ibm.jbatch.container.jsl.TransitionElement"/>
+             </jaxb:property>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Split']/xsd:sequence/xsd:element[@name='flow']">
+            <jaxb:property name="flows"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Flow']/xsd:sequence/xsd:choice[1]">
+            <jaxb:property name="executionElements">
+                <jaxb:baseType name="com.ibm.jbatch.container.jsl.ExecutionElement"/>
+             </jaxb:property>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Flow']/xsd:sequence/xsd:group[1]">
+            <jaxb:property name="transitionElements">
+                <jaxb:baseType name="com.ibm.jbatch.container.jsl.TransitionElement"/>
+             </jaxb:property>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Properties']">
+            <jaxb:class name="JSLProperties"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Properties']/xsd:sequence/xsd:element[1]">
+            <jaxb:property name="propertyList"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='Listeners']/xsd:sequence/xsd:element[1]">
+            <jaxb:property name="listenerList"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='ExceptionClassFilter']/xsd:sequence/xsd:element[@name='include']">
+            <jaxb:property name="includeList"/>
+        </jaxb:bindings>
+        <jaxb:bindings node="//xsd:complexType[@name='ExceptionClassFilter']/xsd:sequence/xsd:element[@name='exclude']">
+            <jaxb:property name="excludeList"/>
+        </jaxb:bindings>
+    </jaxb:bindings>
+</jaxb:bindings>
+

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xsd
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xsd b/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xsd
new file mode 100755
index 0000000..8ed923d
--- /dev/null
+++ b/JSR352.JobXML.Model/src/main/resources/xsd/jobXML_1_0.xsd
@@ -0,0 +1,435 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2012,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. -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified" targetNamespace="http://xmlns.jcp.org/xml/ns/javaee"
+	xmlns:jsl="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+
+	<xs:annotation>
+		<xs:documentation>
+			Job Specification Language (JSL) specifies a job,
+			its steps, and directs their execution.
+			JSL also can be referred to as "Job XML".
+		</xs:documentation>
+	</xs:annotation>
+
+	<xs:simpleType name="artifactRef">
+		<xs:annotation>
+			<xs:documentation>
+				This is a helper type. Though it is not otherwise
+				called out by this name
+				in the specification, it captures the fact
+				that the xs:string value refers
+				to a batch artifact, across numerous
+				other JSL type definitions.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:restriction base="xs:string" />
+	</xs:simpleType>
+
+	<xs:complexType name="Job">
+		<xs:annotation>
+			<xs:documentation>
+				The type of a job definition, whether concrete or
+				abstract. This is the type of the root element of any JSL document.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>
+						The job-level properties, which are accessible
+						via the JobContext.getProperties() API in a batch artifact.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="listeners" type="jsl:Listeners"
+				minOccurs="0" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>
+						Note that "listeners" sequence order in XML does
+						not imply order of execution by
+						the batch runtime, per the
+						specification.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="decision" type="jsl:Decision" />
+				<xs:element name="flow" type="jsl:Flow" />
+				<xs:element name="split" type="jsl:Split" />
+				<xs:element name="step" type="jsl:Step" />
+			</xs:choice>
+		</xs:sequence>
+        <xs:attribute name="version" use="required" type="xs:string" fixed="1.0" />
+		<xs:attribute name="id" use="required" type="xs:ID" />
+		<xs:attribute name="restartable" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:element name="job" type="jsl:Job">
+		<xs:annotation>
+			<xs:documentation>
+				The definition of an job, whether concrete or
+				abstract. This is the
+				type of the root element of any JSL document.
+			</xs:documentation>
+		</xs:annotation>
+	</xs:element>
+
+	<xs:complexType name="Listener">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="Split">
+		<xs:sequence>
+			<xs:element name="flow" type="jsl:Flow" minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="id" use="required" type="xs:ID" />
+		<xs:attribute name="next" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="Flow">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element name="decision" type="jsl:Decision" />
+				<xs:element name="flow" type="jsl:Flow" />
+				<xs:element name="split" type="jsl:Split" />
+				<xs:element name="step" type="jsl:Step" />
+			</xs:choice>
+			<xs:group ref="jsl:TransitionElements" minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="id" use="required" type="xs:ID" />
+		<xs:attribute name="next" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:group name="TransitionElements">
+		<xs:annotation>
+			<xs:documentation>
+				This grouping provides allows for the reuse of the
+				'end', 'fail', 'next', 'stop' element sequences which
+				may appear at the end of a 'step', 'flow', 'split' or 'decision'.
+				The term 'TransitionElements' does not formally appear in the spec, it is
+				a schema convenience.			
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="end" type="jsl:End" />
+			<xs:element name="fail" type="jsl:Fail" />
+			<xs:element name="next" type="jsl:Next" />
+			<xs:element name="stop" type="jsl:Stop" />
+		</xs:choice>
+	</xs:group>
+
+	<xs:complexType name="Decision">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+			<xs:group ref="jsl:TransitionElements" minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="id" use="required" type="xs:ID" />
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:attributeGroup name="TerminatingAttributes">
+		<xs:attribute name="on" use="required" type="xs:string" />
+		<xs:attribute name="exit-status" use="optional" type="xs:string" />
+	</xs:attributeGroup>
+
+	<xs:complexType name="Fail">
+		<xs:attributeGroup ref="jsl:TerminatingAttributes" />
+	</xs:complexType>
+
+	<xs:complexType name="End">
+		<xs:attributeGroup ref="jsl:TerminatingAttributes" />
+	</xs:complexType>
+
+	<xs:complexType name="Stop">
+		<xs:attributeGroup ref="jsl:TerminatingAttributes" />
+		<xs:attribute name="restart" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="Next">
+		<xs:attribute name="on" use="required" type="xs:string" />
+		<xs:attribute name="to" use="required" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="CheckpointAlgorithm">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="ExceptionClassFilter">
+		<xs:sequence>
+			<xs:element name="include" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence />
+					<xs:attribute name="class" use="required" type="xs:string" />
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="exclude" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence />
+					<xs:attribute name="class" use="required" type="xs:string" />
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="Step">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="listeners" type="jsl:Listeners"
+				minOccurs="0" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>
+						Note that "listeners" sequence order in XML does
+						not imply order of execution by
+						the batch runtime, per the
+						specification.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:choice minOccurs="0" maxOccurs="1"> 
+				<xs:element name="batchlet" type="jsl:Batchlet" />
+				<xs:element name="chunk" type="jsl:Chunk" />
+			</xs:choice>
+			<xs:element name="partition" type="jsl:Partition"
+				minOccurs="0" maxOccurs="1" />
+			<xs:group ref="jsl:TransitionElements" minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="id" use="required" type="xs:ID" />
+		<xs:attribute name="start-limit" use="optional" type="xs:string" />
+		<xs:attribute name="allow-start-if-complete" use="optional"
+			type="xs:string" />
+		<xs:attribute name="next" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="Batchlet">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="Chunk">
+		<xs:sequence>
+			<xs:element name="reader" type="jsl:ItemReader" />
+			<xs:element name="processor" type="jsl:ItemProcessor"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="writer" type="jsl:ItemWriter" />
+			<xs:element name="checkpoint-algorithm" type="jsl:CheckpointAlgorithm"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="skippable-exception-classes" type="jsl:ExceptionClassFilter"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="retryable-exception-classes" type="jsl:ExceptionClassFilter"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="no-rollback-exception-classes" type="jsl:ExceptionClassFilter"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="checkpoint-policy" use="optional"
+			type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies the checkpoint policy that governs
+					commit behavior for this chunk.
+					Valid values are: "item" or
+					"custom". The "item" policy means the
+					chunk is checkpointed after a
+					specified number of items are
+					processed. The "custom" policy means
+					the chunk is checkpointed
+					according to a checkpoint algorithm
+					implementation. Specifying
+					"custom" requires that the
+					checkpoint-algorithm element is also
+					specified. It is an optional
+					attribute. The default policy is
+					"item". However, we chose not to define
+					a schema-specified default for this attribute.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="item-count" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies the number of items to process per chunk
+					when using the item
+					checkpoint policy. It must be valid XML integer.
+					It is an optional
+					attribute. The default is 10. The item-count
+					attribute is ignored
+					for "custom" checkpoint policy. However, to
+					make it easier for implementations to support JSL inheritance
+					we
+					abstain from defining a schema-specified default for this
+					attribute.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="time-limit" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies the amount of time in seconds before
+					taking a checkpoint for the
+					item checkpoint policy. It must be valid
+					XML integer. It is an
+					optional attribute. The default is 0, which
+					means no limit. However, to
+					make it easier for implementations to
+					support JSL inheritance
+					we abstain from defining a schema-specified
+					default for this attribute.
+					When a value greater than zero is
+					specified, a checkpoint is taken when
+					time-limit is reached or
+					item-count items have been processed,
+					whichever comes first. The
+					time-limit attribute is ignored for
+					"custom" checkpoint policy.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="skip-limit" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies the number of exceptions a step will
+					skip if any configured
+					skippable exceptions are thrown by chunk
+					processing. It must be a
+					valid XML integer value. It is an optional
+					attribute. The default
+					is no limit.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="retry-limit" use="optional" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies the number of times a step will retry if
+					any configured retryable
+					exceptions are thrown by chunk processing.
+					It must be a valid XML
+					integer value. It is an optional attribute.
+					The default is no
+					limit.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+	</xs:complexType>
+
+	<xs:complexType name="ItemReader">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="ItemProcessor">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="ItemWriter">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="Property">
+		<xs:attribute name="name" type="xs:string" use="required" />
+		<xs:attribute name="value" type="xs:string" use="required" />
+	</xs:complexType>
+
+	<xs:complexType name="Properties">
+		<xs:sequence>
+			<xs:element name="property" type="jsl:Property" maxOccurs="unbounded" minOccurs="0" />
+		</xs:sequence>
+		<xs:attribute name="partition" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="Listeners">
+		<xs:sequence>
+			<xs:element name="listener" type="jsl:Listener" maxOccurs="unbounded" minOccurs="0" />
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="Partition">
+		<xs:sequence>
+			<xs:choice minOccurs="0" maxOccurs="1"> 
+				<xs:element name="mapper" type="jsl:PartitionMapper" />
+				<xs:element name="plan" type="jsl:PartitionPlan" />
+			</xs:choice>
+			<xs:element name="collector" type="jsl:Collector"
+				minOccurs="0" maxOccurs="1" />
+			<xs:element name="analyzer" type="jsl:Analyzer" minOccurs="0"
+				maxOccurs="1" />
+			<xs:element name="reducer" type="jsl:PartitionReducer"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="PartitionPlan">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="unbounded" />
+		</xs:sequence>
+		<xs:attribute name="partitions" use="optional" type="xs:string" />
+		<xs:attribute name="threads" use="optional" type="xs:string" />
+	</xs:complexType>
+
+	<xs:complexType name="PartitionMapper">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="Collector">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="Analyzer">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+	<xs:complexType name="PartitionReducer">
+		<xs:sequence>
+			<xs:element name="properties" type="jsl:Properties"
+				minOccurs="0" maxOccurs="1" />
+		</xs:sequence>
+		<xs:attribute name="ref" use="required" type="jsl:artifactRef" />
+	</xs:complexType>
+
+</xs:schema>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/test/java/test/JobModelTest.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/test/java/test/JobModelTest.java b/JSR352.JobXML.Model/src/test/java/test/JobModelTest.java
new file mode 100755
index 0000000..3e1c584
--- /dev/null
+++ b/JSR352.JobXML.Model/src/test/java/test/JobModelTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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 test;
+
+import static org.junit.Assert.*;
+
+import java.net.URL;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.ibm.jbatch.jsl.model.Batchlet;
+import com.ibm.jbatch.jsl.model.JSLJob;
+import com.ibm.jbatch.jsl.model.Step;
+import com.ibm.jbatch.jsl.util.ValidatorHelper;
+import com.ibm.jbatch.jsl.util.JSLValidationEventHandler;
+
+public class JobModelTest {
+
+    @Test
+    public void testModelNoValidate() throws Exception {
+        
+        JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model");
+        
+        Unmarshaller u = ctx.createUnmarshaller();
+        URL url = this.getClass().getResource("/job1.xml");
+        
+        // Use this for anonymous type
+        //Job job = (Job)u.unmarshal(url.openStream());
+        
+        // Use this for named complex type
+        Object elem = u.unmarshal(url.openStream());
+        JSLJob job = (JSLJob)((JAXBElement)elem).getValue();
+        
+        assertEquals("job1", job.getId());
+        assertEquals(1, job.getExecutionElements().size());
+        Step step = (Step)job.getExecutionElements().get(0);
+        assertEquals("step1", step.getId());
+        Batchlet b = step.getBatchlet();
+        assertEquals("step1Ref", b.getRef());
+    }
+    
+    @Test
+    public void testModelValidate() throws Exception {
+        
+        JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model");
+        
+        Unmarshaller u = ctx.createUnmarshaller();
+        u.setSchema(ValidatorHelper.getXJCLSchema());
+        JSLValidationEventHandler handler = new JSLValidationEventHandler();
+        u.setEventHandler(handler);
+        URL url = this.getClass().getResource("/job1.xml");
+        
+        // Use this for anonymous type
+        //Job job = (Job)u.unmarshal(url.openStream());
+        
+        // Use this for named complex type
+        Object elem = u.unmarshal(url.openStream());
+        assertFalse("XSD invalid, see sysout", handler.eventOccurred());
+
+        JSLJob job = (JSLJob)((JAXBElement)elem).getValue();
+        
+        assertEquals("job1", job.getId());
+        assertEquals(1, job.getExecutionElements().size());
+        Step step = (Step)job.getExecutionElements().get(0);
+        assertEquals("step1", step.getId());
+        Batchlet b = step.getBatchlet();
+        assertEquals("step1Ref", b.getRef());
+    }
+
+    @Test
+    public void testValidateInvalid() throws Exception {
+        
+        JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model");
+        
+        Unmarshaller u = ctx.createUnmarshaller();
+        u.setSchema(ValidatorHelper.getXJCLSchema());
+        JSLValidationEventHandler handler = new JSLValidationEventHandler();
+        u.setEventHandler(handler);
+        URL url = this.getClass().getResource("/invalid.job1.xml");
+        
+        // Use this for anonymous type
+        //Job job = (Job)u.unmarshal(url.openStream());
+        
+        // Use this for named complex type
+        Object elem = u.unmarshal(url.openStream());
+        assertTrue("XSD invalid, see sysout", handler.eventOccurred());
+    }
+    
+    @Test
+    @Ignore
+    public void testValidateInvalidEmptyString() throws Exception {
+        
+        JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model");
+        
+        Unmarshaller u = ctx.createUnmarshaller();
+        u.setSchema(ValidatorHelper.getXJCLSchema());
+        JSLValidationEventHandler handler = new JSLValidationEventHandler();
+        u.setEventHandler(handler);
+        URL url = this.getClass().getResource("/emptyString.xml");
+        
+        // Use this for anonymous type
+        //Job job = (Job)u.unmarshal(url.openStream());
+        
+        // Use this for named complex type
+        Object elem = u.unmarshal(url.openStream());
+        assertTrue("XSD invalid, see sysout", handler.eventOccurred());
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/test/java/test/PatternMatchingTests.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/test/java/test/PatternMatchingTests.java b/JSR352.JobXML.Model/src/test/java/test/PatternMatchingTests.java
new file mode 100755
index 0000000..f9c0adf
--- /dev/null
+++ b/JSR352.JobXML.Model/src/test/java/test/PatternMatchingTests.java
@@ -0,0 +1,114 @@
+/*
+ * 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 test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.ibm.jbatch.container.jsl.impl.GlobPatternMatcherImpl;
+
+public class PatternMatchingTests {
+
+	private boolean matchSpecifiedExitStatus(String toMatch, String pattern) {
+		GlobPatternMatcherImpl matcher = new GlobPatternMatcherImpl();
+		return matcher.matchWithoutBackslashEscape(toMatch, pattern);
+	}
+
+	public PatternMatchingTests() {
+		super();
+	}
+
+	@Test
+	public void testBasic() {            
+		assertTrue(matchSpecifiedExitStatus("AA", "AA"));
+	}
+
+	@Test
+	public void testQuestionMark() {            
+		assertTrue(matchSpecifiedExitStatus("AA", "A?"));
+	}
+
+	@Test
+	public void testQuestionMarkRegEx() {            
+		assertFalse(matchSpecifiedExitStatus("AA", "A.?"));
+	}
+
+	@Test
+	public void testAsterisk() {            
+		assertTrue(matchSpecifiedExitStatus("ABCDEFG", "A*"));
+	}
+
+	@Test
+	public void testAsteriskRegEx() {            
+		assertFalse(matchSpecifiedExitStatus("ABCDEFG", "A.*"));
+	}
+	
+	@Test
+	public void testMultiple1() {            
+		assertFalse(matchSpecifiedExitStatus("AAABCABC", "A*C*D*"));
+		assertTrue(matchSpecifiedExitStatus("AAABCABDC", "A*C*D*"));
+		assertTrue(matchSpecifiedExitStatus("AAABCABDC", "A*C??*D*"));
+		assertTrue(matchSpecifiedExitStatus("AAABCABDC", "A*C??*D?"));
+		assertTrue(matchSpecifiedExitStatus("AAABCABDC", "*BDC"));
+		assertTrue(matchSpecifiedExitStatus("BDC", "*BDC"));
+		assertTrue(matchSpecifiedExitStatus("BDC", "BDC*"));
+		assertTrue(matchSpecifiedExitStatus("BDC", "*B*D*C*"));
+		assertTrue(matchSpecifiedExitStatus("BBC", "*B*B*C*"));
+		assertTrue(matchSpecifiedExitStatus("Bxzvc7689asafBC", "*B*B*C*"));
+		assertTrue(matchSpecifiedExitStatus("AAABCABC", "AA*A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A*A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A**A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A***A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A?*A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A??A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A??A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "*A??A*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "*AB*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "*AB**"));
+		assertTrue(matchSpecifiedExitStatus("ABCCBAABCCBA", "*A*A*A"));
+		assertFalse(matchSpecifiedExitStatus("ABCCBAABCCBA", "*A*D*A"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "*AB*C"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "*AB*C*"));
+		// Not sure if this will work
+		assertTrue(matchSpecifiedExitStatus("A*B", "A*B"));
+		assertFalse(matchSpecifiedExitStatus("ZABCCBAABCCBA", "*A*D*"));
+		assertTrue(matchSpecifiedExitStatus("ZABCCBAABCCBA", "Z*C*A*BA"));
+		assertFalse(matchSpecifiedExitStatus("ABCABC", "*AB?C*"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A??*C"));
+		assertFalse(matchSpecifiedExitStatus("ABCABC", "A?CB?*C"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A?CA?*C"));
+		assertTrue(matchSpecifiedExitStatus("ABCABC", "A?CA*C"));
+		assertFalse(matchSpecifiedExitStatus("ABCCBAABCCBA", "*A*D*A"));
+		assertFalse(matchSpecifiedExitStatus("A", "AD*A"));
+		assertFalse(matchSpecifiedExitStatus("AD", "AD*A"));
+		assertFalse(matchSpecifiedExitStatus("AD", "AD*AD"));
+		assertFalse(matchSpecifiedExitStatus("ADADA", "AD*AD"));
+		assertFalse(matchSpecifiedExitStatus("AAA", "A*D*A*D"));
+		assertFalse(matchSpecifiedExitStatus("AAAD", "A*D*A*D"));
+	}
+	
+	// Basically I just have this here since it's easy to copy-paste a failing
+	// assertion to run only the single JUnit test.
+	@Test
+	public void testMultiple2() {            	
+
+	}
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/test/resources/emptyString.xml
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/test/resources/emptyString.xml b/JSR352.JobXML.Model/src/test/resources/emptyString.xml
new file mode 100755
index 0000000..ecd916d
--- /dev/null
+++ b/JSR352.JobXML.Model/src/test/resources/emptyString.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<job id="job1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+	<step id="step1">
+		<batchlet ref="" /> <!-- Empty String -->
+	</step>
+</job>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/test/resources/invalid.job1.xml
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/test/resources/invalid.job1.xml b/JSR352.JobXML.Model/src/test/resources/invalid.job1.xml
new file mode 100755
index 0000000..8485378
--- /dev/null
+++ b/JSR352.JobXML.Model/src/test/resources/invalid.job1.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<jsl:job id="job1" xmlns:jsl="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+    <!-- With elemFormDefault = "unqualified", <step> & <batchlet> 
+        should not be NS-qualified by the default ns above -->
+	<step id="step1">
+		<batchlet ref="step1Ref" />
+	</step>
+</jsl:job>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/src/test/resources/job1.xml
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/src/test/resources/job1.xml b/JSR352.JobXML.Model/src/test/resources/job1.xml
new file mode 100755
index 0000000..bcf7de6
--- /dev/null
+++ b/JSR352.JobXML.Model/src/test/resources/job1.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<job id="job1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
+	<step id="step1">
+		<batchlet ref="step1Ref" />
+	</step>
+</job>

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/BatchletExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/BatchletExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/BatchletExtraCode.java
new file mode 100755
index 0000000..016d5e1
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/BatchletExtraCode.java
@@ -0,0 +1,26 @@
+/**
+ * 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("Batchlet: ref=" + ref);
+	    buf.append("\n");
+	    buf.append("Properties = " + com.ibm.jbatch.jsl.util.PropertiesToStringHelper.getString(properties));
+	    return buf.toString();
+    }

http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/f7740962/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/ChunkExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/ChunkExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/ChunkExtraCode.java
new file mode 100755
index 0000000..36fe50d
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/ChunkExtraCode.java
@@ -0,0 +1,36 @@
+/**
+ * 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(250);
+	    String chkAlgStr = checkpointAlgorithm == null ? "null" : checkpointAlgorithm.getRef();
+	    buf.append("Chunk: checkpointAlgorithm = " + chkAlgStr);
+	    buf.append(", skippableExceptions = " + skippableExceptionClasses);
+	    buf.append(", retryableExceptions = " + retryableExceptionClasses);
+	    buf.append(", reader = " + reader);
+	    buf.append(", processor = " + processor);
+	    buf.append(", writer = " + writer);
+	    buf.append(", checkpointPolicy = " + checkpointPolicy);
+	    buf.append(", itemCount = " + itemCount);
+	    buf.append(", timeLimit = " + timeLimit);
+	    buf.append(", skipLimit = " + skipLimit);
+	    buf.append(", retryLimit = " + retryLimit);
+	    buf.append("\n");
+	    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/DecisionExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/DecisionExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/DecisionExtraCode.java
new file mode 100755
index 0000000..a9521cf
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/DecisionExtraCode.java
@@ -0,0 +1,37 @@
+/**
+ * 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("Decision: id=" + id);
+		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");
+	    buf.append("Contains decider =" + ref);
+	    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/EndExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/EndExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/EndExtraCode.java
new file mode 100755
index 0000000..70d9cad
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/EndExtraCode.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("End: 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/FailExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FailExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FailExtraCode.java
new file mode 100755
index 0000000..9ed2d09
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FailExtraCode.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("Fail: 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/FlowExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FlowExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FlowExtraCode.java
new file mode 100755
index 0000000..e2aefce
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/FlowExtraCode.java
@@ -0,0 +1,46 @@
+/**
+ * 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("Flow: id=" + id);
+	buf.append("\nExecution elements: \n");
+	if (executionElements == null) {
+		buf.append("<none>");
+	} else {
+		int i = 0;
+		for ( com.ibm.jbatch.container.jsl.ExecutionElement e : executionElements) {
+			buf.append("element[" + i + "]:" + e + "\n");
+			i++;
+		}
+	}
+	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("\n");
+	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/JSLJobExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLJobExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLJobExtraCode.java
new file mode 100755
index 0000000..871646e
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLJobExtraCode.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.
+ */
+    /*
+     * Appended by build tooling.
+     */ 
+	public String toString() {
+	    StringBuffer buf = new StringBuffer(100);
+	    buf.append("Job: id=" + id);
+	    buf.append(", restartable=" + restartable);
+	    buf.append("\n");
+	    buf.append("Properties = " + com.ibm.jbatch.jsl.util.PropertiesToStringHelper.getString(properties));
+	    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/JSLPropertiesExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLPropertiesExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLPropertiesExtraCode.java
new file mode 100755
index 0000000..4876ad7
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/JSLPropertiesExtraCode.java
@@ -0,0 +1,32 @@
+/**
+ * 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(140);
+	    buf.append("JSL Properties: ");
+	    List<Property> propList = getPropertyList();
+	    if (propList.size() == 0) {
+	    	buf.append("<no properties>");
+	    } else {
+	    	for (Property p : propList) {
+	    		buf.append(p.toString() + "\n");
+	    	}
+	    }
+	    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/NextExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/NextExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/NextExtraCode.java
new file mode 100755
index 0000000..f7c0830
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/NextExtraCode.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("Next: to =" + to + ", on = " + on);
+	    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/PropertyExtraCode.java
----------------------------------------------------------------------
diff --git a/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/PropertyExtraCode.java b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/PropertyExtraCode.java
new file mode 100755
index 0000000..01f75a4
--- /dev/null
+++ b/JSR352.JobXML.Model/toStringAndExtraAppendedCodeStubs/PropertyExtraCode.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("Property name = " + getName() + ", value = " + getValue());
+	    return buf.toString();
+    }
\ No newline at end of file