|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl
| Constructor Summary | |
QueryCacheImpl()
|
|
| Method Summary | |
void |
classesChanged(Set classes)
Invoked when objects of the types in the classes set have been changed. |
void |
clear()
Remove all data from this cache. |
void |
close()
Close this cache, dropping all hard references and releasing any resources that this cache maintains. |
void |
endConfiguration()
Invoked upon completion of configuration of this object |
List |
get(QueryKey qk)
Return a list of OIDs for the given query key. |
CacheMap |
getCacheMap()
Returns the underlying CacheMap that this
QueryCacheImpl is using. |
int |
getCacheSize()
Returns the maximum number of unpinned objects to keep hard references to. |
com.solarmetric.util.Listener |
getExpirationListener()
Returns this query cache's expiration listener. |
protected CacheMap |
newCacheMap()
Returns a new CacheMap for use as the underlying data
cache. |
void |
notifyChangedClasses(Set classes)
Tells the cache that all the classes in the classes set have been changed. |
boolean |
pin(QueryKey qk)
Pin the value stored under qk into the
cache. |
List |
put(QueryKey qk,
List oids)
Set the list of OIDs for the given query key. |
void |
registerClassChangeListener(ClassChangeListener ccl)
Register ccl with this cache. |
List |
remove(QueryKey qk)
Remove the value stored under the given query key. |
void |
setCacheSize(int size)
Sets the maximum number of unpinned objects to keep hard references to. |
void |
startConfiguration()
Invoked before configuration is begun on this object |
boolean |
unpin(QueryKey qk)
Unpin the value stored under key into the cache. |
void |
unregisterClassChangeListener(ClassChangeListener ccl)
Unregister ccl from the set of listeners managed
by this cache. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public QueryCacheImpl()
| Method Detail |
public CacheMap getCacheMap()
Returns the underlying CacheMap that this
QueryCacheImpl is using. This is not an
unmodifiable view on the map, so care should be taken with
this reference. Implementations should probably not mess with
the contents of the cache, but should only use this reference
to obtain cache metrics. Additionally, this map may contain
expired data. Removal of timed-out data is done in a lazy
fashion, so the actual size of the map may be greater than the
number of non-expired query results in cache.
Methods that manipulate the cache map should synchronize on the map.
public void setCacheSize(int size)
size, then this method will result in the cache
flushing old values.public int getCacheSize()
protected CacheMap newCacheMap()
CacheMap for use as the underlying data
cache. This implementation returns a CacheMap. To
implement a more sophisticated caching strategy, override this
method to return a subclass of CacheMap.public void notifyChangedClasses(Set classes)
QueryCacheTells the cache that all the classes in the
classes set have been changed. This could mean
that items have been updated, deleted, or added. This limits
the QueryCache to only be able to invalidate
cached queries -- because the cache is not notified of actual
changes, it cannot recompute query results.
After this method is invoked, all cached results that
correspond to queries that use one of the classes in
classes will be dropped.
notifyChangedClasses in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCacheclasses - a Set of Class objects that
correspond to instances that have changedpublic void registerClassChangeListener(ClassChangeListener ccl)
QueryCacheccl with this cache.registerClassChangeListener in interface QueryCachepublic void unregisterClassChangeListener(ClassChangeListener ccl)
QueryCacheccl from the set of listeners managed
by this cache.unregisterClassChangeListener in interface QueryCachepublic void classesChanged(Set classes)
ClassChangeListenerInvoked when objects of the types in the
classes set have been changed. This could mean
that items have been updated, deleted, or added.
classesChanged in interface ClassChangeListenercom.solarmetric.kodo.runtime.datacache.query.ClassChangeListenerclasses - a Set of Class objects that
correspond to instances that have changedpublic List get(QueryKey qk)
QueryCacheReturn a list of OIDs for the given query key. This is an unmodifiable list.
get in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCache
public List put(QueryKey qk,
List oids)
QueryCacheSet the list of OIDs for the given query key. A reference to the given list will be stored in the query cache, so the list should not be modified after invoking this method.
put in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCachenull if
the key was not previously cached. See Map.put(java.lang.Object, java.lang.Object)
for more information.public List remove(QueryKey qk)
QueryCacheRemove the value stored under the given query key.
This method is typically not invoked directly from outside
the QueryCache class. Instead, the cache should
be updated by invoking #notifyChanges, which will
result in all queries that may be invalid being dropped.
remove in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCachenull if
the key was not previously cached. See Map.remove(java.lang.Object)
for more information.public void clear()
QueryCacheRemove all data from this cache.
clear in interface QueryCachepublic boolean pin(QueryKey qk)
QueryCacheqk into the
cache. This method guarantees that qk's value
will not be expired if the cache exceeds its capacity. It
causes this data to be ignored when determining whether or not
the cache is full, effectively increasing the total amount of
data stored in the cache. This method does not affect the
behavior of QueryCache.remove(com.solarmetric.kodo.runtime.datacache.query.QueryKey) or #notifyChanges.pin in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCachetrue if key's value was
pinned into the cache; false if the
key is not in the cache.public boolean unpin(QueryKey qk)
QueryCachekey into the cache.
This method reverses a previous invocation of QueryCache.pin(com.solarmetric.kodo.runtime.datacache.query.QueryKey).
This method does not remove anything from the cache; it merely
makes key's value a candidate for flushing from
the cache.unpin in interface QueryCachecom.solarmetric.kodo.runtime.datacache.query.QueryCachetrue if key's value was
unpinned from the cache; false if the
key is not in the cache.public void close()
QueryCacheclose in interface QueryCachepublic com.solarmetric.util.Listener getExpirationListener()
QueryCachegetExpirationListener in interface QueryCachepublic void startConfiguration()
ConfigurablestartConfiguration in interface Configurablepublic void endConfiguration()
ConfigurableendConfiguration in interface Configurable
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||