public void afterPropertiesSet() throws Exception { xFire.getInHandlers().addAll(getInHandlers()); xFire.getOutHandlers().addAll(getOutHandlers()); xFire.getFaultHandlers().addAll(getFaultHandlers()); for (Iterator itr = transports.iterator(); itr.hasNext();) { Transport t = (Transport) itr.next(); xFire.getTransportManager().register(t); } for(Iterator iter = properties.keySet().iterator();iter.hasNext();){ Object key = iter.next(); xFire.setProperty(key.toString(), properties.get(key)); } }
public XFire loadConfig(String configPath) throws XFireException { XFireConfigLoader loader = new XFireConfigLoader(); loader.setBasedir(getWebappBase()); log.debug("Loading configuration files relative to " + loader.getBasedir().getAbsolutePath()); ServletContext servletCtx = getServletContext(); ApplicationContext parent = (ApplicationContext) servletCtx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); if (parent == null) { GenericWebApplicationContext webCtx = new GenericWebApplicationContextX(); webCtx.setServletContext(getServletContext()); webCtx.refresh(); parent = webCtx; } ApplicationContext newCtx = loader.loadContext(configPath, parent); if(servletCtx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE) == null) { servletCtx.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, newCtx); } XFire xfire = (XFire) newCtx.getBean("xfire"); xfire.setProperty(XFire.XFIRE_HOME, getWebappBase().getAbsolutePath()); return xfire; }