本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}