Package com.sun.jini.jeri.internal.http

Examples of com.sun.jini.jeri.internal.http.HttpSettings



    private OutboundRequest nextRequest(final Constraints.Distilled distilled)
  throws IOException
    {
  HttpSettings settings = getHttpSettings();
  String phost = settings.getProxyHost(host);
  boolean usingProxy = (phost.length() != 0);
  int pport;
  boolean ppersist;

  // If looking for a connection through an HTTP proxy, and if the
  // pingProxyConnectionTimeout has passed, then ping the server
  // endpoint to verify that the endpoint is alive and reachable.
  // This reduces the likelihood that a server endpoint having
  // terminated or having become unreachable won't be noticed
  // until after some or all of the data destined for the server
  // has already been sent to the proxy.

  if (!usingProxy) {
      pport = -1;
      ppersist = true;
  } else {
      pport = settings.getProxyPort();
      ppersist = !settings.getDisableProxyPersistentConnections();

      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    sm.checkConnect(host, port);
      }

      long now = System.currentTimeMillis();
      if (settings.getPingProxyConnections() &&
    now - timeLastVerified >
                          settings.getPingProxyConnectionTimeout())
      {
    Object obj = connectionAction(distilled, phost, pport, ppersist,
              new ConnectionAction() {
            public Object run(Connection conn)
          throws IOException
View Full Code Here


   * null.
   */
  HttpsConnection connect(CallContext context)
      throws IOException
  {
      HttpSettings settings = getHttpSettings();
      String phost = settings.getProxyHost(endpoint.serverHost);
      int pport = (phost.length() == 0) ? 0 : settings.getProxyPort();
      HttpsConnection result;
      synchronized (this) {
    List reap = new ArrayList(0);
    if (!(proxyHost.equals(phost) && proxyPort == pport)) {
        proxyHost = phost;
View Full Code Here


    private OutboundRequest nextRequest(final Constraints.Distilled distilled)
  throws IOException
    {
  HttpSettings settings = getHttpSettings();
  String phost = settings.getProxyHost(host);
  boolean usingProxy = (phost.length() != 0);
  int pport;
  boolean ppersist;

  // If looking for a connection through an HTTP proxy, and if the
  // pingProxyConnectionTimeout has passed, then ping the server
  // endpoint to verify that the endpoint is alive and reachable.
  // This reduces the likelihood that a server endpoint having
  // terminated or having become unreachable won't be noticed
  // until after some or all of the data destined for the server
  // has already been sent to the proxy.

  if (!usingProxy) {
      pport = -1;
      ppersist = true;
  } else {
      pport = settings.getProxyPort();
      ppersist = !settings.getDisableProxyPersistentConnections();

      SecurityManager sm = System.getSecurityManager();
      if (sm != null) {
    sm.checkConnect(host, port);
      }

      long now = System.currentTimeMillis();
      if (settings.getPingProxyConnections() &&
    now - timeLastVerified >
                          settings.getPingProxyConnectionTimeout())
      {
    Object obj = connectionAction(distilled, phost, pport, ppersist,
              new ConnectionAction() {
            public Object run(Connection conn)
          throws IOException
View Full Code Here

    // won't be noticed until after some or all of the data
    // destined for the server has already been sent to the
    // proxy.

    if (connection.usesHttpProxy()) {
        HttpSettings settings = getHttpSettings();
        if (settings.getPingProxyConnections()) {
      long timeout = settings.getPingProxyConnectionTimeout();
      long now = System.currentTimeMillis();
      if (now - timeLastVerified > timeout) {
          pingEndpoint(connection);
          // The ping succeeded, but the connection
          // cannot be reused as it was marked idle.
View Full Code Here

TOP

Related Classes of com.sun.jini.jeri.internal.http.HttpSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.