jboss-as-threads_1_0.xsd 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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.0"
  25. xmlns="urn:jboss:domain:threads:1.0"
  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="queueless-thread-pool" type="queueless-thread-pool"/>
  44. <xs:element name="scheduled-thread-pool" type="scheduled-thread-pool"/>
  45. </xs:choice>
  46. </xs:complexType>
  47. <xs:complexType name="thread-factory">
  48. <xs:annotation>
  49. <xs:documentation>
  50. <![CDATA[
  51. A thread factory (implementing java.util.concurrent.ThreadFactory). The "name" attribute is
  52. the bean name of the created thread factory. The optional "priority" attribute may be used to specify
  53. the thread priority of created threads. The optional "group-name" attribute specifies the name of a the
  54. thread group to create for this thread factory.
  55. The "thread-name-pattern" is the template used to create names for threads. The following patterns
  56. may be used:
  57. %% - emit a percent sign
  58. %t - emit the per-factory thread sequence number
  59. %g - emit the global thread sequence number
  60. %f - emit the factory sequence number
  61. %i - emit the thread ID
  62. %G - emit the thread group name
  63. ]]>
  64. </xs:documentation>
  65. </xs:annotation>
  66. <xs:all>
  67. <xs:element name="properties" type="properties" minOccurs="0"/>
  68. </xs:all>
  69. <xs:attribute name="name" type="xs:string" use="required"/>
  70. <xs:attribute name="group-name" type="xs:string" use="optional"/>
  71. <xs:attribute name="thread-name-pattern" type="xs:string" use="optional"/>
  72. <xs:attribute name="priority" type="priority" use="optional"/>
  73. </xs:complexType>
  74. <xs:complexType name="unbounded-queue-thread-pool">
  75. <xs:annotation>
  76. <xs:documentation>
  77. <![CDATA[
  78. A thread pool executor with an unbounded queue. Such a thread pool has a core size and a queue with no
  79. upper bound. When a task is submitted, if the number of running threads is less than the core size,
  80. a new thread is created. Otherwise, the task is placed in queue. If too many tasks are allowed to be
  81. submitted to this type of executor, an out of memory condition may occur.
  82. The "name" attribute is the bean name of the created executor.
  83. The nested "max-threads" element must be used to specify the thread pool size. The nested
  84. "keepalive-time" element may used to specify the amount of time that pool threads should
  85. be kept running when idle; if not specified, threads will run until the executor is shut down.
  86. The "thread-factory" element specifies the bean name of a specific thread factory to use to create worker
  87. threads.
  88. ]]>
  89. </xs:documentation>
  90. </xs:annotation>
  91. <xs:all>
  92. <xs:element name="max-threads" type="scaled-count"/>
  93. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  94. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  95. <xs:element name="properties" type="properties" minOccurs="0"/>
  96. </xs:all>
  97. <xs:attribute name="name" use="required" type="xs:string"/>
  98. </xs:complexType>
  99. <xs:complexType name="bounded-queue-thread-pool">
  100. <xs:annotation>
  101. <xs:documentation>
  102. <![CDATA[
  103. A thread pool executor with a bounded queue. Such a thread pool has a core and maximum size and a
  104. specified queue length. When a task is submitted, if the number of running threads is less than the
  105. core size, a new thread is created. Otherwise, if there is room in the queue, the task is enqueued.
  106. Otherwise, if the number of running threads is less than the maximum size, a new thread is created.
  107. Otherwise, if blocking is enabled, the caller blocks until room becomes available in the queue.
  108. Otherwise, the task is handed off to the designated handoff executor, if one is specified. Otherwise,
  109. the task is rejected.
  110. The "name" attribute is the bean name of the created executor. The "allow-core-timeout" attribute
  111. specifies whether core threads may time out; if false, only threads above the core size will time out.
  112. The "blocking" attribute specifies whether the submitter thread will block if no space is available in
  113. this executor.
  114. The optional "core-threads" element may be used to specify the core thread pool size which is smaller
  115. than the maximum pool size. The required "max-threads" element specifies the maximum thread pool size.
  116. The required "queue-length" element specifies the queue length. The nested "keepalive-time" element may
  117. used to specify the amount of time that threads beyond the core pool size should be kept running when idle.
  118. The optional "thread-factory" element specifies the bean name of a specific thread factory to use to
  119. create worker threads. The optional "handoff-executor" element specifies an executor to delegate tasks
  120. to in the event that a task cannot be accepted.
  121. ]]>
  122. </xs:documentation>
  123. </xs:annotation>
  124. <xs:all>
  125. <xs:element name="core-threads" type="scaled-count" minOccurs="0"/>
  126. <xs:element name="queue-length" type="scaled-count"/>
  127. <xs:element name="max-threads" type="scaled-count"/>
  128. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  129. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  130. <xs:element name="handoff-executor" type="ref" minOccurs="0"/>
  131. <xs:element name="properties" type="properties" minOccurs="0"/>
  132. </xs:all>
  133. <xs:attribute name="name" use="required" type="xs:string"/>
  134. <xs:attribute name="allow-core-timeout" use="optional" type="xs:boolean" default="false"/>
  135. <xs:attribute name="blocking" use="optional" type="xs:boolean" default="false"/>
  136. </xs:complexType>
  137. <xs:complexType name="queueless-thread-pool">
  138. <xs:annotation>
  139. <xs:documentation>
  140. <![CDATA[
  141. A thread pool executor with no queue. When a task is submitted, if the number of running threads is
  142. less than the maximum size, a new thread is created. Otherwise, if blocking is enabled, the caller
  143. blocks until another thread completes its task and accepts the new one. Otherwise, the task is handed
  144. off to the designated handoff executor, if one is specified. Otherwise, the task is rejected.
  145. The "name" attribute is the bean name of the created executor. The "blocking" attribute specifies
  146. whether the submitter thread will block if no space is available in this executor.
  147. The "max-threads" element specifies the number of threads to use for this executor before
  148. tasks cannot be accepted anymore. The optional "keepalive-time" is used to specify the amount of time
  149. that threads should be kept running when idle; by default threads run indefinitely. The optional
  150. "thread-factory" element specifies the bean name of a specific thread factory to use to create worker
  151. threads. The optional "handoff-executor" element specifies an executor to delegate tasks to in the
  152. event that a task cannot be accepted.
  153. ]]>
  154. </xs:documentation>
  155. </xs:annotation>
  156. <xs:all>
  157. <xs:element name="max-threads" type="scaled-count"/>
  158. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  159. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  160. <xs:element name="handoff-executor" type="ref" minOccurs="0"/>
  161. <xs:element name="properties" type="properties" minOccurs="0"/>
  162. </xs:all>
  163. <xs:attribute name="name" use="required" type="xs:string"/>
  164. <xs:attribute name="blocking" use="optional" type="xs:boolean" default="false"/>
  165. </xs:complexType>
  166. <xs:complexType name="scheduled-thread-pool">
  167. <xs:annotation>
  168. <xs:documentation>
  169. <![CDATA[
  170. A scheduled thread pool executor. The "name" attribute is the bean name of the created executor. The
  171. "thread-factory" attribute specifies the bean name of the thread factory to use to create worker
  172. threads. The nested "max-threads" element may be used to specify the thread pool size. The nested
  173. "keepalive-time" element is used to specify the amount of time that threads should be kept running when idle.
  174. ]]>
  175. </xs:documentation>
  176. </xs:annotation>
  177. <xs:all>
  178. <xs:element name="max-threads" type="scaled-count"/>
  179. <xs:element name="keepalive-time" type="time" minOccurs="0"/>
  180. <xs:element name="thread-factory" type="ref" minOccurs="0"/>
  181. <xs:element name="properties" type="properties" minOccurs="0"/>
  182. </xs:all>
  183. <xs:attribute name="name" use="required" type="xs:string"/>
  184. </xs:complexType>
  185. <xs:simpleType name="priority">
  186. <xs:annotation>
  187. <xs:documentation>
  188. <![CDATA[
  189. 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.
  190. ]]>
  191. </xs:documentation>
  192. </xs:annotation>
  193. <xs:restriction base="xs:integer">
  194. <xs:minInclusive value="1"/>
  195. <xs:maxInclusive value="10"/>
  196. </xs:restriction>
  197. </xs:simpleType>
  198. <xs:complexType name="properties">
  199. <xs:annotation>
  200. <xs:documentation>
  201. <![CDATA[
  202. A set of free-form properties.
  203. ]]>
  204. </xs:documentation>
  205. </xs:annotation>
  206. <xs:choice minOccurs="0" maxOccurs="unbounded">
  207. <xs:element name="property" type="property"/>
  208. </xs:choice>
  209. </xs:complexType>
  210. <xs:complexType name="property">
  211. <xs:annotation>
  212. <xs:documentation>
  213. <![CDATA[
  214. A free-form property. The name is required; the value is optional.
  215. ]]>
  216. </xs:documentation>
  217. </xs:annotation>
  218. <xs:attribute name="name" type="xs:string" use="required"/>
  219. <xs:attribute name="value" type="xs:string" use="optional"/>
  220. </xs:complexType>
  221. <xs:complexType name="ref">
  222. <xs:annotation>
  223. <xs:documentation>
  224. <![CDATA[
  225. A reference to another named service.
  226. ]]>
  227. </xs:documentation>
  228. </xs:annotation>
  229. <xs:attribute name="name" type="xs:string" use="required"/>
  230. </xs:complexType>
  231. <xs:complexType name="scaled-count">
  232. <xs:annotation>
  233. <xs:documentation>
  234. <![CDATA[
  235. A scaled size designation. The "count" attribute specifies a flat quantity. The
  236. "per-cpu" attribute specifies a quantity per available CPU, as determined by
  237. java.lang.Runtime#availableProcessors(). The numbers are added together and rounded off
  238. to an integer value.
  239. ]]>
  240. </xs:documentation>
  241. </xs:annotation>
  242. <xs:attribute name="count" type="xs:float" use="optional"/>
  243. <xs:attribute name="per-cpu" type="xs:float" use="optional"/>
  244. </xs:complexType>
  245. <xs:complexType name="time">
  246. <xs:annotation>
  247. <xs:documentation>
  248. An amount of time. Comprised of a time value and a unit value.
  249. </xs:documentation>
  250. </xs:annotation>
  251. <xs:attribute name="time" type="xs:long" use="required"/>
  252. <xs:attribute name="unit" type="time-unit-name" use="required"/>
  253. </xs:complexType>
  254. <xs:simpleType name="time-unit-name">
  255. <xs:annotation>
  256. <xs:documentation>
  257. The name of a unit of time.
  258. </xs:documentation>
  259. </xs:annotation>
  260. <xs:restriction base="xs:token">
  261. <xs:enumeration value="seconds"/>
  262. <xs:enumeration value="minutes"/>
  263. <xs:enumeration value="milliseconds"/>
  264. <xs:enumeration value="nanoseconds"/>
  265. <xs:enumeration value="hours"/>
  266. <xs:enumeration value="days"/>
  267. </xs:restriction>
  268. </xs:simpleType>
  269. </xs:schema>