Search in sources :

Example 1 with Executor

use of org.apache.catalina.Executor in project tomcat by apache.

the class ServiceMBean method findExecutors.

/**
     * Retrieves all executors.
     * @return an array of string representations of the executors
     * @throws MBeanException error accessing the associated service
     */
public String[] findExecutors() throws MBeanException {
    Service service = doGetManagedResource();
    Executor[] executors = service.findExecutors();
    String[] str = new String[executors.length];
    for (int i = 0; i < executors.length; i++) {
        str[i] = executors[i].toString();
    }
    return str;
}
Also used : Executor(org.apache.catalina.Executor) Service(org.apache.catalina.Service)

Example 2 with Executor

use of org.apache.catalina.Executor in project tomcat by apache.

the class ServiceMBean method addExecutor.

/**
     * Adds a named executor to the service
     * @param type Classname of the Executor to be added
     * @throws MBeanException error creating the executor
     */
public void addExecutor(String type) throws MBeanException {
    Service service = doGetManagedResource();
    Executor executor = (Executor) newInstance(type);
    service.addExecutor(executor);
}
Also used : Executor(org.apache.catalina.Executor) Service(org.apache.catalina.Service)

Example 3 with Executor

use of org.apache.catalina.Executor in project tomcat by apache.

the class ServiceMBean method getExecutor.

/**
     * Retrieves executor by name
     * @param name Name of the executor to be retrieved
     * @return a string representation of the executor
     * @throws MBeanException error accessing the associated service
     */
public String getExecutor(String name) throws MBeanException {
    Service service = doGetManagedResource();
    Executor executor = service.getExecutor(name);
    return executor.toString();
}
Also used : Executor(org.apache.catalina.Executor) Service(org.apache.catalina.Service)

Example 4 with Executor

use of org.apache.catalina.Executor in project tomcat by apache.

the class StandardServiceSF method storeChildren.

/**
     * Store the specified service element children.
     *
     * @param aWriter Current output writer
     * @param indent Indentation level
     * @param aService Service to store
     * @param parentDesc The element description
     * @throws Exception Configuration storing error
     */
@Override
public void storeChildren(PrintWriter aWriter, int indent, Object aService, StoreDescription parentDesc) throws Exception {
    if (aService instanceof StandardService) {
        StandardService service = (StandardService) aService;
        // Store nested <Listener> elements
        LifecycleListener[] listeners = ((Lifecycle) service).findLifecycleListeners();
        storeElementArray(aWriter, indent, listeners);
        // Store nested <Executor> elements
        Executor[] executors = service.findExecutors();
        storeElementArray(aWriter, indent, executors);
        Connector[] connectors = service.findConnectors();
        storeElementArray(aWriter, indent, connectors);
        // Store nested <Engine> element
        Engine container = service.getContainer();
        if (container != null) {
            StoreDescription elementDesc = getRegistry().findDescription(container.getClass());
            if (elementDesc != null) {
                IStoreFactory factory = elementDesc.getStoreFactory();
                factory.store(aWriter, indent, container);
            }
        }
    }
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor) Lifecycle(org.apache.catalina.Lifecycle) StandardService(org.apache.catalina.core.StandardService) LifecycleListener(org.apache.catalina.LifecycleListener) Engine(org.apache.catalina.Engine)

Example 5 with Executor

use of org.apache.catalina.Executor in project tomcat by apache.

the class ConnectorCreateRule method begin.

// --------------------------------------------------------- Public Methods
/**
     * Process the beginning of this element.
     *
     * @param namespace the namespace URI of the matching element, or an
     *   empty string if the parser is not namespace aware or the element has
     *   no namespace
     * @param name the local name if the parser is namespace aware, or just
     *   the element name otherwise
     * @param attributes The attribute list for this element
     */
@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
    Service svc = (Service) digester.peek();
    Executor ex = null;
    if (attributes.getValue("executor") != null) {
        ex = svc.getExecutor(attributes.getValue("executor"));
    }
    Connector con = new Connector(attributes.getValue("protocol"));
    if (ex != null) {
        setExecutor(con, ex);
    }
    String sslImplementationName = attributes.getValue("sslImplementationName");
    if (sslImplementationName != null) {
        setSSLImplementationName(con, sslImplementationName);
    }
    digester.push(con);
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor) Service(org.apache.catalina.Service)

Aggregations

Executor (org.apache.catalina.Executor)8 Connector (org.apache.catalina.connector.Connector)5 Service (org.apache.catalina.Service)4 Engine (org.apache.catalina.Engine)1 JmxEnabled (org.apache.catalina.JmxEnabled)1 Lifecycle (org.apache.catalina.Lifecycle)1 LifecycleListener (org.apache.catalina.LifecycleListener)1 StandardService (org.apache.catalina.core.StandardService)1