The 'task' sub-element of the 'scheduled-tasks' element is now 'scheduled' to be consistent with the @Scheduled annotation (and to avoid task:task).
This commit is contained in:
parent
9368e76ffc
commit
b2d73b9824
|
|
@ -53,7 +53,7 @@ public class ScheduledTasksBeanDefinitionParser extends AbstractSingleBeanDefini
|
||||||
NodeList childNodes = element.getChildNodes();
|
NodeList childNodes = element.getChildNodes();
|
||||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||||
Node child = childNodes.item(i);
|
Node child = childNodes.item(i);
|
||||||
if (!(child instanceof Element) || !child.getLocalName().equals("task")) {
|
if (!(child instanceof Element) || !child.getLocalName().equals("scheduled")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Element taskElement = (Element) child;
|
Element taskElement = (Element) child;
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="task" type="taskType" minOccurs="1" maxOccurs="unbounded"/>
|
<xsd:element name="scheduled" type="scheduledTaskType" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="scheduler" type="xsd:string" use="optional">
|
<xsd:attribute name="scheduler" type="xsd:string" use="optional">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
|
|
@ -173,10 +173,10 @@
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
|
|
||||||
<xsd:complexType name="taskType">
|
<xsd:complexType name="scheduledTaskType">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation><![CDATA[
|
<xsd:documentation><![CDATA[
|
||||||
Element defining a method-invoking task and its corresponding trigger.
|
Element defining a scheduled method-invoking task and its corresponding trigger.
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
<xsd:attribute name="cron" type="xsd:string" use="optional">
|
<xsd:attribute name="cron" type="xsd:string" use="optional">
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@
|
||||||
http://www.springframework.org/schema/task/spring-task.xsd">
|
http://www.springframework.org/schema/task/spring-task.xsd">
|
||||||
|
|
||||||
<task:scheduled-tasks scheduler="testScheduler">
|
<task:scheduled-tasks scheduler="testScheduler">
|
||||||
<task:task ref="testBean" method="test" fixed-rate="1000"/>
|
<task:scheduled ref="testBean" method="test" fixed-rate="1000"/>
|
||||||
<task:task ref="testBean" method="test" fixed-rate="2000"/>
|
<task:scheduled ref="testBean" method="test" fixed-rate="2000"/>
|
||||||
<task:task ref="testBean" method="test" fixed-delay="3000"/>
|
<task:scheduled ref="testBean" method="test" fixed-delay="3000"/>
|
||||||
<task:task ref="testBean" method="test" cron="*/4 * 9-17 * * MON-FRI"/>
|
<task:scheduled ref="testBean" method="test" cron="*/4 * 9-17 * * MON-FRI"/>
|
||||||
</task:scheduled-tasks>
|
</task:scheduled-tasks>
|
||||||
|
|
||||||
<task:scheduler id="testScheduler"/>
|
<task:scheduler id="testScheduler"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue