net.jini.jeri.ssl
Class HttpsEndpoint.EndpointInfo

java.lang.Object
  extended by net.jini.jeri.ssl.HttpsEndpoint.EndpointInfo
Enclosing class:
HttpsEndpoint

private static final class HttpsEndpoint.EndpointInfo
extends Object

Manages the open connections associated with endpoints equal to a representative endpoint.


Field Summary
private  HttpsEndpoint.HttpsEndpointImpl endpoint
          A representative endpoint that equals the endpoint for all the connections.
private  List idle
          The idle connections for the endpoint.
private  List inUse
          The connections that are in use for the endpoint.
private  String proxyHost
          The proxy host, or empty string if using a direct connection.
private  int proxyPort
          The proxy port, ignored if using a direct connection.
 
Constructor Summary
HttpsEndpoint.EndpointInfo(HttpsEndpoint.HttpsEndpointImpl endpoint)
           
 
Method Summary
(package private)  boolean checkIdle(long now, List reap)
          For each connection, calls checkIdle on the connection and, if that returns true, removes the connection and adds it to the reap list.
(package private)  HttpsEndpoint.HttpsConnection connect(CallContext context)
          Chooses and returns an idle connection that satisfies the constraints, removing the connection from the list of idle connections and adding it to the list of ones in use, else returns null.
(package private)  void noteClosed(HttpsEndpoint.HttpsConnection connection)
          Removes a connection from the set of connections in use.
(package private)  void noteIdle(HttpsEndpoint.HttpsConnection connection)
          Removes a connection from the set of connections in use and adds it to the set of idle connections.
(package private)  void noteInUse(HttpsEndpoint.HttpsConnection connection)
          Adds a connection to the set of connections in use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpoint

private final HttpsEndpoint.HttpsEndpointImpl endpoint
A representative endpoint that equals the endpoint for all the connections.


proxyHost

private String proxyHost
The proxy host, or empty string if using a direct connection.


proxyPort

private int proxyPort
The proxy port, ignored if using a direct connection.


idle

private final List idle
The idle connections for the endpoint.


inUse

private final List inUse
The connections that are in use for the endpoint.

Constructor Detail

HttpsEndpoint.EndpointInfo

HttpsEndpoint.EndpointInfo(HttpsEndpoint.HttpsEndpointImpl endpoint)
Method Detail

connect

HttpsEndpoint.HttpsConnection connect(CallContext context)
                                throws IOException
Chooses and returns an idle connection that satisfies the constraints, removing the connection from the list of idle connections and adding it to the list of ones in use, else returns null.

Throws:
IOException

noteInUse

void noteInUse(HttpsEndpoint.HttpsConnection connection)
Adds a connection to the set of connections in use.


noteClosed

void noteClosed(HttpsEndpoint.HttpsConnection connection)
Removes a connection from the set of connections in use.


noteIdle

void noteIdle(HttpsEndpoint.HttpsConnection connection)
Removes a connection from the set of connections in use and adds it to the set of idle connections.


checkIdle

boolean checkIdle(long now,
                  List reap)
For each connection, calls checkIdle on the connection and, if that returns true, removes the connection and adds it to the reap list. Returns true if no in-use or idle connections remain.



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.