Class JavaxCacheQueryResultCache
java.lang.Object
org.datanucleus.store.query.cache.AbstractQueryResultsCache
org.datanucleus.store.query.cache.JavaxCacheQueryResultCache
- All Implemented Interfaces:
Serializable, QueryResultsCache
Implementation of a query results cache using javax.cache (v0.3+) interface.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.cache.Cacheprivate static final longFields inherited from class AbstractQueryResultsCache
cacheName, clearAtClose, expiryMillis, maxSize, nucleusCtx -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Method to close the cache when no longer needed.booleanAccessor for whether the specified query is in the cachevoidMethod to evict all queries that use the provided class as candidate.voidEvict the query from the results cache.voidEvict the query with the specified params from the results cache.voidevictAll()Method to clear the cache.Accessor for the results from the cache.Method to put an object in the cache.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cache
private javax.cache.Cache cache
-
-
Constructor Details
-
JavaxCacheQueryResultCache
Constructor.- Parameters:
nucleusCtx- Context
-
-
Method Details
-
close
public void close()Description copied from interface:QueryResultsCacheMethod to close the cache when no longer needed. Provides a hook to release resources etc. -
contains
Description copied from interface:QueryResultsCacheAccessor for whether the specified query is in the cache- Parameters:
queryKey- The query key- Returns:
- Whether it is in the cache
-
evict
Description copied from interface:QueryResultsCacheMethod to evict all queries that use the provided class as candidate. This is usually called when an instance of the candidate has been changed in the datastore.- Parameters:
candidate- The candidate
-
evict
Description copied from interface:QueryResultsCacheEvict the query from the results cache.- Parameters:
query- The query to evict (evicts all use of this query, with any params)
-
evict
Description copied from interface:QueryResultsCacheEvict the query with the specified params from the results cache.- Parameters:
query- The query to evictparams- The parameters
-
evictAll
public void evictAll()Description copied from interface:QueryResultsCacheMethod to clear the cache. -
get
Description copied from interface:QueryResultsCacheAccessor for the results from the cache.- Parameters:
queryKey- The query key- Returns:
- The cached query result ids
-
put
-