Top Description Methods
jakarta.batch.api.chunk

public Interface ItemWriter

Known Direct Implementers
jakarta.batch.api.chunk.AbstractItemWriter
Imports
java.io.Serializable, java.util.List

ItemWriter defines the batch artifact that writes to a list of items for chunk processing.

Method Summary

Modifier and TypeMethod and Description
public Serializable

Returns:

checkpoint data
checkpointInfo
()

The checkpointInfo method returns the current checkpoint data for this writer.

public void
close()

The close method marks the end of use of the ItemWriter.

public void
open(Serializable
specifies the last checkpoint
checkpoint
)

The open method prepares the writer to write items.

public void
writeItems(List<Object>
specifies the list of items to write. This may be an empty list (e.g. if all the items have been filtered out by the ItemProcessor).
items
)

The writeItems method writes a list of item for the current chunk.

Method Detail

checkpointInfoback to summary
public Serializable checkpointInfo() throws Exception

The checkpointInfo method returns the current checkpoint data for this writer. It is called before a chunk checkpoint is committed.

Returns:Serializable

checkpoint data

Exceptions
Exception:
is thrown for any errors.
closeback to summary
public void close() throws Exception

The close method marks the end of use of the ItemWriter. The writer is free to do any cleanup necessary.

Exceptions
Exception:
is thrown for any errors.
openback to summary
public void open(Serializable checkpoint) throws Exception

The open method prepares the writer to write items. The input parameter represents the last checkpoint for this writer in a given job instance. The checkpoint data is defined by this writer and is provided by the checkpointInfo method. The checkpoint data provides the writer whatever information it needs to resume writing items upon restart. A checkpoint value of null is passed upon initial start.

Parameters
checkpoint:Serializable

specifies the last checkpoint

Exceptions
Exception:
is thrown for any errors.
writeItemsback to summary
public void writeItems(List<Object> items) throws Exception

The writeItems method writes a list of item for the current chunk.

Parameters
items:List<Object>

specifies the list of items to write. This may be an empty list (e.g. if all the items have been filtered out by the ItemProcessor).

Exceptions
Exception:
is thrown for any errors.