org.terracotta.collections
Class ConcurrentDistributedMapDso<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by org.terracotta.collections.ConcurrentDistributedMapDso<K,V>
All Implemented Interfaces:
com.tc.object.bytecode.AAFairDistributionPolicyMarker, com.tc.object.bytecode.Clearable, com.tc.object.bytecode.Manageable, com.tc.object.bytecode.TCMap, Map<K,V>

public class ConcurrentDistributedMapDso<K,V>
extends AbstractMap<K,V>
implements com.tc.object.bytecode.TCMap, com.tc.object.bytecode.Manageable, com.tc.object.bytecode.Clearable, com.tc.object.bytecode.AAFairDistributionPolicyMarker


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ConcurrentDistributedMapDso(LockType lockType, LockStrategy<? super K> lockingStrategy)
           
 
Method Summary
 void __tc_applicator_clear()
           
 void __tc_applicator_put(Object key, Object value)
           
 void __tc_applicator_remove(Object key)
           
 int __tc_clearReferences(int toClear)
           
 Collection __tc_getAllEntriesSnapshot()
           
 Collection __tc_getAllLocalEntriesSnapshot()
           
 boolean __tc_isManaged()
           
 com.tc.object.TCObject __tc_managed()
           
 void __tc_managed(com.tc.object.TCObject tcObject)
           
 void __tc_put_logical(Object key, Object value)
           
 void __tc_remove_logical(Object key)
           
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 FinegrainedLock createFinegrainedLock(K key)
          Obtain a fine-grained lock instance for a particular key.
 Set<Map.Entry<K,V>> entrySet()
           
 boolean flush(Object key, Object value)
           
 V get(Object key)
           
 Collection<Map.Entry<K,V>> getAllEntriesSnapshot()
           
 Collection<Map.Entry<K,V>> getAllLocalEntriesSnapshot()
           
 List<Map<K,?>> getConstituentMaps()
           
 String getLockIdForKey(K key)
           
 Map.Entry<K,V> getRandomEntry()
           
 Map.Entry<K,V> getRandomLocalEntry()
           
 boolean isEvictionEnabled()
           
 Set<K> keySet()
           
 int localSize()
           
 void lockEntry(K key)
          Lock the entry corresponding to this key.
static
<K,V> ConcurrentDistributedMapDso<K,V>
newCDM(int lockLevel, Object strategy)
           
 V put(K key, V value)
           
 V putIfAbsent(K key, V value)
           
 void putNoReturn(K key, V value)
           
 MapSizeListener registerMapSizeListener(MapSizeListener newListener)
           
 V remove(Object key)
           
 boolean remove(Object key, Object value)
           
 void removeNoReturn(K key)
           
 V replace(K key, V value)
           
 boolean replace(K key, V oldValue, V newValue)
           
 void setEvictionEnabled(boolean flag)
           
 int size()
           
 boolean tryRemove(Object key, long time, TimeUnit unit)
           
 V unlockedGet(Object key)
           
 void unlockedPutNoReturn(K key, V value)
           
 void unlockedRemoveNoReturn(K key)
           
 void unlockEntry(K key)
          Unlock the entry corresponding to this key
 V unsafeGet(K key)
           
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty, putAll, values
 

Constructor Detail

ConcurrentDistributedMapDso

public ConcurrentDistributedMapDso(LockType lockType,
                                   LockStrategy<? super K> lockingStrategy)
Method Detail

newCDM

public static <K,V> ConcurrentDistributedMapDso<K,V> newCDM(int lockLevel,
                                                            Object strategy)

put

public V put(K key,
             V value)
Specified by:
put in interface Map<K,V>
Overrides:
put in class AbstractMap<K,V>

unsafeGet

public V unsafeGet(K key)

get

public V get(Object key)
Specified by:
get in interface Map<K,V>
Overrides:
get in class AbstractMap<K,V>

unlockedGet

public V unlockedGet(Object key)

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>
Overrides:
remove in class AbstractMap<K,V>

removeNoReturn

public void removeNoReturn(K key)

unlockedRemoveNoReturn

public void unlockedRemoveNoReturn(K key)

putNoReturn

public void putNoReturn(K key,
                        V value)

unlockedPutNoReturn

public void unlockedPutNoReturn(K key,
                                V value)

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<K,V>
Overrides:
containsKey in class AbstractMap<K,V>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<K,V>
Overrides:
containsValue in class AbstractMap<K,V>

