Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.datacache
Class TangosolCache

    java.lang.Object
      |
      +--serp.util.AbstractEventManager
            |
            +--kodo.datacache.AbstractDataCache
                  |
                  +--kodo.datacache.TangosolCache

All Implemented Interfaces:
  com.solarmetric.util.Closeable, Configurable, DataCache

public class TangosolCache
extends AbstractDataCache

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.

Field Summary
`static int` | `TYPE_DISTRIBUTED`
`static int` | `TYPE_NAMED`
`static int` | `TYPE_REPLICATED`

Fields inherited from class kodo.datacache.AbstractDataCache
`conf, log`

Fields inherited from interface kodo.datacache.DataCache
`DEFAULT_NAME`

Constructor Summary
`TangosolCache()`

Method Summary
`void` | `addExpirationListener(ExpirationListener listen)` Add a new expiration event listener to this cache.
`protected void` | `clearInternal()` Clear the cache.
`void` | `close()` Free the resources used by this cache.
`void` | `endConfiguration()` Invoked upon completion of bean property configuration for this object.
`protected DataCachePCData` | `getInternal(Object key)` Return the object for the given oid.
`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.
`int` | `getTangosolCacheType()` The tangosol cache type as one of the TYPE constants.
`protected com.tangosol.net.NamedCache` | `newTangosolCache(String name)` Returns a new `NamedCache` for use as the underlying data cache.
`protected boolean` | `pinInternal(Object key)` Coherence doesn't have a concept of expiring data, so pinning is meaningless.
`protected DataCachePCData` | `putInternal(Object key, DataCachePCData pc)` Add the given object to the cache, returning the old object under the given oid.
`protected boolean` | `recacheUpdates()` Tangosol does not automatically update objects stored in the cache, so we must re-enlist them as appropriate.
`protected DataCachePCData` | `removeInternal(Object key)` Remove the object under the given oid from the cache.
`void` | `setTangosolCacheName(String name)` Sets the name of the Tangosol cache to use.
`void` | `setTangosolCacheType(int type)` The tangosol cache type as one of the TYPE constants.
`void` | `setTangosolCacheType(String type)` If `distributed`, this cache implementation will use a distibuted cache.
`protected boolean` | `unpinInternal(Object key)` Coherence doesn't have a concept of expiring data, so unpinning is meaningless.

Methods inherited from class kodo.datacache.AbstractDataCache
`afterCommit, clear, commit, contains, containsAll, fireEvent, get, getEvictionSchedule, getHitRate, getHits, getMisses, getName, getStatistics, getStatisticsString, initialize, isClosed, keyRemoved, pin, pinAll, put, putAllInternal, remove, removeAll, removeAllInternal, removeExpirationListener, resetStatistics, setConfiguration, setEvictionSchedule, setName, startConfiguration, toString, unpin, unpinAll, update`

Methods inherited from class serp.util.AbstractEventManager
`fireEvent, getListeners, hasListener, hasListeners, registerListener, removeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### TYPE_DISTRIBUTED

    public static final int TYPE_DISTRIBUTED

### TYPE_REPLICATED

    public static final int TYPE_REPLICATED

### TYPE_NAMED

    public static final int TYPE_NAMED

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.

### 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.

### setTangosolCacheType

    public void setTangosolCacheType(int type)

  The tangosol cache type as one of the TYPE constants.

### getTangosolCacheType

    public int getTangosolCacheType()

  The tangosol cache type as one of the TYPE constants.

### 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. If left unset or set to `named`, the cache is looked up through Coherence's named-cache lookup mechanisms. This method is primarily used for automated string-based configuration.

### addExpirationListener

    public void addExpirationListener(ExpirationListener listen)

  Description copied from interface: `DataCache`
  Add a new expiration event listener to this cache.
  Overrides:
    `addExpirationListener` in class `AbstractDataCache`

### getInternal

    protected DataCachePCData getInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Return the object for the given oid.
  Overrides:
    `getInternal` in class `AbstractDataCache`

### putInternal

    protected DataCachePCData putInternal(Object key,
                                          DataCachePCData pc)

  Description copied from class: `AbstractDataCache`
  Add the given object to the cache, returning the old object under the given oid.
  Overrides:
    `putInternal` in class `AbstractDataCache`

### removeInternal

    protected DataCachePCData removeInternal(Object key)

  Description copied from class: `AbstractDataCache`
  Remove the object under the given oid from the cache.
  Overrides:
    `removeInternal` in class `AbstractDataCache`

### clearInternal

    protected void clearInternal()

  Description copied from class: `AbstractDataCache`
  Clear the cache.
  Overrides:
    `clearInternal` in class `AbstractDataCache`

### pinInternal

    protected boolean pinInternal(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)`.
  Overrides:
    `pinInternal` in class `AbstractDataCache`

### unpinInternal

    protected boolean unpinInternal(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)`.
  Overrides:
    `unpinInternal` in class `AbstractDataCache`

### recacheUpdates

    protected boolean recacheUpdates()

  Tangosol does not automatically update objects stored in the cache, so we must re-enlist them as appropriate.
  Overrides:
    `recacheUpdates` in class `AbstractDataCache`

### close

    public void close()

  Description copied from interface: `DataCache`
  Free the resources used by this cache.
  Overrides:
    `close` in class `AbstractDataCache`

### endConfiguration

    public void endConfiguration()

  Description copied from interface: `Configurable`
  Invoked upon completion of bean property configuration for this object.
  Overrides:
    `endConfiguration` in class `AbstractDataCache`

### newTangosolCache

    protected com.tangosol.net.NamedCache newTangosolCache(String name)

  Returns a new `NamedCache` for use as the underlying data cache. This implementation returns a `NamedCache` obtained by invoking `CacheFactory.getCache(java.lang.String)` unless the `TangosolCacheType` optional DataCache property is set to `distributed` or to `replicated`, in which case `CacheFactory.getDistributedCache(java.lang.String)` or `CacheFactory.getReplicatedCache(java.lang.String)` are invoked, as appropriate. It uses the name specified by the `TangosolCacheName` property, or `"kodo"` if unset. To implement a more sophisticated caching strategy, override this method.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.3.5 generated on August 31 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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