-
- All Known Implementing Classes:
- AbstractItemReader
public interface ItemReader
ItemReader defines the batch artifact that reads items for chunk processing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Serializable
checkpointInfo()
The checkpointInfo method returns the current checkpoint data for this reader.void
close()
The close method marks the end of use of the ItemReader.void
open(Serializable checkpoint)
The open method prepares the reader to read items.Object
readItem()
The readItem method returns the next item for chunk processing.
-
-
-
Method Detail
-
open
void open(Serializable checkpoint) throws Exception
The open method prepares the reader to read items. The input parameter represents the last checkpoint for this reader in a given job instance. The checkpoint data is defined by this reader and is provided by the checkpointInfo method. The checkpoint data provides the reader whatever information it needs to resume reading items upon restart. A checkpoint value of null is passed upon initial start.- Parameters:
checkpoint
- specifies the last checkpoint- Throws:
Exception
- is thrown for any errors.
-
close
void close() throws Exception
The close method marks the end of use of the ItemReader. The reader is free to do any cleanup necessary.- Throws:
Exception
- is thrown for any errors.
-
readItem
Object readItem() throws Exception
The readItem method returns the next item for chunk processing. It returns null to indicate no more items, which also means the current chunk will be committed and the step will end.- Returns:
- next item or null
- Throws:
Exception
- is thrown for any errors.
-
checkpointInfo
Serializable checkpointInfo() throws Exception
The checkpointInfo method returns the current checkpoint data for this reader. It is called before a chunk checkpoint is committed.- Returns:
- checkpoint data
- Throws:
Exception
- is thrown for any errors.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 20:48:04 Cette version de la page est en cache (à la date du 21/08/2025 20:48:04) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/batch/api/chunk/ItemReader.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.