Java Code Examples for org.apache.catalina.Host#findChildren()

The following examples show how to use org.apache.catalina.Host#findChildren() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapperListener.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Register host.
 */
private void registerHost(Host host) {

    String[] aliases = host.findAliases();
    mapper.addHost(host.getName(), aliases, host);

    for (Container container : host.findChildren()) {
        if (container.getState().isAvailable()) {
            registerContext((Context) container);
        }
    }
    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerHost",
                host.getName(), domain, service));
    }
}
 
Example 2
Source File: MapperListener.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Register host.
 */
private void registerHost(Host host) {

    String[] aliases = host.findAliases();
    mapper.addHost(host.getName(), aliases, host);

    for (Container container : host.findChildren()) {
        if (container.getState().isAvailable()) {
            registerContext((Context) container);
        }
    }
    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerHost",
                host.getName(), domain, connector));
    }
}
 
Example 3
Source File: MapperListener.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Register host.
 */
private void registerHost(Host host) {

    String[] aliases = host.findAliases();
    mapper.addHost(host.getName(), aliases, host);

    for (Container container : host.findChildren()) {
        if (container.getState().isAvailable()) {
            registerContext((Context) container);
        }
    }
    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerHost",
                host.getName(), domain, connector));
    }
}
 
Example 4
Source File: TomcatLoader.java    From tomee with Apache License 2.0 5 votes vote down vote up
/**
 * Process running web applications for ejb deployments.
 *
 * @param tomcatWebAppBuilder tomcat web app builder instance
 * @param standardServer      tomcat server instance
 */
private void processRunningApplications(final TomcatWebAppBuilder tomcatWebAppBuilder, final StandardServer standardServer) {
    for (final org.apache.catalina.Service service : standardServer.findServices()) {
        if (service.getContainer() instanceof Engine) {
            final Engine engine = (Engine) service.getContainer();
            for (final Container engineChild : engine.findChildren()) {
                if (engineChild instanceof Host) {
                    final Host host = (Host) engineChild;
                    for (final Container hostChild : host.findChildren()) {
                        if (hostChild instanceof StandardContext) {
                            final StandardContext standardContext = (StandardContext) hostChild;
                            final int state = TomcatHelper.getContextState(standardContext);
                            if (state == 0) {
                                // context only initialized
                                tomcatWebAppBuilder.init(standardContext);
                            } else if (state == 1) {
                                // context already started
                                standardContext.addParameter("openejb.start.late", "true");
                                final ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
                                Thread.currentThread().setContextClassLoader(standardContext.getLoader().getClassLoader());
                                try {
                                    tomcatWebAppBuilder.init(standardContext);
                                    tomcatWebAppBuilder.beforeStart(standardContext);
                                    tomcatWebAppBuilder.start(standardContext);
                                    tomcatWebAppBuilder.afterStart(standardContext);
                                } finally {
                                    Thread.currentThread().setContextClassLoader(oldCL);
                                }
                                standardContext.removeParameter("openejb.start.late");
                            }
                        }
                    }
                }
            }
        }
    }
}
 
Example 5
Source File: ThreadLocalLeakPreventionListener.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
private void registerListenersForHost(Host host) {
    for (Container contextContainer : host.findChildren()) {
        Context context = (Context) contextContainer;
        registerContextListener(context);
    }
}
 
Example 6
Source File: ThreadLocalLeakPreventionListener.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
private void registerListenersForHost(Host host) {
    for (Container contextContainer : host.findChildren()) {
        Context context = (Context) contextContainer;
        registerContextListener(context);
    }
}
 
Example 7
Source File: ThreadLocalLeakPreventionListener.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
private void registerListenersForHost(Host host) {
    for (Container contextContainer : host.findChildren()) {
        Context context = (Context) contextContainer;
        registerContextListener(context);
    }
}