public class PropertySettingJobFactory extends SimpleJobFactory
class.newInstance()
), and
then attempts to set all values in the JobExecutionContext
's
JobDataMap
onto bean properties of the Job
.Constructor and Description |
---|
PropertySettingJobFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
isThrowIfPropertyNotFound()
Whether the JobInstantiation should fail and throw and exception if
a key (name) and value (type) found in the JobDataMap does not
correspond to a proptery setter on the Job class.
|
boolean |
isWarnIfPropertyNotFound()
Whether a warning should be logged if
a key (name) and value (type) found in the JobDataMap does not
correspond to a proptery setter on the Job class.
|
Job |
newJob(TriggerFiredBundle bundle)
Called by the scheduler at the time of the trigger firing, in order to
produce a
Job instance on which to call execute. |
void |
setThrowIfPropertyNotFound(boolean throwIfNotFound)
Whether the JobInstantiation should fail and throw and exception if
a key (name) and value (type) found in the JobDataMap does not
correspond to a proptery setter on the Job class.
|
void |
setWarnIfPropertyNotFound(boolean warnIfNotFound)
Whether a warning should be logged if
a key (name) and value (type) found in the JobDataMap does not
correspond to a proptery setter on the Job class.
|
public Job newJob(TriggerFiredBundle bundle) throws SchedulerException
JobFactory
Job
instance on which to call execute.
It should be extremely rare for this method to throw an exception -
basically only the the case where there is no way at all to instantiate
and prepare the Job for execution. When the exception is thrown, the
Scheduler will move all triggers associated with the Job into the
Trigger.STATE_ERROR
state, which will require human
intervention (e.g. an application restart after fixing whatever
configuration problem led to the issue wih instantiating the Job.
newJob
in interface JobFactory
newJob
in class SimpleJobFactory
bundle
- The TriggerFiredBundle from which the JobDetail
and other info relating to the trigger firing can be obtained.SchedulerException
- if there is a problem instantiating the Job.public boolean isThrowIfPropertyNotFound()
public void setThrowIfPropertyNotFound(boolean throwIfNotFound)
throwIfNotFound
- defaults to false
.public boolean isWarnIfPropertyNotFound()
public void setWarnIfPropertyNotFound(boolean warnIfNotFound)
warnIfNotFound
- defaults to true
.