org.springframework.batch.sample.common

## Class InfiniteLoopWriter

- java.lang.Object
- - org.springframework.batch.core.listener.StepExecutionListenerSupport
  - - org.springframework.batch.sample.common.InfiniteLoopWriter

- All Implemented Interfaces:
    StepExecutionListener, StepListener, ItemWriter<java.lang.Object>

      public class InfiniteLoopWriter
      extends StepExecutionListenerSupport
      implements ItemWriter<java.lang.Object>

  Simple module implementation that will always return true to indicate that processing should continue. This is useful for testing graceful shutdown of jobs.
  Author:
    Lucas Ward

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfiniteLoopWriter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeStep(StepExecution stepExecution)` Initialize the state of the listener with the `StepExecution` from the current scope.
    `void` | `write(java.util.List<? extends java.lang.Object> items)` Process the supplied data element.

    - ### Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport

      `afterStep`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InfiniteLoopWriter

          public InfiniteLoopWriter()

  - ### Method Detail

    - #### beforeStep

          public void beforeStep(StepExecution stepExecution)

      Description copied from interface: `StepExecutionListener`
      Initialize the state of the listener with the `StepExecution` from the current scope.
      Specified by:
        `beforeStep` in interface `StepExecutionListener`
      Overrides:
        `beforeStep` in class `StepExecutionListenerSupport`
      See Also:
        `StepExecutionListener.beforeStep(StepExecution)`

    - #### write

          public void write(java.util.List<? extends java.lang.Object> items)
                     throws java.lang.Exception

      Description copied from interface: `ItemWriter`
      Process the supplied data element. Will not be called with any null items in normal operation.
      Specified by:
        `write` in interface `ItemWriter<java.lang.Object>`
      Parameters:
        `items` - items to be written
      Throws:
        `java.lang.Exception` - if there are errors. The framework will catch the exception and convert or rethrow it as appropriate.