public class EhCacheQueryCache extends Object implements QueryCache
Modifier and Type | Field and Description |
---|---|
protected CacheManager |
cacheManager |
Constructor and Description |
---|
EhCacheQueryCache() |
EhCacheQueryCache(CacheManager cacheManager) |
EhCacheQueryCache(String configFile) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all cache 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 cached query result for the given QueryMetadata.
|
Ehcache |
getDefaultCache()
Returns default cache group.
|
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.
|
void |
shutdown()
Shuts down EhCache CacheManager
|
int |
size()
Returns the number of entries currently in the cache, including expired but not
removed entries.
|
public EhCacheQueryCache()
public EhCacheQueryCache(String configFile)
public EhCacheQueryCache(CacheManager cacheManager)
public List get(QueryMetadata metadata)
QueryCache
get
in interface QueryCache
public List get(QueryMetadata metadata, QueryCacheEntryFactory factory)
QueryCache
QueryCache.get(QueryMetadata)
, this method allows the cache to do
appropriate synchronization when refreshing the entry, preventing multiple threads
from running the same query when a missing entry is requested by multiple threads
simultaneously.get
in interface QueryCache
public void put(QueryMetadata metadata, List results)
put
in interface QueryCache
public void remove(String key)
QueryCache
remove
in interface QueryCache
public void removeGroup(String groupKey)
QueryCache
removeGroup
in interface QueryCache
public void clear()
QueryCache
clear
in interface QueryCache
public int size()
QueryCache
size
in interface QueryCache
public Ehcache getDefaultCache()
@BeforeScopeEnd public void shutdown()
Copyright © 2001–2018 Apache Cayenne. All rights reserved.