com.hazelcast.core
Interface TransactionalMap<K,V>

Type Parameters:
K - key
V - value
All Superinterfaces:
BaseMap<K,V>, DistributedObject, TransactionalObject

public interface TransactionalMap<K,V>
extends TransactionalObject, BaseMap<K,V>

Transactional implementation of BaseMap.

See Also:
BaseMap, IMap

Method Summary
 boolean containsKey(Object key)
          Transactional implementation of IMap.containsKey(Object).
 void delete(Object key)
          Transactional implementation of IMap.delete(Object).
 V get(Object key)
          Transactional implementation of IMap.get(Object).
 V getForUpdate(Object key)
          Locks the key and then gets and returns the value to which the specified key is mapped.
 boolean isEmpty()
          Transactional implementation of Map.isEmpty().
 Set<K> keySet()
          Transactional implementation of IMap.keySet().
 Set<K> keySet(Predicate predicate)
          Transactional implementation of IMap.keySet(com.hazelcast.query.Predicate) .
 V put(K key, V value)
          Transactional implementation of IMap.put(Object, Object).
 V put(K key, V value, long ttl, TimeUnit timeunit)
          Transactional implementation of IMap.put(Object, Object, long, java.util.concurrent.TimeUnit).
 V putIfAbsent(K key, V value)
          Transactional implementation of IMap.putIfAbsent(Object, Object).
 V remove(Object key)
          Transactional implementation of IMap.remove(Object).
 boolean remove(Object key, Object value)
          Transactional implementation of IMap.remove(Object, Object).
 V replace(K key, V value)
          Transactional implementation of IMap.replace(Object, Object).
 boolean replace(K key, V oldValue, V newValue)
          Transactional implementation of IMap.replace(Object, Object, Object).
 void set(K key, V value)
          Transactional implementation of IMap.set(Object, Object).
 int size()
          Transactional implementation of Map.size().
 Collection<V> values()
          Transactional implementation of IMap.values().
 Collection<V> values(Predicate predicate)
          Transactional implementation of IMap.values(com.hazelcast.query.Predicate) .
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getName, getPartitionKey, getServiceName
 

Method Detail

containsKey

boolean containsKey(Object key)
Transactional implementation of IMap.containsKey(Object).

Specified by:
containsKey in interface BaseMap<K,V>
Parameters:
key - key
Returns:
true if this map contains an entry for the specified key
See Also:
IMap.containsKey(Object)

get

V get(Object key)
Transactional implementation of IMap.get(Object).

Specified by:
get in interface BaseMap<K,V>
Parameters:
key - key
Returns:
value
See Also:
IMap.get(Object)

getForUpdate

V getForUpdate(Object key)
Locks the key and then gets and returns the value to which the specified key is mapped. Lock will be released at the end of the transaction (either commit or rollback).

See Also:
IMap.get(Object)

size

int size()
Transactional implementation of Map.size().

Specified by:
size in interface BaseMap<K,V>
Returns:
the number of entries in this map
See Also:
Map.size()

isEmpty

boolean isEmpty()
Transactional implementation of Map.isEmpty().

Specified by:
isEmpty in interface BaseMap<K,V>
Returns:
true if this map contains no entries
See Also:
Map.isEmpty()

put

V put(K key,
      V value)
Transactional implementation of IMap.put(Object, Object).

The object to be put will be accessible only in the current transaction context till transaction is committed.

Specified by:
put in interface BaseMap<K,V>
Parameters:
key - key
value - value
Returns:
previous value associated with key or null if there was no mapping for key.
See Also:
IMap.put(Object, Object)

put

V put(K key,
      V value,
      long ttl,
      TimeUnit timeunit)
Transactional implementation of IMap.put(Object, Object, long, java.util.concurrent.TimeUnit).

The object to be put will be accessible only in the current transaction context till transaction is committed.

See Also:
IMap.put(Object, Object, long, java.util.concurrent.TimeUnit)

set

void set(K key,
         V value)
Transactional implementation of IMap.set(Object, Object).

The object to be set will be accessible only in the current transaction context till transaction is committed.

Specified by:
set in interface BaseMap<K,V>
Parameters:
key - key
value - value
See Also:
IMap.set(Object, Object)

putIfAbsent

V putIfAbsent(K key,
              V value)
Transactional implementation of IMap.putIfAbsent(Object, Object).

The object to be put will be accessible only in the current transaction context till transaction is committed.

Specified by:
putIfAbsent in interface BaseMap<K,V>
Parameters:
key - key
value - value
Returns:
previous value associated with key or null if there was no mapping for key.
See Also:
IMap.putIfAbsent(Object, Object)

replace

V replace(K key,
          V value)
Transactional implementation of IMap.replace(Object, Object).

The object to be replaced will be accessible only in the current transaction context till transaction is committed.

Specified by:
replace in interface BaseMap<K,V>
Parameters:
key - key
value - value
Returns:
previous value associated with key or null if there was no mapping for key.
See Also:
IMap.replace(Object, Object)

replace

boolean replace(K key,
                V oldValue,
                V newValue)
Transactional implementation of IMap.replace(Object, Object, Object).

The object to be replaced will be accessible only in the current transaction context till transaction is committed.

Specified by:
replace in interface BaseMap<K,V>
Parameters:
key - key
oldValue - old value
newValue - new value
Returns:
true if the value was replaced
See Also:
IMap.replace(Object, Object, Object)

remove

V remove(Object key)
Transactional implementation of IMap.remove(Object).

The object to be removed will be removed from only the current transaction context till transaction is committed.

Specified by:
remove in interface BaseMap<K,V>
Parameters:
key - key
Returns:
previous value associated with key or null if there was no mapping for key.
See Also:
IMap.remove(Object)

delete

void delete(Object key)
Transactional implementation of IMap.delete(Object).

The object to be deleted will be removed from only the current transaction context till transaction is committed.

Specified by:
delete in interface BaseMap<K,V>
Parameters:
key - key
See Also:
IMap.delete(Object)

remove

boolean remove(Object key,
               Object value)
Transactional implementation of IMap.remove(Object, Object).

The object to be removed will be removed from only the current transaction context till transaction is committed.

Specified by:
remove in interface BaseMap<K,V>
Parameters:
key - key
value - value
Returns:
true if the value was removed
See Also:
IMap.remove(Object, Object)

keySet

Set<K> keySet()
Transactional implementation of IMap.keySet().

See Also:
IMap.keySet()

keySet

Set<K> keySet(Predicate predicate)
Transactional implementation of IMap.keySet(com.hazelcast.query.Predicate) .

See Also:
IMap.keySet(com.hazelcast.query.Predicate)

values

Collection<V> values()
Transactional implementation of IMap.values().

See Also:
IMap.values()

values

Collection<V> values(Predicate predicate)
Transactional implementation of IMap.values(com.hazelcast.query.Predicate) .

See Also:
IMap.values(com.hazelcast.query.Predicate)


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.