|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.cache.MapQueryCache
public class MapQueryCache
A default implementation of the QueryCache interface that stores data in a
non-expiring LRUMap.
| Field Summary | |
|---|---|
static int |
DEFAULT_CACHE_SIZE
|
protected Map |
map
|
| Constructor Summary | |
|---|---|
MapQueryCache()
|
|
MapQueryCache(int maxSize)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears all entries. |
List |
get(QueryMetadata metadata)
Returns a cached query result for the given QueryMetadata or null if the result is not cached or is expired. |
List |
get(QueryMetadata metadata,
QueryCacheEntryFactory factory)
Returns a non-null cached value. |
void |
put(QueryMetadata metadata,
List results)
|
void |
remove(String key)
Removes a single entry from cache. |
void |
removeGroup(String groupKey)
Removes a group of entries identified by group key. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_CACHE_SIZE
protected Map map
| Constructor Detail |
|---|
public MapQueryCache()
public MapQueryCache(int maxSize)
| Method Detail |
|---|
public List get(QueryMetadata metadata)
QueryCache
get in interface QueryCache
public List get(QueryMetadata metadata,
QueryCacheEntryFactory factory)
QueryCacheEntryFactory.createObject() without blocking the cache. As
a result there is a potential of multiple threads to be updating cache in parallel -
this wouldn't lead to corruption of the cache, but can be suboptimal.
get in interface QueryCache
public void put(QueryMetadata metadata,
List results)
put in interface QueryCachepublic void remove(String key)
QueryCache
remove in interface QueryCachepublic void removeGroup(String groupKey)
QueryCache
removeGroup in interface QueryCachepublic void clear()
QueryCache
clear in interface QueryCachepublic int size()
size in interface QueryCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||