4.5. Connector

The Connector element represents an interface between clients and the Service; the element defines how client requests are transported.
There are multiple optional connectors available with JBoss Web: JK2 (mod_jk), mod_cluster. By default, the connector for HTTP and for AJP are defined.

Note

Further details about configuration of individual connectors are available in the HTTP Connectors Load Balancing Guide on the Red Hat Documentation website.

4.5.1. Executor

The Executor represents a thread pool that can be shared among components (primarily among connectors).
Every Executor must implement the 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

Previously, it was possible to define the Executor for a single Connector in the server.xml file. Such Executor definitions are now ignored.
To define an Executor, do the following:
  1. Open the $JBOSS_SERVER_HOME/PROFILE/deploy/jbossweb.sar/META-INF/jboss-beans.xml file.
  2. 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>
  3. 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>