public class AbstractMapQueryResultsCache extends Object implements QueryResultsCache
Constructor and Description |
---|
AbstractMapQueryResultsCache(NucleusContext nucleusCtx) |
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.
|
boolean |
isEmpty()
Accessor for whether the cache is empty.
|
void |
pin(Query query)
Method to pin the specified query in the cache, preventing garbage collection.
|
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.
|
int |
size()
Accessor for the total number of results in the query cache.
|
void |
unpin(Query query)
Method to unpin the specified query from the cache, allowing garbage collection.
|
void |
unpin(Query query,
Map params)
Method to unpin the specified query from the cache, allowing garbage collection.
|
public AbstractMapQueryResultsCache(NucleusContext nucleusCtx)
public void close()
QueryResultsCache
close
in interface QueryResultsCache
public boolean contains(String queryKey)
QueryResultsCache
contains
in interface QueryResultsCache
queryKey
- The query keypublic void evict(Class candidate)
QueryResultsCache
evict
in interface QueryResultsCache
candidate
- The candidatepublic void evictAll()
QueryResultsCache
evictAll
in interface QueryResultsCache
public void evict(Query query)
QueryResultsCache
evict
in interface QueryResultsCache
query
- The query to evict (evicts all use of this query, with any params)public void evict(Query query, Map params)
QueryResultsCache
evict
in interface QueryResultsCache
query
- The query to evictparams
- The parameterspublic void pin(Query query, Map params)
QueryResultsCache
pin
in interface QueryResultsCache
query
- The queryparams
- Its paramspublic void pin(Query query)
QueryResultsCache
pin
in interface QueryResultsCache
query
- The querypublic void unpin(Query query, Map params)
QueryResultsCache
unpin
in interface QueryResultsCache
query
- The queryparams
- Its paramspublic void unpin(Query query)
QueryResultsCache
unpin
in interface QueryResultsCache
query
- The querypublic List<Object> get(String queryKey)
QueryResultsCache
get
in interface QueryResultsCache
queryKey
- The query keypublic boolean isEmpty()
QueryResultsCache
isEmpty
in interface QueryResultsCache
public List<Object> put(String queryKey, List<Object> results)
QueryResultsCache
put
in interface QueryResultsCache
queryKey
- The query keyresults
- The results for this querypublic int size()
QueryResultsCache
size
in interface QueryResultsCache
Copyright © 2019. All rights reserved.