public class

KeepAliveCache

extends ConcurrentHashMap<K, V>
implements Runnable
java.lang.Object
   ↳ java.util.AbstractMap<K, V>
     ↳ java.util.concurrent.ConcurrentHashMap<K, V>
       ↳ sun.net.www.http.KeepAliveCache

Class Overview

A class that implements a cache of idle Http connections for keep-alive

Summary

Public Constructors
KeepAliveCache()
Constructor
Public Methods
synchronized Object get(URL url, Object obj)
Check to see if this URL has a cached HttpClient
synchronized void put(URL url, Object obj, HttpClient http)
Register this URL and HttpClient (that supports keep-alive) with the cache
synchronized void remove(HttpClient h, Object obj)
void run()
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
[Expand]
Inherited Methods
From class java.util.concurrent.ConcurrentHashMap
From class java.util.AbstractMap
From class java.lang.Object
From interface java.lang.Runnable
From interface java.util.Map
From interface java.util.concurrent.ConcurrentMap

Public Constructors

public KeepAliveCache ()

Constructor

Public Methods

public synchronized Object get (URL url, Object obj)

Check to see if this URL has a cached HttpClient

public synchronized void put (URL url, Object obj, HttpClient http)

Register this URL and HttpClient (that supports keep-alive) with the cache

Parameters
url The URL contains info about the host and port
http The HttpClient to be cached

public synchronized void remove (HttpClient h, Object obj)

public void run ()

When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

The general contract of the method run is that it may take any action whatsoever.