|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hazelcast.client.spi.ClientProxy
com.hazelcast.client.proxy.ClientReplicatedMapProxy<K,V>
K - key typeV - value typepublic class ClientReplicatedMapProxy<K,V>
The replicated map client side proxy implementation proxying all requests to a member node
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
ClientReplicatedMapProxy(String serviceName,
String objectName)
|
|
| Method Summary | |
|---|---|
String |
addEntryListener(EntryListener<K,V> listener)
Adds an entry listener for this map. |
String |
addEntryListener(EntryListener<K,V> listener,
K key)
Adds the specified entry listener for the specified key. |
String |
addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate)
Adds an continuous entry listener for this map. |
String |
addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
K key)
Adds an continuous entry listener for this map. |
void |
clear()
The clear operation is used for wiping data out of the replicated maps. |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
Returns a Set view of the mappings contained in this map. |
V |
get(Object key)
|
boolean |
isEmpty()
|
Set<K> |
keySet()
|
protected void |
onDestroy()
Called before proxy is destroyed. |
V |
put(K key,
V value)
|
V |
put(K key,
V value,
long ttl,
TimeUnit timeUnit)
Associates a given value to the specified key and replicates it to the cluster. |
void |
putAll(Map<? extends K,? extends V> m)
|
V |
remove(Object key)
|
boolean |
removeEntryListener(String id)
Removes the specified entry listener. |
int |
size()
|
String |
toString()
|
Collection<V> |
values()
Returns a Collection view of the values contained in this map. |
Collection<V> |
values(Comparator<V> comparator)
Returns a Collection view of the values contained in this map. |
| Methods inherited from class com.hazelcast.client.spi.ClientProxy |
|---|
destroy, equals, getContext, getId, getName, getPartitionKey, getServiceName, hashCode, invoke, invoke, invoke, invokeInterruptibly, listen, listen, onInitialize, onShutdown, setContext, stopListening, throwExceptionIfNull, toData, toObject |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Methods inherited from interface com.hazelcast.core.DistributedObject |
|---|
destroy, getId, getName, getPartitionKey, getServiceName |
| Constructor Detail |
|---|
public ClientReplicatedMapProxy(String serviceName,
String objectName)
| Method Detail |
|---|
protected void onDestroy()
ClientProxy
onDestroy in class ClientProxy
public V put(K key,
V value,
long ttl,
TimeUnit timeUnit)
ReplicatedMapAssociates a given value to the specified key and replicates it to the cluster. If there is an old value, it will be replaced by the specified one and returned from the call.
In addition, you have to specify a ttl and its TimeUnit
to define when the value is outdated and thus should be removed from the
replicated map.
put in interface ReplicatedMap<K,V>key - key with which the specified value is to be associatedvalue - value to be associated with the specified keyttl - ttl to be associated with the specified key-value pairtimeUnit - TimeUnit to be used for the ttl valuepublic int size()
size in interface Map<K,V>public boolean isEmpty()
isEmpty in interface Map<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public V get(Object key)
get in interface Map<K,V>
public V put(K key,
V value)
put in interface Map<K,V>public V remove(Object key)
remove in interface Map<K,V>public void putAll(Map<? extends K,? extends V> m)
putAll in interface Map<K,V>public void clear()
ReplicatedMapThe clear operation is used for wiping data out of the replicated maps. It is the only synchronous remote operation in this implementation, so be aware that this might be a slow operation.
If some node fails on executing the operation, it is retried for at most
3 times (on the failing nodes only). If not working after the third time, this
method throws a OperationTimeoutException back
to the caller.
clear in interface ReplicatedMap<K,V>clear in interface Map<K,V>public boolean removeEntryListener(String id)
ReplicatedMap
removeEntryListener in interface ReplicatedMap<K,V>id - id of the registered listener
public String addEntryListener(EntryListener<K,V> listener)
ReplicatedMap
addEntryListener in interface ReplicatedMap<K,V>listener - entry listener
public String addEntryListener(EntryListener<K,V> listener,
K key)
ReplicatedMapWarning:
This method uses hashCode and equals of the binary form of the key, not the actual implementations of hashCode and equals defined in the key's class.
addEntryListener in interface ReplicatedMap<K,V>listener - the entry listenerkey - the key to listen to
public String addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate)
ReplicatedMap
addEntryListener in interface ReplicatedMap<K,V>listener - the entry listenerpredicate - the predicate for filtering entries
public String addEntryListener(EntryListener<K,V> listener,
Predicate<K,V> predicate,
K key)
ReplicatedMap
addEntryListener in interface ReplicatedMap<K,V>listener - the entry listenerpredicate - the predicate for filtering entrieskey - the key to listen topublic Set<K> keySet()
keySet in interface Map<K,V>public Collection<V> values()
ReplicatedMapCollection view of the values contained in this map.
The collection is NOT backed by the map, so changes to the map are
NOT reflected in the collection, and vice-versa.ReplicatedMap.values(java.util.Comparator) to force reordering of the
elements before returning.
values in interface ReplicatedMap<K,V>values in interface Map<K,V>public Collection<V> values(Comparator<V> comparator)
ReplicatedMapCollection view of the values contained in this map.
The collection is NOT backed by the map, so changes to the map are
NOT reflected in the collection, and vice-versa.Comparator before returning the elements.
values in interface ReplicatedMap<K,V>comparator - the Comparator to sort the returned elements
public Set<Map.Entry<K,V>> entrySet()
ReplicatedMapSet view of the mappings contained in this map.
The set is NOT backed by the map, so changes to the map are
NOT reflected in the set, and vice-versa.
entrySet in interface ReplicatedMap<K,V>entrySet in interface Map<K,V>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||