Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.net.cache
Class VersionedNearCache

    java.lang.Object
      com.tangosol.net.cache.CachingMap
          com.tangosol.net.cache.NearCache
              com.tangosol.net.cache.VersionedNearCache

All Implemented Interfaces:
  ClassLoaderAware, CacheMap, NamedCache, ConcurrentMap, InvocableMap, ObservableMap, QueryMap, java.util.Map

Deprecated. as of Coherence 3.2 all the functionality of this class has been superceded by the NearCache implementation

    public class VersionedNearCache

extends NearCache

A near cache that fronts a Distributed Cache and uses a Replicated Cache of version data to keep the local cache in sync.

Author:
  cp 2002.10.20

Nested Class Summary
`class` | `VersionedNearCache.VersionCacheListener` Deprecated. A map listener that listens to the VersionCache and invalidates local entries accordingly.

Nested classes/interfaces inherited from class com.tangosol.net.cache.NearCache
`NearCache.BackServiceListener`

Nested classes/interfaces inherited from class com.tangosol.net.cache.CachingMap
`CachingMap.BackMapListener, CachingMap.FrontMapListener`

Nested classes/interfaces inherited from interface com.tangosol.util.QueryMap
`QueryMap.Entry`

Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap
`InvocableMap.Entry, InvocableMap.EntryAggregator, InvocableMap.EntryProcessor, InvocableMap.ParallelAwareAggregator`

Field Summary

Fields inherited from class com.tangosol.net.cache.NearCache
`m_listenerBackService, m_sName`

Fields inherited from class com.tangosol.net.cache.CachingMap
`LISTEN_ALL, LISTEN_AUTO, LISTEN_NONE, LISTEN_PRESENT, m_nStrategyCurrent, m_nStrategyTarget`

Fields inherited from interface com.tangosol.net.cache.CacheMap
`EXPIRY_DEFAULT, EXPIRY_NEVER`

Fields inherited from interface com.tangosol.util.ConcurrentMap
`LOCK_ALL`

Constructor Summary
`VersionedNearCache(java.util.Map mapLocal, NamedCache mapDist, NamedCache mapVersion)` Deprecated. Construct a VersionedNearCache.

Method Summary
`java.lang.Object` | `get(java.lang.Object oKey)` Deprecated. Returns the value to which this map maps the specified key.
`java.util.Map` | `getAll(java.util.Collection colKeys)` Deprecated. Get all the specified keys, if they are in the cache.
`NamedCache` | `getVersionCache()` Deprecated. Obtain the NamedCache object that holds the version data.
`protected void` | `incrementVersion(java.lang.Object oKey, java.lang.Object oValue)` Deprecated. Increment value's version.
`protected MapListener` | `instantiateVersionCacheListener()` Deprecated. Factory method: Provide a MapListener that listens to the VersionCache and invalidates local entries accordingly.
`boolean` | `lock(java.lang.Object oKey, long lMillis)` Deprecated. Attempt to lock the specified item within the specified period of time.
`java.lang.Object` | `put(java.lang.Object oKey, java.lang.Object oValue, boolean fReturn, long cMillis)` Deprecated. Implementation of put method that optionally skips the return value retrieval and allows to specify an expiry for the cache entry.
`void` | `putAll(java.util.Map map)` Deprecated. Copy all of the mappings from the specified map to this map.
`void` | `release()` Deprecated. Invalidate the CachingMap.
`java.lang.Object` | `remove(java.lang.Object oKey)` Deprecated. Removes the mapping for this key from this map if present.
`boolean` | `unlock(java.lang.Object oKey)` Deprecated. Unlock the specified item.
`protected void` | `updateVersion(java.lang.Object oKey, java.lang.Object oValue)` Deprecated. Update value's version in the version cache.

Methods inherited from class com.tangosol.net.cache.NearCache
`addIndex, addMapListener, addMapListener, addMapListener, aggregate, aggregate, destroy, entrySet, entrySet, getBackCache, getCacheName, getCacheService, getContextClassLoader, invoke, invokeAll, invokeAll, isActive, keySet, lock, put, registerBackServiceListener, removeIndex, removeMapListener, removeMapListener, removeMapListener, setContextClassLoader, unregisterBackServiceListener`

Methods inherited from class com.tangosol.net.cache.CachingMap
`clear, containsKey, containsValue, ensureInvalidationStrategy, entrySet, getBackMap, getCacheStatistics, getControlMap, getFrontMap, getInvalidationHits, getInvalidationMisses, getInvalidationStrategy, getTotalRegisterListener, instantiateBackMapListener, instantiateFrontMapListener, invalidateFront, isCoherent, isEmpty, keySet, put, registerFrontListener, registerListener, registerListener, resetInvalidationStrategy, size, toString, unregisterFrontListener, unregisterListener, unregisterListener, validate, values`

Methods inherited from interface com.tangosol.net.cache.CacheMap
`put`

Methods inherited from interface com.tangosol.util.ConcurrentMap
`clear, containsKey, containsValue, isEmpty, put, size`

Constructor Detail

### VersionedNearCache

    public VersionedNearCache(java.util.Map mapLocal,
                              NamedCache mapDist,
                              NamedCache mapVersion)

  Deprecated.
  Construct a VersionedNearCache.

  Parameters:
    `mapLocal` - local cache to front the distributed cache with
    `mapDist` - distributed cache of Versionable objects
    `mapVersion` - replicated version cache

