| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.swarmcache.HybridCache
public class HybridCache
A hybrid cache solution that uses a (presumably small) LRU cache backed by a larger AutoCache. This implementation aims to be a good trade-off between cache hit frequency and agressive memory usage.
| Constructor Summary | |
|---|---|
HybridCache()
 | 
|
| Method Summary | |
|---|---|
 java.lang.Object | 
clear(java.io.Serializable key)
Clears an object from the cache by key.  | 
 void | 
clearAll()
Clears the entire cache.  | 
 java.lang.Object | 
get(java.io.Serializable key)
Gets an object from the cache by key, or returns null if that object is not cached.  | 
 java.util.Set | 
getAllKeys()
Get all items.  | 
 java.lang.String | 
getType()
Gets the common name of the type of objects to cache.  | 
 void | 
objectRemoved(java.io.Serializable key,
              java.lang.Object value)
Called when an object is automatically removed from the LRU cache.  | 
 void | 
put(java.io.Serializable key,
    java.lang.Object object)
Adds an object to the cache.  | 
 void | 
setSize(int newSize)
Sets the size of the LRU cache.  | 
 void | 
setType(java.lang.String type)
Sets the common name of the type of objects to cache.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public HybridCache()
| Method Detail | 
|---|
public void setSize(int newSize)
public java.lang.String getType()
ObjectCache
getType in interface ObjectCachepublic void setType(java.lang.String type)
ObjectCache
setType in interface ObjectCache
public void objectRemoved(java.io.Serializable key,
                          java.lang.Object value)
objectRemoved in interface LRUCacheListener
public void put(java.io.Serializable key,
                java.lang.Object object)
ObjectCache
put in interface ObjectCachepublic java.lang.Object get(java.io.Serializable key)
ObjectCache
get in interface ObjectCachepublic java.lang.Object clear(java.io.Serializable key)
ObjectCache
clear in interface ObjectCachepublic void clearAll()
ObjectCache
clearAll in interface ObjectCachepublic java.util.Set getAllKeys()
ObjectCache
getAllKeys in interface ObjectCache
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||