com.sun.jini.jeri.internal.http
Class HttpClientManager

java.lang.Object
  extended by com.sun.jini.jeri.internal.http.HttpClientManager

public class HttpClientManager
extends Object

Class for managing client-side functions shared among multiple connections (e.g., tracking of unsent response acknowledgments, caching of information about contacted HTTP servers).

Author:
Sun Microsystems, Inc.

Nested Class Summary
private static class HttpClientManager.ServerKey
          Server lookup key.
 
Field Summary
private  SoftCache rolodex
           
private static Executor systemThreadPool
           
private  TimedMap unsentAcks
           
 
Constructor Summary
HttpClientManager(long ackTimeout)
          Creates new HttpClientManager which expires unsent acknowledgments after the specified timeout.
 
Method Summary
(package private)  void addUnsentAcks(String host, int port, String[] cookies)
          Adds to list of unsent acknowledgments for server at given host/port.
(package private)  void cacheServerInfo(ServerInfo info)
          Caches HTTP server information, overwriting any previously registered information for server if timestamp is more recent.
 void clearServerInfo()
          Forgets all cached information about contacted HTTP servers.
(package private)  void clearUnsentAcks(String host, int port, String[] cookies)
          Removes cookies from list of unsent acknowledgments for server at given host/port.
(package private)  ServerInfo getServerInfo(String host, int port)
          Returns cached information about specified HTTP server, or ServerInfo struct with default values if no entry found.
(package private)  String[] getUnsentAcks(String host, int port)
          Returns list of unsent acknowledgments for server at given host/port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

systemThreadPool

private static final Executor systemThreadPool

rolodex

private final SoftCache rolodex

unsentAcks

private final TimedMap unsentAcks
Constructor Detail

HttpClientManager

public HttpClientManager(long ackTimeout)
Creates new HttpClientManager which expires unsent acknowledgments after the specified timeout.

Method Detail

clearServerInfo

public void clearServerInfo()
Forgets all cached information about contacted HTTP servers.


addUnsentAcks

void addUnsentAcks(String host,
                   int port,
                   String[] cookies)
Adds to list of unsent acknowledgments for server at given host/port.


clearUnsentAcks

void clearUnsentAcks(String host,
                     int port,
                     String[] cookies)
Removes cookies from list of unsent acknowledgments for server at given host/port.


getUnsentAcks

String[] getUnsentAcks(String host,
                       int port)
Returns list of unsent acknowledgments for server at given host/port.


getServerInfo

ServerInfo getServerInfo(String host,
                         int port)
Returns cached information about specified HTTP server, or ServerInfo struct with default values if no entry found.


cacheServerInfo

void cacheServerInfo(ServerInfo info)
Caches HTTP server information, overwriting any previously registered information for server if timestamp is more recent.



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