org.apache.catalina.Engine.addChild()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.catalina.Engine.addChild()方法的一些代码示例,展示了Engine.addChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Engine.addChild()方法的具体详情如下:
包路径:org.apache.catalina.Engine
类名称:Engine
方法名:addChild

Engine.addChild介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

engine.addChild(localHost);
engine.setDefaultHost(localHost.getName());
container.addEngine(engine);

代码示例来源:origin: apache/geode

engine.addChild(localHost);
engine.setDefaultHost(localHost.getName());
engine.setJvmRoute(jvmRoute);

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat6

public void addHost(Host host) {
  engine.addChild(host);
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Sets the current host - all future webapps will
 * be added to this host. When tomcat starts, the
 * host will be the default host.
 *
 * @param host The current host
 */
public void setHost(Host host) {
  Engine engine = getEngine();
  boolean found = false;
  for (Container engineHost : engine.findChildren()) {
    if (engineHost == host) {
      found = true;
    }
  }
  if (!found) {
    engine.addChild(host);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Sets the current host - all future webapps will
 * be added to this host. When tomcat starts, the
 * host will be the default host.
 *
 * @param host The current host
 */
public void setHost(Host host) {
  Engine engine = getEngine();
  boolean found = false;
  for (Container engineHost : engine.findChildren()) {
    if (engineHost == host) {
      found = true;
    }
  }
  if (!found) {
    engine.addChild(host);
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: codefollower/Tomcat-Research

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

public Host getHost() {
  if (host == null) {
    host = new StandardHost();
    host.setName(hostname);
    getEngine().addChild( host );
  }
  return host;
}

代码示例来源:origin: apache/ofbiz-framework

private Host prepareVirtualHost(Tomcat tomcat, List<String> virtualHosts) {
  // assume that the first virtual-host will be the default; additional virtual-hosts will be aliases
  String hostName = virtualHosts.get(0);
  Host host;
  Engine engine = tomcat.getEngine();
  org.apache.catalina.Container childContainer = engine.findChild(hostName);
  if (childContainer instanceof Host) {
    host = (Host) childContainer;
  } else {
    host = new StandardHost();
    host.setName(hostName);
    engine.addChild(host);
  }
  virtualHosts.stream()
    .filter(virtualHost -> virtualHost != hostName)
    .forEach(virtualHost -> host.addAlias(virtualHost));
  return host;
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat

private void addHost(ObjectRetriever objRetriever) {
  Host host = (Host)objRetriever.getInternalObject();
  //If we didn't set a realm, then use the default
  if (host.getRealm() == null) {
    host.setRealm(engine.getRealm());
  }
  engine.addChild(host);
}

代码示例来源:origin: net.disy.legato/legato-testing

public TomcatWebServerEnvironment(final String catalinaHome, final int port) {
 container = new Embedded();
 container.setCatalinaHome(catalinaHome);
 //container.setRealm(new MemoryRealm());
 localHost = container.createHost("localHost", new File(".").getAbsolutePath());
 final Engine engine = container.createEngine();
 engine.setName("localEngine");
 engine.addChild(localHost);
 engine.setDefaultHost(localHost.getName());
 container.addEngine(engine);
 final Connector httpConnector = container.createConnector((InetAddress) null, port, false);
 container.addConnector(httpConnector);
 container.setAwait(true);
 webAppLoader = new WebappLoader(this.getClass().getClassLoader());
 if (classesDir != null) {
  try {
   webAppLoader.addRepository(new File(classesDir).toURI().toURL().toString());
  }
  catch (final MalformedURLException e) {
   e.printStackTrace();
  }
 }
}

代码示例来源:origin: stackoverflow.com

Context context = (Context) wrapper.getParent();
 Host currentHost = (Host) context.getParent();
 Engine engine = (Engine) currentHost.getParent();
 StandardHost host = new StandardHost();
 host.setAppBase(appBase);
 host.setName(domainName);
 engine.addChild(host);

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

public Host getHost() {
  Engine engine = getEngine();
  if (engine.findChildren().length > 0) {
    return (Host) engine.findChildren()[0];
  }
  Host host = new StandardHost();
  host.setName(hostname);
  getEngine().addChild(host);
  return host;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

public Host getHost() {
  Engine engine = getEngine();
  if (engine.findChildren().length > 0) {
    return (Host) engine.findChildren()[0];
  }
  Host host = new StandardHost();
  host.setName(hostname);
  getEngine().addChild(host);
  return host;
}

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.url.mapper.clustermessage

public static Host addHostToEngine(String hostName) {
  String hostBaseDir = CarbonUtils.getCarbonRepository() + "/webapps/";
  CarbonTomcatService carbonTomcatService = DataHolder.getInstance().getCarbonTomcatService();
  // adding virtual host to tomcat engine
  Engine engine = carbonTomcatService.getTomcat().getEngine();
  StandardHost host = new StandardHost();
  host.setAppBase(hostBaseDir);
  host.setName(hostName);
  host.setUnpackWARs(false);
  host.addValve(new CarbonContextCreatorValve());
  host.addValve(new CompositeValve());
  engine.addChild(host);
  log.info("host added to the tomcat: " + host);
  return host;
}

代码示例来源:origin: codefollower/Tomcat-Research

Service service = getService(pname);
Engine engine = (Engine) service.getContainer();
engine.addChild(host);

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

Service service = getService(pname);
Engine engine = service.getContainer();
engine.addChild(host);

相关文章