4.5. Connector
Connector
element represents an interface between clients and the Service; the element defines how client requests are transported.
Note
4.5.1. Executor
Executor
represents a thread pool that can be shared among components (primarily among connectors).
org.apache.catalina.Executor
interface.
Table 4.3. Element Attributes
Attribute | Description |
---|---|
className |
class implementing the Executor
The class must implement the org.apache.catalina.Executor interface. If no className is specified, the standard
org.apache.catalina.core.StandardThreadExecutor implementation is used.
|
name |
Executor name (the name must be unique within the
Server element)
|
Table 4.4. Additional Element Attributes of the Standard Executor Implementation (org.apache.catalina.core.StandardThreadExecutor)
Attribute | Description |
---|---|
threadPriority | thread priority for threads in the executor (Thread.NORM_PRIORITY by default) |
daemon | enabling/disabling daemon threads (true by default) |
namePrefix | name prefix for each thread created by the executor (the thread name takes the form namePrefix+threadNumber) |
maxThreads | maximum number of active threads in the thread pool (200 by default) |
minSpareThreads | minimum number of threads kept alive (25 by default) |
maxIdleTime |
number of milliseconds before the idle thread is shut down (applied only if the number of active threads is higher that the minSpareThreads value;
60.000 by default)
|
Defining Executor for Multiple Components
Important
server.xml
file. Such Executor definitions are now ignored.
- Open the
$JBOSS_SERVER_HOME/PROFILE/deploy/jbossweb.sar/META-INF/jboss-beans.xml
file. - Add the
Executor
bean definition to the file (see Example 4.1, “Executor bean definition”).Example 4.1. Executor bean definition
<bean name="Executor" class="org.apache.catalina.core.StandardThreadExecutor"> <property name="maxThreads">300</property> <property name="minSpareThreads">25</property> </bean>
- Set the executor property for the
TomcatService
bean.<bean name="WebServer" class="org.jboss.web.tomcat.service.deployers.TomcatService"> <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web:service=WebServer", exposedInterface=org.jboss.web.tomcat.service.deployers.TomcatServiceMBean.class,registerDirectly=true)</annotation> ⋮ <!--This is the executor property you need to add.--> <property name="executor"><inject bean="Executor"/></property> </bean>