| java.net.NegativeCache
NegativeCache | class NegativeCache extends LinkedHashMap (Code) | | This class is used to manage the negative name lookup cache.
|
Constructor Summary | |
| NegativeCache(int initialCapacity, float loadFactor, boolean accessOrder) |
LOADING | final static float LOADING(Code) | | |
MAX_NEGATIVE_ENTRIES | final static int MAX_NEGATIVE_ENTRIES(Code) | | |
NegativeCache | NegativeCache(int initialCapacity, float loadFactor, boolean accessOrder)(Code) | | Answers the hostname for the cache element
hostName name of the host on which the lookup failed |
checkCacheExists | static void checkCacheExists()(Code) | | This method checks if we have created the cache and if not creates it
|
getFailedMessage | static String getFailedMessage(String hostName)(Code) | | Answers the message that occurred when we failed to lookup the host if
such a failure is within the cache and the entry has not yet expired
Parameters: hostName - the name of the host for which we are looking for an entry the message which was returned when the host failed to be lookedup if there is still a valid entry within the cache |
put | static void put(String hostName, String failedMessage)(Code) | | Adds the host name and the corresponding name lookup fail message to the
cache
Parameters: hostName - the name of the host for which the lookup failed Parameters: failedMessage - the message returned when we failed the lookup |
removeEldestEntry | protected boolean removeEldestEntry(Map.Entry<K, V> eldest)(Code) | | Answers if we should remove the Eldest entry. We remove the eldest entry
if the size has grown beyond the maximum size allowed for the cache. We
create the LinkedHashMap such that this deletes the least recently used
entry
Parameters: eldest - the map entry which will be deleted if we return true |
|
|