jboss-as-threads_1_1.xsd 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ JBoss, Home of Professional Open Source.
  4. ~ Copyright 2011, Red Hat, Inc., and individual contributors
  5. ~ as indicated by the @author tags. See the copyright.txt file in the
  6. ~ distribution for a full listing of individual contributors.
  7. ~
  8. ~ This is free software; you can redistribute it and/or modify it
  9. ~ under the terms of the GNU Lesser General Public License as
  10. ~ published by the Free Software Foundation; either version 2.1 of
  11. ~ the License, or (at your option) any later version.
  12. ~
  13. ~ This software is distributed in the hope that it will be useful,
  14. ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. ~ Lesser General Public License for more details.
  17. ~
  18. ~ You should have received a copy of the GNU Lesser General Public
  19. ~ License along with this software; if not, write to the Free
  20. ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  22. -->
  23. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  24. targetNamespace="urn:jboss:domain:threads:1.1"
  25. xmlns="urn:jboss:domain:threads:1.1"
  26. elementFormDefault="qualified"
  27. attributeFormDefault="unqualified"
  28. version="1.0">
  29. <!-- The threads subsystem root element -->
  30. <xs:element name="subsystem" type="subsystem"/>
  31. <xs:complexType name="subsystem">
  32. <xs:annotation>
  33. <xs:documentation>
  34. <![CDATA[
  35. The threading subsystem, used to declare manageable thread pools and resources.
  36. ]]>
  37. </xs:documentation>
  38. </xs:annotation>
  39. <xs:choice minOccurs="0" maxOccurs="unbounded">
  40. <xs:element name="thread-factory" type="thread-factory"/>
  41. <xs:element name="unbounded-queue-thread-pool" type="unbounded-queue-thread-pool"/>
  42. <xs:element name="bounded-queue-thread-pool" type="bounded-queue-thread-pool"/>
  43. <xs:element name="blocking-bounded-queue-thread-pool" type="blocking-bounded-queue-thread-pool"/>
  44. <xs:element name="queueless-thread-pool" type="queueless-thread-pool"/>
  45. <xs:element name="blocking-queueless-thread-pool" type="blocking-queueless-thread-pool"/>
  46. <xs:element name="scheduled-thread-pool" type="scheduled-thread-pool"/>
  47. </xs:choice>
  48. </xs:complexType>
  49. <xs:complexType name="thread-factory">
  50. <xs:annotation>
  51. <xs:documentation>
  52. <![CDATA[
  53. A thread factory (implementing java.util.concurrent.ThreadFactory). The "name" attribute is
  54. the bean name of the created thread factory. The optional "priority" attribute may be used to specify
  55. the thread priority of created threads. The optional "group-name" attribute specifies the name of a the
  56. thread group to create for this thread factory.
  57. The "thread-name-pattern" is the template used to create names for threads. The following patterns
  58. may be used:
  59. %% - emit a percent sign
  60. %t - emit the per-factory thread sequence number
  61. %g - emit the global thread sequence number
  62. %f - emit the factory sequence number
  63. %i - emit the thread ID
  64. %G - emit the thread group name
  65. ]]>
  66. </xs:documentation>
  67. </xs:annotation>
  68. <xs:attribute name="name" type="xs:string" use="required"/>
  69. <xs:attribute name="group-name" type="xs:string" use="optional"/>
  70. <xs:attribute name="thread-name-pattern" type="xs:string" use="optional"/>
  71. <xs:attribute name="priority" type="priority" use="optional"/>
  72. </xs:complexType>
  73. <xs:complexType name="unbounded-queue-thread-pool">
  74. <xs:annotation>
  75. <xs:documentation>
  76. <![CDATA[
  77. A thread pool executor with an unbounded queue. Such a thread pool has a core size and a queue with no
  78. upper bound. When a task is submitted, if the number of running threads is less than the core size,
  79. a new thread is created. Otherwise, the task is placed in queue. If too many tasks are allowed to be
  80. submitted to this type of executor, an out of memory condition may occur.
  81. The "name" attribute is the bean name of the created executor.
  82. The "max-threads" attribute must be used to specify the thread pool size. The nested
  83. "keepalive-time" element may used to specify the amount of time that pool threads should
  84. be kept running when idle; if not specified, threads will run until the executor is shut down.
  85. The "thread-factory" element specifies the bean name of a specific thread factory to use to create worker
  86. threads.
  87. ]]>
  88. </xs:documentation>
  89. </xs:annotation>
  90. <xs:all>
  91. <xs:element name="max-threads" type="countType"/>
  92. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  93. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  94. </xs:all>
  95. <xs:attribute name="name" use="required" type="xs:string"/>
  96. </xs:complexType>
  97. <xs:complexType name="bounded-queue-thread-pool">
  98. <xs:annotation>
  99. <xs:documentation>
  100. <![CDATA[
  101. A thread pool executor with a bounded queue, where threads attempting to submit tasks will not block.
  102. Such a thread pool has a core and maximum size and a specified queue length. When a task is submitted,
  103. if the number of running threads is less than the core size, a new thread is created. Otherwise, if
  104. there is room in the queue, the task is enqueued. Otherwise, if the number of running threads is less
  105. than the maximum size, a new thread is created. Otherwise, the task is handed off to the designated
  106. handoff executor, if one is specified. Otherwise, the task is discarded.
  107. The "name" attribute is the bean name of the created executor. The "allow-core-timeout" attribute
  108. specifies whether core threads may time out; if false, only threads above the core size will time out.
  109. The optional "core-threads" element may be used to specify the core thread pool size which is smaller
  110. than the maximum pool size. The required "max-threads" element specifies the maximum thread pool size.
  111. The required "queue-length" element specifies the queue length. The optional "keepalive-time" element may
  112. used to specify the amount of time that threads beyond the core pool size should be kept running when idle.
  113. The optional "thread-factory" element specifies the bean name of a specific thread factory to use to
  114. create worker threads. The optional "handoff-executor" element specifies an executor to delegate tasks
  115. to in the event that a task cannot be accepted.
  116. ]]>
  117. </xs:documentation>
  118. </xs:annotation>
  119. <xs:all>
  120. <xs:element name="core-threads" type="countType" minOccurs="0"/>
  121. <xs:element name="queue-length" type="countType"/>
  122. <xs:element name="max-threads" type="countType"/>
  123. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  124. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  125. <xs:element name="handoff-executor" type="ref" minOccurs="0"/>
  126. </xs:all>
  127. <xs:attribute name="name" use="required" type="xs:string"/>
  128. <xs:attribute name="allow-core-timeout" use="optional" type="xs:boolean" default="false"/>
  129. <xs:attribute name="blocking" use="optional" type="xs:boolean" default="false"/>
  130. </xs:complexType>
  131. <xs:complexType name="blocking-bounded-queue-thread-pool">
  132. <xs:annotation>
  133. <xs:documentation>
  134. <![CDATA[
  135. A thread pool executor with a bounded queue, where threads attempting to submit tasks may block.
  136. Such a thread pool has a core and maximum size and a specified queue length. When a task is submitted,
  137. if the number of running threads is less than the core size, a new thread is created. Otherwise, if
  138. there is room in the queue, the task is enqueued. Otherwise, if the number of running threads is less
  139. than the maximum size, a new thread is created.Otherwise, the caller blocks until room becomes available
  140. in the queue.
  141. The "name" attribute is the bean name of the created executor. The "allow-core-timeout" attribute
  142. specifies whether core threads may time out; if false, only threads above the core size will time out.
  143. The optional "core-threads" element may be used to specify the core thread pool size which is smaller
  144. than the maximum pool size. The required "max-threads" element specifies the maximum thread pool size.
  145. The required "queue-length" element specifies the queue length. The optional "keepalive-time" element may
  146. used to specify the amount of time that threads beyond the core pool size should be kept running when idle.
  147. The optional "thread-factory" element specifies the bean name of a specific thread factory to use to
  148. create worker threads.
  149. ]]>
  150. </xs:documentation>
  151. </xs:annotation>
  152. <xs:all>
  153. <xs:element name="core-threads" type="countType" minOccurs="0"/>
  154. <xs:element name="queue-length" type="countType"/>
  155. <xs:element name="max-threads" type="countType"/>
  156. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  157. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  158. </xs:all>
  159. <xs:attribute name="name" use="required" type="xs:string"/>
  160. <xs:attribute name="allow-core-timeout" use="optional" type="xs:boolean" default="false"/>
  161. </xs:complexType>
  162. <xs:complexType name="queueless-thread-pool">
  163. <xs:annotation>
  164. <xs:documentation>
  165. <![CDATA[
  166. A thread pool executor with no queue, where threads attempting to submit tasks will not block.
  167. When a task is submitted, if the number of running threads is less than the maximum size, a new thread
  168. is created. Otherwise, the task is handed off to the designated handoff executor, if one is specified.
  169. Otherwise, the task is discarded.
  170. The "name" attribute is the bean name of the created executor.
  171. The "max-threads" attribute specifies the number of threads to use for this executor before
  172. tasks cannot be accepted anymore. The optional "keepalive-time" is used to specify the amount of time
  173. that threads should be kept running when idle; by default threads run indefinitely. The optional
  174. "thread-factory" element specifies the bean name of a specific thread factory to use to create worker
  175. threads. The optional "handoff-executor" element specifies an executor to delegate tasks to in the
  176. event that a task cannot be accepted.
  177. ]]>
  178. </xs:documentation>
  179. </xs:annotation>
  180. <xs:all>
  181. <xs:element name="max-threads" type="countType"/>
  182. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  183. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  184. <xs:element name="handoff-executor" type="ref" minOccurs="0"/>
  185. </xs:all>
  186. <xs:attribute name="name" use="required" type="xs:string"/>
  187. </xs:complexType>
  188. <xs:complexType name="blocking-queueless-thread-pool">
  189. <xs:annotation>
  190. <xs:documentation>
  191. <![CDATA[
  192. A thread pool executor with no queue, where threads attempting to submit tasks may block.
  193. When a task is submitted, if the number of running threads is less than the maximum size, a new thread
  194. is created. Otherwise, the caller blocks until another thread completes its task and accepts the new one.
  195. The "name" attribute is the bean name of the created executor.
  196. The "max-threads" attribute specifies the number of threads to use for this executor before
  197. tasks cannot be accepted anymore. The optional "keepalive-time" is used to specify the amount of time
  198. that threads should be kept running when idle; by default threads run indefinitely. The optional
  199. "thread-factory" element specifies the bean name of a specific thread factory to use to create worker
  200. threads.
  201. ]]>
  202. </xs:documentation>
  203. </xs:annotation>
  204. <xs:all>
  205. <xs:element name="max-threads" type="countType"/>
  206. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  207. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  208. </xs:all>
  209. <xs:attribute name="name" use="required" type="xs:string"/>
  210. </xs:complexType>
  211. <xs:complexType name="scheduled-thread-pool">
  212. <xs:annotation>
  213. <xs:documentation>
  214. <![CDATA[
  215. A scheduled thread pool executor. The "name" attribute is the bean name of the created executor. The
  216. "thread-factory" attribute specifies the bean name of the thread factory to use to create worker
  217. threads. The nested "max-threads" attribute may be used to specify the thread pool size. The nested
  218. "keepalive-time" element is used to specify the amount of time that threads should be kept running when idle.
  219. ]]>
  220. </xs:documentation>
  221. </xs:annotation>
  222. <xs:all>
  223. <xs:element name="max-threads" type="countType"/>
  224. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  225. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  226. </xs:all>
  227. <xs:attribute name="name" use="required" type="xs:string"/>
  228. </xs:complexType>
  229. <xs:simpleType name="priority">
  230. <xs:annotation>
  231. <xs:documentation>
  232. <![CDATA[
  233. A priority which can range from 1 to 10 (inclusive). See http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#setPriority(int) for more information.
  234. ]]>
  235. </xs:documentation>
  236. </xs:annotation>
  237. <xs:restriction base="xs:integer">
  238. <xs:minInclusive value="1"/>
  239. <xs:maxInclusive value="10"/>
  240. </xs:restriction>
  241. </xs:simpleType>
  242. <xs:complexType name="countType">
  243. <xs:annotation>
  244. <xs:documentation>
  245. <![CDATA[
  246. A size designation.
  247. ]]>
  248. </xs:documentation>
  249. </xs:annotation>
  250. <xs:attribute name="count" type="xs:int" use="required"/>
  251. </xs:complexType>
  252. <xs:complexType name="ref">
  253. <xs:annotation>
  254. <xs:documentation>
  255. <![CDATA[
  256. A reference to another named service.
  257. ]]>
  258. </xs:documentation>
  259. </xs:annotation>
  260. <xs:attribute name="name" type="xs:string" use="required"/>
  261. </xs:complexType>
  262. <xs:complexType name="time">
  263. <xs:annotation>
  264. <xs:documentation>
  265. An amount of time. Comprised of a time value and a unit value.
  266. </xs:documentation>
  267. </xs:annotation>
  268. <xs:attribute name="time" type="xs:long" use="required"/>
  269. <xs:attribute name="unit" type="time-unit-name" use="required"/>
  270. </xs:complexType>
  271. <xs:simpleType name="time-unit-name">
  272. <xs:annotation>
  273. <xs:documentation>
  274. The name of a unit of time.
  275. </xs:documentation>
  276. </xs:annotation>
  277. <xs:restriction base="xs:token">
  278. <xs:enumeration value="seconds"/>
  279. <xs:enumeration value="minutes"/>
  280. <xs:enumeration value="milliseconds"/>
  281. <xs:enumeration value="nanoseconds"/>
  282. <xs:enumeration value="hours"/>
  283. <xs:enumeration value="days"/>
  284. </xs:restriction>
  285. </xs:simpleType>
  286. </xs:schema>