Browse Source

The 'task' sub-element of the 'scheduled-tasks' element is now 'scheduled' to be consistent with the @Scheduled annotation (and to avoid task:task).

conversation
Mark Fisher 16 years ago
parent
commit
b2d73b9824
  1. 2
      org.springframework.context/src/main/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParser.java
  2. 6
      org.springframework.context/src/main/resources/org/springframework/scheduling/config/spring-task-3.0.xsd
  3. 8
      org.springframework.context/src/test/resources/org/springframework/scheduling/config/scheduledTasksContext.xml

2
org.springframework.context/src/main/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParser.java

@ -53,7 +53,7 @@ public class ScheduledTasksBeanDefinitionParser extends AbstractSingleBeanDefini @@ -53,7 +53,7 @@ public class ScheduledTasksBeanDefinitionParser extends AbstractSingleBeanDefini
NodeList childNodes = element.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node child = childNodes.item(i);
if (!(child instanceof Element) || !child.getLocalName().equals("task")) {
if (!(child instanceof Element) || !child.getLocalName().equals("scheduled")) {
continue;
}
Element taskElement = (Element) child;

6
org.springframework.context/src/main/resources/org/springframework/scheduling/config/spring-task-3.0.xsd

@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
</xsd:annotation>
<xsd:complexType>
<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:attribute name="scheduler" type="xsd:string" use="optional">
<xsd:annotation>
@ -173,10 +173,10 @@ @@ -173,10 +173,10 @@
</xsd:complexType>
</xsd:element>
<xsd:complexType name="taskType">
<xsd:complexType name="scheduledTaskType">
<xsd:annotation>
<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:annotation>
<xsd:attribute name="cron" type="xsd:string" use="optional">

8
org.springframework.context/src/test/resources/org/springframework/scheduling/config/scheduledTasksContext.xml

@ -8,10 +8,10 @@ @@ -8,10 +8,10 @@
http://www.springframework.org/schema/task/spring-task.xsd">
<task:scheduled-tasks scheduler="testScheduler">
<task:task ref="testBean" method="test" fixed-rate="1000"/>
<task:task ref="testBean" method="test" fixed-rate="2000"/>
<task:task 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" fixed-rate="1000"/>
<task:scheduled ref="testBean" method="test" fixed-rate="2000"/>
<task:scheduled ref="testBean" method="test" fixed-delay="3000"/>
<task:scheduled ref="testBean" method="test" cron="*/4 * 9-17 * * MON-FRI"/>
</task:scheduled-tasks>
<task:scheduler id="testScheduler"/>

Loading…
Cancel
Save