Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.runtime.datacache.plugins
Class TangosolCache

    java.lang.Object
      |
      +--com.solarmetric.kodo.runtime.datacache.AbstractCacheImpl
            |
            +--com.solarmetric.kodo.runtime.datacache.plugins.TangosolCache

All Implemented Interfaces:
  Configurable, DataCache

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 com.solarmetric.kodo.runtime.datacache.AbstractCacheImpl
`cache, s_log`

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 configuration of 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 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 com.solarmetric.kodo.runtime.datacache.AbstractCacheImpl
`addExpirationListener, batchUpdate, clear, containsKey, get, getCacheStatisticsString, getHitCount, getMap, getMissCount, getName, getRecordCacheStatistics, isDecorator, keyExpired, put, remove, removeAll, removeDecorator, removeDecorators, removeExpirationListener, 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: `com.solarmetric.kodo.runtime.datacache.DataCache`
  Returns:
    `true` if `key`'s value was pinned into the cache; `false` if the key 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: `com.solarmetric.kodo.runtime.datacache.DataCache`
  Returns:
    `true` if `key`'s value was unpinned from the cache; `false` if the key 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 configuration is begun on this object
  Overrides:
    `startConfiguration` in class `AbstractCacheImpl`

### endConfiguration

    public void endConfiguration()

  Description copied from interface: `Configurable`
  Invoked upon completion of configuration of this object
  Overrides:
    `endConfiguration` in class `AbstractCacheImpl`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.8 generated on January 11 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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