Package 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
,NamedCollection
,NamedMap
,Releasable
,ConcurrentMap
,InvocableMap
,ObservableMap
,QueryMap
,AutoCloseable
,Map
Deprecated.
as of Coherence 3.2 all the functionality of this class has been
superceded by the NearCache implementation
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
Modifier and TypeClassDescriptionclass
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.DeactivationListener, CachingMap.FrontMapListener, CachingMap.PrimingListener, CachingMap.SimpleListener
Nested classes/interfaces inherited from interface com.tangosol.util.InvocableMap
InvocableMap.Entry<K,
V>, InvocableMap.EntryAggregator<K, V, R>, InvocableMap.EntryProcessor<K, V, R>, InvocableMap.ParallelAwareAggregator<K, V, P, R>, InvocableMap.StreamingAggregator<K, V, P, R> Nested classes/interfaces inherited from interface com.tangosol.net.NamedMap
NamedMap.Option
Nested classes/interfaces inherited from interface com.tangosol.util.QueryMap
QueryMap.Entry<K,
V> -
Field Summary
Fields inherited from class com.tangosol.net.cache.NearCache
f_listenerBackService, f_service, f_sName, f_sServiceName, m_fDestroyed
Fields inherited from class com.tangosol.net.cache.CachingMap
LISTEN_ALL, LISTEN_AUTO, LISTEN_LOGICAL, LISTEN_NONE, LISTEN_PRESENT, m_listenerDeactivation, 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
ConstructorDescriptionVersionedNearCache
(Map mapLocal, NamedCache mapDist, NamedCache mapVersion) Deprecated.Construct a VersionedNearCache. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the value to which this map maps the specified key.getAll
(Collection colKeys) Deprecated.Get all the specified keys, if they are in the cache.Deprecated.Obtain the NamedCache object that holds the version data.protected void
incrementVersion
(Object oKey, Object oValue) Deprecated.Increment value's version.protected MapListener
Deprecated.Factory method: Provide a MapListener that listens to the VersionCache and invalidates local entries accordingly.boolean
Deprecated.Attempt to lock the specified item within the specified period of time.Deprecated.Implementation of put method that optionally skips the return value retrieval and allows to specify an expiry for the cache entry.void
Deprecated.Copy all of the mappings from the specified map to this map.void
release()
Deprecated.Invalidate the CachingMap.Deprecated.Removes the mapping for this key from this map if present.boolean
Deprecated.Unlock the specified item.protected void
updateVersion
(Object oKey, 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, async, computeIfAbsent, computeIfAbsent, destroy, entrySet, entrySet, getBackCache, getCacheName, getCacheService, getContextClassLoader, getOrDefault, getRegistrationContext, invoke, invokeAll, invokeAll, isActive, isDestroyed, isReady, isReleased, keySet, lock, put, registerBackServiceListener, registerMBean, release, removeIndex, removeMapListener, removeMapListener, removeMapListener, setContextClassLoader, setRegistrationContext, truncate, unregisterBackServiceListener, unregisterMBean
Methods inherited from class com.tangosol.net.cache.CachingMap
clear, containsKey, containsValue, ensureInvalidationStrategy, entrySet, getAllFromFrontMap, getBackMap, getCacheStatistics, getControlMap, getFrontMap, getInvalidationHits, getInvalidationMisses, getInvalidationStrategy, getTotalRegisterListener, instantiateBackMapListener, instantiateFrontMapListener, invalidateFront, isCheckPrimingExclusively, isCoherent, isEmpty, isPriming, keySet, put, registerDeactivationListener, registerFrontListener, registerListener, registerListener, registerListeners, removeKeyHolder, resetFrontMap, resetInvalidationStrategy, setKeyHolder, size, toString, tryLock, unregisterDeactivationListener, unregisterFrontListener, unregisterListener, unregisterListener, unregisterListeners, validate, values
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tangosol.util.ConcurrentMap
containsKey, containsValue, isEmpty, put, size
Methods inherited from interface com.tangosol.util.InvocableMap
aggregate, compute, compute, computeIfPresent, computeIfPresent, invokeAll, merge, merge, putIfAbsent, remove, replace, replace, replaceAll, replaceAll, replaceAll, replaceAll, stream, stream, stream, stream, stream, stream
Methods inherited from interface com.tangosol.net.NamedCache
as, async, forEach, view
Methods inherited from interface com.tangosol.net.NamedMap
clear, getName, getService
Methods inherited from interface com.tangosol.util.QueryMap
addIndex, forEach, forEach, values, values
Methods inherited from interface com.tangosol.net.Releasable
close
-
Constructor Details
-
VersionedNearCache
Deprecated.Construct a VersionedNearCache.- Parameters:
mapLocal
- local cache to front the distributed cache withmapDist
- distributed cache of Versionable objectsmapVersion
- replicated version cache
-
-
Method Details
-
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 interfaceReleasable
- Overrides:
release
in classNearCache
-
get
Deprecated.Returns the value to which this map maps the specified key.- Specified by:
get
in interfaceConcurrentMap
- Specified by:
get
in interfaceMap
- Overrides:
get
in classCachingMap
- 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:
-
getAll
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.
-
remove
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 interfaceConcurrentMap
- Specified by:
remove
in interfaceMap
- Overrides:
remove
in classCachingMap
- 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
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 classCachingMap
- Parameters:
oKey
- the keyoValue
- the valuefReturn
- if true, the return value is required; otherwise the return value will be ignoredcMillis
- the number of milliseconds until the cache entry will expire- Returns:
- previous value (if required)
- Throws:
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:
-
putAll
Deprecated.Copy all of the mappings from the specified map to this map.- Specified by:
putAll
in interfaceConcurrentMap
- Specified by:
putAll
in interfaceMap
- Overrides:
putAll
in classCachingMap
- Parameters:
map
- mappings to be stored in this map
-
updateVersion
Deprecated.Update value's version in the version cache.- Parameters:
oKey
- the keyoValue
- the value
-
incrementVersion
Deprecated.Increment value's version.- Parameters:
oKey
- the keyoValue
- the value
-
lock
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 interfaceConcurrentMap
- Overrides:
lock
in classNearCache
- Parameters:
oKey
- key being lockedlMillis
- 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
Deprecated.Unlock the specified item.- Specified by:
unlock
in interfaceConcurrentMap
- Overrides:
unlock
in classNearCache
- Parameters:
oKey
- key being unlocked- Returns:
- true if the item was successfully unlocked; false otherwise
-
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
Deprecated.Obtain the NamedCache object that holds the version data.- Returns:
- the NamedCache object, which holds just keys and version data
-