/** * @param host The host in which the context will be deployed * @param contextPath The context mapping to use, "" for root context. * @param docBase Base directory for the context, for static files. * Must exist, relative to the server home * @return the deployed context * @see #addWebapp(String, String) */ public Context addWebapp(Host host, String contextPath, String docBase) { LifecycleListener listener = null; try { Class<?> clazz = Class.forName(getHost().getConfigClass()); listener = (LifecycleListener) clazz.getConstructor().newInstance(); } catch (ReflectiveOperationException e) { // Wrap in IAE since we can't easily change the method signature to // to throw the specific checked exceptions throw new IllegalArgumentException(e); } return addWebapp(host, contextPath, docBase, listener); }
/** * @param host The host in which the context will be deployed * @param contextPath The context mapping to use, "" for root context. * @param docBase Base directory for the context, for static files. * Must exist, relative to the server home * @return the deployed context * @see #addWebapp(String, String) */ public Context addWebapp(Host host, String contextPath, String docBase) { LifecycleListener listener = null; try { Class<?> clazz = Class.forName(getHost().getConfigClass()); listener = (LifecycleListener) clazz.getConstructor().newInstance(); } catch (ReflectiveOperationException e) { // Wrap in IAE since we can't easily change the method signature to // to throw the specific checked exceptions throw new IllegalArgumentException(e); } return addWebapp(host, contextPath, docBase, listener); }
Context context = (Context) Class.forName(contextClass).newInstance(); if (context instanceof Lifecycle) { Class clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Context context = (Context) Class.forName(contextClass).newInstance(); if (context instanceof Lifecycle) { Class clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.getConstructor().newInstance(); context.addLifecycleListener(listener);
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.getConstructor().newInstance(); context.addLifecycleListener(listener);
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
Class<?> clazz = Class.forName(host.getConfigClass()); LifecycleListener listener = (LifecycleListener) clazz.newInstance();
@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); }