Class WrapperCollections.ConcurrentWrapperEntry<K,V>

java.lang.Object
com.tangosol.util.WrapperCollections.ConcurrentWrapperEntry<K,V>
All Implemented Interfaces:
Map.Entry<K,V>
Enclosing class:
WrapperCollections

public static class WrapperCollections.ConcurrentWrapperEntry<K,V> extends Object implements Map.Entry<K,V>
Map Entry implementation which uses a ReadWriteLock to manage concurrent access to an underlying Map Entry.
Since:
Coherence 3.7
  • Field Details

    • m_lock

      protected final ReadWriteLock m_lock
      The read/write lock for concurrency control.
    • m_lockShared

      protected final Lock m_lockShared
      The shared lock for performing read operations.

      Note: This field is null if read-only operations are not supposed to be protected, i.e. if the "strict" option is not used.

    • m_lockExclusive

      protected final Lock m_lockExclusive
      The exclusive lock for performing read/write operations.
  • Constructor Details

    • ConcurrentWrapperEntry

      public ConcurrentWrapperEntry(Map.Entry<K,V> entry)
      Create an ConcurrentWrapperEntry which delegates to the specified Map Entry.
      Parameters:
      entry - the Map Entry to delegate all calls to
    • ConcurrentWrapperEntry

      protected ConcurrentWrapperEntry(Map.Entry<K,V> entry, ReadWriteLock lock)
      Create an ConcurrentWrapperEntry which delegates to the specified Map Entry.
      Parameters:
      entry - the Map Entry to delegate all calls to
      lock - a read/write lock for concurrency management
    • ConcurrentWrapperEntry

      protected ConcurrentWrapperEntry(Map.Entry<K,V> entry, ReadWriteLock lock, boolean fStrict)
      Create an ConcurrentWrapperEntry which delegates to the specified Map Entry.
      Parameters:
      entry - the Map Entry to delegate all calls to
      lock - a read/write lock for concurrency management
      fStrict - pass true to protect all Entry methods; false to protect only the setValue() method
  • Method Details

    • getKey

      public K getKey()
      Specified by:
      getKey in interface Map.Entry<K,V>
    • getValue

      public V getValue()
      Specified by:
      getValue in interface Map.Entry<K,V>
    • setValue

      public V setValue(V value)
      Specified by:
      setValue in interface Map.Entry<K,V>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map.Entry<K,V>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<K,V>
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDelegate

      protected Map.Entry<K,V> getDelegate()
      Return the Collection to which all operations should be delegated to.
      Returns:
      the wrapped Collection
    • getLock

      protected ReadWriteLock getLock()
      Return the ReadWriteLock that is used to manage concurrent access and modifications to the underlying map.
      Returns:
      the ReadWriteLock