Top Description Fields Constructors Methods
org.eclipse.persistence.internal.helper

public Class ConcurrentFixedCache

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.*, java.util.concurrent.*

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.

Field Summary

Modifier and TypeField and Description
protected Map<K, V>
protected int

Constructor Summary

AccessConstructor and Description
public
ConcurrentFixedCache()

Create a new concurrent cache, with a fixed size of 100.

public
ConcurrentFixedCache(int maxSize)

Create a new concurrent cache, with the max size.

Method Summary

Modifier and TypeMethod and Description
public void
public Object
get(Object key)

Return the pre-parsed query that represents the EJBQL string.

public Map<K, V>
getCache()

Return the cache.

public int
getMaxSize()

Return the fixed size of the parse cache.

public void
put(Object key, Object value)

Add the value to the cache.

public void
remove(Object key)

Remove from cache.

public void
setMaxSize(int maxSize)

Set the fixed size of the parse cache.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
protected Map<K, V> cache
maxSizeback to summary
protected int maxSize

Constructor Detail

ConcurrentFixedCacheback to summary
public ConcurrentFixedCache()

Create a new concurrent cache, with a fixed size of 100.

ConcurrentFixedCacheback to summary
public ConcurrentFixedCache(int maxSize)

Create a new concurrent cache, with the max size.

Method Detail

clearback to summary
public void clear()
getback to summary
public Object get(Object key)

Return the pre-parsed query that represents the EJBQL string. If the EJBQL has not been cached, null is returned.

getCacheback to summary
public Map<K, V> getCache()

Return the cache.

getMaxSizeback to summary
public int getMaxSize()

Return the fixed size of the parse cache.

putback to summary
public void put(Object key, Object value)

Add the value to the cache. Remove the

removeback to summary
public void remove(Object key)

Remove from cache.

setMaxSizeback to summary
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;