javax.batch.api.chunk.listener

## Interface ItemWriteListener

- All Known Implementing Classes:
    AbstractItemWriteListener

      public interface ItemWriteListener

  ItemWriteListener intercepts item writer processing.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterWrite(List<Object> items)` The afterWrite method receives control after an item writer writes its items.
    `void` | `beforeWrite(List<Object> items)` The beforeWrite method receives control before an item writer is called to write its items.
    `void` | `onWriteError(List<Object> items, Exception ex)` The onWriteError method receives control after an item writer writeItems throws an exception.

- - ### Method Detail

    - #### beforeWrite

          void beforeWrite(List<Object> items)
                           throws Exception

      The beforeWrite method receives control before an item writer is called to write its items. The method receives the list of items sent to the item reader as an input.
      Parameters:
        `items` - specifies the items about to be written.
      Throws:
        `Exception` - is thrown if an error occurs.

    - #### afterWrite

          void afterWrite(List<Object> items)
                          throws Exception

      The afterWrite method receives control after an item writer writes its items. The method receives the list of items sent to the item reader as an input.
      Parameters:
        `items` - specifies the items about to be written.
      Throws:
        `Exception` - is thrown if an error occurs.

    - #### onWriteError

          void onWriteError(List<Object> items,
                          Exception ex)
                            throws Exception

      The onWriteError method receives control after an item writer writeItems throws an exception. The method receives the list of items sent to the item reader as an input.
      Parameters:
        `items` - specifies the items about to be written.
        `ex` - specifies the exception thrown by the item writer.
      Throws:
        `Exception` - is thrown if an error occurs.

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.