org.apache.abdera.protocol.client.cache
Class InMemoryCache

java.lang.Object
  extended by org.apache.abdera.protocol.client.cache.AbstractCache
      extended by org.apache.abdera.protocol.client.cache.InMemoryCache
All Implemented Interfaces:
Iterable<Object>, Cache
Direct Known Subclasses:
LRUCache

public abstract class InMemoryCache
extends AbstractCache


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.client.cache.Cache
Cache.Disposition
 
Field Summary
protected  Map<Object,CachedResponse> cache
           
 
Fields inherited from class org.apache.abdera.protocol.client.cache.AbstractCache
abdera
 
Constructor Summary
protected InMemoryCache(Abdera abdera, Map<Object,CachedResponse> map)
           
 
Method Summary
protected  void add(Object key, CachedResponse response)
           
 Cache clear()
          Clear all items from the cache
protected  CachedResponse createCachedResponse(ClientResponse response, Object key)
           
 CachedResponse get(Object key)
          Get a specific item from the cache
 Iterator<Object> iterator()
           
 Cache remove(Object key)
          Remove a specific item from the cache
 
Methods inherited from class org.apache.abdera.protocol.client.cache.AbstractCache
disposition, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected final transient Map<Object,CachedResponse> cache
Constructor Detail

InMemoryCache

protected InMemoryCache(Abdera abdera,
                        Map<Object,CachedResponse> map)
Method Detail

createCachedResponse

protected CachedResponse createCachedResponse(ClientResponse response,
                                              Object key)
                                       throws IOException
Specified by:
createCachedResponse in class AbstractCache
Throws:
IOException

clear

public Cache clear()
Description copied from interface: Cache
Clear all items from the cache


get

public CachedResponse get(Object key)
Description copied from interface: Cache
Get a specific item from the cache


remove

public Cache remove(Object key)
Description copied from interface: Cache
Remove a specific item from the cache


add

protected void add(Object key,
                   CachedResponse response)
Specified by:
add in class AbstractCache

iterator

public Iterator<Object> iterator()


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.