Search in sources :

Example 11 with Engine

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

the class ManagerServlet method setWrapper.

/**
     * Set the Wrapper with which we are associated.
     *
     * @param wrapper The new wrapper
     */
@Override
public void setWrapper(Wrapper wrapper) {
    this.wrapper = wrapper;
    if (wrapper == null) {
        context = null;
        host = null;
        oname = null;
    } else {
        context = (Context) wrapper.getParent();
        host = (Host) context.getParent();
        Engine engine = (Engine) host.getParent();
        String name = engine.getName() + ":type=Deployer,host=" + host.getName();
        try {
            oname = new ObjectName(name);
        } catch (Exception e) {
            log(sm.getString("managerServlet.objectNameFail", name), e);
        }
    }
    // Retrieve the MBean server
    mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
}
Also used : Engine(org.apache.catalina.Engine) ServletException(javax.servlet.ServletException) IOException(java.io.IOException) MalformedObjectNameException(javax.management.MalformedObjectNameException) UnavailableException(javax.servlet.UnavailableException) ObjectName(javax.management.ObjectName)

Example 12 with Engine

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

the class MapperListener method startInternal.

// ------------------------------------------------------- Lifecycle Methods
@Override
public void startInternal() throws LifecycleException {
    setState(LifecycleState.STARTING);
    Engine engine = service.getContainer();
    if (engine == null) {
        return;
    }
    findDefaultHost();
    addListeners(engine);
    Container[] conHosts = engine.findChildren();
    for (Container conHost : conHosts) {
        Host host = (Host) conHost;
        if (!LifecycleState.NEW.equals(host.getState())) {
            // Registering the host will register the context and wrappers
            registerHost(host);
        }
    }
}
Also used : Container(org.apache.catalina.Container) Host(org.apache.catalina.Host) Engine(org.apache.catalina.Engine)

Example 13 with Engine

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

the class ManagerServlet method getConnectorCiphers.

protected Map<String, Set<String>> getConnectorCiphers() {
    Map<String, Set<String>> result = new HashMap<>();
    Engine e = (Engine) host.getParent();
    Service s = e.getService();
    Connector[] connectors = s.findConnectors();
    for (Connector connector : connectors) {
        if (Boolean.TRUE.equals(connector.getProperty("SSLEnabled"))) {
            SSLHostConfig[] sslHostConfigs = connector.getProtocolHandler().findSslHostConfigs();
            for (SSLHostConfig sslHostConfig : sslHostConfigs) {
                String name = connector.toString() + "-" + sslHostConfig.getHostName();
                Set<String> cipherList = new HashSet<>();
                String[] cipherNames = sslHostConfig.getEnabledCiphers();
                for (String cipherName : cipherNames) {
                    cipherList.add(cipherName);
                }
                result.put(name, cipherList);
            }
        } else {
            Set<String> cipherList = new HashSet<>();
            cipherList.add(sm.getString("managerServlet.notSslConnector"));
            result.put(connector.toString(), cipherList);
        }
    }
    return result;
}
Also used : Connector(org.apache.catalina.connector.Connector) HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) Service(org.apache.catalina.Service) SSLHostConfig(org.apache.tomcat.util.net.SSLHostConfig) Engine(org.apache.catalina.Engine) HashSet(java.util.HashSet)

Example 14 with Engine

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

the class MapperListener method stopInternal.

@Override
public void stopInternal() throws LifecycleException {
    setState(LifecycleState.STOPPING);
    Engine engine = service.getContainer();
    if (engine == null) {
        return;
    }
    removeListeners(engine);
}
Also used : Engine(org.apache.catalina.Engine)

Example 15 with Engine

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

the class SimpleTcpCluster method getManagerName.

@Override
public String getManagerName(String name, Manager manager) {
    String clusterName = name;
    if (clusterName == null)
        clusterName = manager.getContext().getName();
    if (getContainer() instanceof Engine) {
        Context context = manager.getContext();
        Container host = context.getParent();
        if (host instanceof Host && clusterName != null && !(clusterName.startsWith(host.getName() + "#"))) {
            clusterName = host.getName() + "#" + clusterName;
        }
    }
    return clusterName;
}
Also used : Context(org.apache.catalina.Context) Container(org.apache.catalina.Container) Host(org.apache.catalina.Host) Engine(org.apache.catalina.Engine)

Aggregations

Engine (org.apache.catalina.Engine)36 Container (org.apache.catalina.Container)18 Host (org.apache.catalina.Host)18 Service (org.apache.catalina.Service)12 Context (org.apache.catalina.Context)9 StandardEngine (org.apache.catalina.core.StandardEngine)8 StandardHost (org.apache.catalina.core.StandardHost)8 StandardService (org.apache.catalina.core.StandardService)7 ObjectName (javax.management.ObjectName)6 Connector (org.apache.catalina.connector.Connector)6 File (java.io.File)5 IOException (java.io.IOException)5 StandardContext (org.apache.catalina.core.StandardContext)4 ServletContext (javax.servlet.ServletContext)2 UnavailableException (javax.servlet.UnavailableException)2 LifecycleException (org.apache.catalina.LifecycleException)2 Server (org.apache.catalina.Server)2 Wrapper (org.apache.catalina.Wrapper)2 ContextName (org.apache.catalina.util.ContextName)2 TraceContext (com.navercorp.pinpoint.bootstrap.context.TraceContext)1