engine.addChild(localHost); engine.setDefaultHost(localHost.getName()); container.addEngine(engine);
engine.addChild(localHost); engine.setDefaultHost(localHost.getName()); engine.setJvmRoute(jvmRoute);
public void addHost(Host host) { engine.addChild(host); }
/** * 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); } }
/** * 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); } }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
public Host getHost() { if (host == null) { host = new StandardHost(); host.setName(hostname); getEngine().addChild( host ); } return host; }
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; }
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); }
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(); } } }
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);
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; }
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; }
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; }
Service service = getService(pname); Engine engine = (Engine) service.getContainer(); engine.addChild(host);
Service service = getService(pname); Engine engine = service.getContainer(); engine.addChild(host);