Skip navigation links

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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, 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 Class Summary

Nested classes/interfaces inherited from class com.tangosol.util.WrapperConcurrentMap
`WrapperConcurrentMap.Lock`

Nested classes/interfaces inherited from class com.tangosol.util.WrapperObservableMap
`WrapperObservableMap.InternalListener`

Nested classes/interfaces inherited from class com.tangosol.util.AbstractKeySetBasedMap
`AbstractKeySetBasedMap.EntrySet, AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection`

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
`protected boolean` | `m_fStrict` Specifies whether or not the "read-only" nature of this NamedCache is strictly enforced.

Fields inherited from class com.tangosol.net.cache.WrapperNamedCache
`m_service, m_sName`

Fields inherited from class com.tangosol.util.WrapperConcurrentMap
`m_cWaitMillis, m_fEnforceLocking, m_gateMap, m_mapLock`

Fields inherited from class com.tangosol.util.WrapperObservableMap
`m_fTranslateEvents, m_listenerInternal, m_listenerSupport, m_map, m_stats`

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
`ReadonlyNamedCache(Map map, 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.
`Object` | `invoke(Object oKey, InvocableMap.EntryProcessor agent)` Should not be called.
`Map` | `invokeAll(Collection collKeys, InvocableMap.EntryProcessor agent)` Should not be called.
`Map` | `invokeAll(Filter filter, InvocableMap.EntryProcessor agent)` Should not be called.
`boolean` | `lock(Object oKey)` Should not be called.
`boolean` | `lock(Object oKey, long cWait)` Should not be called.
`Object` | `put(Object oKey, Object oValue)` Should not be called.
`void` | `putAll(Map map)` Should not be called.
`Object` | `remove(Object oKey)` Should not be called.
`protected boolean` | `removeBlind(Object oKey)` Should not be called.
`boolean` | `unlock(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.WrapperConcurrentMap
`getDescription, getLockDescription, getWaitMillis, instantiateLock, isInternalKeySetIteratorMutable, isLockingEnforced, setLockingEnforced, setWaitMillis, toString`

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 class com.tangosol.util.AbstractKeySetBasedMap
`containsKey, instantiateEntrySet, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, iterateKeys, size`

Methods inherited from class com.tangosol.util.AbstractKeyBasedMap
`clone, entrySet, equals, hashCode, keySet, values`

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

Field Detail

### m_fStrict

    protected boolean m_fStrict

  Specifies whether or not the "read-only" nature of this NamedCache is strictly enforced.

Constructor Detail

### 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(Map map,
                              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

Method Detail

### 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 Object invoke(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 Map invokeAll(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 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 Object put(Object oKey,
                      Object oValue)

  Should not be called.
  Specified by:
    `put` in interface `CacheMap`
  Specified by:
    `put` in interface `ConcurrentMap`
  Specified by:
    `put` in interface `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(Map map)

  Should not be called.
  Specified by:
    `putAll` in interface `ConcurrentMap`
  Specified by:
    `putAll` in interface `Map`
  Overrides:
    `putAll` in class `WrapperConcurrentMap`
  Parameters:
    `map` - the Map containing the key/value pairings to put into this Map

### remove

    public Object remove(Object oKey)

  Should not be called.
  Specified by:
    `remove` in interface `ConcurrentMap`
  Specified by:
    `remove` in interface `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 `Map`
  Overrides:
    `clear` in class `WrapperConcurrentMap`

### lock

    public boolean lock(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(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(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(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

Overview | Package | Class | Tree | Index | Help
| Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.