protected Element getRootElement(final URL url) throws Exception { Reader reader = new InputStreamReader(url.openStream()); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = org.hornetq.utils.XMLUtil.replaceSystemProps(xml); return org.hornetq.utils.XMLUtil.stringToElement(xml); }
protected Element getRootElement(final URI url) throws Exception { Reader reader = new InputStreamReader(url.toURL().openStream()); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = org.hornetq.utils.XMLUtil.replaceSystemProps(xml); return org.hornetq.utils.XMLUtil.stringToElement(xml); }
/** * Parse the JMS Configuration XML as a JMSConfiguration object */ public JMSConfiguration parseConfiguration(final InputStream stream) throws Exception { Reader reader = new InputStreamReader(stream); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); return parseConfiguration(XMLUtil.stringToElement(xml)); }
public Configuration parseMainConfig(final InputStream input) throws Exception { Reader reader = new InputStreamReader(input); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = org.hornetq.utils.XMLUtil.stringToElement(xml); Configuration config = new ConfigurationImpl(); parseMainConfig(e, config); return config; }
public Configuration parseMainConfig(final InputStream input) throws Exception { Reader reader = new InputStreamReader(input); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = org.hornetq.utils.XMLUtil.stringToElement(xml); Configuration config = new ConfigurationImpl(); parseMainConfig(e, config); return config; }
public synchronized void start() throws Exception { if (started) { return; } URL url = getClass().getClassLoader().getResource(configurationUrl); if (url == null) { // The URL is outside of the classloader. Trying a pure url now url = new URL(configurationUrl); } FileConfiguration.log.debug("Loading server configuration from " + url); Reader reader = new InputStreamReader(url.openStream()); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = org.hornetq.utils.XMLUtil.stringToElement(xml); FileConfigurationParser parser = new FileConfigurationParser(); // https://jira.jboss.org/browse/HORNETQ-478 - We only want to validate AIO when // starting the server // and we don't want to do it when deploying hornetq-queues.xml which uses the same parser and XML format parser.setValidateAIO(true); parser.parseMainConfig(e, this); started = true; }
public synchronized void start() throws Exception { if (started) { return; } URL url = getClass().getClassLoader().getResource(configurationUrl); if (url == null) { // The URL is outside of the classloader. Trying a pure url now url = new URL(configurationUrl); } HornetQServerLogger.LOGGER.debug("Loading server configuration from " + url); Reader reader = new InputStreamReader(url.openStream()); String xml = org.hornetq.utils.XMLUtil.readerToString(reader); xml = XMLUtil.replaceSystemProps(xml); Element e = org.hornetq.utils.XMLUtil.stringToElement(xml); FileConfigurationParser parser = new FileConfigurationParser(); // https://jira.jboss.org/browse/HORNETQ-478 - We only want to validate AIO when // starting the server // and we don't want to do it when deploying hornetq-queues.xml which uses the same parser and XML format parser.setValidateAIO(true); parser.parseMainConfig(e, this); started = true; }