Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
            targetNamespace="urn:jboss:threads:1.0"
            xmlns="urn:jboss:threads:1.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            version="1.0">

    <xsd:element name="threads" type="threads"/>

    <xsd:complexType name="threads">
        <xsd:annotation>
            <xsd:documentation>
                The root threads deployment element.  Specify thread groups, thread factories, and executors within.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
            <xsd:choice>
                <xsd:element name="thread-group" type="thread-group"/>
                <xsd:element name="thread-factory" type="thread-factory"/>
                <xsd:element name="thread-pool-executor" type="thread-pool-executor"/>
                <xsd:element name="scheduled-thread-pool-executor" type="scheduled-thread-pool-executor"/>
                <xsd:element name="direct-executor" type="direct-executor"/>
                <xsd:element name="notating-executor" type="notating-executor"/>
            </xsd:choice>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="thread-group">
        <xsd:annotation>
            <xsd:documentation>
                A thread group that can be referenced by a bean name.  The "name" attribute is the
                bean name of the created thread group, used for injection.  The "group-name" attribute is
                the JDK name of the thread group.  The optional "daemon" attribute specifies whether
                threads should be forced to be daemon threads, or forced to be non-daemon threads (not
                specifying this attribute will cause the thread group to inherit the daemon status from
                its parent).  The optional "max-priority" attribute can be used to limit the priority of
                threads within the group.  The optional "parent" attribute specifies the parent thread
                group (by bean name).
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="group-name" type="xsd:string" use="required"/>
        <xsd:attribute name="daemon" type="xsd:boolean" use="optional"/>
        <xsd:attribute name="max-priority" type="priority" use="optional"/>
        <xsd:attribute name="parent" type="xsd:string" use="optional"/>
    </xsd:complexType>

    <xsd:complexType name="thread-factory">
        <xsd:annotation>
            <xsd:documentation>
                A thread factory (implementing java.util.concurrent.ThreadFactory).  The "name" attribute is
                the bean name of the created thread factory.  The "group" attribute specifies the thread group to
                be used for threads created by this factory.  The optional "daemon" attribute specifies whether
                threads created by this factory should be forced to be daemon threads, or forced to be non-daemon
                threads (not specifying this attribute will cause the thread group to inherit the daemon status from
                its group).  The optional "initial-priority" attribute may be used to specify the thread priority of
                created threads.

                One nested "exception-handler" tag may be used to specify an uncaught exception handler for the
                thread factory.  One or more "interrupt-handler" tags may be used to specify beans which need to be
                notified when a thread from this factory has been interrupted.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="exception-handler" type="exception-handler" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="interrupt-handler" type="interrupt-handler" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>

        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="group" type="xsd:string" use="required"/>
        <xsd:attribute name="daemon" type="xsd:boolean" use="optional"/>
        <xsd:attribute name="thread-name-pattern" type="xsd:string" use="optional"/>
        <xsd:attribute name="initial-priority" type="priority" use="optional"/>
    </xsd:complexType>

    <xsd:simpleType name="priority">
        <xsd:annotation>
            <xsd:documentation>
                A priority which can range from 1 to 10 (inclusive).  See <xhtml:a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#setPriority(int)">Thread.setPriority(int)</xhtml:a> for more information.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="10"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="thread-pool-executor">
        <xsd:annotation>
            <xsd:documentation>
                A thread pool executor.  The "name" attribute is the bean name of the created executor.  The
                "thread-factory" attribute specifies the bean name of the thread factory to use to create worker
                threads.  The nested "core-pool-size" element may be used to specify the core thread pool size.
                The nested "max-pool-size" element may be used to specify the maximum thread pool size.  The nested
                "keepalive-time" is used to specify the amount of time that threads beyond the core pool size should
                be kept running when idle.  The nested "reject-policy" element may be used to specify how rejected tasks
                are handled.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="core-pool-size" type="pool-size" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="max-pool-size" type="pool-size" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="keepalive-time" type="time" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="reject-policy" type="reject-policy" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="name" use="required" type="xsd:string"/>
        <xsd:attribute name="thread-factory" use="required" type="xsd:string"/>
        <xsd:attribute name="allow-core-timeout" use="optional" type="xsd:boolean"/>
        <xsd:attribute name="queue-length" use="optional" type="xsd:integer"/>
    </xsd:complexType>

    <xsd:complexType name="scheduled-thread-pool-executor">
        <xsd:annotation>
            <xsd:documentation>
                A scheduled thread pool executor.  The "name" attribute is the bean name of the created executor.  The
                "thread-factory" attribute specifies the bean name of the thread factory to use to create worker
                threads.  The nested "pool-size" element may be used to specify the thread pool size.  The nested
                "keepalive-time" element is used to specify the amount of time that threads should be kept running when idle.
                The "executor-name" element may be used to specify an executor which should run tasks that are dequeued.
                If it is not specified, then this executor's threads will run the tasks directly.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="pool-size" type="pool-size" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="keepalive-time" type="time" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="executor-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="name" use="required" type="xsd:string"/>
        <xsd:attribute name="thread-factory" use="required" type="xsd:string"/>
    </xsd:complexType>

    <xsd:complexType name="direct-executor">
        <xsd:annotation>
            <xsd:documentation>
                An executor that executes tasks in the caller's thread.  The "name" attribute is the bean name of
                the executor.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="notating-executor">
        <xsd:annotation>
            <xsd:documentation>
                An executor which wraps another executor, and adds a notation to the name of a thread while that thread
                is executing a task.  The "name" attribute is the bean name of the created executor.  The "parent"
                attribute is the bean name of the executor to delegate tasks to.  The "note" element specifies the text
                that is to be added to the thread name while it executes the task.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
        <xsd:attribute name="parent" type="xsd:string" use="required"/>
        <xsd:attribute name="note" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="exception-handler">
        <xsd:annotation>
            <xsd:documentation>
                A reference to an exception handler for a thread or executor.  The referenced bean should implement
                java.lang.Thread.UncaughtExceptionHandler.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="name" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="interrupt-handler">
        <xsd:attribute name="name" type="xsd:string" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="pool-size">
        <xsd:annotation>
            <xsd:documentation>
                A thread pool size designation.  The "count" attribute specifies a flat number of threads.  The
                "per-cpu" attribute specifies a number of threads per CPU.  The numbers are added and rounded off
                to an integer number of threads.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="count" type="xsd:float" use="optional"/>
        <xsd:attribute name="per-cpu" type="xsd:float" use="optional"/>
    </xsd:complexType>

    <xsd:complexType name="time">
        <xsd:annotation>
            <xsd:documentation>
                An amount of time.  Comprised of a time value and a unit value.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="time" type="xsd:integer" use="required"/>
        <xsd:attribute name="unit" type="time-unit-name" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="reject-policy">
        <xsd:annotation>
            <xsd:documentation>
                Specify a task rejection policy for a thread pool executor.  This is the action that is taken when
                all threads are busy and the task queue is full for an executor.  The "name" attribute specifies which
                reject policy to use.  The "executor-name" attribute is used to specify a handoff executor
                for policies that involve passing the task to another executor, and is required when the reject policy
                is set to "handoff".
            </xsd:documentation>
        </xsd:annotation>
        <xsd:attribute name="name" type="reject-policy-name" use="required"/>
        <xsd:attribute name="executor-name" type="xsd:string" use="optional"/>
    </xsd:complexType>

    <xsd:simpleType name="reject-policy-name">
        <xsd:annotation>
            <xsd:documentation>
                The name of the policy.  Possible values are "abort", "block", "caller-runs", "discard", "discard-oldest",
                and "handoff".
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="abort">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[When a task cannot be accepted, a RejectedExecutionException is thrown.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="block">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[Block until a task can be accepted.  If the thread is interrupted while waiting, a RejectedExecutionException is thrown.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="caller-runs">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[When a task connot be accepted, the calling thread runs the task.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="discard">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[When a task cannot be accepted, the task is discarded.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="discard-oldest">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[When a task cannot be accepted, the task which has been in the queue for the longest is discarded to make room.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="handoff">
                <xsd:annotation>
                    <xsd:documentation>
                        <![CDATA[When a task cannot be accepted, the task is handed off to another Executor whose name is given in the executor-name attribute.]]>
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="time-unit-name">
        <xsd:annotation>
            <xsd:documentation>
                The name of a unit of time.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">

            <xsd:enumeration value="s"/>
            <xsd:enumeration value="sec"/>
            <xsd:enumeration value="seconds"/>

            <xsd:enumeration value="m"/>
            <xsd:enumeration value="min"/>
            <xsd:enumeration value="minutes"/>

            <xsd:enumeration value="ms"/>
            <xsd:enumeration value="milliseconds"/>

            <xsd:enumeration value="ns"/>
            <xsd:enumeration value="nanoseconds"/>

            <xsd:enumeration value="h"/>
            <xsd:enumeration value="hours"/>

            <xsd:enumeration value="d"/>
            <xsd:enumeration value="days"/>

            <xsd:enumeration value="w"/>
            <xsd:enumeration value="weeks"/>

            <xsd:enumeration value="mon"/>
            <xsd:enumeration value="months"/>

        </xsd:restriction>
    </xsd:simpleType>

</xsd:schema>
New to GrepCode? Check out our FAQ X