651916512.cache 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <xsd:schema xmlns="http://www.springframework.org/schema/task"
  3. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  4. xmlns:tool="http://www.springframework.org/schema/tool"
  5. targetNamespace="http://www.springframework.org/schema/task"
  6. elementFormDefault="qualified"
  7. attributeFormDefault="unqualified">
  8. <xsd:annotation>
  9. <xsd:documentation><![CDATA[
  10. Defines the elements used in the Spring Framework's support for task execution and scheduling.
  11. ]]></xsd:documentation>
  12. </xsd:annotation>
  13. <xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"/>
  14. <xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-4.0.xsd"/>
  15. <xsd:element name="annotation-driven">
  16. <xsd:annotation>
  17. <xsd:documentation><![CDATA[
  18. Enables the detection of @Async and @Scheduled annotations on any Spring-managed
  19. object. If present, a proxy will be generated for executing the annotated methods
  20. asynchronously.
  21. See Javadoc for the org.springframework.scheduling.annotation.EnableAsync and
  22. org.springframework.scheduling.annotation.EnableScheduling annotations for information
  23. on code-based alternatives to this XML element.
  24. ]]></xsd:documentation>
  25. </xsd:annotation>
  26. <xsd:complexType>
  27. <xsd:attribute name="executor" type="xsd:string" use="optional">
  28. <xsd:annotation>
  29. <xsd:documentation><![CDATA[
  30. Specifies the java.util.Executor instance to use when invoking asynchronous methods.
  31. If not provided, an instance of org.springframework.core.task.SimpleAsyncTaskExecutor
  32. will be used by default.
  33. Note that as of Spring 3.1.2, individual @Async methods may qualify which executor to
  34. use, meaning that the executor specified here acts as a default for all non-qualified
  35. @Async methods.
  36. ]]></xsd:documentation>
  37. </xsd:annotation>
  38. </xsd:attribute>
  39. <xsd:attribute name="scheduler" type="xsd:string" use="optional">
  40. <xsd:annotation>
  41. <xsd:documentation><![CDATA[
  42. Specifies the org.springframework.scheduling.TaskScheduler or
  43. java.util.ScheduledExecutorService instance to use when invoking scheduled
  44. methods. If no reference is provided, a TaskScheduler backed by a single
  45. thread scheduled executor will be used.
  46. ]]></xsd:documentation>
  47. </xsd:annotation>
  48. </xsd:attribute>
  49. <xsd:attribute name="mode" default="proxy">
  50. <xsd:annotation>
  51. <xsd:documentation><![CDATA[
  52. Should annotated beans be proxied using Spring's AOP framework,
  53. or should they rather be weaved with an AspectJ async execution aspect?
  54. AspectJ weaving requires spring-aspects.jar on the classpath,
  55. as well as load-time weaving (or compile-time weaving) enabled.
  56. Note: The weaving-based aspect requires the @Async annotation to be
  57. defined on the concrete class. Annotations in interfaces will not work
  58. in that case (they will rather only work with interface-based proxies)!
  59. ]]></xsd:documentation>
  60. </xsd:annotation>
  61. <xsd:simpleType>
  62. <xsd:restriction base="xsd:string">
  63. <xsd:enumeration value="proxy"/>
  64. <xsd:enumeration value="aspectj"/>
  65. </xsd:restriction>
  66. </xsd:simpleType>
  67. </xsd:attribute>
  68. <xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false">
  69. <xsd:annotation>
  70. <xsd:documentation><![CDATA[
  71. Are class-based (CGLIB) proxies to be created? By default, standard
  72. Java interface-based proxies are created.
  73. Note: Class-based proxies require the @Async annotation to be defined
  74. on the concrete class. Annotations in interfaces will not work in
  75. that case (they will rather only work with interface-based proxies)!
  76. ]]></xsd:documentation>
  77. </xsd:annotation>
  78. </xsd:attribute>
  79. </xsd:complexType>
  80. </xsd:element>
  81. <xsd:element name="scheduler">
  82. <xsd:annotation>
  83. <xsd:documentation><![CDATA[
  84. Defines a ThreadPoolTaskScheduler instance with configurable pool size. See Javadoc
  85. for the org.springframework.scheduling.annotation.EnableScheduling annotation for
  86. information on a code-based alternative to this XML element.
  87. ]]></xsd:documentation>
  88. </xsd:annotation>
  89. <xsd:complexType>
  90. <xsd:attribute name="id" type="xsd:string" use="required">
  91. <xsd:annotation>
  92. <xsd:documentation><![CDATA[
  93. The bean name for the generated ThreadPoolTaskScheduler instance.
  94. It will also be used as the default thread name prefix.
  95. ]]></xsd:documentation>
  96. </xsd:annotation>
  97. </xsd:attribute>
  98. <xsd:attribute name="pool-size" type="xsd:string" use="optional">
  99. <xsd:annotation>
  100. <xsd:documentation><![CDATA[
  101. The size of the ScheduledExecutorService's thread pool. The default is 1.
  102. ]]></xsd:documentation>
  103. </xsd:annotation>
  104. </xsd:attribute>
  105. </xsd:complexType>
  106. </xsd:element>
  107. <xsd:element name="executor">
  108. <xsd:annotation>
  109. <xsd:documentation><![CDATA[
  110. Defines a ThreadPoolTaskExecutor instance with configurable pool size,
  111. queue-capacity, keep-alive, and rejection-policy values.
  112. See Javadoc for the org.springframework.scheduling.annotation.EnableAsync annotation
  113. for information on code-based alternatives to this XML element.
  114. ]]></xsd:documentation>
  115. </xsd:annotation>
  116. <xsd:complexType>
  117. <xsd:attribute name="id" type="xsd:string" use="required">
  118. <xsd:annotation>
  119. <xsd:documentation><![CDATA[
  120. The bean name for the generated ThreadPoolTaskExecutor instance.
  121. This value will also be used as the thread name prefix which is why it is
  122. required even when defining the executor as an inner bean: The executor
  123. won't be directly accessible then but will nevertheless use the specified
  124. id as the thread name prefix of the threads that it manages.
  125. In the case of multiple task:executors, as of Spring 3.1.2 this value may be used to
  126. qualify which executor should handle a given @Async method, e.g. @Async("executorId").
  127. See the Javadoc for the #value attribute of Spring's @Async annotation for details.
  128. ]]></xsd:documentation>
  129. </xsd:annotation>
  130. </xsd:attribute>
  131. <xsd:attribute name="pool-size" type="xsd:string" use="optional">
  132. <xsd:annotation>
  133. <xsd:documentation><![CDATA[
  134. The size of the executor's thread pool as either a single value or a range
  135. (e.g. 5-10). If no bounded queue-capacity value is provided, then a max value
  136. has no effect unless the range is specified as 0-n. In that case, the core pool
  137. will have a size of n, but the 'allowCoreThreadTimeout' flag will be set to true.
  138. If a queue-capacity is provided, then the lower bound of a range will map to the
  139. core size and the upper bound will map to the max size. If this attribute is not
  140. provided, the default core size will be 1, and the default max size will be
  141. Integer.MAX_VALUE (i.e. unbounded).
  142. ]]></xsd:documentation>
  143. </xsd:annotation>
  144. </xsd:attribute>
  145. <xsd:attribute name="queue-capacity" type="xsd:string" use="optional">
  146. <xsd:annotation>
  147. <xsd:documentation><![CDATA[
  148. Queue capacity for the ThreadPoolTaskExecutor. If not specified, the default will
  149. be Integer.MAX_VALUE (i.e. unbounded).
  150. ]]></xsd:documentation>
  151. </xsd:annotation>
  152. </xsd:attribute>
  153. <xsd:attribute name="keep-alive" type="xsd:string" use="optional">
  154. <xsd:annotation>
  155. <xsd:documentation><![CDATA[
  156. Keep-alive time in seconds. Inactive threads that have been created beyond the
  157. core size will timeout after the specified number of seconds elapse. If the
  158. executor has an unbounded queue capacity and a size range represented as 0-n,
  159. then the core threads will also be configured to timeout when inactive.
  160. Otherwise, core threads will not ever timeout.
  161. ]]></xsd:documentation>
  162. </xsd:annotation>
  163. </xsd:attribute>
  164. <xsd:attribute name="rejection-policy" use="optional">
  165. <xsd:annotation>
  166. <xsd:documentation><![CDATA[
  167. The RejectedExecutionHandler type. When a bounded queue cannot accept any
  168. additional tasks, this determines the behavior. While the default is ABORT,
  169. consider using CALLER_RUNS to throttle inbound tasks. In other words, by forcing
  170. the caller to run the task itself, it will not be able to provide another task
  171. until after it completes the task at hand. In the meantime, one or more tasks
  172. may be removed from the queue. Alternatively, if it is not critical to run every
  173. task, consider using DISCARD to drop the current task or DISCARD_OLDEST to drop
  174. the task at the head of the queue.
  175. ]]></xsd:documentation>
  176. </xsd:annotation>
  177. <xsd:simpleType>
  178. <xsd:restriction base="xsd:string">
  179. <xsd:enumeration value="ABORT"/>
  180. <xsd:enumeration value="CALLER_RUNS"/>
  181. <xsd:enumeration value="DISCARD"/>
  182. <xsd:enumeration value="DISCARD_OLDEST"/>
  183. </xsd:restriction>
  184. </xsd:simpleType>
  185. </xsd:attribute>
  186. </xsd:complexType>
  187. </xsd:element>
  188. <xsd:element name="scheduled-tasks">
  189. <xsd:annotation>
  190. <xsd:documentation><![CDATA[
  191. Top-level element that contains one or more task sub-elements to be
  192. managed by a given TaskScheduler.
  193. ]]></xsd:documentation>
  194. </xsd:annotation>
  195. <xsd:complexType>
  196. <xsd:sequence>
  197. <xsd:element name="scheduled" type="scheduledTaskType" minOccurs="1" maxOccurs="unbounded"/>
  198. </xsd:sequence>
  199. <xsd:attribute name="scheduler" type="xsd:string" use="optional">
  200. <xsd:annotation>
  201. <xsd:documentation><![CDATA[
  202. Reference to an instance of TaskScheduler to manage the provided tasks. If not specified,
  203. the default value will be a wrapper for a single-threaded Executor.
  204. ]]></xsd:documentation>
  205. <xsd:appinfo>
  206. <tool:annotation kind="ref">
  207. <tool:expected-type type="org.springframework.scheduling.TaskScheduler"/>
  208. </tool:annotation>
  209. </xsd:appinfo>
  210. </xsd:annotation>
  211. </xsd:attribute>
  212. </xsd:complexType>
  213. </xsd:element>
  214. <xsd:complexType name="scheduledTaskType">
  215. <xsd:annotation>
  216. <xsd:documentation><![CDATA[
  217. Element defining a scheduled method-invoking task and its corresponding trigger.
  218. ]]></xsd:documentation>
  219. </xsd:annotation>
  220. <xsd:attribute name="cron" type="xsd:string" use="optional">
  221. <xsd:annotation>
  222. <xsd:documentation><![CDATA[
  223. A cron-based trigger. See the org.springframework.scheduling.support.CronSequenceGenerator
  224. JavaDoc for example patterns.
  225. ]]></xsd:documentation>
  226. </xsd:annotation>
  227. </xsd:attribute>
  228. <xsd:attribute name="fixed-delay" type="xsd:string" use="optional">
  229. <xsd:annotation>
  230. <xsd:documentation><![CDATA[
  231. An interval-based trigger where the interval is measured from the completion time of the
  232. previous task. The time unit value is measured in milliseconds.
  233. ]]></xsd:documentation>
  234. </xsd:annotation>
  235. </xsd:attribute>
  236. <xsd:attribute name="fixed-rate" type="xsd:string" use="optional">
  237. <xsd:annotation>
  238. <xsd:documentation><![CDATA[
  239. An interval-based trigger where the interval is measured from the start time of the
  240. previous task. The time unit value is measured in milliseconds.
  241. ]]></xsd:documentation>
  242. </xsd:annotation>
  243. </xsd:attribute>
  244. <xsd:attribute name="trigger" type="xsd:string" use="optional">
  245. <xsd:annotation>
  246. <xsd:documentation><![CDATA[
  247. A reference to a bean that implements the Trigger interface.
  248. ]]></xsd:documentation>
  249. </xsd:annotation>
  250. </xsd:attribute>
  251. <xsd:attribute name="initial-delay" type="xsd:string" use="optional">
  252. <xsd:annotation>
  253. <xsd:documentation><![CDATA[
  254. Number of milliseconds to delay before the first execution of a 'fixed-rate' or
  255. 'fixed-delay' task.
  256. ]]></xsd:documentation>
  257. </xsd:annotation>
  258. </xsd:attribute>
  259. <xsd:attribute name="ref" type="xsd:string" use="required">
  260. <xsd:annotation>
  261. <xsd:documentation><![CDATA[
  262. Reference to an object that provides a method to be invoked.
  263. ]]></xsd:documentation>
  264. <xsd:appinfo>
  265. <tool:annotation kind="ref" />
  266. </xsd:appinfo>
  267. </xsd:annotation>
  268. </xsd:attribute>
  269. <xsd:attribute name="method" type="xsd:string" use="required">
  270. <xsd:annotation>
  271. <xsd:documentation><![CDATA[
  272. The name of the method to be invoked.
  273. ]]></xsd:documentation>
  274. <xsd:appinfo>
  275. <tool:annotation>
  276. <tool:expected-method type-ref="@ref"/>
  277. </tool:annotation>
  278. </xsd:appinfo>
  279. </xsd:annotation>
  280. </xsd:attribute>
  281. </xsd:complexType>
  282. </xsd:schema>