Interface QueryResultsCache
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractMapQueryResultsCache, AbstractQueryResultsCache, JavaxCacheQueryResultCache, SoftQueryResultsCache, StrongQueryResultsCache, WeakQueryResultsCache
Cache for query results.
-
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.default booleanisEmpty()Accessor for whether the cache is empty.default voidMethod to pin the specified query in the cache, preventing garbage collection.default voidMethod to pin the specified query in the cache, preventing garbage collection.Method to put an object in the cache.default intsize()Accessor for the total number of results in the query cache.default voidMethod to unpin the specified query from the cache, allowing garbage collection.default voidMethod to unpin the specified query from the cache, allowing garbage collection.
-
Method Details
-
close
void close()Method to close the cache when no longer needed. Provides a hook to release resources etc. -
evict
Method 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
Evict the query from the results cache.- Parameters:
query- The query to evict (evicts all use of this query, with any params)
-
evict
-
evictAll
void evictAll()Method to clear the cache. -
pin
Method to pin the specified query in the cache, preventing garbage collection.- Parameters:
query- The query
-
pin
-
unpin
Method to unpin the specified query from the cache, allowing garbage collection.- Parameters:
query- The query
-
unpin
-
isEmpty
default boolean isEmpty()Accessor for whether the cache is empty.- Returns:
- Whether it is empty.
-
size
default int size()Accessor for the total number of results in the query cache.- Returns:
- Number of queries
-
get
-
put
-
contains
Accessor for whether the specified query is in the cache- Parameters:
queryKey- The query key- Returns:
- Whether it is in the cache
-