diff --git a/pom.xml b/pom.xml
index 55b0cca7..0f9e6aad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,15 +30,8 @@
Jakarta EE Tutorial
- ${project.build.directory}/stagingtrue
- 1.5.7.1
-
- 1.6.2
- 1.5.0-alpha.16
- 9.2.6.0
-
- DRAFT
+ 2.0.0-RC.1scm:git:git@github.com:eclipse-ee4j/jakartaee-tutorial.git
@@ -55,133 +48,37 @@
package
- org.apache.maven.plugins
- maven-enforcer-plugin
- 1.4.1
-
-
- enforce-versions
-
- enforce
-
-
-
-
- [1.8.0,1.9.0)
- You need JDK8 or lower
-
-
-
-
-
-
-
- org.glassfish.doc
- glassfish-doc-maven-plugin
+ org.asciidoctor
+ asciidoctor-maven-plugin
+ ${asciidoctor.maven.plugin.version}
- generate-toc
+ asciidoc-to-htmlgenerate-resources
- toc
+ process-asciidoc
-
- [0-9]+\s.*,Preface.*,Part\s.*
-
- JEET.*
+ html5
+
+ book
+ ${status}
+
+ font
+ left
+ font
+ true
+
+ -
+ true
+
-
- generate-book
- generate-resources
-
- book
-
-
-
-
-
- com.blazebit
- jbake-maven-plugin
- 1.0.0
-
- ${site.output.dir}
-
- ${status}
-
-
-
-
- build-site
- generate-resources
-
- build
-
-
-
-
- org.asciidoctor
- asciidoctorj
- 1.5.5
-
-
-
-
- org.asciidoctor
- asciidoctor-maven-plugin
- ${asciidoctor.maven.plugin.version}
-
-
- org.jruby
- jruby-complete
- ${jruby.version}
-
-
- org.asciidoctor
- asciidoctorj
- ${asciidoctorj.version}
-
-
- org.asciidoctor
- asciidoctorj-pdf
- ${asciidoctorj.pdf.version}
-
-
- ${project.build.directory}/book
- book.adoc
-
- ${project.build.directory}/staging/
- pdf
- JakartaEETutorial.pdf
-
- ${project.basedir}/src/theme
- jakartaee
- book
- ${status}
-
- font
-
-
- font
- true
-
- -
- true
- true
-
+ index.adoc
+ coderay
-
-
- generate-pdf-doc
- generate-resources
-
- process-asciidoc
-
-
- org.apache.maven.plugins
@@ -200,43 +97,7 @@
-
-
-
- maven-assembly-plugin
- false
-
-
- package
-
- single
-
-
-
- tutorial.xml
-
-
-
-
-
-
-
-
-
- org.glassfish.doc
- glassfish-doc-maven-plugin
- 1.2
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 2.4
-
-
-
diff --git a/src/main/asciidoc/batch-processing/batch-processing.adoc b/src/main/asciidoc/batch-processing/batch-processing.adoc
new file mode 100644
index 00000000..df84ae78
--- /dev/null
+++ b/src/main/asciidoc/batch-processing/batch-processing.adoc
@@ -0,0 +1,30 @@
+= Batch Processing
+
+[[GKJIQ6]][[batch-processing]]
+
+This chapter describes Jakarta Batch,
+which provides support for defining, implementing, and running
+batch jobs. Batch jobs are tasks that can be executed without user
+interaction. The batch framework is composed of a job specification
+language based on XML, a Java API, and a batch runtime.
+
+include::batch-processing001.adoc[]
+
+include::batch-processing002.adoc[]
+
+include::batch-processing003.adoc[]
+
+include::batch-processing004.adoc[]
+
+include::batch-processing005.adoc[]
+
+include::batch-processing006.adoc[]
+
+include::batch-processing007.adoc[]
+
+include::batch-processing008.adoc[]
+
+include::batch-processing009.adoc[]
+
+include::batch-processing010.adoc[]
+
diff --git a/src/main/jbake/content/batch-processing001.adoc b/src/main/asciidoc/batch-processing/batch-processing001.adoc
similarity index 93%
rename from src/main/jbake/content/batch-processing001.adoc
rename to src/main/asciidoc/batch-processing/batch-processing001.adoc
index 7b71cd20..da665add 100644
--- a/src/main/jbake/content/batch-processing001.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing001.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=Introduction to Batch Processing
-next=batch-processing002.html
-prev=batch-processing.html
-~~~~~~
-Introduction to Batch Processing
-================================
-
[[BCGJDEEH]][[introduction-to-batch-processing]]
-Introduction to Batch Processing
---------------------------------
+== Introduction to Batch Processing
Some enterprise applications contain tasks that can be executed without
user interaction. These tasks are executed periodically or when resource
@@ -48,8 +38,7 @@ other common characteristics of batch frameworks.
[[sthref261]][[steps-in-batch-jobs]]
-Steps in Batch Jobs
-~~~~~~~~~~~~~~~~~~~
+=== Steps in Batch Jobs
A step is an independent and sequential phase of a batch job. Batch jobs
contain chunk-oriented steps and task-oriented steps.
@@ -86,7 +75,7 @@ batch job.
[[BABFJBAH]]
.*Figure 58-1 Chunk Steps in a Batch Job*
-image:img/jakartaeett_dt_058.png[
+image:jakartaeett_dt_058.png[
"This figure shows a batch job that contains two chunk steps: step A and
step B. Step A has the three parts of a chunk-oriented step: input
retrieval A, business processing A, and output writing A. Step B also
@@ -109,8 +98,7 @@ files from the bills generated for the previous month.
[[sthref263]][[parallel-processing]]
-Parallel Processing
-~~~~~~~~~~~~~~~~~~~
+=== Parallel Processing
Batch jobs often process large amounts of data or perform
computationally expensive operations. Batch applications can benefit
@@ -127,8 +115,7 @@ run in parallel.
[[sthref264]][[status-and-decision-elements]]
-Status and Decision Elements
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Status and Decision Elements
Batch frameworks keep track of a status for every step in a job. The
status indicates if a step is running or if it has completed. If the
@@ -150,7 +137,7 @@ chunk steps, task steps and a decision element.
[[BCGDCDCA]]
.*Figure 58-2 Steps and Decision Elements in a Job*
-image:img/jakartaeett_dt_059.png[
+image:jakartaeett_dt_059.png[
"This figure shows a batch job that contains two chunk steps, a task step
and a decision element. The job starts with chunk step A, continues with
chunk step B, and then decision element D evaluates condition 1. The
@@ -160,8 +147,7 @@ ends."]
[[sthref266]][[batch-framework-functionality]]
-Batch Framework Functionality
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Batch Framework Functionality
Batch applications have the following common requirements.
diff --git a/src/main/jbake/content/batch-processing002.adoc b/src/main/asciidoc/batch-processing/batch-processing002.adoc
similarity index 67%
rename from src/main/jbake/content/batch-processing002.adoc
rename to src/main/asciidoc/batch-processing/batch-processing002.adoc
index de456269..fde64449 100644
--- a/src/main/jbake/content/batch-processing002.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing002.adoc
@@ -1,34 +1,14 @@
-type=page
-status=published
-title=Batch Processing in Jakarta EE
-next=batch-processing003.html
-prev=batch-processing001.html
-~~~~~~
-= Batch Processing in Jakarta EE
-
-
[[BCGGIBHA]][[batch-processing-in-jakarta-ee]]
-Batch Processing in Jakarta EE
-------------------------------
+== Batch Processing in Jakarta EE
This section lists the components of the batch processing framework in
Jakarta EE and provides an overview of the steps you have to follow to
create a batch application.
-The following topics are addressed here:
-
-* link:#BABEAFJI[The Batch Processing Framework]
-* link:#BABCGDHJ[Creating Batch Applications]
-* link:#BABDGDJB[Elements of a Batch Job]
-* link:#BABHJEJC[Properties and Parameters]
-* link:#BABHJGDH[Job Instances and Job Executions]
-* link:#BABBFGEF[Batch and Exit Status]
-
[[BABEAFJI]][[the-batch-processing-framework]]
-The Batch Processing Framework
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== The Batch Processing Framework
Jakarta EE includes a batch processing framework that consists of the
following elements:
@@ -50,34 +30,19 @@ Java classes to run the jobs in a batch application.
[[BABCGDHJ]][[creating-batch-applications]]
-Creating Batch Applications
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Creating Batch Applications
The process for creating a batch application in Jakarta EE is the
following.
-1. Design the batch application.
-1. Identify the input sources, the format of the input data, the
-desired final result, and the required processing phases.
-2. Organize the application as a job with chunk-oriented steps,
-task-oriented steps, and decision elements. Determine the dependencies
-between them.
-3. Determine the order of execution in terms of transitions between
-steps.
-4. Identify steps that can run in parallel and steps that can run in
-more than one thread.
-2. Create the batch artifacts as Java classes by implementing the
-interfaces specified by the framework for steps, decision elements, and
-so on. These Java classes contain the code to read data from input
-sources, format items, process items, and store results. Batch artifacts
-can access context objects from the batch runtime using dependency
-injection.
-3. Define jobs, steps, and their execution flow in XML files using the
-Job Specification Language. The elements in the XML files reference
-batch artifacts implemented as Java classes. The batch artifacts can
-access properties declared in the XML files, such as names of files and
-databases.
-4. Use the Java API provided by the batch runtime to launch the batch
+. Design the batch application.
+.. Identify the input sources, the format of the input data, the desired final result, and the required processing phases.
+.. Organize the application as a job with chunk-oriented steps, task-oriented steps, and decision elements. Determine the dependencies between them.
+.. Determine the order of execution in terms of transitions between steps.
+.. Identify steps that can run in parallel and steps that can run in more than one thread.
+. Create the batch artifacts as Java classes by implementing the interfaces specified by the framework for steps, decision elements, and so on. These Java classes contain the code to read data from input sources, format items, process items, and store results. Batch artifacts can access context objects from the batch runtime using dependency injection.
+. Define jobs, steps, and their execution flow in XML files using the Job Specification Language. The elements in the XML files reference batch artifacts implemented as Java classes. The batch artifacts can access properties declared in the XML files, such as names of files and databases.
+. Use the Java API provided by the batch runtime to launch the batch
application.
The following sections describe in detail how to use the components of
@@ -85,8 +50,7 @@ the batch processing framework in Jakarta EE to create batch applications.
[[BABDGDJB]][[elements-of-a-batch-job]]
-Elements of a Batch Job
-~~~~~~~~~~~~~~~~~~~~~~~
+=== Elements of a Batch Job
A batch job can contain one or more of the following elements:
@@ -96,7 +60,7 @@ A batch job can contain one or more of the following elements:
* Decision elements
Steps are described in
-link:batch-processing001.html#BCGJDEEH[Introduction to Batch Processing],
+link:#BCGJDEEH[Introduction to Batch Processing],
and can be chunk-oriented or task-oriented. Chunk-oriented steps can be
partitioned steps. In a partitioned chunk step, the processing of one
item does not depend on other items, so these steps can run in more than
@@ -116,8 +80,7 @@ the next step or to terminate the batch job.
[[BABHJEJC]][[properties-and-parameters]]
-Properties and Parameters
-~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Properties and Parameters
Jobs and steps can have a number of properties associated with them. You
define properties in the job definition file, and batch artifacts access
@@ -127,9 +90,9 @@ the job from the business logic and to reuse batch artifacts in
different job definition files.
Specifying properties is described in
-link:batch-processing004.html#BCGDDBBG[Using the Job Specification
+link:#BCGDDBBG[Using the Job Specification
Language], and accessing properties in batch artifacts is described in
-link:batch-processing005.html#BCGHDHGH[Creating Batch Artifacts].
+link:#BCGHDHGH[Creating Batch Artifacts].
Jakarta EE applications can also pass parameters to a job when they submit
it to the batch runtime. This enables you to specify dynamic parameters
@@ -138,27 +101,25 @@ partitioned steps, since each partition needs to know, for example, what
range of items to process.
Specifying parameters when submitting jobs is described in
-link:batch-processing006.html#BCGCAHCB[Submitting Jobs to the Batch
+link:#BCGCAHCB[Submitting Jobs to the Batch
Runtime]. Specifying parameters for partitioned steps and accessing them
in batch artifacts is demonstrated in
-link:batch-processing009.html#BCGFCACD[The phonebilling Example
+link:#BCGFCACD[The phonebilling Example
Application].
[[BABHJGDH]][[job-instances-and-job-executions]]
-Job Instances and Job Executions
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Job Instances and Job Executions
A job definition can have multiple instances, each with different
parameters. A job execution is an attempt to run a job instance. The
batch runtime maintains information about job instances and job
executions, as described in
-link:batch-processing006.html#BCGIBGFC[Checking the Status of a Job].
+link:#BCGIBGFC[Checking the Status of a Job].
[[BABBFGEF]][[batch-and-exit-status]]
-Batch and Exit Status
-~~~~~~~~~~~~~~~~~~~~~
+=== Batch and Exit Status
The state of jobs, steps, splits, and flows is represented in the batch
runtime as a batch status value. Batch status values are listed
@@ -184,12 +145,12 @@ link:#BCGJBGDF[Table 58-1]. They are represented as strings.
Jakarta EE applications can submit jobs and access the batch status of a
job using the `JobOperator` interface, as described in
-link:batch-processing006.html#BCGCAHCB[Submitting Jobs to the Batch
+link:#BCGCAHCB[Submitting Jobs to the Batch
Runtime]. Job definition files can refer to batch status values using
the Job Specification Language (JSL), as described in
-link:batch-processing004.html#BCGDDBBG[Using the Job Specification
+link:#BCGDDBBG[Using the Job Specification
Language]. Batch artifacts can access batch status values using context
-objects, as described in link:batch-processing005.html#BCGCJEEF[Using the
+objects, as described in link:#BCGCJEEF[Using the
Context Objects from the Batch Runtime].
For flows, the batch status is that of its last step. For splits, the
diff --git a/src/main/jbake/content/batch-processing003.adoc b/src/main/asciidoc/batch-processing/batch-processing003.adoc
similarity index 93%
rename from src/main/jbake/content/batch-processing003.adoc
rename to src/main/asciidoc/batch-processing/batch-processing003.adoc
index aa0e3cd3..33160e1c 100644
--- a/src/main/jbake/content/batch-processing003.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing003.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=Simple Use Case
-next=batch-processing004.html
-prev=batch-processing002.html
-~~~~~~
-Simple Use Case
-===============
-
[[BCGHBJIG]][[simple-use-case]]
-Simple Use Case
----------------
+== Simple Use Case
This section demonstrates how to define a simple job using the Job
Specification Language (JSL) and how to implement the corresponding
@@ -20,7 +10,7 @@ detailed descriptions of the elements in the batch framework.
The following job definition specifies a chunk step and a task step as
follows:
-[source,oac_no_warn]
+[source,xml]
----
@@ -66,8 +56,7 @@ child elements.
[[sthref270]][[the-job-element]]
-The job Element
-~~~~~~~~~~~~~~~
+=== The job Element
The `job` element is always the top-level element in a job definition
file. Its main attributes are `id` and `restartable`. The `job` element
@@ -75,7 +64,7 @@ can contain one `properties` element and zero or more of each of the
following elements: `listener`, `step`, `flow`, and `split`. For
example:
-[source,oac_no_warn]
+[source,xml]
----
@@ -96,7 +85,7 @@ example:
The `listener` element specifies a batch artifact whose methods are
invoked before and after the execution of the job. The batch artifact is
an implementation of the `javax.batch.api.listener.JobListener`
-interface. See link:batch-processing008.html#BCGCCFAC[The Listener Batch
+interface. See link:#BCGCCFAC[The Listener Batch
Artifacts] for an example of a job listener implementation.
The first `step`, `flow`, or `split` element inside the `job` element
@@ -104,8 +93,7 @@ executes first.
[[sthref271]][[the-step-element]]
-The step Element
-~~~~~~~~~~~~~~~~
+=== The step Element
The `step` element can be a child of the `job` and `flow` elements. Its
main attributes are `id` and `next`. The `step` element can contain the
@@ -133,7 +121,7 @@ implementations of the following interfaces: `StepListener`,
For task steps, the batch artifact for these listeners must be an
implementation of the `StepListener` interface.
+
-See link:batch-processing008.html#BCGCCFAC[The Listener Batch Artifacts]
+See link:#BCGCCFAC[The Listener Batch Artifacts]
for an example of an item processor listener implementation.
* One `partition` element (optional).
+
@@ -155,7 +143,7 @@ step, a flow, a split, or a decision element.
The following is an example of a chunk step:
-[source,oac_no_warn]
+[source,xml]
----
...
@@ -173,7 +161,7 @@ The following is an example of a chunk step:
The following is an example of a task step:
-[source,oac_no_warn]
+[source,xml]
----
...
@@ -184,8 +172,7 @@ The following is an example of a task step:
[[sthref272]][[the-chunk-element]]
-The chunk Element
-^^^^^^^^^^^^^^^^^
+==== The chunk Element
The `chunk` element is a child of the `step` element for chunk-oriented
steps. The attributes of this element are listed in link:#BCGJCIEI[Table
@@ -282,7 +269,7 @@ rolled back by default when an exception occurs.
The following is an example of a chunk-oriented step:
-[source,oac_no_warn]
+[source,xml]
----
@@ -336,8 +322,7 @@ This example defines a batch step and specifies its batch artifact.
[[sthref275]][[the-partition-element]]
-The partition Element
-^^^^^^^^^^^^^^^^^^^^^
+==== The partition Element
The `partition` element is a child of the `step` element. It indicates
that a step is partitioned. Most partitioned steps are chunk steps where
@@ -378,8 +363,8 @@ properties to specify a range of items for each partition, and one that
relies on a `PartitionMapper` implementation to determine
partition-specific information.
-See link:batch-processing009.html#BCGGGAHB[The Phone Billing Chunk Step]
-in link:batch-processing009.html#BCGFCACD[The phonebilling Example
+See link:#BCGGGAHB[The Phone Billing Chunk Step]
+in link:#BCGFCACD[The phonebilling Example
Application] for a complete example of a partitioned chunk step.
The `partition` element can contain the following elements.
@@ -420,7 +405,7 @@ implementation of the `PartitionAnalyzer` interface.
The following is an example of a partitioned step using the `plan`
element:
-[source,oac_no_warn]
+[source,xml]
----
@@ -454,7 +439,7 @@ element. The `PartitionMapper` implementation dynamically provides the
same information as the `plan` element provides in the job definition
file:
-[source,oac_no_warn]
+[source,xml]
----
@@ -471,14 +456,13 @@ file:
----
-Refer to link:batch-processing009.html#BCGFCACD[The phonebilling Example
+Refer to link:#BCGFCACD[The phonebilling Example
Application] for an example implementation of the `PartitionMapper`
interface.
[[sthref276]][[the-flow-element]]
-The flow Element
-~~~~~~~~~~~~~~~~
+=== The flow Element
The `flow` element can be a child of the `job`, `flow`, and `split`
elements. Its attributes are `id` and `next`. Flows can transition to
@@ -496,7 +480,7 @@ elements outside the flow.
The following is an example of the `flow` element:
-[source,oac_no_warn]
+[source,xml]
----
...
@@ -513,8 +497,7 @@ last step does not have the `next` attribute. The flow transitions to
[[sthref277]][[the-split-element]]
-The split Element
-~~~~~~~~~~~~~~~~~
+=== The split Element
The `split` element can be a child of the `job` and `flow` elements. Its
attributes are `id` and `next`. Splits can transition to splits, steps,
@@ -525,7 +508,7 @@ elements in the split.
The following is an example of a split with three flows that execute
concurrently:
-[source,oac_no_warn]
+[source,xml]
----
...
@@ -536,8 +519,7 @@ concurrently:
[[sthref278]][[the-decision-element]]
-The decision Element
-~~~~~~~~~~~~~~~~~~~~
+=== The decision Element
The `decision` element can be a child of the `job` and `flow` elements.
Its attributes are `id` and `next`. Steps, flows, and splits can
@@ -561,7 +543,7 @@ This element sets the batch status to `FAILED`.
The following is an example of the `decider` element:
-[source,oac_no_warn]
+[source,xml]
----
diff --git a/src/main/jbake/content/batch-processing005.adoc b/src/main/asciidoc/batch-processing/batch-processing005.adoc
similarity index 91%
rename from src/main/jbake/content/batch-processing005.adoc
rename to src/main/asciidoc/batch-processing/batch-processing005.adoc
index 354946a8..777de009 100644
--- a/src/main/jbake/content/batch-processing005.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing005.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=Creating Batch Artifacts
-next=batch-processing006.html
-prev=batch-processing004.html
-~~~~~~
-= Creating Batch Artifacts
-
-
[[BCGHDHGH]][[creating-batch-artifacts]]
-Creating Batch Artifacts
-------------------------
+== Creating Batch Artifacts
After you define a job in terms of its batch artifacts using the Job
Specification Language (JSL), you create these artifacts as Java classes
@@ -21,20 +11,13 @@ This section lists the main batch artifact interfaces, demonstrates how
to access context objects from the batch runtime, and provides some
examples.
-The following topics are addressed here:
-
-* link:#BABDAIBI[Batch Artifact Interfaces]
-* link:#BCGIFJBB[Dependency Injection in Batch Artifacts]
-* link:#BCGCJEEF[Using the Context Objects from the Batch Runtime]
-
[[BABDAIBI]][[batch-artifact-interfaces]]
-Batch Artifact Interfaces
-~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Batch Artifact Interfaces
The following tables list the interfaces that you implement to create
batch artifacts. The interface implementations are referenced from the
-elements described in link:batch-processing004.html#BCGDDBBG[Using the
+elements described in link:#BCGDDBBG[Using the
Job Specification Language].
link:#BCGGCIDC[Table 58-3] lists the interfaces to implement batch
@@ -174,8 +157,7 @@ referenced from the `listener` element inside the `step` element.
[[BCGIFJBB]][[dependency-injection-in-batch-artifacts]]
-Dependency Injection in Batch Artifacts
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Dependency Injection in Batch Artifacts
To ensure that Jakarta Contexts and Dependency Injection (CDI) works in your
batch artifacts, follow these steps.
@@ -186,7 +168,7 @@ the `Named` annotation.
For example, define an item reader implementation in a chunk step as
follows:
+
-[source,oac_no_warn]
+[source,java]
----
@Named("MyItemReaderImpl")
public class MyItemReaderImpl implements ItemReader {
@@ -198,7 +180,7 @@ artifacts.
+
For example, provide the following constructor for the artifact above:
+
-[source,oac_no_warn]
+[source,java]
----
public MyItemReaderImpl() {}
----
@@ -207,7 +189,7 @@ file, instead of using the fully qualified name of the class.
+
For example, define the step for the artifact above as follows:
+
-[source,oac_no_warn]
+[source,xml]
----
@@ -226,7 +208,7 @@ or by including an empty `beans.xml` deployment description with your
application. For example, the following batch artifact is annotated with
`@Dependent`:
+
-[source,oac_no_warn]
+[source,java]
----
@Dependent
@Named("MyItemReaderImpl")
@@ -234,8 +216,8 @@ public class MyItemReaderImpl implements ItemReader { ... }
----
+
For more information on bean archives, see
-link:cdi-adv001.html#CACDCFDE[Packaging CDI Applications] in
-link:cdi-adv.html#GJEHI[Chapter 27, "Jakarta Contexts and Dependency Injection: Advanced Topics"].
+link:#CACDCFDE[Packaging CDI Applications] in
+link:#GJEHI[Chapter 27, "Jakarta Contexts and Dependency Injection: Advanced Topics"].
[width="100%",cols="100%",]
@@ -258,8 +240,7 @@ injected objects.
[[BCGCJEEF]][[using-the-context-objects-from-the-batch-runtime]]
-Using the Context Objects from the Batch Runtime
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Using the Context Objects from the Batch Runtime
The batch runtime provides context objects that implement the
`JobContext` and `StepContext` interfaces in the
@@ -279,7 +260,7 @@ writers, batchlets, listeners, and so on. The following example
demonstrates how to access property values from the job definition file
in an item reader implementation:
-[source,oac_no_warn]
+[source,java]
----
@Dependent
@Named("MyItemReaderImpl")
diff --git a/src/main/jbake/content/batch-processing006.adoc b/src/main/asciidoc/batch-processing/batch-processing006.adoc
similarity index 77%
rename from src/main/jbake/content/batch-processing006.adoc
rename to src/main/asciidoc/batch-processing/batch-processing006.adoc
index 79bf55fc..5055207b 100644
--- a/src/main/jbake/content/batch-processing006.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing006.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=Submitting Jobs to the Batch Runtime
-next=batch-processing007.html
-prev=batch-processing005.html
-~~~~~~
-Submitting Jobs to the Batch Runtime
-====================================
-
[[BCGCAHCB]][[submitting-jobs-to-the-batch-runtime]]
-Submitting Jobs to the Batch Runtime
-------------------------------------
+== Submitting Jobs to the Batch Runtime
The `JobOperator` interface in the `javax.batch.operations` package
enables you to submit jobs to the batch runtime and obtain information
@@ -26,13 +16,12 @@ the `getJobOperator` factory method to obtain `JobOperator` objects.
[[sthref282]][[starting-a-job]]
-Starting a Job
-~~~~~~~~~~~~~~
+=== Starting a Job
The following example code demonstrates how to obtain a `JobOperator`
object and submit a batch job:
-[source,oac_no_warn]
+[source,java]
----
JobOperator jobOperator = BatchRuntime.getJobOperator();
Properties props = new Properties();
@@ -49,8 +38,7 @@ is only known at runtime.
[[BCGIBGFC]][[checking-the-status-of-a-job]]
-Checking the Status of a Job
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Checking the Status of a Job
The `JobExecution` interface in the `javax.batch.runtime` package
provides methods to obtain information about submitted jobs. This
@@ -64,7 +52,7 @@ interface provides the following functionality.
The following example code demonstrates how to obtain the batch status
of a job using its execution ID:
-[source,oac_no_warn]
+[source,java]
----
JobExecution jobExec = jobOperator.getJobExecution(execID);
String status = jobExec.getBatchStatus().toString();
@@ -72,16 +60,15 @@ String status = jobExec.getBatchStatus().toString();
[[sthref283]][[invoking-the-batch-runtime-in-your-application]]
-Invoking the Batch Runtime in Your Application
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Invoking the Batch Runtime in Your Application
The component from which you invoke the batch runtime depends on the
architecture of your particular application. For example, you can invoke
the batch runtime from an enterprise bean, a servlet, a managed bean,
and so on.
-See link:batch-processing008.html#BCGJHEHJ[The webserverlog Example
-Application] and link:batch-processing009.html#BCGFCACD[The phonebilling
+See link:#BCGJHEHJ[The webserverlog Example
+Application] and link:#BCGFCACD[The phonebilling
Example Application] for details on how to invoke the batch runtime from
a managed bean driven by a Jakarta Server Faces user interface.
diff --git a/src/main/jbake/content/batch-processing007.adoc b/src/main/asciidoc/batch-processing/batch-processing007.adoc
similarity index 75%
rename from src/main/jbake/content/batch-processing007.adoc
rename to src/main/asciidoc/batch-processing/batch-processing007.adoc
index 33f94045..d6a3c125 100644
--- a/src/main/jbake/content/batch-processing007.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing007.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=Packaging Batch Applications
-next=batch-processing008.html
-prev=batch-processing006.html
-~~~~~~
-Packaging Batch Applications
-============================
-
[[BCGBBGJI]][[packaging-batch-applications]]
-Packaging Batch Applications
-----------------------------
+== Packaging Batch Applications
Job definition files and batch artifacts do not require separate
packaging and can be included in any Jakarta EE application.
@@ -27,7 +17,7 @@ if you define a job as follows, and you are packaging your application
as a WAR file, include the job definition file in
`WEB-INF/classes/META-INF/batch-jobs/simplejob.xml`:
-[source,oac_no_warn]
+[source,xml]
----
diff --git a/src/main/jbake/content/batch-processing008.adoc b/src/main/asciidoc/batch-processing/batch-processing008.adoc
similarity index 85%
rename from src/main/jbake/content/batch-processing008.adoc
rename to src/main/asciidoc/batch-processing/batch-processing008.adoc
index bbf62fc3..0f0c34ef 100644
--- a/src/main/jbake/content/batch-processing008.adoc
+++ b/src/main/asciidoc/batch-processing/batch-processing008.adoc
@@ -1,16 +1,6 @@
-type=page
-status=published
-title=The webserverlog Example Application
-next=batch-processing009.html
-prev=batch-processing007.html
-~~~~~~
-The webserverlog Example Application
-====================================
-
[[BCGJHEHJ]][[the-webserverlog-example-application]]
-The webserverlog Example Application
-------------------------------------
+== The webserverlog Example Application
The `webserverlog` example application, located in the
tut-install`/examples/batch/webserverlog/` directory, demonstrates how
@@ -18,15 +8,9 @@ to use the batch framework in Jakarta EE to analyze the log file from a web
server. This example application reads a log file and finds what
percentage of page views from tablet devices are product sales.
-The following topics are addressed here:
-
-* link:#BABCHDFB[Architecture of the webserverlog Example Application]
-* link:#BABFIHJA[Running the webserverlog Example Application]
-
[[BABCHDFB]][[architecture-of-the-webserverlog-example-application]]
-Architecture of the webserverlog Example Application
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+=== Architecture of the webserverlog Example Application
The `webserverlog` example application consists of the following
elements:
@@ -58,14 +42,13 @@ the job, and reads the results from a text file.
[[BABFGCEC]][[the-job-definition-file]]
-The Job Definition File
-^^^^^^^^^^^^^^^^^^^^^^^
+==== The Job Definition File
The `webserverlog.xml` job definition file is located in the
`WEB-INF/classes/META-INF/batch-jobs/` directory. The file specifies
seven job-level properties and two steps:
-[source,oac_no_warn]
+[source,xml]
----
@@ -110,7 +93,7 @@ with `@Named`.
The second step is defined as follows:
-[source,oac_no_warn]
+[source,java]
----
@@ -123,13 +106,12 @@ implements it. This is the last step of the job.
[[BABIHBFF]][[the-logline-and-logfilteredline-items]]
-The LogLine and LogFilteredLine Items
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+==== The LogLine and LogFilteredLine Items
The `LogLine` class represents entries in the web server log file and it
is defined as follows:
-[source,oac_no_warn]
+[source,java]
----
public class LogLine {
private final String datetime;
@@ -146,15 +128,14 @@ fields: the IP address of the client and the URL.
[[sthref284]][[the-chunk-step-batch-artifacts]]
-The Chunk Step Batch Artifacts
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+==== The Chunk Step Batch Artifacts
The first step is composed of the `LogLineReader`, `LogLineProcessor`,
and `LogFilteredLineWriter` batch artifacts.
The `LogLineReader` artifact reads records from the web server log file:
-[source,oac_no_warn]
+[source,java]
----
@Dependent
@Named("LogLineReader")
@@ -177,7 +158,7 @@ file with a buffered reader. In this example, the log file has been
included with the application under
`webserverlog/WEB-INF/classes/log1.txt`:
-[source,oac_no_warn]
+[source,java]
----
fileName = jobCtx.getProperties().getProperty("log_file_name");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -193,7 +174,7 @@ from the last committed chunk.
The `readItem` method returns a new `LogLine` object or null at the end
of the log file:
-[source,oac_no_warn]
+[source,java]
----
@Override
public Object readItem() throws Exception {
@@ -210,7 +191,7 @@ public Object readItem() throws Exception {
The `LogLineProcessor` artifact obtains a list of browsers from the job
properties and filters the log entries according to the list:
-[source,oac_no_warn]
+[source,java]
----
@Override
public Object processItem(Object item) {
@@ -240,7 +221,7 @@ If a checkpoint object is provided, the artifact continues writing at
the end of the file; otherwise, it overwrites the file if it exists. The
`writeItems` method writes filtered items to the output file:
-[source,oac_no_warn]
+[source,java]
----
@Override
public void writeItems(List