SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

kodo.datacache
Class TangosolCache

java.lang.Object
  |
  +--kodo.datacache.AbstractCacheImpl
        |
        +--kodo.datacache.TangosolCache
All Implemented Interfaces:
com.solarmetric.util.Closeable, Configurable, DataCache, Watchable

public class TangosolCache
extends AbstractCacheImpl

A PersistenceManagerFactory cache that delegates to a Tangosol Coherence cache. This cache can be used to share data among PersistenceManagers created from a single PersistenceManagerFactory. Batch updates are performed atomically.


Fields inherited from class kodo.datacache.AbstractCacheImpl
cache, conf, log
 
Fields inherited from interface kodo.datacache.DataCache
DEFAULT_NAME
 
Constructor Summary
TangosolCache()
           
 
Method Summary
protected  boolean addExistingUpdates()
          Tangosol does not automatically update objects stored in the cache, so we must re-enlist them as appropriate.
 void close()
          Close this cache, dropping all hard references and releasing any resources that this cache maintains.
 void endConfiguration()
          Invoked upon completion of bean property configuration for this object.
 boolean getDistributedCache()
          Returns true if this cache will use a distributed Tangosol cache; otherwise returns false.
 com.tangosol.net.NamedCache getTangosolCache()
          Returns the underlying NamedCache that this TangosolCache is using.
 String getTangosolCacheName()
          Returns the name of the Tangosol cache to use.
protected  Map newMap()
          Returns a new NamedCache for use as the underlying data cache.
 boolean pin(Object key)
          Coherence doesn't have a concept of expiring data, so pinning is meaningless.
 void setTangosolCacheName(String name)
          Sets the name of the Tangosol cache to use.
 void setTangosolCacheType(String type)
          If distributed, this cache implementation will use a distibuted cache.
 void startConfiguration()
          Invoked before bean property configuration is begun on this object.
 boolean unpin(Object key)
          Coherence doesn't have a concept of expiring data, so unpinning is meaningless.
 
Methods inherited from class kodo.datacache.AbstractCacheImpl
addListener, batchUpdate, clear, clearListeners, containsKey, get, getCacheStatisticsString, getHitCount, getMap, getMissCount, getName, getRecordCacheStatistics, getStatistics, keyRemoved, put, registerListener, remove, removeAll, removeListener, removeListener, setConfiguration, setName, setRecordCacheStatistics, toString, updateValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TangosolCache

public TangosolCache()
Method Detail

getTangosolCache

public com.tangosol.net.NamedCache getTangosolCache()
Returns the underlying NamedCache that this TangosolCache is using. This is not an unmodifiable view on the map, so care should be taken with this reference. Implementations should probably not mess with the contents of the cache, but should only use this reference to obtain cache metrics.

newMap

protected Map newMap()
Returns a new NamedCache for use as the underlying data cache. This implementation returns a NamedCache obtained by invoking CacheFactory.getDistributedCache(java.lang.String) if the TangosolCacheType DataCache property is set to distributed or unset, or by invoking CacheFactory.getReplicatedCache(java.lang.String) if set to replicated. It uses the name specified by the TangosolCacheName property, or "kodo" if unset. To implement a more sophisticated caching strategy, override this method.
Overrides:
newMap in class AbstractCacheImpl

addExistingUpdates

protected boolean addExistingUpdates()
Tangosol does not automatically update objects stored in the cache, so we must re-enlist them as appropriate.
Overrides:
addExistingUpdates in class AbstractCacheImpl

pin

public boolean pin(Object key)
Coherence doesn't have a concept of expiring data, so pinning is meaningless. This method is equivalent to invoking Map.containsKey(java.lang.Object).
Following copied from interface: kodo.datacache.DataCache
Returns:
true if oid's value was pinned into the cache; false if the oid is not in the cache.

unpin

public boolean unpin(Object key)
Coherence doesn't have a concept of expiring data, so unpinning is meaningless. This method is equivalent to invoking Map.containsKey(java.lang.Object).
Following copied from interface: kodo.datacache.DataCache
Returns:
true if oid's value was unpinned from the cache; false if the oid is not in the cache.

close

public void close()
Description copied from interface: DataCache
Close this cache, dropping all hard references and releasing any resources that this cache maintains.
Overrides:
close in class AbstractCacheImpl

setTangosolCacheType

public void setTangosolCacheType(String type)
If distributed, this cache implementation will use a distibuted cache. If replicated, this cache implementation will use a replicated cache.

getDistributedCache

public final boolean getDistributedCache()
Returns true if this cache will use a distributed Tangosol cache; otherwise returns false.

setTangosolCacheName

public void setTangosolCacheName(String name)
Sets the name of the Tangosol cache to use.

getTangosolCacheName

public final String getTangosolCacheName()
Returns the name of the Tangosol cache to use.

startConfiguration

public void startConfiguration()
Description copied from interface: Configurable
Invoked before bean property configuration is begun on this object.
Overrides:
startConfiguration in class AbstractCacheImpl

endConfiguration

public void endConfiguration()
Description copied from interface: Configurable
Invoked upon completion of bean property configuration for this object.
Overrides:
endConfiguration in class AbstractCacheImpl

SolarMetric Kodo JDO 3.0.3 generated on February 20 2004

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.