public class MapBasedJobFactory extends Object implements JobFactory
| Constructor and Description |
|---|
MapBasedJobFactory(Map<String,? extends Class<?>> jobTypes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJobType(String jobName,
Class<?> jobType)
Allow the given job type to be executed.
|
protected void |
checkJobType(String jobName,
Class<?> jobType)
Determine if a job name and job type are valid.
|
protected void |
checkJobTypes(Map<String,? extends Class<?>> jobTypes)
Verify the given job types are all valid.
|
Map<String,Class<?>> |
getJobTypes()
The allowed job names and types that this JobExecutor will execute.
|
Object |
materializeJob(Job job)
Materializes a job.
|
void |
removeJobName(String jobName)
Disallow the job name from being executed.
|
void |
removeJobType(Class<?> jobType)
Disallow the job type from being executed.
|
void |
setJobTypes(Map<String,? extends Class<?>> jobTypes)
Clear any current allowed job types and use the given set.
|
public Object materializeJob(Job job) throws Exception
materializeJob in interface JobFactoryjob - the job to materializeException - if there was an exception creating the objectpublic Map<String,Class<?>> getJobTypes()
public void addJobType(String jobName, Class<?> jobType)
jobName - the job name as seenjobType - the job type to allowpublic void removeJobType(Class<?> jobType)
jobType - the job type to disallowpublic void removeJobName(String jobName)
jobName - the job name to disallowpublic void setJobTypes(Map<String,? extends Class<?>> jobTypes)
jobTypes - the job types to allowprotected void checkJobTypes(Map<String,? extends Class<?>> jobTypes)
jobTypes - the given job typesIllegalArgumentException - if any of the job types are invalidcheckJobType(String, Class)protected void checkJobType(String jobName, Class<?> jobType)
jobName - the name of the jobjobType - the class of the jobIllegalArgumentException - if the name or type are invalidCopyright © 2011-2015. All Rights Reserved.