host = new StandardHost(); host.setName(hostname); engine.addChild(host);
public static StandardContext createContext() { final StandardEngine engine = new StandardEngine(); engine.setService( new StandardService() ); final StandardContext context = new StandardContext(); context.setPath( "/" ); context.setSessionCookiePath( "/" ); final WebappLoader webappLoader = new WebappLoader() { @Override public ClassLoader getClassLoader() { return Thread.currentThread().getContextClassLoader(); } }; context.setLoader( webappLoader ); final StandardHost host = new StandardHost(); engine.addChild( host ); host.addChild( context ); return context; }
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; }
@Override public Host createHost(String name, String appBase) { if( log.isDebugEnabled() ) log.debug("Creating host '" + name + "' with appBase '" + appBase + "'"); StandardHost host = new StandardHost(); host.setAppBase(appBase); host.setName(name); return (host); }
appBase + "'"); StandardHost host = new StandardHost();
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; }
appBase + "'"); StandardHost host = new StandardHost();
appBase + "'"); StandardHost host = new StandardHost();
/** * Create a standard host. * * @return host */ public Host createHost() { log.debug("Creating host"); StandardHost stdHost = new StandardHost(); stdHost.setAppBase(webappRoot); stdHost.setAutoDeploy(autoDeploy); if (domain == null) { stdHost.setName(name); } else { stdHost.setDomain(domain); //seems to require that the domain be appended to the name stdHost.setName(name + '.' + domain); } stdHost.setStartChildren(startChildren); stdHost.setUnpackWARs(unpackWARs); // See http://tomcat.apache.org/migration-7.html#Deployment stdHost.setCopyXML(true); return stdHost; }
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; }
StandardHost host = new StandardHost(); host.setName(name); host.setAppBase(appBase);
@Before public void setupManager() { Context context = new StandardContext(); Host host = new StandardHost(); this.manager.setContext(context); context.setName("test-context-name"); context.setParent(host); host.setName("test-host-name"); }