|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
org.apache.openjpa.datacache.AbstractDataCache
net.sf.ehcache.openjpa.datacache.EhCacheDataCache
public class EhCacheDataCache
A plug-in L2 Cache for OpenJPA to use EhCache.
@DataCache annotation in
the class C. If no name is specified in @DataCache annotation then a
default name is used. The default name is openjpa but can be
configured via this plug-in's DefaultName property unless
UseDefaultForUnnamedCaches is set to false.
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.Class,net.sf.ehcache.Ehcache> |
caches
|
protected java.lang.String |
defaultName
|
protected static org.apache.openjpa.lib.util.Localizer |
LOCALIZER
|
protected boolean |
useDefaultForUnnamedCaches
|
protected java.util.concurrent.locks.ReentrantLock |
writeLock
|
| Fields inherited from class org.apache.openjpa.datacache.AbstractDataCache |
|---|
conf, log |
| Fields inherited from class org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager |
|---|
_listeners |
| Fields inherited from interface org.apache.openjpa.datacache.DataCache |
|---|
NAME_DEFAULT |
| Constructor Summary | |
|---|---|
EhCacheDataCache()
|
|
| Method Summary | |
|---|---|
protected void |
clearInternal()
Clears all entries from the cache |
protected java.lang.Class |
determineClassFromObjectId(java.lang.Object oid)
|
protected net.sf.ehcache.Ehcache |
findCache(java.lang.Class clazz)
Find an Ehcache for the given Class. |
java.lang.String |
getDefaultName()
Gets the default name for the Ehcache used for classes which do not specify explicitly a name in its @DataCache annotation. |
protected org.apache.openjpa.datacache.DataCachePCData |
getInternal(java.lang.Object oid)
|
protected net.sf.ehcache.Ehcache |
getOrCreateCache(java.lang.String name)
Gets a cache. |
boolean |
isUseDefaultForUnnamedCaches()
Asserts if default name will be used for the Ehcache for classes which do not specify explicitly a name in its @DataCache annotation. |
protected boolean |
pinInternal(java.lang.Object oid)
Pinning is is not implemented in this version |
protected org.apache.openjpa.datacache.DataCachePCData |
putInternal(java.lang.Object oid,
org.apache.openjpa.datacache.DataCachePCData pc)
|
protected void |
removeAllInternal(java.lang.Class cls,
boolean subclasses)
|
protected org.apache.openjpa.datacache.DataCachePCData |
removeInternal(java.lang.Object oid)
|
void |
setDefaultName(java.lang.String defaultName)
Sets the default name for the Ehcache used for classes which do not specify explicitly a name in its @DataCache annotation. |
void |
setUseDefaultForUnnamedCaches(boolean flag)
Sets if default name will be used for the Ehcache for classes which do not specify explicitly a name in its @DataCache annotation. |
protected boolean |
unpinInternal(java.lang.Object oid)
Pinning and unpinning are not implemented in this version |
void |
writeLock()
|
void |
writeUnlock()
|
| Methods inherited from class org.apache.openjpa.datacache.AbstractDataCache |
|---|
addExpirationListener, afterCommit, clear, close, close, commit, contains, containsAll, endConfiguration, fireEvent, get, getAll, getEvictionSchedule, getName, initialize, isClosed, keyRemoved, pin, pinAll, pinAll, put, putAllInternal, recacheUpdates, remove, removeAll, removeAll, removeAllInternal, removeAllTypeNamesInternal, removeExpirationListener, setConfiguration, setEvictionSchedule, setName, startConfiguration, toString, unpin, unpinAll, unpinAll, update |
| Methods inherited from class org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager |
|---|
addListener, fireEvent, getListeners, hasListener, hasListeners, isFailFast, newListenerCollection, removeListener, setFailFast |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.openjpa.datacache.DataCache |
|---|
addExpirationListener, clear, close, commit, contains, containsAll, get, getAll, getName, initialize, pin, pinAll, pinAll, put, remove, removeAll, removeAll, removeExpirationListener, setName, unpin, unpinAll, unpinAll, update |
| Field Detail |
|---|
protected static final org.apache.openjpa.lib.util.Localizer LOCALIZER
protected final java.util.Map<java.lang.Class,net.sf.ehcache.Ehcache> caches
protected boolean useDefaultForUnnamedCaches
protected java.lang.String defaultName
protected java.util.concurrent.locks.ReentrantLock writeLock
| Constructor Detail |
|---|
public EhCacheDataCache()
| Method Detail |
|---|
public boolean isUseDefaultForUnnamedCaches()
true
public void setUseDefaultForUnnamedCaches(boolean flag)
true
public java.lang.String getDefaultName()
openjpa
public void setDefaultName(java.lang.String defaultName)
openjpa
protected void clearInternal()
clearInternal in class org.apache.openjpa.datacache.AbstractDataCacheprotected org.apache.openjpa.datacache.DataCachePCData getInternal(java.lang.Object oid)
getInternal in class org.apache.openjpa.datacache.AbstractDataCacheoid -
protected boolean pinInternal(java.lang.Object oid)
pinInternal in class org.apache.openjpa.datacache.AbstractDataCacheoid -
protected org.apache.openjpa.datacache.DataCachePCData putInternal(java.lang.Object oid,
org.apache.openjpa.datacache.DataCachePCData pc)
putInternal in class org.apache.openjpa.datacache.AbstractDataCacheoid - pc -
protected void removeAllInternal(java.lang.Class cls,
boolean subclasses)
removeAllInternal in class org.apache.openjpa.datacache.AbstractDataCachecls - subclasses - protected org.apache.openjpa.datacache.DataCachePCData removeInternal(java.lang.Object oid)
removeInternal in class org.apache.openjpa.datacache.AbstractDataCacheoid -
protected boolean unpinInternal(java.lang.Object oid)
unpinInternal in class org.apache.openjpa.datacache.AbstractDataCacheoid -
public void writeLock()
writeLock in interface org.apache.openjpa.datacache.DataCachepublic void writeUnlock()
writeUnlock in interface org.apache.openjpa.datacache.DataCacheprotected net.sf.ehcache.Ehcache findCache(java.lang.Class clazz)
DataCache.
Configured to use
default cache.
protected net.sf.ehcache.Ehcache getOrCreateCache(java.lang.String name)
name -
protected java.lang.Class determineClassFromObjectId(java.lang.Object oid)
oid -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||