Ejemplo n.º 1
0
  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;
  }