Search in sources :

Example 86 with Container

use of org.apache.catalina.Container in project tomee by apache.

the class GlobalListenerSupport method engineAdded.

/**
 * Engine is added.
 *
 * @param engine tomcat engine
 */
private void engineAdded(final StandardEngine engine) {
    addContextListener(engine);
    for (final Container child : engine.findChildren()) {
        if (child instanceof StandardHost) {
            final StandardHost host = (StandardHost) child;
            hostAdded(host);
        }
    }
}
Also used : Container(org.apache.catalina.Container) StandardHost(org.apache.catalina.core.StandardHost)

Example 87 with Container

use of org.apache.catalina.Container in project tomee by apache.

the class GlobalListenerSupport method engineRemoved.

/**
 * Engine is removed.
 *
 * @param engine tomcat engine
 */
private void engineRemoved(final StandardEngine engine) {
    for (final Container child : engine.findChildren()) {
        if (child instanceof StandardHost) {
            final StandardHost host = (StandardHost) child;
            hostRemoved(host);
        }
    }
}
Also used : Container(org.apache.catalina.Container) StandardHost(org.apache.catalina.core.StandardHost)

Example 88 with Container

use of org.apache.catalina.Container in project tomee by apache.

the class GlobalListenerSupport method serviceAdded.

/**
 * Service is added.
 *
 * @param service tomcat service
 */
private void serviceAdded(final Service service) {
    final Container container = service.getContainer();
    if (container instanceof StandardEngine) {
        final StandardEngine engine = (StandardEngine) container;
        engineAdded(engine);
    }
}
Also used : Container(org.apache.catalina.Container) StandardEngine(org.apache.catalina.core.StandardEngine)

Example 89 with Container

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

the class StandardHost method getConfigBaseFile.

/**
     * ({@inheritDoc}
     */
@Override
public File getConfigBaseFile() {
    if (hostConfigBase != null) {
        return hostConfigBase;
    }
    String path = null;
    if (getXmlBase() != null) {
        path = getXmlBase();
    } else {
        StringBuilder xmlDir = new StringBuilder("conf");
        Container parent = getParent();
        if (parent instanceof Engine) {
            xmlDir.append('/');
            xmlDir.append(parent.getName());
        }
        xmlDir.append('/');
        xmlDir.append(getName());
        path = xmlDir.toString();
    }
    File file = new File(path);
    if (!file.isAbsolute())
        file = new File(getCatalinaBase(), path);
    try {
        file = file.getCanonicalFile();
    } catch (IOException e) {
    // ignore
    }
    this.hostConfigBase = file;
    return file;
}
Also used : Container(org.apache.catalina.Container) IOException(java.io.IOException) File(java.io.File) Engine(org.apache.catalina.Engine)

Example 90 with Container

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

the class ApplicationContext method getVirtualServerName.

@Override
public String getVirtualServerName() {
    // Constructor will fail if context or its parent is null
    Container host = context.getParent();
    Container engine = host.getParent();
    return engine.getName() + "/" + host.getName();
}
Also used : Container(org.apache.catalina.Container)

Aggregations

Container (org.apache.catalina.Container)163 Context (org.apache.catalina.Context)28 IOException (java.io.IOException)24 Host (org.apache.catalina.Host)22 StandardContext (org.apache.catalina.core.StandardContext)21 Engine (org.apache.catalina.Engine)18 LifecycleException (org.apache.catalina.LifecycleException)17 File (java.io.File)15 ObjectName (javax.management.ObjectName)15 Wrapper (org.apache.catalina.Wrapper)13 StandardHost (org.apache.catalina.core.StandardHost)13 ArrayList (java.util.ArrayList)12 ServletException (javax.servlet.ServletException)11 MalformedURLException (java.net.MalformedURLException)10 Valve (org.apache.catalina.Valve)10 StandardWrapper (org.apache.catalina.core.StandardWrapper)10 SecurityConstraint (org.apache.tomcat.util.descriptor.web.SecurityConstraint)10 NamingException (javax.naming.NamingException)9 Lifecycle (org.apache.catalina.Lifecycle)9 Realm (org.apache.catalina.Realm)9