Skip navigation links
com.tangosol.net.cache
Class ReadonlyNamedCache
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.AbstractKeyBasedMap
com.tangosol.util.AbstractKeySetBasedMap
com.tangosol.util.WrapperObservableMap
com.tangosol.util.WrapperConcurrentMap
com.tangosol.net.cache.WrapperNamedCache
com.tangosol.net.cache.ReadonlyNamedCache
- All Implemented Interfaces:
- CacheMap, NamedCache, ConcurrentMap, InvocableMap, ObservableMap, QueryMap, java.util.Map
-
public class ReadonlyNamedCache
- extends WrapperNamedCache
A simple extension of the WrapperNamedCache implementation that shields all content mutating operations such as put(), remove(), lock() etc.
- Author:
- gg 2006.08.06
| Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry |
| Field Summary |
protected boolean |
m_fStrict
Specifies whether or not the "read-only" nature of this NamedCache is strictly enforced. |
| Constructor Summary |
ReadonlyNamedCache(java.util.Map map, java.lang.String sName, boolean fStrict)
Construct a NamedCache wrapper based on the specified map. |
ReadonlyNamedCache(NamedCache cache, boolean fStrict)
Construct a NamedCache wrapper based on the specified map. |
| Method Summary |
protected void |
checkStrict()
Enforce the "strict" read-only policy. |
void |
clear()
Should not be called. |
void |
destroy()
Should not be called. |
java.lang.Object |
invoke(java.lang.Object oKey, InvocableMap.EntryProcessor agent)
Should not be called. |
java.util.Map |
invokeAll(java.util.Collection collKeys, InvocableMap.EntryProcessor agent)
Should not be called. |
java.util.Map |
invokeAll(Filter filter, InvocableMap.EntryProcessor agent)
Should not be called. |
boolean |
lock(java.lang.Object oKey)
Should not be called. |
boolean |
lock(java.lang.Object oKey, long cWait)
Should not be called. |
java.lang.Object |
put(java.lang.Object oKey, java.lang.Object oValue)
Should not be called. |
void |
putAll(java.util.Map map)
Should not be called. |
java.lang.Object |
remove(java.lang.Object oKey)
Should not be called. |
protected boolean |
removeBlind(java.lang.Object oKey)
Should not be called. |
boolean |
unlock(java.lang.Object oKey)
Should not be called. |
| Methods inherited from class com.tangosol.net.cache.WrapperNamedCache |
addIndex, aggregate, aggregate, entrySet, entrySet, getAll, getCacheName, getCacheService, isActive, keySet, put, release, removeIndex |
| Methods inherited from class com.tangosol.util.WrapperObservableMap |
addMapListener, addMapListener, addMapListener, containsValue, dispatchEvent, dispatchPendingEvent, ensureInternalListener, ensureMapListenerSupport, get, getCacheStatistics, getInternalKeySet, getMap, getMapListenerSupport, hasListeners, instantiateInternalListener, isCollectStats, isEventFabricator, isSynthetic, isTranslateEvents, removeMapListener, removeMapListener, removeMapListener, setCollectStats, setTranslateEvents |
| Methods inherited from interface java.util.Map |
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, values |
m_fStrict
protected boolean m_fStrict
- Specifies whether or not the "read-only" nature of this NamedCache is strictly enforced.
ReadonlyNamedCache
public ReadonlyNamedCache(NamedCache cache,
boolean fStrict)
- Construct a NamedCache wrapper based on the specified map.
- Parameters:
cache - the NamedCache object that will be wrapped by this read-only wrapper
fStrict - if true, calls to mutating opearations will throw the UnsupportedOpearionException; otherwise those calls will have no effect whatsoever
ReadonlyNamedCache
public ReadonlyNamedCache(java.util.Map map,
java.lang.String sName,
boolean fStrict)
- Construct a NamedCache wrapper based on the specified map.
- Parameters:
map - the Map that will be wrapped by this read-only wrapper
sName - the cache name
fStrict - if true, calls to mutating opearations will throw the UnsupportedOpearionException; otherwise those calls will have no effect whatsoever
destroy
public void destroy()
- Should not be called.
-
- Specified by:
destroy in interface NamedCache
- Overrides:
destroy in class WrapperNamedCache
-
- See Also:
CacheFactory.destroyCache(NamedCache), ConfigurableCacheFactory.destroyCache(NamedCache)
invoke
public java.lang.Object invoke(java.lang.Object oKey,
InvocableMap.EntryProcessor agent)
- Should not be called.
-
- Specified by:
invoke in interface InvocableMap
- Overrides:
invoke in class WrapperNamedCache
-
- Parameters:
oKey - the key to process; it is not required to exist within the Map
agent - the EntryProcessor to use to process the specified key
- Returns:
- the result of the invocation as returned from the EntryProcessor
invokeAll
public java.util.Map invokeAll(java.util.Collection collKeys,
InvocableMap.EntryProcessor agent)
- Should not be called.
-
- Specified by:
invokeAll in interface InvocableMap
- Overrides:
invokeAll in class WrapperNamedCache
-
- Parameters:
collKeys - the keys to process; these keys are not required to exist within the Map
agent - the EntryProcessor to use to process the specified keys
- Returns:
- a Map containing the results of invoking the EntryProcessor against each of the specified keys
invokeAll
public java.util.Map invokeAll(Filter filter,
InvocableMap.EntryProcessor agent)
- Should not be called.
-
- Specified by:
invokeAll in interface InvocableMap
- Overrides:
invokeAll in class WrapperNamedCache
-
- Parameters:
filter - a Filter that results in the set of keys to be processed
agent - the EntryProcessor to use to process the specified keys
- Returns:
- a Map containing the results of invoking the EntryProcessor against the keys that are selected by the given Filter
put
public java.lang.Object put(java.lang.Object oKey,
java.lang.Object oValue)
- Should not be called.
-
- Specified by:
put in interface CacheMap
- Specified by:
put in interface ConcurrentMap
- Specified by:
put in interface java.util.Map
- Overrides:
put in class WrapperConcurrentMap
-
- Parameters:
oKey - key with which the specified value is to be associated
oValue - value to be associated with the specified key
- Returns:
- previous value associated with specified key, or null if there was no mapping for key
putAll
public void putAll(java.util.Map map)
- Should not be called.
-
- Specified by:
putAll in interface ConcurrentMap
- Specified by:
putAll in interface java.util.Map
- Overrides:
putAll in class WrapperConcurrentMap
-
- Parameters:
map - the Map containing the key/value pairings to put into this Map
remove
public java.lang.Object remove(java.lang.Object oKey)
- Should not be called.
-
- Specified by:
remove in interface ConcurrentMap
- Specified by:
remove in interface java.util.Map
- Overrides:
remove in class WrapperConcurrentMap
-
- 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.
clear
public void clear()
- Should not be called.
-
- Specified by:
clear in interface ConcurrentMap
- Specified by:
clear in interface java.util.Map
- Overrides:
clear in class WrapperConcurrentMap
lock
public boolean lock(java.lang.Object oKey,
long cWait)
- Should not be called.
-
- Specified by:
lock in interface ConcurrentMap
- Overrides:
lock in class WrapperConcurrentMap
-
- Parameters:
oKey - key being locked
cWait - 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
lock
public boolean lock(java.lang.Object oKey)
- Should not be called.
-
- Specified by:
lock in interface ConcurrentMap
- Overrides:
lock in class WrapperConcurrentMap
-
- Parameters:
oKey - key being locked
- Returns:
- true if the item was successfully locked; false otherwise
unlock
public boolean unlock(java.lang.Object oKey)
- Should not be called.
-
- Specified by:
unlock in interface ConcurrentMap
- Overrides:
unlock in class WrapperConcurrentMap
-
- Parameters:
oKey - key being unlocked
- Returns:
- true if the item was successfully unlocked; false otherwise
removeBlind
protected boolean removeBlind(java.lang.Object oKey)
- Should not be called.
-
- Overrides:
removeBlind in class WrapperConcurrentMap
-
- Parameters:
oKey - key whose mapping is to be removed from the map
- Returns:
- true iff the Map changed as the result of this operation
checkStrict
protected void checkStrict()
- Enforce the "strict" read-only policy.
Skip navigation links
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.