Class MapJobRegistry
java.lang.Object
org.springframework.batch.core.configuration.support.MapJobRegistry
- All Implemented Interfaces:
JobLocator,JobRegistry,ListableJobLocator
Simple, thread-safe, map-based implementation of
JobRegistry.- Author:
- Dave Syer, Robert Fischer, Mahmoud Ben Hassine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLocates aJobat runtime.Provides an unmodifiable view of the job names.voidregister(JobFactory jobFactory) Registers aJobat runtime.voidunregister(String name) Unregisters a previously registeredJob.
-
Constructor Details
-
MapJobRegistry
public MapJobRegistry()
-
-
Method Details
-
register
Description copied from interface:JobRegistryRegisters aJobat runtime.- Specified by:
registerin interfaceJobRegistry- Parameters:
jobFactory- theJobto be registered- Throws:
DuplicateJobException- if a factory with the same job name has already been registered.
-
unregister
Description copied from interface:JobRegistryUnregisters a previously registeredJob. If it was not previously registered, there is no error.- Specified by:
unregisterin interfaceJobRegistry- Parameters:
name- theJobto unregister.
-
getJob
Description copied from interface:JobLocatorLocates aJobat runtime.- Specified by:
getJobin interfaceJobLocator- Parameters:
name- the name of theJobwhich should be unique- Returns:
- a
Jobidentified by the given name - Throws:
NoSuchJobException- if the required configuration can not be found.
-
getJobNames
Provides an unmodifiable view of the job names.- Specified by:
getJobNamesin interfaceListableJobLocator- Returns:
- a collection of String. Empty if none are registered.
-