Java Reference
In-Depth Information
The overview of the batching framework
The batching framework defines the concept of a batch job , which is a feature of the ap-
plication that can be executed without user interaction. A single job consists of one or more
steps, which can be executed sequentially or in parallel. Additionally, a sequence of steps
can be grouped into a flow . The start of a parallel execution is called a switch . And finally,
if we want to control the sequence of steps using conditional statements, we should use de-
cisions . These following five nouns are the basic building blocks of a batch application. To
compose such an application, we will use a specification language written in an XML file,
as shown in the following code snippet:
<job id="jobName">
<step> … </step>
<step> … </step>
<decision> … </decision>
<flow> … </flow>
<split> … </split>
A step is the basic unit of work and our main area of interest. The batching framework
defines two types of steps, which are as follows:
Chunk steps : These work on chunks of data in three phases: reading, processing,
and writing (for each phase, a separate class is created). The chunks can be con-
figured with a number of elements that should be processed in one transaction.
Task steps : These execute a specific block of code created by the programmer,
without any special constraints. They are used for most non-data processing er-
Additionally, the batching framework allows listeners to register for the whole job or spe-
cific phases of the tasks.
Now that we've covered the basic vocabulary, it will be best to jump straight to coding.
Search WWH ::

Custom Search