17 lines
3.1 KiB
HTML
17 lines
3.1 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg"><head><title>Chapter 12. JSR-352 Support</title><link rel="stylesheet" type="text/css" href="docbook-epub.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/><link rel="prev" href="ch11s08.xhtml" title="Passing Data to Future Steps"/><link rel="next" href="ch12s02.xhtml" title="Setup"/></head><body><header/><section class="chapter" title="Chapter 12. JSR-352 Support" epub:type="chapter" id="jsr-352"><div class="titlepage"><div><div><h1 class="title">Chapter 12. JSR-352 Support</h1></div></div></div><p>As of Spring Batch 3.0 support for JSR-352 has been fully implemented. This section is not a replacement for
|
||
the spec itself and instead, intends to explain how the JSR-352 specific concepts apply to Spring Batch.
|
||
Additional information on JSR-352 can be found via the
|
||
JCP here: <a class="ulink" href="https://jcp.org/en/jsr/detail?id=352" target="_top">https://jcp.org/en/jsr/detail?id=352</a></p><section class="section" title="General Notes Spring Batch and JSR-352" epub:type="subchapter" id="jsrGeneralNotes"><div class="titlepage"><div><div><h2 class="title" style="clear: both">General Notes Spring Batch and JSR-352</h2></div></div></div><p>Spring Batch and JSR-352 are structurally the same. They both have jobs that are made up of steps. They
|
||
both have readers, processors, writers, and listeners. However, their interactions are subtly different.
|
||
For example, the <code class="code">org.springframework.batch.core.SkipListener#onSkipInWrite(S item, Throwable t)</code>
|
||
within Spring Batch receives two parameters: the item that was skipped and the Exception that caused the
|
||
skip. The JSR-352 version of the same method
|
||
(<code class="classname">javax.batch.api.chunk.listener.SkipWriteListener#onSkipWriteItem(List<Object> items, Exception ex)</code>)
|
||
also receives two parameters. However the first one is a <code class="classname">List</code> of all the items
|
||
within the current chunk with the second being the <code class="classname">Exception</code> that caused the skip.
|
||
Because of these differences, it is important to note that there are two paths to execute a job within
|
||
Spring Batch: either a traditional Spring Batch job or a JSR-352 based job. While the use of Spring Batch
|
||
artifacts (readers, writers, etc) will work within a job configured via JSR-352's JSL and executed via the
|
||
<code class="classname">JsrJobOperator</code>, they will behave according to the rules of JSR-352. It is also
|
||
important to note that batch artifacts that have been developed against the JSR-352 interfaces will not work
|
||
within a traditional Spring Batch job.</p></section></section><footer/></body></html> |