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; }
standardHost.setDeployIgnore(".*"); standardHost.setName("localhost"); engine.addChild(standardHost);
@Override public void addChild(Container child) { if(child instanceof Host) { final Host host = (Host) child; String hostName = host.getName(); String[] aliases = host.findAliases(); if(getService() instanceof SipService) { final SipService sipService = (SipService) getService(); SipApplicationDispatcher sipApplicationDispatcher = sipService.getSipApplicationDispatcher(); if(sipApplicationDispatcher != null) { sipApplicationDispatcher.addHostName(hostName); for (String alias : aliases) { sipService.getSipApplicationDispatcher().addHostName(alias); } } } //FIXME : ugly hack to cope with lack of extensibility in jboss as 5 Tomcat Service if("org.jboss.web.tomcat.service.deployers.JBossContextConfig".equals(host.getConfigClass())) { host.setConfigClass("org.mobicents.servlet.sip.startup.jboss.SipJBossContextConfig"); } } super.addChild(child); }
@Override public void addChild(Container child) { if(child instanceof Host) { final Host host = (Host) child; String hostName = host.getName(); String[] aliases = host.findAliases(); if(getService() instanceof SipService) { final SipService sipService = (SipService) getService(); SipApplicationDispatcher sipApplicationDispatcher = sipService.getSipApplicationDispatcher(); if(sipApplicationDispatcher != null) { sipApplicationDispatcher.addHostName(hostName); for (String alias : aliases) { sipService.getSipApplicationDispatcher().addHostName(alias); } } } //FIXME : ugly hack to cope with lack of extensibility in jboss as 5 Tomcat Service if("org.jboss.web.tomcat.service.deployers.JBossContextConfig".equals(host.getConfigClass())) { host.setConfigClass("org.mobicents.servlet.sip.startup.jboss.SipJBossContextConfig"); } } super.addChild(child); }