Java Reference
In-Depth Information
<subsystem xmlns="urn:jboss:domain:ee:2.0">
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
<concurrent>
(…)
<managed-executor-services>
<managed-executor-service name="default"
jndi-name="java:jboss/ee/concurrency/executor/default"
context-service="default"
hung-task-threshold="60000"
core-threads="5" max-threads="25" keepalive-time="5000"
/>
</managed-executor-services>
(…)
</concurrent>
</subsystem>
As you can see, the
standalone.xml
file contains the configuration of the default
ManagedExecutorService
. You can add a new custom configuration with another
name and JNDI path; you can also create a separate one for every deployed application.
Note
Note that the default ManagedExecutorService has two JNDI names: the one in the con-
figuration and the one defined in the Java EE specification (
java:comp/De-
faultManagedExecutorService
). You can switch to the default executor service
(and other components) using the default-bindings tag in the
standalone.xml
file.
Let's take a closer look at some of the properties of the executor service:
•
core-threads
: This defines how many threads should be alive in the thread pool
all the time (even if those threads are idle and the server is handling no user re-
quests).
•
max-threads
: This states how many threads the server can start (including the
core threads) if necessary, for instance, when under heavy load.
•
keepalive-time
: This defines after how many milliseconds a thread can be idle
before the server kills it (it only applies if there are more threads running than the
core-threads parameter specified). This configuration value defines how long the
server will keep around the additional threads when they are not needed anymore.