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
-
Method Summary
Modifier and TypeMethodDescriptionLocates aJob
at runtime.Provides an unmodifiable view of the job names.void
register
(JobFactory jobFactory) Registers aJob
at runtime.void
unregister
(String name) Unregisters a previously registeredJob
.
-
Constructor Details
-
MapJobRegistry
public MapJobRegistry()
-
-
Method Details
-
register
Description copied from interface:JobRegistry
Registers aJob
at runtime.- Specified by:
register
in interfaceJobRegistry
- Parameters:
jobFactory
- theJob
to be registered- Throws:
DuplicateJobException
- if a factory with the same job name has already been registered.
-
unregister
Description copied from interface:JobRegistry
Unregisters a previously registeredJob
. If it was not previously registered, there is no error.- Specified by:
unregister
in interfaceJobRegistry
- Parameters:
name
- theJob
to unregister.
-
getJob
Description copied from interface:JobLocator
Locates aJob
at runtime.- Specified by:
getJob
in interfaceJobLocator
- Parameters:
name
- the name of theJob
which should be unique- Returns:
- a
Job
identified 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:
getJobNames
in interfaceListableJobLocator
- Returns:
- a collection of String. Empty if none are registered.
-