Skip to content
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Commit b15a7cf

Browse files
author
Arun Gupta
committed
Reader should be initialized in open instead of constructor
Former-commit-id: e4b8f23fe8096344a5ef67a73e6459c5ba7f4b49
1 parent a2ec8a6 commit b15a7cf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

samples/batch/chunk-optional-processor/src/main/java/org/glassfish/chunk/optional/processor/MyItemReader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
//import javax.batch.annotation.CheckpointInfo;
4343

44+
import java.io.Serializable;
4445
import java.util.StringTokenizer;
4546
import javax.batch.api.chunk.AbstractItemReader;
4647
import javax.inject.Named;
@@ -51,9 +52,10 @@
5152
@Named
5253
public class MyItemReader extends AbstractItemReader {
5354

54-
private final StringTokenizer tokens;
55+
private StringTokenizer tokens;
5556

56-
public MyItemReader() {
57+
@Override
58+
public void open(Serializable c) {
5759
tokens = new StringTokenizer("1,2,3,4,5,6,7,8,9,10", ",");
5860
}
5961

samples/batch/chunk-optional-processor/src/main/webapp/index.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
<html>
4747
<head>
4848
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
49-
<title>Getting Started with Batch API - Optional Processor in Chunk!</title>
49+
<title>GOptional Processor in Chunk!</title>
5050
</head>
5151
<body>
52-
<h1>Getting Started with Batch API - Optional Processor in Chunk!</h1>
52+
<h1>Optional Processor in Chunk!</h1>
5353
Start the <a href="${pageContext.request.contextPath}/TestServlet"/>job</a>.
5454
</body>
5555
</html>

0 commit comments

Comments
 (0)