-
1. Re: How to created the equivalent of a singleThreadedScheduledExecutor in wildfly
jewellgm Apr 18, 2018 12:43 PM (in response to jeffgaer)This is contained in the jboss-as-ee_3_0.xsd on how to define the managed-scheduled-executor-service:
<xs:complexType name="managedScheduledExecutorServiceType">
<xs:annotation>
<xs:documentation>
A managed scheduled executor service (implementing javax.enterprise.concurrent.ManagedScheduledExecutorService).
If the "thread-factory" attribute is not defined a managed thread factory with no context service and normal thread priority will be created and used by the executor.
</xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="nameType" use="required"/>
<xs:attribute name="jndi-name" type="jndiNameType" use="required"/>
<xs:attribute name="context-service" type="contextServiceNameType"/>
<xs:attribute name="thread-factory" type="threadFactoryType"/>
<xs:attribute name="hung-task-threshold" type="hungTaskThresholdType" default="0"/>
<xs:attribute name="long-running-tasks" type="longRunningTasksType" default="false"/>
<xs:attribute name="core-threads" type="coreThreadsType" use="required"/>
<xs:attribute name="keepalive-time" type="keepAliveTimeType" default="60000"/>
<xs:attribute name="reject-policy" type="rejectPolicyType" default="ABORT"/>
</xs:complexType>
where coreThreadsType is:
<xs:simpleType name="coreThreadsType">
<xs:annotation>
<xs:documentation>
The number of threads to keep in the executor's pool, even if they are idle.
This type matches EE Concurrent 1.0 Final Release attribute named "Pool Info: Core Size", defined in sections 3.1.4.2 and 3.2.4.2
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
As you mentioned, maxThreads is not a valid attribute. Based on the documentation, it looks like the coreThreads attribute is all you need.