diff --git a/jee-7/pom.xml b/jee-7/pom.xml
index 4f6e6a20fb..9011648d17 100644
--- a/jee-7/pom.xml
+++ b/jee-7/pom.xml
@@ -1,430 +1,537 @@
-
- 4.0.0
- jee-7
- 1.0-SNAPSHOT
- war
- JavaEE 7 Arquillian Archetype Sample
+
+ 4.0.0
+ jee-7
+ 1.0-SNAPSHOT
+ war
+ JavaEE 7 Arquillian Archetype Sample
-
- com.baeldung
- parent-modules
- 1.0.0-SNAPSHOT
-
+
+ com.baeldung
+ parent-modules
+ 1.0.0-SNAPSHOT
+
-
-
- javax
- javaee-api
- ${javaee_api.version}
- provided
-
+
+
+ javax
+ javaee-api
+ ${javaee_api.version}
+ provided
+
-
- org.jboss.arquillian.junit
- arquillian-junit-container
- test
-
-
- org.jboss.arquillian.graphene
- graphene-webdriver
- ${graphene-webdriver.version}
- pom
- test
-
-
- com.jayway.awaitility
- awaitility
- ${awaitility.version}
- test
-
+
+ org.jboss.arquillian.junit
+ arquillian-junit-container
+ test
+
+
+ org.jboss.arquillian.graphene
+ graphene-webdriver
+ ${graphene-webdriver.version}
+ pom
+ test
+
+
+ com.jayway.awaitility
+ awaitility
+ ${awaitility.version}
+ test
+
-
- org.jboss.shrinkwrap.resolver
- shrinkwrap-resolver-impl-maven
- test
- jar
-
+
+ org.jboss.shrinkwrap.resolver
+ shrinkwrap-resolver-impl-maven
+ test
+ jar
+
-
- org.jboss.shrinkwrap.resolver
- shrinkwrap-resolver-impl-maven-archive
- test
-
-
- org.apache.httpcomponents
- httpclient
- ${httpclient.version}
-
-
- commons-io
- commons-io
- ${commons-io.version}
-
-
- com.sun.faces
- jsf-api
- ${com.sun.faces.jsf.version}
-
-
- com.sun.faces
- jsf-impl
- ${com.sun.faces.jsf.version}
-
-
- javax.servlet
- jstl
- ${jstl.version}
-
-
- javax.servlet
- javax.servlet-api
- ${javax.servlet-api.version}
-
-
- javax.servlet.jsp
- jsp-api
- ${jsp-api.version}
- provided
-
-
- taglibs
- standard
- ${taglibs.standard.version}
-
+
+ org.jboss.shrinkwrap.resolver
+ shrinkwrap-resolver-impl-maven-archive
+ test
+
+
+ org.apache.httpcomponents
+ httpclient
+ ${httpclient.version}
+
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+
+
+ com.sun.faces
+ jsf-api
+ ${com.sun.faces.jsf.version}
+
+
+ com.sun.faces
+ jsf-impl
+ ${com.sun.faces.jsf.version}
+
+
+ javax.servlet
+ jstl
+ ${jstl.version}
+
+
+ javax.servlet
+ javax.servlet-api
+ ${javax.servlet-api.version}
+
+
+ javax.servlet.jsp
+ jsp-api
+ ${jsp-api.version}
+ provided
+
+
+ taglibs
+ standard
+ ${taglibs.standard.version}
+
-
- javax.mvc
- javax.mvc-api
- 20160715
-
-
- org.glassfish.ozark
- ozark
- ${ozark.version}
-
+
+ javax.mvc
+ javax.mvc-api
+ 20160715
+
+
+ org.glassfish.ozark
+ ozark
+ ${ozark.version}
+
-
- org.springframework.security
- spring-security-web
- ${org.springframework.security.version}
-
+
+ org.springframework.security
+ spring-security-web
+ ${org.springframework.security.version}
+
-
- org.springframework.security
- spring-security-config
- ${org.springframework.security.version}
-
-
- org.springframework.security
- spring-security-taglibs
- ${org.springframework.security.version}
-
-
+
+ org.springframework.security
+ spring-security-config
+ ${org.springframework.security.version}
+
+
+ org.springframework.security
+ spring-security-taglibs
+ ${org.springframework.security.version}
+
+
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- ${maven-war-plugin.version}
-
- src/main/webapp
- false
-
-
-
-
+
+ org.jboss.spec.javax.batch
+ jboss-batch-api_1.0_spec
+ 1.0.0.Final
+
+
+ org.jberet
+ jberet-core
+ 1.0.2.Final
+
+
+ org.jberet
+ jberet-support
+ 1.0.2.Final
+
+
+ org.jboss.spec.javax.transaction
+ jboss-transaction-api_1.2_spec
+ 1.0.0.Final
+
+
+ org.jboss.marshalling
+ jboss-marshalling
+ 1.4.2.Final
+
+
+ org.jboss.weld
+ weld-core
+ 2.1.1.Final
+
+
+ org.jboss.weld.se
+ weld-se
+ 2.1.1.Final
+
+
+ org.jberet
+ jberet-se
+ 1.0.2.Final
+
+
+ com.h2database
+ h2
+ 1.4.178
+
+
+ org.glassfish.jersey.containers
+ jersey-container-jetty-servlet
+ 2.22.1
+
+
-
-
-
- org.jboss.arquillian
- arquillian-bom
- ${arquillian_core.version}
- import
- pom
-
-
- org.jboss.arquillian.extension
- arquillian-drone-bom
- ${arquillian-drone-bom.version}
- pom
- import
-
-
-
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ ${maven-war-plugin.version}
+
+ src/main/webapp
+ false
+
+
+
+
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+
+ org.apache.maven.plugins
+
+
+ maven-pmd-plugin
+
+
+ [3.8,)
+
+
+ check
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- wildfly-managed-arquillian
-
- true
-
-
- standalone-full.xml
- ${project.build.directory}/wildfly-${version.wildfly}
-
-
-
- io.undertow
- undertow-websockets-jsr
- ${undertow-websockets-jsr.version}
- test
-
-
- org.jboss.resteasy
- resteasy-client
- ${resteasy.version}
- test
-
-
- org.jboss.resteasy
- resteasy-jaxb-provider
- ${resteasy.version}
- test
-
-
- org.jboss.resteasy
- resteasy-json-p-provider
- ${resteasy.version}
- test
-
-
- org.wildfly
- wildfly-arquillian-container-managed
- ${wildfly.version}
- test
-
-
+
+
+
+ org.jboss.arquillian
+ arquillian-bom
+ ${arquillian_core.version}
+ import
+ pom
+
+
+ org.jboss.arquillian.extension
+ arquillian-drone-bom
+ ${arquillian-drone-bom.version}
+ pom
+ import
+
+
+
-
-
-
-
- maven-dependency-plugin
- ${maven-dependency-plugin.version}
-
- ${maven.test.skip}
-
-
-
- unpack
- process-test-classes
-
- unpack
-
-
-
-
- org.wildfly
- wildfly-dist
- ${wildfly.version}
- zip
- false
- ${project.build.directory}
-
-
-
-
-
-
-
- maven-surefire-plugin
- ${maven-surefire-plugin.version}
-
-
- ${project.build.directory}/wildfly-${wildfly.version}
-
-
-
-
-
-
-
-
- wildfly-remote-arquillian
-
-
- io.undertow
- undertow-websockets-jsr
- ${undertow-websockets-jsr.version}
- test
-
-
- org.jboss.resteasy
- resteasy-client
- ${resteasy.version}
- test
-
-
- org.jboss.resteasy
- resteasy-jaxb-provider
- ${resteasy.version}
- test
-
-
- org.jboss.resteasy
- resteasy-json-p-provider
- ${resteasy.version}
- test
-
-
- org.wildfly
- wildfly-arquillian-container-remote
- ${wildfly.version}
- test
-
-
-
-
- glassfish-embedded-arquillian
-
-
- org.glassfish.main.extras
- glassfish-embedded-all
- ${glassfish-embedded-all.version}
- test
-
-
- org.glassfish
- javax.json
- ${javax.json.version}
- test
-
-
- org.glassfish.tyrus
- tyrus-client
- ${tyrus.version}
- test
-
-
- org.glassfish.tyrus
- tyrus-container-grizzly-client
- ${tyrus.version}
- test
-
-
- org.glassfish.jersey.core
- jersey-client
- ${jersey.version}
- test
-
-
- org.jboss.arquillian.container
- arquillian-glassfish-embedded-3.1
- ${arquillian-glassfish.version}
- test
-
-
-
-
- glassfish-remote-arquillian
-
-
- org.glassfish
- javax.json
- ${javax.json.version}
- test
-
-
- org.glassfish.tyrus
- tyrus-client
- ${tyrus.version}
- test
-
-
- org.glassfish.tyrus
- tyrus-container-grizzly-client
- ${tyrus.version}
- test
-
-
- org.glassfish.jersey.core
- jersey-client
- ${jersey.version}
- test
-
-
- org.glassfish.jersey.media
- jersey-media-json-jackson
- ${jersey.version}
- test
-
-
- org.glassfish.jersey.media
- jersey-media-json-processing
- ${jersey.version}
- test
-
-
- org.jboss.arquillian.container
- arquillian-glassfish-remote-3.1
- ${arquillian-glassfish.version}
- test
-
-
-
-
- webdriver-chrome
-
- true
-
-
- chrome
-
-
-
- webdriver-firefox
-
- firefox
-
-
-
+
+
+ wildfly-managed-arquillian
+
+ true
+
+
+ standalone-full.xml
+ ${project.build.directory}/wildfly-${version.wildfly}
+
+
+
+ io.undertow
+ undertow-websockets-jsr
+ ${undertow-websockets-jsr.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-client
+ ${resteasy.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-jaxb-provider
+ ${resteasy.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-json-p-provider
+ ${resteasy.version}
+ test
+
+
+ org.wildfly
+ wildfly-arquillian-container-managed
+ ${wildfly.version}
+ test
+
+
+ sun.jdk
+ jconsole
+
+
+
+
-
-
- bintray-mvc-spec-maven
- bintray
- http://dl.bintray.com/mvc-spec/maven
-
- true
-
-
- false
-
-
-
+
+
+
+
+ maven-dependency-plugin
+ ${maven-dependency-plugin.version}
+
+ ${maven.test.skip}
+
+
+
+ unpack
+ process-test-classes
+
+ unpack
+
+
+
+
+ org.wildfly
+ wildfly-dist
+ ${wildfly.version}
+ zip
+ false
+ ${project.build.directory}
+
+
+ sun.jdk
+ jconsole
+
+
+
+
+
+
+
+
+
+ maven-surefire-plugin
+ ${maven-surefire-plugin.version}
+
+
+ ${project.build.directory}/wildfly-${wildfly.version}
+
+
+
+
+
+
+
+
+ wildfly-remote-arquillian
+
+
+ io.undertow
+ undertow-websockets-jsr
+ ${undertow-websockets-jsr.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-client
+ ${resteasy.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-jaxb-provider
+ ${resteasy.version}
+ test
+
+
+ org.jboss.resteasy
+ resteasy-json-p-provider
+ ${resteasy.version}
+ test
+
+
+ org.wildfly
+ wildfly-arquillian-container-remote
+ ${wildfly.version}
+ test
+
+
+ sun.jdk
+ jconsole
+
+
+
+
+
+
+ glassfish-embedded-arquillian
+
+
+ org.glassfish.main.extras
+ glassfish-embedded-all
+ ${glassfish-embedded-all.version}
+ test
+
+
+ org.glassfish
+ javax.json
+ ${javax.json.version}
+ test
+
+
+ org.glassfish.tyrus
+ tyrus-client
+ ${tyrus.version}
+ test
+
+
+ org.glassfish.tyrus
+ tyrus-container-grizzly-client
+ ${tyrus.version}
+ test
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey.version}
+ test
+
+
+ org.jboss.arquillian.container
+ arquillian-glassfish-embedded-3.1
+ ${arquillian-glassfish.version}
+ test
+
+
+
+
+ glassfish-remote-arquillian
+
+
+ org.glassfish
+ javax.json
+ ${javax.json.version}
+ test
+
+
+ org.glassfish.tyrus
+ tyrus-client
+ ${tyrus.version}
+ test
+
+
+ org.glassfish.tyrus
+ tyrus-container-grizzly-client
+ ${tyrus.version}
+ test
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey.version}
+ test
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey.version}
+ test
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-processing
+ ${jersey.version}
+ test
+
+
+ org.jboss.arquillian.container
+ arquillian-glassfish-remote-3.1
+ ${arquillian-glassfish.version}
+ test
+
+
+
+
+ webdriver-chrome
+
+ true
+
+
+ chrome
+
+
+
+ webdriver-firefox
+
+ firefox
+
+
+
-
- 1.8
- 3.0.0
- 7.0
- 1.1.11.Final
- 8.2.1.Final
- 1.7.0
- 1.4.6.Final
- 3.0.19.Final
- 4.1.1
- 1.0.4
- 1.13
- 2.25
- 1.0.0.Final
- 2.6
- 4.2.3.RELEASE
- 2.21.0
- 1.1.2
- 2.4
- 2.2.14
- 4.5
- 2.0.1.Final
- 3.1.0
- 2.1.0.Final
- 2.8
- 1.2
- 2.2
- 20160715
-
+
+
+ bintray-mvc-spec-maven
+ bintray
+ http://dl.bintray.com/mvc-spec/maven
+
+ true
+
+
+ false
+
+
+
-
+
+ 1.8
+ 3.0.0
+ 7.0
+ 1.1.11.Final
+ 8.2.1.Final
+ 1.7.0
+ 1.4.6.Final
+ 3.0.19.Final
+ 4.1.1
+ 1.0.4
+ 1.13
+ 2.25
+ 1.0.0.Final
+ 2.6
+ 4.2.3.RELEASE
+ 2.21.0
+ 1.1.2
+ 2.4
+ 2.2.14
+ 4.5
+ 2.0.1.Final
+ 3.1.0
+ 2.1.0.Final
+ 2.8
+ 1.2
+ 2.2
+ 20160715
+
+
+
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java b/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java
new file mode 100644
index 0000000000..ce47de66af
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java
@@ -0,0 +1,11 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.chunk.listener.SkipReadListener;
+import javax.inject.Named;
+
+@Named
+public class ChunkExceptionSkipReadListener implements SkipReadListener {
+ @Override
+ public void onSkipReadItem(Exception e) throws Exception {
+ }
+}
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java b/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java
new file mode 100644
index 0000000000..fe6759b365
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java
@@ -0,0 +1,12 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.chunk.AbstractCheckpointAlgorithm;
+import javax.inject.Named;
+
+@Named
+public class CustomCheckPoint extends AbstractCheckpointAlgorithm {
+ @Override
+ public boolean isReadyToCheckpoint() throws Exception {
+ return SimpleChunkItemReader.COUNT % 5 == 0;
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java b/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java
new file mode 100644
index 0000000000..6cc2012f23
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java
@@ -0,0 +1,14 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.Decider;
+import javax.batch.runtime.StepExecution;
+import javax.inject.Named;
+
+@Named
+public class DeciderJobSequence implements Decider {
+ @Override
+ public String decide(StepExecution[] ses) throws Exception {
+ return "nothing";
+ }
+
+}
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java b/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java
new file mode 100644
index 0000000000..93eb20708d
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java
@@ -0,0 +1,20 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.AbstractBatchlet;
+import javax.batch.api.BatchProperty;
+import javax.batch.runtime.BatchStatus;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named
+public class InjectSimpleBatchLet extends AbstractBatchlet {
+ @Inject
+ @BatchProperty(name = "name")
+ private String nameString;
+
+ @Override
+ public String process() throws Exception {
+ System.out.println("Value passed in = " + nameString);
+ return BatchStatus.COMPLETED.toString();
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java
new file mode 100644
index 0000000000..6a367b064b
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java
@@ -0,0 +1,13 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.AbstractBatchlet;
+import javax.batch.runtime.BatchStatus;
+import javax.inject.Named;
+
+@Named
+public class SimpleBatchLet extends AbstractBatchlet {
+ @Override
+ public String process() throws Exception {
+ return BatchStatus.FAILED.toString();
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java
new file mode 100644
index 0000000000..3f8166b6d8
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java
@@ -0,0 +1,12 @@
+package com.baeldung.batch.understanding;
+
+import javax.batch.api.chunk.ItemProcessor;
+import javax.inject.Named;
+
+@Named
+public class SimpleChunkItemProcessor implements ItemProcessor {
+ @Override
+ public Integer processItem(Object t) {
+ return ((Integer) t).intValue() % 2 == 0 ? null : ((Integer) t).intValue();
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java
new file mode 100644
index 0000000000..10f81d95d0
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java
@@ -0,0 +1,27 @@
+package com.baeldung.batch.understanding;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+import javax.batch.api.chunk.AbstractItemReader;
+import javax.inject.Named;
+
+@Named
+public class SimpleChunkItemReader extends AbstractItemReader {
+ private StringTokenizer tokens;
+ public static int COUNT = 0;
+
+ @Override
+ public Integer readItem() throws Exception {
+ if (tokens.hasMoreTokens()) {
+ COUNT++;
+ String tempTokenize = tokens.nextToken();
+ return Integer.valueOf(tempTokenize);
+ }
+ return null;
+ }
+
+ @Override
+ public void open(Serializable checkpoint) throws Exception {
+ tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ",");
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java
new file mode 100644
index 0000000000..92096d0571
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java
@@ -0,0 +1,31 @@
+package com.baeldung.batch.understanding;
+
+import java.io.Serializable;
+import java.util.StringTokenizer;
+
+import javax.batch.api.chunk.AbstractItemReader;
+import javax.inject.Named;
+
+@Named
+public class SimpleChunkItemReaderError extends AbstractItemReader {
+ private StringTokenizer tokens;
+ public static int COUNT = 0;
+
+ @Override
+ public Integer readItem() throws Exception {
+ if (tokens.hasMoreTokens()) {
+ COUNT++;
+ int token = Integer.valueOf(tokens.nextToken());
+ if (token == 3) {
+ throw new RuntimeException("Something happened");
+ }
+ return Integer.valueOf(token);
+ }
+ return null;
+ }
+
+ @Override
+ public void open(Serializable checkpoint) throws Exception {
+ tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ",");
+ }
+}
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java
new file mode 100644
index 0000000000..909596766d
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java
@@ -0,0 +1,13 @@
+package com.baeldung.batch.understanding;
+
+import java.util.List;
+
+import javax.batch.api.chunk.AbstractItemWriter;
+import javax.inject.Named;
+
+@Named
+public class SimpleChunkWriter extends AbstractItemWriter {
+ @Override
+ public void writeItems(List