Method Detail

### release

    public void release()

  Deprecated.
  Invalidate the CachingMap. If the BackMap implements an ObservableMap calling this method is necessary to remove the BackMap listener.

  Specified by:
    `release` in interface `NamedCache`
  Overrides:
    `release` in class `NearCache`
  See Also:
    `CacheFactory.releaseCache(NamedCache)`, `ConfigurableCacheFactory.releaseCache(NamedCache)`

### get

    public java.lang.Object get(java.lang.Object oKey)

  Deprecated.
  Returns the value to which this map maps the specified key.

  Specified by:
    `get` in interface `ConcurrentMap`
  Specified by:
    `get` in interface `java.util.Map`
  Overrides:
    `get` in class `CachingMap`
  Parameters:
    `oKey` - the key object
  Returns:
    the value to which this map maps the specified key, or null if the map contains no mapping for this key
  See Also:
    `ConcurrentMap.containsKey(Object)`

### getAll

    public java.util.Map getAll(java.util.Collection colKeys)

  Deprecated.
  Get all the specified keys, if they are in the cache. For each key that is in the cache, that key and its corresponding value will be placed in the map that is returned by this method. The absence of a key in the returned map indicates that it was not in the cache, which may imply (for caches that can load behind the scenes) that the requested data could not be loaded.

  Note: this implementation does not differentiate between missing keys or null values stored in the back map; in both cases the returned map will not contain the corresponding entry.

  Specified by:
    `getAll` in interface `CacheMap`
  Overrides:
    `getAll` in class `CachingMap`
  Parameters:
    `colKeys` - a collection of keys that may be in the named cache
  Returns:
    a Map of keys to values for the specified keys passed in `col`
  Since:
    Coherence 2.5

### remove

    public java.lang.Object remove(java.lang.Object oKey)

  Deprecated.
  Removes the mapping for this key from this map if present. Expensive: updates both the underlying cache and the local cache.

  Specified by:
    `remove` in interface `ConcurrentMap`
  Specified by:
    `remove` in interface `java.util.Map`
  Overrides:
    `remove` in class `CachingMap`
  Parameters:
    `oKey` - key whose mapping is to be removed from the map
  Returns:
    previous value associated with specified key, or `null` if there was no mapping for key. A `null` return can also indicate that the map previously associated `null` with the specified key, if the implementation supports `null` values.

### put

    public java.lang.Object put(java.lang.Object oKey,
                                java.lang.Object oValue,
                                boolean fReturn,
                                long cMillis)

  Deprecated.
  Implementation of put method that optionally skips the return value retrieval and allows to specify an expiry for the cache entry.

  Overrides:
    `put` in class `CachingMap`
  Parameters:
    `oKey` - the key
    `oValue` - the value
    `fReturn` - if true, the return value is required; otherwise the return value will be ignored
    `cMillis` - the number of milliseconds until the cache entry will expire
  Returns:
    previous value (if required)
  Throws:
    `java.lang.UnsupportedOperationException` - if the requested expiry is a positive value and either the front map or the back map implementations do not support the expiration functionality
  See Also:
    `CacheMap.put(Object oKey, Object oValue, long cMillis)`

### putAll

    public void putAll(java.util.Map map)

  Deprecated.
  Copy all of the mappings from the specified map to this map.

  Specified by:
    `putAll` in interface `ConcurrentMap`
  Specified by:
    `putAll` in interface `java.util.Map`
  Overrides:
    `putAll` in class `CachingMap`
  Parameters:
    `map` - mappings to be stored in this map

### updateVersion

    protected void updateVersion(java.lang.Object oKey,
                                 java.lang.Object oValue)

  Deprecated.
  Update value's version in the version cache.

### incrementVersion

    protected void incrementVersion(java.lang.Object oKey,
                                    java.lang.Object oValue)

  Deprecated.
  Increment value's version.

### lock

    public boolean lock(java.lang.Object oKey,
                        long lMillis)

  Deprecated.
  Attempt to lock the specified item within the specified period of time. Expensive: Locking always occurs on the back cache, and removes the value from the front cache if successful (forcing a get() from the back cache on next access to the key).

  Specified by:
    `lock` in interface `ConcurrentMap`
  Overrides:
    `lock` in class `NearCache`
  Parameters:
    `oKey` - key being locked
    `lMillis` - the number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtained
  Returns:
    true if the item was successfully locked within the specified time; false otherwise

### unlock

    public boolean unlock(java.lang.Object oKey)

  Deprecated.
  Unlock the specified item.

  Specified by:
    `unlock` in interface `ConcurrentMap`
  Overrides:
    `unlock` in class `NearCache`
  Parameters:
    `oKey` - key being unlocked
  Returns:
    true if the item was successfully unlocked; false otherwise

### instantiateVersionCacheListener

    protected MapListener instantiateVersionCacheListener()

  Deprecated.
  Factory method: Provide a MapListener that listens to the VersionCache and invalidates local entries accordingly.

  Returns:
    a MapListener object to listen to the VersionCache

### getVersionCache

    public NamedCache getVersionCache()

  Deprecated.
  Obtain the NamedCache object that holds the version data.

  Returns:
    the NamedCache object, which holds just keys and version data

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.