Class JavaxCacheQueryCompilationCache
- java.lang.Object
-
- org.datanucleus.store.query.cache.JavaxCacheQueryCompilationCache
-
- All Implemented Interfaces:
Serializable
,QueryCompilationCache
public class JavaxCacheQueryCompilationCache extends Object implements QueryCompilationCache, Serializable
Query compilation cache using javax.cache for implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JavaxCacheQueryCompilationCache(NucleusContext nucleusCtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Method to clear the cache.void
close()
Method to close the cache when no longer needed.boolean
contains(String queryKey)
Accessor for whether the specified query is in the cachevoid
evict(String queryKey)
Evict the query from the compilation cache.QueryCompilation
get(String queryKey)
Accessor for a (generic) compilation from the cache.boolean
isEmpty()
Accessor for whether the cache is empty.QueryCompilation
put(String queryKey, QueryCompilation compilation)
Method to put an object in the cache.int
size()
Accessor for the total number of compilations in the query cache.
-
-
-
Constructor Detail
-
JavaxCacheQueryCompilationCache
public JavaxCacheQueryCompilationCache(NucleusContext nucleusCtx)
-
-
Method Detail
-
close
public void close()
Description copied from interface:QueryCompilationCache
Method to close the cache when no longer needed. Provides a hook to release resources etc.- Specified by:
close
in interfaceQueryCompilationCache
-
evict
public void evict(String queryKey)
Description copied from interface:QueryCompilationCache
Evict the query from the compilation cache.- Specified by:
evict
in interfaceQueryCompilationCache
- Parameters:
queryKey
- Key for the query to evict.
-
clear
public void clear()
Description copied from interface:QueryCompilationCache
Method to clear the cache.- Specified by:
clear
in interfaceQueryCompilationCache
-
isEmpty
public boolean isEmpty()
Description copied from interface:QueryCompilationCache
Accessor for whether the cache is empty.- Specified by:
isEmpty
in interfaceQueryCompilationCache
- Returns:
- Whether it is empty.
-
size
public int size()
Description copied from interface:QueryCompilationCache
Accessor for the total number of compilations in the query cache.- Specified by:
size
in interfaceQueryCompilationCache
- Returns:
- Number of queries
-
get
public QueryCompilation get(String queryKey)
Description copied from interface:QueryCompilationCache
Accessor for a (generic) compilation from the cache.- Specified by:
get
in interfaceQueryCompilationCache
- Parameters:
queryKey
- The query key- Returns:
- The cached query compilation
-
put
public QueryCompilation put(String queryKey, QueryCompilation compilation)
Description copied from interface:QueryCompilationCache
Method to put an object in the cache.- Specified by:
put
in interfaceQueryCompilationCache
- Parameters:
queryKey
- The query keycompilation
- The compilation to cache- Returns:
- The cached query previously associated with this query
-
contains
public boolean contains(String queryKey)
Description copied from interface:QueryCompilationCache
Accessor for whether the specified query is in the cache- Specified by:
contains
in interfaceQueryCompilationCache
- Parameters:
queryKey
- The query key- Returns:
- Whether it is in the cache
-
-