Kodo 4.1.0 generated on October 9 2006

kodo.datacache
Class GemFireDataCache

java.lang.Object
  extended by org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager
      extended by org.apache.openjpa.datacache.AbstractDataCache
          extended by kodo.datacache.GemFireDataCache
All Implemented Interfaces:
org.apache.openjpa.datacache.DataCache, org.apache.openjpa.lib.conf.Configurable, org.apache.openjpa.lib.util.Closeable, org.apache.openjpa.lib.util.EventManager

public class GemFireDataCache
extends org.apache.openjpa.datacache.AbstractDataCache

A data cache that delegates to a GemStone GemFire cache. Batch updates are performed atomically.

To use GemFire in Kodo set kodo.DataCache to gemfire

The gemfire property enable-shared-memory=true must be set.

By default, a GemFire region of root/kodo-data-cache is used. This can be changed be setting the optional property CacheName

Some notes regarding using Kodo with GemFire: - Externalized fields must externalize to a serializable type - The Kodo option of DynamicDataStructs and custom field proxies aren't currently with GemFire


Field Summary
static String DEFAULT_CACHE_NAME
           
 
Fields inherited from class org.apache.openjpa.datacache.AbstractDataCache
conf, log
 
Fields inherited from interface org.apache.openjpa.datacache.DataCache
NAME_DEFAULT
 
Constructor Summary
GemFireDataCache()
           
 
Method Summary
protected  void clearInternal()
           
 void endConfiguration()
           
 GemFireCacheWrapper getCacheWrapper()
          The internal cache.
 String getGemFireCacheName()
          Gets the name of the GemFire region to use.
protected  org.apache.openjpa.datacache.DataCachePCData getInternal(Object key)
           
protected  GemFireCacheWrapper newCacheWrapper()
          Create a new GemFire cache wrapper for internal use.
protected  boolean pinInternal(Object key)
          GemFire doesn't have a concept of pinning data.
protected  org.apache.openjpa.datacache.DataCachePCData putInternal(Object key, org.apache.openjpa.datacache.DataCachePCData value)
           
protected  boolean recacheUpdates()
           
protected  void removeAllInternal(Class cls, boolean subclasses)
          Evict objects in cache by class.
protected  org.apache.openjpa.datacache.DataCachePCData removeInternal(Object key)
           
 void setGemfireCacheName(String name)
          Deprecated. Retained for auto-conf compatibility with old conf files.
 void setGemFireCacheName(String name)
          Sets the name of the GemFire region to use.
 void startConfiguration()
           
protected  boolean unpinInternal(Object key)
          GemFire doesn't have a concept of pinning data.
 void writeLock()
           
 void writeUnlock()
           
 
Methods inherited from class org.apache.openjpa.datacache.AbstractDataCache
addExpirationListener, afterCommit, clear, close, close, commit, contains, containsAll, fireEvent, get, getEvictionSchedule, getName, initialize, isClosed, keyRemoved, pin, pinAll, pinAll, put, putAllInternal, remove, removeAll, removeAll, removeAllInternal, removeAllTypeNamesInternal, removeExpirationListener, setConfiguration, setEvictionSchedule, setName, 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
 

Field Detail

DEFAULT_CACHE_NAME

public static final String DEFAULT_CACHE_NAME
See Also:
Constant Field Values
Constructor Detail

GemFireDataCache

public GemFireDataCache()
Method Detail

setGemFireCacheName

public void setGemFireCacheName(String name)
Sets the name of the GemFire region to use.


setGemfireCacheName

public void setGemfireCacheName(String name)
Deprecated. Retained for auto-conf compatibility with old conf files.


getGemFireCacheName

public String getGemFireCacheName()
Gets the name of the GemFire region to use.


getCacheWrapper

public GemFireCacheWrapper getCacheWrapper()
The internal cache.


startConfiguration

public void startConfiguration()
Specified by:
startConfiguration in interface org.apache.openjpa.lib.conf.Configurable
Overrides:
startConfiguration in class org.apache.openjpa.datacache.AbstractDataCache

endConfiguration

public void endConfiguration()
Specified by:
endConfiguration in interface org.apache.openjpa.lib.conf.Configurable
Overrides:
endConfiguration in class org.apache.openjpa.datacache.AbstractDataCache

newCacheWrapper

protected GemFireCacheWrapper newCacheWrapper()
Create a new GemFire cache wrapper for internal use.


writeLock

public void writeLock()

writeUnlock

public void writeUnlock()

getInternal

protected org.apache.openjpa.datacache.DataCachePCData getInternal(Object key)
Specified by:
getInternal in class org.apache.openjpa.datacache.AbstractDataCache

putInternal

protected org.apache.openjpa.datacache.DataCachePCData putInternal(Object key,
                                                                   org.apache.openjpa.datacache.DataCachePCData value)
Specified by:
putInternal in class org.apache.openjpa.datacache.AbstractDataCache

removeAllInternal

protected void removeAllInternal(Class cls,
                                 boolean subclasses)
Evict objects in cache by class.

Specified by:
removeAllInternal in class org.apache.openjpa.datacache.AbstractDataCache

removeInternal

protected org.apache.openjpa.datacache.DataCachePCData removeInternal(Object key)
Specified by:
removeInternal in class org.apache.openjpa.datacache.AbstractDataCache

clearInternal

protected void clearInternal()
Specified by:
clearInternal in class org.apache.openjpa.datacache.AbstractDataCache

pinInternal

protected boolean pinInternal(Object key)
GemFire doesn't have a concept of pinning data. This method is equivalent to invoking Map#contains.

Specified by:
pinInternal in class org.apache.openjpa.datacache.AbstractDataCache

unpinInternal

protected boolean unpinInternal(Object key)
GemFire doesn't have a concept of pinning data. This method is equivalent to invoking Map#contains.

Specified by:
unpinInternal in class org.apache.openjpa.datacache.AbstractDataCache

recacheUpdates

protected boolean recacheUpdates()
Overrides:
recacheUpdates in class org.apache.openjpa.datacache.AbstractDataCache

Kodo 4.1.0 generated on October 9 2006

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.