com.sun.syndication.fetcher.impl
Class HashMapFeedInfoCache

java.lang.Object
  extended bycom.sun.syndication.fetcher.impl.HashMapFeedInfoCache
All Implemented Interfaces:
FeedFetcherCache, java.io.Serializable

public class HashMapFeedInfoCache
extends java.lang.Object
implements FeedFetcherCache, java.io.Serializable

A very simple implementation of the FeedFetcherCache interface.

This implementation uses a HashMap to cache retrieved feeds. This implementation is most suitible for sort term (client aggregator?) use, as the memory usage will increase over time as the number of feeds in the cache increases.

Author:
Nick Lothian
See Also:
Serialized Form

Field Summary
(package private) static HashMapFeedInfoCache _instance
           
 
Constructor Summary
HashMapFeedInfoCache()
          Constructor for HashMapFeedInfoCache
 
Method Summary
protected  java.lang.Object get(java.lang.Object key)
           
 SyndFeedInfo getFeedInfo(java.net.URL feedUrl)
          Get a SyndFeedInfo object from the cache.
protected  java.util.Map getInfoCache()
           
static FeedFetcherCache getInstance()
          Get the global instance of the cache
protected  void put(java.lang.Object key, java.lang.Object value)
           
 void setFeedInfo(java.net.URL feedUrl, SyndFeedInfo syndFeedInfo)
          Add a SyndFeedInfo object to the cache
protected  void setInfoCache(java.util.Map map)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instance

static HashMapFeedInfoCache _instance
Constructor Detail

HashMapFeedInfoCache

public HashMapFeedInfoCache()

Constructor for HashMapFeedInfoCache

Only use this if you want multiple instances of the cache. Usually getInstance() is more appropriate.

Method Detail

getInstance

public static FeedFetcherCache getInstance()
Get the global instance of the cache

Returns:
an implementation of FeedFetcherCache

get

protected java.lang.Object get(java.lang.Object key)

getFeedInfo

public SyndFeedInfo getFeedInfo(java.net.URL feedUrl)
Description copied from interface: FeedFetcherCache
Get a SyndFeedInfo object from the cache.

Specified by:
getFeedInfo in interface FeedFetcherCache
Parameters:
feedUrl - The url of the feed
Returns:
A SyndFeedInfo or null if it is not in the cache
See Also:
extensions.io.FeedFetcherCache#getFeedInfo(java.net.URL)

put

protected void put(java.lang.Object key,
                   java.lang.Object value)

setFeedInfo

public void setFeedInfo(java.net.URL feedUrl,
                        SyndFeedInfo syndFeedInfo)
Description copied from interface: FeedFetcherCache
Add a SyndFeedInfo object to the cache

Specified by:
setFeedInfo in interface FeedFetcherCache
Parameters:
feedUrl - The url of the feed
syndFeedInfo - A SyndFeedInfo for the feed
See Also:
extensions.io.FeedFetcherCache#setFeedInfo(java.net.URL, extensions.io.SyndFeedInfo)

getInfoCache

protected java.util.Map getInfoCache()

setInfoCache

protected void setInfoCache(java.util.Map map)


Copyright © 2004 Sun Microsystems. All Rights Reserved.