size

public int size()
Specified by:
size in interface Map<K,V>
Overrides:
size in class AbstractMap<K,V>

localSize

public int localSize()

clear

public void clear()
Specified by:
clear in interface Map<K,V>
Overrides:
clear in class AbstractMap<K,V>

keySet

public Set<K> keySet()
Specified by:
keySet in interface Map<K,V>
Overrides:
keySet in class AbstractMap<K,V>

entrySet

public Set<Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface Map<K,V>
Specified by:
entrySet in class AbstractMap<K,V>

putIfAbsent

public V putIfAbsent(K key,
                     V value)

remove

public boolean remove(Object key,
                      Object value)

replace

public boolean replace(K key,
                       V oldValue,
                       V newValue)

replace

public V replace(K key,
                 V value)

getAllEntriesSnapshot

public Collection<Map.Entry<K,V>> getAllEntriesSnapshot()

getAllLocalEntriesSnapshot

public Collection<Map.Entry<K,V>> getAllLocalEntriesSnapshot()

__tc_applicator_clear

public void __tc_applicator_clear()
Specified by:
__tc_applicator_clear in interface com.tc.object.bytecode.TCMap

__tc_applicator_put

public void __tc_applicator_put(Object key,
                                Object value)
Specified by:
__tc_applicator_put in interface com.tc.object.bytecode.TCMap

__tc_applicator_remove

public void __tc_applicator_remove(Object key)
Specified by:
__tc_applicator_remove in interface com.tc.object.bytecode.TCMap

__tc_getAllEntriesSnapshot

public Collection __tc_getAllEntriesSnapshot()
Specified by:
__tc_getAllEntriesSnapshot in interface com.tc.object.bytecode.TCMap

__tc_getAllLocalEntriesSnapshot

public Collection __tc_getAllLocalEntriesSnapshot()
Specified by:
__tc_getAllLocalEntriesSnapshot in interface com.tc.object.bytecode.TCMap

__tc_put_logical

public void __tc_put_logical(Object key,
                             Object value)
Specified by:
__tc_put_logical in interface com.tc.object.bytecode.TCMap

__tc_remove_logical

public void __tc_remove_logical(Object key)
Specified by:
__tc_remove_logical in interface com.tc.object.bytecode.TCMap

__tc_isManaged

public boolean __tc_isManaged()
Specified by:
__tc_isManaged in interface com.tc.object.bytecode.Manageable

__tc_managed

public com.tc.object.TCObject __tc_managed()
Specified by:
__tc_managed in interface com.tc.object.bytecode.Manageable

__tc_managed

public void __tc_managed(com.tc.object.TCObject tcObject)
Specified by:
__tc_managed in interface com.tc.object.bytecode.Manageable

__tc_clearReferences

public int __tc_clearReferences(int toClear)
Specified by:
__tc_clearReferences in interface com.tc.object.bytecode.Clearable

isEvictionEnabled

public boolean isEvictionEnabled()
Specified by:
isEvictionEnabled in interface com.tc.object.bytecode.Clearable

setEvictionEnabled

public void setEvictionEnabled(boolean flag)
Specified by:
setEvictionEnabled in interface com.tc.object.bytecode.Clearable

createFinegrainedLock

public FinegrainedLock createFinegrainedLock(K key)
Description copied from interface: LockableMap
Obtain a fine-grained lock instance for a particular key.

Parameters:
key - the key for which a fine-grained lock has to be constructed
Returns:
an instance of fine-grained lock that can be used to perform primitive locking operations on a key

lockEntry

public void lockEntry(K key)
Description copied from interface: LockableMap
Lock the entry corresponding to this key.

Parameters:
key - the key for which all entry accesses have to be locked

unlockEntry

public void unlockEntry(K key)
Description copied from interface: LockableMap
Unlock the entry corresponding to this key

Parameters:
key - the key for which all entry accesses have to be unlocked

getLockIdForKey

public String getLockIdForKey(K key)

getConstituentMaps

public List<Map<K,?>> getConstituentMaps()

getRandomEntry

public Map.Entry<K,V> getRandomEntry()

getRandomLocalEntry

public Map.Entry<K,V> getRandomLocalEntry()

flush

public boolean flush(Object key,
                     Object value)

tryRemove

public boolean tryRemove(Object key,
                         long time,
                         TimeUnit unit)

registerMapSizeListener

public MapSizeListener registerMapSizeListener(MapSizeListener newListener)


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.