当前位置: 首页>>代码示例>>Java>>正文


Java StandardEngine.findChildren方法代码示例

本文整理汇总了Java中org.apache.catalina.core.StandardEngine.findChildren方法的典型用法代码示例。如果您正苦于以下问题:Java StandardEngine.findChildren方法的具体用法?Java StandardEngine.findChildren怎么用?Java StandardEngine.findChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.core.StandardEngine的用法示例。


在下文中一共展示了StandardEngine.findChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: engineAdded

import org.apache.catalina.core.StandardEngine; //导入方法依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:15,代码来源:GlobalListenerSupport.java

示例2: engineRemoved

import org.apache.catalina.core.StandardEngine; //导入方法依赖的package包/类
/**
 * 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);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:14,代码来源:GlobalListenerSupport.java

示例3: tryToFindAndExtractWar

import org.apache.catalina.core.StandardEngine; //导入方法依赖的package包/类
private static File tryToFindAndExtractWar(final StandardServer source) {
    if (System.getProperties().containsKey("openejb.war")) {
        return new File(System.getProperty("openejb.war"));
    }

    for (final Service service : source.findServices()) {
        final Container container = service.getContainer();
        if (container instanceof StandardEngine) {
            final StandardEngine engine = (StandardEngine) container;
            for (final Container child : engine.findChildren()) {
                if (child instanceof StandardHost) {
                    final StandardHost host = (StandardHost) child;
                    final File base = hostDir(System.getProperty("catalina.base"), host.getAppBase());

                    final File[] files = base.listFiles();
                    if (files != null) {
                        for (final File file : files) {
                            if (isTomEEWar(file)) {
                                return file;
                            }
                        }
                    }
                }
            }
        }
    }

    return null;
}
 
开发者ID:apache,项目名称:tomee,代码行数:30,代码来源:OpenEJBListener.java

示例4: findOpenEjbWar

import org.apache.catalina.core.StandardEngine; //导入方法依赖的package包/类
private static File findOpenEjbWar() {
    // in Tomcat 5.5 the OpenEjb war is in the server/webapps director
    final String catalinaBase = System.getProperty("catalina.base");
    final File serverWebapps = new File(catalinaBase, "server/webapps");
    File openEjbWar = findOpenEjbWar(serverWebapps);
    if (openEjbWar != null) {
        return openEjbWar;
    }

    try {
        // in Tomcat 6 the OpenEjb war is normally in webapps, but we just
        // scan all hosts directories
        for (final Service service : TomcatHelper.getServer().findServices()) {
            final Container container = service.getContainer();
            if (container instanceof StandardEngine) {
                final StandardEngine engine = (StandardEngine) container;
                for (final Container child : engine.findChildren()) {
                    if (child instanceof StandardHost) {
                        final StandardHost host = (StandardHost) child;
                        final File hostDir = hostDir(catalinaBase, host.getAppBase());

                        openEjbWar = findOpenEjbWar(hostDir);
                        if (openEjbWar != null) {
                            return openEjbWar;
                        } else {
                            return findOpenEjbWar(host);
                        }
                    }
                }
            }
        }
    } catch (final Exception e) {
        LOGGER.log(Level.WARNING, "OpenEJBListener.findOpenEjbWar: " + e.getMessage());
    }

    return null;
}
 
开发者ID:apache,项目名称:tomee,代码行数:38,代码来源:OpenEJBListener.java


注:本文中的org.apache.catalina.core.StandardEngine.findChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。