@@ -6152,7 +6152,7 @@ support for autowiring of `@Bean` methods:
6152
6152
@Qualifier("public") TestBean spouse,
6153
6153
@Value("#{privateInstance.age}") String country) {
6154
6154
TestBean tb = new TestBean("protectedInstance", 1);
6155
- tb.setSpouse(tb );
6155
+ tb.setSpouse(spouse );
6156
6156
tb.setCountry(country);
6157
6157
return tb;
6158
6158
}
@@ -44850,30 +44850,30 @@ classes that simplify the usage of Quartz within Spring-based applications.
44850
44850
44851
44851
44852
44852
[[scheduling-quartz-jobdetail]]
44853
- ==== Using the JobDetailBean
44854
- `JobDetail` objects contain all information needed to run a job. The Spring Framework
44855
- provides a `JobDetailBean` that makes the `JobDetail` more of an actual JavaBean with
44856
- sensible defaults. Let's have a look at an example:
44853
+ ==== Using the JobDetailFactoryBean
44854
+ Quartz `JobDetail` objects contain all information needed to run a job. Spring provides a
44855
+ `JobDetailFactoryBean` which provides bean-style properties for XML configuration purposes.
44856
+ Let's have a look at an example:
44857
44857
44858
44858
[source,xml,indent=0]
44859
44859
[subs="verbatim,quotes"]
44860
44860
----
44861
- <bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean ">
44862
- <property name="jobClass" value="example.ExampleJob" />
44861
+ <bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean ">
44862
+ <property name="jobClass" value="example.ExampleJob"/>
44863
44863
<property name="jobDataAsMap">
44864
44864
<map>
44865
- <entry key="timeout" value="5" />
44865
+ <entry key="timeout" value="5"/>
44866
44866
</map>
44867
44867
</property>
44868
44868
</bean>
44869
44869
----
44870
44870
44871
- The job detail bean has all information it needs to run the job ( `ExampleJob`). The
44872
- timeout is specified in the job data map. The job data map is available through the
44873
- `JobExecutionContext` (passed to you at execution time), but the `JobDetailBean ` also
44874
- maps the properties from the job data map to properties of the actual job. So in this
44875
- case, if the `ExampleJob` contains a property named `timeout`, the `JobDetailBean` will
44876
- automatically apply it:
44871
+ The job detail configuration has all information it needs to run the job (`ExampleJob`).
44872
+ The timeout is specified in the job data map. The job data map is available through the
44873
+ `JobExecutionContext` (passed to you at execution time), but the `JobDetail ` also gets
44874
+ its properties from the job data mapped to properties of the job instance . So in this
44875
+ case, if the `ExampleJob` contains a bean property named `timeout`, the `JobDetail`
44876
+ will have it applied automatically :
44877
44877
44878
44878
[source,java,indent=0]
44879
44879
[subs="verbatim,quotes"]
@@ -44886,7 +44886,7 @@ automatically apply it:
44886
44886
44887
44887
/**
44888
44888
* Setter called after the ExampleJob is instantiated
44889
- * with the value from the JobDetailBean (5)
44889
+ * with the value from the JobDetailFactoryBean (5)
44890
44890
*/
44891
44891
public void setTimeout(int timeout) {
44892
44892
this.timeout = timeout;
@@ -44899,13 +44899,13 @@ automatically apply it:
44899
44899
}
44900
44900
----
44901
44901
44902
- All additional settings from the job detail bean are of course available to you as well.
44902
+ All additional properties from the job data map are of course available to you as well.
44903
44903
44904
44904
[NOTE]
44905
44905
====
44906
44906
Using the `name` and `group` properties, you can modify the name and the group
44907
- of the job, respectively. By default, the name of the job matches the bean name of the
44908
- job detail bean (in the example above, this is `exampleJob`).
44907
+ of the job, respectively. By default, the name of the job matches the bean name
44908
+ of the `JobDetailFactoryBean` (in the example above, this is `exampleJob`).
44909
44909
====
44910
44910
44911
44911
@@ -44920,8 +44920,8 @@ Often you just need to invoke a method on a specific object. Using the
44920
44920
[subs="verbatim,quotes"]
44921
44921
----
44922
44922
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
44923
- <property name="targetObject" ref="exampleBusinessObject" />
44924
- <property name="targetMethod" value="doIt" />
44923
+ <property name="targetObject" ref="exampleBusinessObject"/>
44924
+ <property name="targetMethod" value="doIt"/>
44925
44925
</bean>
44926
44926
----
44927
44927
@@ -44963,9 +44963,9 @@ job will not start before the first one has finished. To make jobs resulting fro
44963
44963
[subs="verbatim,quotes"]
44964
44964
----
44965
44965
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
44966
- <property name="targetObject" ref="exampleBusinessObject" />
44967
- <property name="targetMethod" value="doIt" />
44968
- <property name="concurrent" value="false" />
44966
+ <property name="targetObject" ref="exampleBusinessObject"/>
44967
+ <property name="targetMethod" value="doIt"/>
44968
+ <property name="concurrent" value="false"/>
44969
44969
</bean>
44970
44970
----
44971
44971
@@ -44997,17 +44997,17 @@ Find below a couple of examples:
44997
44997
----
44998
44998
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
44999
44999
<!-- see the example of method invoking job above -->
45000
- <property name="jobDetail" ref="jobDetail" />
45000
+ <property name="jobDetail" ref="jobDetail"/>
45001
45001
<!-- 10 seconds -->
45002
- <property name="startDelay" value="10000" />
45002
+ <property name="startDelay" value="10000"/>
45003
45003
<!-- repeat every 50 seconds -->
45004
- <property name="repeatInterval" value="50000" />
45004
+ <property name="repeatInterval" value="50000"/>
45005
45005
</bean>
45006
45006
45007
45007
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
45008
- <property name="jobDetail" ref="exampleJob" />
45008
+ <property name="jobDetail" ref="exampleJob"/>
45009
45009
<!-- run every morning at 6 AM -->
45010
- <property name="cronExpression" value="0 0 6 * * ?" />
45010
+ <property name="cronExpression" value="0 0 6 * * ?"/>
45011
45011
</bean>
45012
45012
----
45013
45013
@@ -45021,8 +45021,8 @@ seconds and one every morning at 6 AM. To finalize everything, we need to set up
45021
45021
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
45022
45022
<property name="triggers">
45023
45023
<list>
45024
- <ref bean="cronTrigger" />
45025
- <ref bean="simpleTrigger" />
45024
+ <ref bean="cronTrigger"/>
45025
+ <ref bean="simpleTrigger"/>
45026
45026
</list>
45027
45027
</property>
45028
45028
</bean>
0 commit comments