private void loadJettyConfiguration(@Nullable URL cfgUrl) throws IgniteCheckedException {
  if (cfgUrl == null) {
    HttpConfiguration httpCfg=new HttpConfiguration();
    httpCfg.setSecureScheme("https");
    httpCfg.setSecurePort(8443);
    httpCfg.setSendServerVersion(true);
    httpCfg.setSendDateHeader(true);
    String srvPortStr=System.getProperty(IGNITE_JETTY_PORT,"8080");
    int srvPort;
    try {
      srvPort=Integer.parseInt(srvPortStr);
    }
 catch (    NumberFormatException ignore) {
      throw new IgniteCheckedException("Failed to start Jetty server because IGNITE_JETTY_PORT system property " + "cannot be cast to integer: " + srvPortStr);
    }
    httpSrv=new Server(new QueuedThreadPool(200,20));
    ServerConnector srvConn=new ServerConnector(httpSrv,new HttpConnectionFactory(httpCfg));
    srvConn.setHost(System.getProperty(IGNITE_JETTY_HOST,"localhost"));
    srvConn.setPort(srvPort);
    srvConn.setIdleTimeout(30000L);
    srvConn.setReuseAddress(true);
    httpSrv.addConnector(srvConn);
    httpSrv.setStopAtShutdown(false);
  }
 else {
    XmlConfiguration cfg;
    try {
      cfg=new XmlConfiguration(cfgUrl);
    }
 catch (    FileNotFoundException e) {
      throw new IgniteSpiException("Failed to find configuration file: " + cfgUrl,e);
    }
catch (    SAXException e) {
      throw new IgniteSpiException("Failed to parse configuration file: " + cfgUrl,e);
    }
catch (    IOException e) {
      throw new IgniteSpiException("Failed to load configuration file: " + cfgUrl,e);
    }
catch (    Exception e) {
      throw new IgniteSpiException("Failed to start HTTP server with configuration file: " + cfgUrl,e);
    }
    try {
      httpSrv=(Server)cfg.configure();
    }
 catch (    Exception e) {
      throw new IgniteCheckedException("Failed to start Jetty HTTP server.",e);
    }
  }
  assert httpSrv != null;
  httpSrv.setHandler(jettyHnd);
  override(getJettyConnector());
}

private void loadJettyConfiguration ( @ Nullable URL cfgUrl ) throws IgniteCheckedException { if ( cfgUrl == null ) { HttpConfiguration httpCfg = new HttpConfiguration ( ) ; httpCfg . setSecureScheme ( "https" ) ; httpCfg . setSecurePort ( 8443 ) ; httpCfg . setSendServerVersion ( true ) ; httpCfg . setSendDateHeader ( true ) ; String srvPortStr = System . getProperty ( IGNITE_JETTY_PORT , "8080" ) ; int srvPort ; try { srvPort = Integer . parseInt ( srvPortStr ) ; } catch ( NumberFormatException ignore ) { throw new IgniteCheckedException ( "Failed to start Jetty server because IGNITE_JETTY_PORT system property " + "cannot be cast to integer: " + srvPortStr ) ; } httpSrv = new Server ( new QueuedThreadPool ( 200 , 20 ) ) ; ServerConnector srvConn = new ServerConnector ( httpSrv , new HttpConnectionFactory ( httpCfg ) ) ; srvConn . setHost ( System . getProperty ( IGNITE_JETTY_HOST , "localhost" ) ) ; srvConn . setPort ( srvPort ) ; srvConn . setIdleTimeout ( 30000L ) ; srvConn . setReuseAddress ( true ) ; httpSrv . addConnector ( srvConn ) ; httpSrv . setStopAtShutdown ( false ) ; } else { XmlConfiguration cfg ; try { cfg = new XmlConfiguration ( cfgUrl ) ; } catch ( FileNotFoundException e ) { throw new IgniteSpiException ( "Failed to find configuration file: " + cfgUrl , e ) ; } catch ( SAXException e ) { throw new IgniteSpiException ( "Failed to parse configuration file: " + cfgUrl , e ) ; } catch ( IOException e ) { throw new IgniteSpiException ( "Failed to load configuration file: " + cfgUrl , e ) ; } catch ( Exception e ) { throw new IgniteSpiException ( "Failed to start HTTP server with configuration file: " + cfgUrl , e ) ; } try { httpSrv = ( Server ) cfg . configure ( ) ; } catch ( Exception e ) { throw new IgniteCheckedException ( "Failed to start Jetty HTTP server." , e ) ; } } assert httpSrv != null ; httpSrv . setHandler ( jettyHnd ) ; override ( getJettyConnector ( ) ) ; }
loads jetty configuration from the given url .
