public interface QueryResultsCache extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
close()
Method to close the cache when no longer needed.
|
boolean |
contains(String queryKey)
Accessor for whether the specified query is in the cache
|
void |
evict(Class candidate)
Method to evict all queries that use the provided class as candidate.
|
void |
evict(Query query)
Evict the query from the results cache.
|
void |
evict(Query query,
Map params)
Evict the query with the specified params from the results cache.
|
void |
evictAll()
Method to clear the cache.
|
List<Object> |
get(String queryKey)
Accessor for the results from the cache.
|
default boolean |
isEmpty()
Accessor for whether the cache is empty.
|
default void |
pin(Query query)
Method to pin the specified query in the cache, preventing garbage collection.
|
default void |
pin(Query query,
Map params)
Method to pin the specified query in the cache, preventing garbage collection.
|
List<Object> |
put(String queryKey,
List<Object> results)
Method to put an object in the cache.
|
default int |
size()
Accessor for the total number of results in the query cache.
|
default void |
unpin(Query query)
Method to unpin the specified query from the cache, allowing garbage collection.
|
default void |
unpin(Query query,
Map params)
Method to unpin the specified query from the cache, allowing garbage collection.
|
void close()
void evict(Class candidate)
candidate
- The candidatevoid evict(Query query)
query
- The query to evict (evicts all use of this query, with any params)void evict(Query query, Map params)
query
- The query to evictparams
- The parametersvoid evictAll()
default void pin(Query query)
query
- The querydefault void pin(Query query, Map params)
query
- The queryparams
- Its paramsdefault void unpin(Query query)
query
- The querydefault void unpin(Query query, Map params)
query
- The queryparams
- Its paramsdefault boolean isEmpty()
default int size()
List<Object> get(String queryKey)
queryKey
- The query keyList<Object> put(String queryKey, List<Object> results)
queryKey
- The query keyresults
- The results for this queryboolean contains(String queryKey)
queryKey
- The query keyCopyright © 2019. All rights reserved.