Module org.eclipse.persistence.core
Class ConcurrentFixedCache
java.lang.Object
org.eclipse.persistence.internal.helper.ConcurrentFixedCache
- All Implemented Interfaces:
Serializable
Provide a concurrent fixed size caching mechanism.
This is used for caching EJBQL parsed queries, Update calls,
and other places a fixed size cache is needed.
The default fixed size is 100.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new concurrent cache, with a fixed size of 100.ConcurrentFixedCache
(int maxSize) Create a new concurrent cache, with the max size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Return the pre-parsed query that represents the EJBQL string.getCache()
Return the cache.int
Return the fixed size of the parse cache.void
Add the value to the cache.void
Remove from cache.void
setMaxSize
(int maxSize) Set the fixed size of the parse cache.
-
Field Details
-
maxSize
protected int maxSize -
cache
-
-
Constructor Details
-
ConcurrentFixedCache
public ConcurrentFixedCache()Create a new concurrent cache, with a fixed size of 100. -
ConcurrentFixedCache
public ConcurrentFixedCache(int maxSize) Create a new concurrent cache, with the max size.
-
-
Method Details
-
getMaxSize
public int getMaxSize()Return the fixed size of the parse cache. -
setMaxSize
public void setMaxSize(int maxSize) Set the fixed size of the parse cache. When the size is exceeded, subsequent EJBQL will not be cached. The default size is 100; -
get
Return the pre-parsed query that represents the EJBQL string. If the EJBQL has not been cached, null is returned. -
clear
public void clear() -
put
Add the value to the cache. Remove the -
remove
Remove from cache. -
getCache
Return the cache.
-