Class JobRegistryBackgroundJobRunner
java.lang.Object
org.springframework.batch.core.launch.support.JobRegistryBackgroundJobRunner
@Deprecated(since="5.0",
forRemoval=true)
public class JobRegistryBackgroundJobRunner
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
since 5.0 with no replacement. Scheduled for removal in 5.2.
Command line launcher for registering jobs with a JobRegistry
. Normally this
will be used in conjunction with an external trigger for the jobs registered, e.g. a
JMX MBean wrapper for a JobLauncher
, or a Quartz trigger.
With any launch of a batch job within Spring Batch, a Spring context containing the
Job
has to be created. Using this launcher, the jobs are all registered with a
JobRegistry
defined in a parent application context. The jobs are then set up
in child contexts. All dependencies of the runner will then be satisfied by autowiring
by type from the parent application context. Default values are provided for all fields
except the JobRegistry
. Therefore, if autowiring fails to set it then an
exception will be thrown.
- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated, for removal: This API element is subject to removal in a future version.System property key that switches the runner to "embedded" mode (returning immediately from the main method).static boolean
Deprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorDescriptionJobRegistryBackgroundJobRunner
(String parentContextPath) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Public getter for the startup errors encountered during parent context creation.static void
Deprecated, for removal: This API element is subject to removal in a future version.Supply a list of application context locations, starting with the parent context, and followed by the children.void
setJobLoader
(JobLoader jobLoader) Deprecated, for removal: This API element is subject to removal in a future version.A loader for the jobs that are going to be registered.void
setJobRegistry
(JobRegistry jobRegistry) Deprecated, for removal: This API element is subject to removal in a future version.A job registry that can be used to create a job loader (if none is provided).static void
stop()
Deprecated, for removal: This API element is subject to removal in a future version.If embedded in a JVM, call this method to terminate the main method.
-
Field Details
-
EMBEDDED
Deprecated, for removal: This API element is subject to removal in a future version.System property key that switches the runner to "embedded" mode (returning immediately from the main method). Useful for testing purposes. -
testing
public static boolean testingDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
JobRegistryBackgroundJobRunner
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
parentContextPath
- the parentContextPath to be used by the JobRegistryBackgroundJobRunner.
-
-
Method Details
-
setJobLoader
Deprecated, for removal: This API element is subject to removal in a future version.A loader for the jobs that are going to be registered.- Parameters:
jobLoader
- theJobLoader
to set
-
setJobRegistry
Deprecated, for removal: This API element is subject to removal in a future version.A job registry that can be used to create a job loader (if none is provided).- Parameters:
jobRegistry
- theJobRegistry
to set
-
getErrors
Deprecated, for removal: This API element is subject to removal in a future version.Public getter for the startup errors encountered during parent context creation.- Returns:
- the errors
-
main
Deprecated, for removal: This API element is subject to removal in a future version.Supply a list of application context locations, starting with the parent context, and followed by the children. The parent must contain aJobRegistry
and the child contexts are expected to containJob
definitions, each of which will be registered wit the registry. Example usage:$ java -classpath ... JobRegistryBackgroundJobRunner job-registry-context.xml job1.xml job2.xml ...
The child contexts are created only when needed though theJobFactory
interface (but the XML is validated on startup by using it to create aBeanFactory
which is then discarded). The parent context is created in a separate thread, and the program will pause for input in an infinite loop until the user hits any key.- Parameters:
args
- the context locations to use (first one is for parent)- Throws:
Exception
- if anything goes wrong with the context creation
-
stop
public static void stop()Deprecated, for removal: This API element is subject to removal in a future version.If embedded in a JVM, call this method to terminate the main method.
-