public AtmosphereConfig parse(AtmosphereConfig config, String filename) throws FileNotFoundException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { return parse(config, factory.newDocumentBuilder().parse(filename)); } catch (SAXException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } catch (IOException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } catch (ParserConfigurationException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } }
AtmosphereConfigReader reader = new AtmosphereConfigReader(stream); Map<String, String> atmosphereHandlerNames = reader.getAtmosphereHandlers(); Set<Entry<String,String>> entries = atmosphereHandlerNames.entrySet(); for (Entry<String,String> entry: entries){ atmosphereHandlers.put(entry.getKey(), wrapper); boolean isJersey = false; for (Property p: reader.getProperty(entry.getValue())){ if (p.value != null && p.value.indexOf("jersey") != -1){ isJersey = true; for (Property p: reader.getProperty(entry.getValue())){ IntrospectionUtils.addProperty(g,p.name,p.value); String broadcasterClass = reader.getBroadcasterClass(entry.getKey()); if (broadcasterClass != null){ wrapper.broadcaster = (Broadcaster) if (reader.getCometSupportClass() != null){ cometSupport = (CometSupport) c.loadClass(reader.getCometSupportClass()).newInstance();
AtmosphereConfigReader.getInstance().parse(config, stream); AtmosphereHandler handler = null; for (AtmosphereHandlerConfig atmoHandler : config.getAtmosphereHandlerConfig()) {
atmosphereHandlerProperties.put(attrs.getNamedItem("class-name").getNodeValue(), list); addAtmosphereHandler(attrs.getNamedItem("context-root").getNodeValue(), attrs.getNamedItem("class-name").getNodeValue());
public AtmosphereConfig parse(AtmosphereConfig config, InputStream stream) throws FileNotFoundException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { return parse(config, factory.newDocumentBuilder().parse(stream)); } catch (SAXException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } catch (IOException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } catch (ParserConfigurationException e) { logger.error(e.getMessage(), e); throw new RuntimeException(e); } }
/** * Create a {@link Dom} element from META-INF/atmosphere.xml * @param stream */ public AtmosphereConfigReader(InputStream stream) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { parse(factory.newDocumentBuilder().parse(stream)); } catch (SAXException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new RuntimeException(e); } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new RuntimeException(e); } catch (ParserConfigurationException e) { logger.log(Level.SEVERE, e.getMessage(), e); throw new RuntimeException(e); } }