public class EhCacheQueryCache extends Object implements QueryCache
Modifier and Type | Field and Description |
---|---|
protected net.sf.ehcache.CacheManager |
cacheManager |
Constructor and Description |
---|
EhCacheQueryCache() |
EhCacheQueryCache(net.sf.ehcache.CacheManager cacheManager) |
EhCacheQueryCache(String configFile) |
Modifier and Type | Method and Description |
---|---|
protected String |
cacheName(String key,
String... cacheGroups) |
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.
|
net.sf.ehcache.Ehcache |
getDefaultCache()
Deprecated.
since 4.0 - this method is no longer in use. If you are
overriding it, override
cacheName(String, String...)
instead. |
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(net.sf.ehcache.CacheManager cacheManager)
public List get(QueryMetadata metadata)
QueryCache
get
in interface QueryCache
public List get(QueryMetadata metadata, QueryCacheEntryFactory factory)
QueryCache
Compared to 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
@Deprecated public net.sf.ehcache.Ehcache getDefaultCache()
cacheName(String, String...)
instead.@BeforeScopeEnd public void shutdown()
Copyright © 2001–2015 Apache Cayenne. All rights reserved.