org.formaria.cache
Class Cache
java.lang.Object
org.formaria.cache.Cache
public class Cache
- extends java.lang.Object
A cache of objects
For licensing information see license.txt
|
Constructor Summary |
Cache()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Cache
public Cache()
put
public void put(java.lang.Object o)
putList
public void putList(java.util.List<?> l)
putList
public void putList(java.lang.Object[] l)
putTree
public void putTree(CachedObject<?> parent,
java.util.List<?> treeItems)
getByName
public java.lang.Object getByName(java.lang.String name,
java.lang.Object id)
- Lookup by the class's simple name (case insensitive)
- Parameters:
name - the simple nameid - the object id if any
- Returns:
- the raw object(s)
get
public java.lang.Object get(java.lang.Class cls,
java.lang.Object id)
- Get a cache object. For lists a shared index list is used so that while a
new list is returned for each invocation the index remains the same. In
this way the contents of the cache can be updated and augmented without
disturbing the client.
- Parameters:
cls - the cached object classid - the object id
- Returns:
remove
public void remove(java.lang.Class cls,
java.lang.Object id)
remove
public void remove(java.lang.Object obj)
isValid
protected boolean isValid(CachedObject co)
read
protected CachedObject read(java.lang.Class cls,
java.lang.Object id)
write
protected void write(CachedObject co)
getRemoteService
public ObjectAccessService getRemoteService()
setRemoteService
public void setRemoteService(ObjectAccessService roas)