Search in sources :

Example 6 with Executor

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

the class StandardService method initInternal.

/**
     * Invoke a pre-startup initialization. This is used to allow connectors
     * to bind to restricted ports under Unix operating environments.
     */
@Override
protected void initInternal() throws LifecycleException {
    super.initInternal();
    if (engine != null) {
        engine.init();
    }
    // Initialize any Executors
    for (Executor executor : findExecutors()) {
        if (executor instanceof JmxEnabled) {
            ((JmxEnabled) executor).setDomain(getDomain());
        }
        executor.init();
    }
    // Initialize mapper listener
    mapperListener.init();
    // Initialize our defined Connectors
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            connector.init();
        }
    }
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor) JmxEnabled(org.apache.catalina.JmxEnabled)

Example 7 with Executor

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

the class StandardService method startInternal.

/**
     * Start nested components ({@link Executor}s, {@link Connector}s and
     * {@link Container}s) and implement the requirements of
     * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
     *
     * @exception LifecycleException if this component detects a fatal error
     *  that prevents this component from being used
     */
@Override
protected void startInternal() throws LifecycleException {
    if (log.isInfoEnabled())
        log.info(sm.getString("standardService.start.name", this.name));
    setState(LifecycleState.STARTING);
    // Start our defined Container first
    if (engine != null) {
        synchronized (engine) {
            engine.start();
        }
    }
    synchronized (executors) {
        for (Executor executor : executors) {
            executor.start();
        }
    }
    mapperListener.start();
    // Start our defined Connectors second
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            // If it has already failed, don't try and start it
            if (connector.getState() != LifecycleState.FAILED) {
                connector.start();
            }
        }
    }
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor)

Example 8 with Executor

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

the class StandardService method destroyInternal.

@Override
protected void destroyInternal() throws LifecycleException {
    mapperListener.destroy();
    // Destroy our defined Connectors
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            connector.destroy();
        }
    }
    // Destroy any Executors
    for (Executor executor : findExecutors()) {
        executor.destroy();
    }
    if (engine != null) {
        engine.destroy();
    }
    super.destroyInternal();
}
Also used : Connector(org.apache.catalina.connector.Connector) Executor(org.apache.catalina.Executor)

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