Java 类org.eclipse.jetty.server.ssl.SslConnector 实例源码

项目:search    文件:JettySolrRunner.java   
/**
 * Returns a base URL consisting of the protocal, host, and port for a 
 * Connector in use by the Jetty Server contained in this runner.
 */
public URL getBaseUrl() {
  String protocol = null;
  try {
    Connector[] conns = server.getConnectors();
    if (0 == conns.length) {
      throw new IllegalStateException("Jetty Server has no Connectors");
    }
    Connector c = conns[0];
    if (c.getLocalPort() < 0) {
      throw new IllegalStateException("Jetty Connector is not open: " + 
                                      c.getLocalPort());
    }
    protocol = (c instanceof SslConnector) ? "https" : "http";
    return new URL(protocol, c.getHost(), c.getLocalPort(), context);

  } catch (MalformedURLException e) {
    throw new  IllegalStateException
      ("Java could not make sense of protocol: " + protocol, e);
  }
}
项目:NYBC    文件:JettySolrRunner.java   
/**
 * Returns a base URL consisting of the protocal, host, and port for a 
 * Connector in use by the Jetty Server contained in this runner.
 */
public URL getBaseUrl() {
  String protocol = null;
  try {
    Connector[] conns = server.getConnectors();
    if (0 == conns.length) {
      throw new IllegalStateException("Jetty Server has no Connectors");
    }
    Connector c = conns[0];
    if (c.getLocalPort() < 0) {
      throw new IllegalStateException("Jetty Connector is not open: " + 
                                      c.getLocalPort());
    }
    protocol = (c instanceof SslConnector) ? "https" : "http";
    return new URL(protocol, c.getHost(), c.getLocalPort(), context);

  } catch (MalformedURLException e) {
    throw new  IllegalStateException
      ("Java could not make sense of protocol: " + protocol, e);
  }
}
项目:search-core    文件:JettySolrRunner.java   
/**
 * Returns a base URL consisting of the protocal, host, and port for a 
 * Connector in use by the Jetty Server contained in this runner.
 */
public URL getBaseUrl() {
  String protocol = null;
  try {
    Connector[] conns = server.getConnectors();
    if (0 == conns.length) {
      throw new IllegalStateException("Jetty Server has no Connectors");
    }
    Connector c = conns[0];
    if (c.getLocalPort() < 0) {
      throw new IllegalStateException("Jetty Connector is not open: " + 
                                      c.getLocalPort());
    }
    protocol = (c instanceof SslConnector) ? "https" : "http";
    return new URL(protocol, c.getHost(), c.getLocalPort(), context);

  } catch (MalformedURLException e) {
    throw new  IllegalStateException
      ("Java could not make sense of protocol: " + protocol, e);
  }
}
项目:read-open-source-code    文件:JettySolrRunner.java   
/**
 * Returns a base URL consisting of the protocal, host, and port for a 
 * Connector in use by the Jetty Server contained in this runner.
 */
public URL getBaseUrl() {
  String protocol = null;
  try {
    Connector[] conns = server.getConnectors();
    if (0 == conns.length) {
      throw new IllegalStateException("Jetty Server has no Connectors");
    }
    Connector c = conns[0];
    if (c.getLocalPort() < 0) {
      throw new IllegalStateException("Jetty Connector is not open: " + 
                                      c.getLocalPort());
    }
    protocol = (c instanceof SslConnector) ? "https" : "http";
    return new URL(protocol, c.getHost(), c.getLocalPort(), context);

  } catch (MalformedURLException e) {
    throw new  IllegalStateException
      ("Java could not make sense of protocol: " + protocol, e);
  }
}
项目:read-open-source-code    文件:JettySolrRunner.java   
/**
 * Returns a base URL consisting of the protocal, host, and port for a 
 * Connector in use by the Jetty Server contained in this runner.
 */
public URL getBaseUrl() {
  String protocol = null;
  try {
    Connector[] conns = server.getConnectors();
    if (0 == conns.length) {
      throw new IllegalStateException("Jetty Server has no Connectors");
    }
    Connector c = conns[0];
    if (c.getLocalPort() < 0) {
      throw new IllegalStateException("Jetty Connector is not open: " + 
                                      c.getLocalPort());
    }
    protocol = (c instanceof SslConnector) ? "https" : "http";
    return new URL(protocol, c.getHost(), c.getLocalPort(), context);

  } catch (MalformedURLException e) {
    throw new  IllegalStateException
      ("Java could not make sense of protocol: " + protocol, e);
  }
}