org.datanucleus.query.cache
Interface QueryCompilationCache

All Known Implementing Classes:
SoftQueryCompilationCache, StrongQueryCompilationCache, WeakQueryCompilationCache

public interface QueryCompilationCache

Cache for query compilations (generic).


Method Summary
 void clear()
          Method to clear the cache.
 void close()
          Method to close the cache when no longer needed.
 boolean contains(java.lang.String queryKey)
          Accessor for whether the specified query is in the cache
 void evict(java.lang.String queryKey)
          Evict the query from the compilation cache.
 QueryCompilation get(java.lang.String queryKey)
          Accessor for a (generic) compilation from the cache.
 boolean isEmpty()
          Accessor for whether the cache is empty.
 QueryCompilation put(java.lang.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.
 

Method Detail

close

void close()
Method to close the cache when no longer needed. Provides a hook to release resources etc.


evict

void evict(java.lang.String queryKey)
Evict the query from the compilation cache.

Parameters:
queryKey - Key for the query to evict.

clear

void clear()
Method to clear the cache.


isEmpty

boolean isEmpty()
Accessor for whether the cache is empty.

Returns:
Whether it is empty.

size

int size()
Accessor for the total number of compilations in the query cache.

Returns:
Number of queries

get

QueryCompilation get(java.lang.String queryKey)
Accessor for a (generic) compilation from the cache.

Parameters:
queryKey - The query key
Returns:
The cached query compilation

put

QueryCompilation put(java.lang.String queryKey,
                     QueryCompilation compilation)
Method to put an object in the cache.

Parameters:
queryKey - The query key
compilation - The compilation to cache
Returns:
The cached query previously associated with this query

contains

boolean contains(java.lang.String queryKey)
Accessor for whether the specified query is in the cache

Parameters:
queryKey - The query key
Returns:
Whether it is in the cache


Copyright © 2011. All Rights Reserved.