Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.quartz.simpl
Class PropertySettingJobFactory

    java.lang.Object
      org.quartz.simpl.SimpleJobFactory
          org.quartz.simpl.PropertySettingJobFactory

All Implemented Interfaces:
  JobFactory

public class PropertySettingJobFactory
extends SimpleJobFactory

A JobFactory that instantiates the Job instance (using the default no-arg constructor, or more specifically: `class.newInstance()`), and then attempts to set all values in the `JobExecutionContext`'s `JobDataMap` onto bean properties of the `Job`.

Author:
  jhouse
See Also:
  `JobFactory`, `SimpleJobFactory`, `JobExecutionContext#getMergedJobDataMap()`, `setWarnIfPropertyNotFound(boolean)`, `setThrowIfPropertyNotFound(boolean)`

Constructor Summary
`PropertySettingJobFactory()`

Method Summary
`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.
`protected void` | `setBeanProps(Object obj, JobDataMap data)`
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PropertySettingJobFactory

    public PropertySettingJobFactory()

Method Detail

### newJob

    public Job newJob(TriggerFiredBundle bundle)
               throws SchedulerException

  Description copied from interface: `JobFactory`
  Called by the scheduler at the time of the trigger firing, in order to produce a `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.

  Specified by:
    `newJob` in interface `JobFactory`
  Overrides:
    `newJob` in class `SimpleJobFactory`
  Throws:
    `SchedulerException`

### setBeanProps

    protected void setBeanProps(Object obj,
                                JobDataMap data)
                         throws SchedulerException

  Throws:
    `SchedulerException`

### isThrowIfPropertyNotFound

    public 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.

  Returns:
    Returns the throwIfNotFound.

### setThrowIfPropertyNotFound

    public 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.

  Parameters:
    `throwIfNotFound` - defaults to `false`.

### isWarnIfPropertyNotFound

    public 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.

  Returns:
    Returns the warnIfNotFound.

### setWarnIfPropertyNotFound

    public 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.

  Parameters:
    `warnIfNotFound` - defaults to `true`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Quartz Enterprise Job Scheduler Project Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD