com.hazelcast.map.impl.tx
Class TransactionalMapProxy

java.lang.Object
  extended by com.hazelcast.spi.AbstractDistributedObject<MapService>
      extended by com.hazelcast.map.impl.tx.TransactionalMapProxySupport
          extended by com.hazelcast.map.impl.tx.TransactionalMapProxy
All Implemented Interfaces:
BaseMap, DistributedObject, TransactionalMap, TransactionalObject

public class TransactionalMapProxy
extends TransactionalMapProxySupport
implements TransactionalMap

Proxy implementation of TransactionalMap interface.


Field Summary
 
Fields inherited from class com.hazelcast.map.impl.tx.TransactionalMapProxySupport
name, partitionStrategy, tx, valueMap
 
Fields inherited from class com.hazelcast.spi.AbstractDistributedObject
PARTITIONING_STRATEGY
 
Constructor Summary
TransactionalMapProxy(String name, MapService mapService, NodeEngine nodeEngine, TransactionSupport transaction)
           
 
Method Summary
 boolean containsKey(Object key)
          Transactional implementation of IMap.containsKey(Object).
 void delete(Object key)
          Transactional implementation of IMap.delete(Object).
 Object get(Object key)
          Transactional implementation of IMap.get(Object).
 Object 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<Object> keySet()
          Transactional implementation of IMap.keySet().
 Set keySet(Predicate predicate)
          Transactional implementation of IMap.keySet(com.hazelcast.query.Predicate) .
 Object put(Object key, Object value)
          Transactional implementation of IMap.put(Object, Object).
 Object put(Object key, Object value, long ttl, TimeUnit timeUnit)
          Transactional implementation of IMap.put(Object, Object, long, java.util.concurrent.TimeUnit).
 Object putIfAbsent(Object key, Object value)
          Transactional implementation of IMap.putIfAbsent(Object, Object).
 Object remove(Object key)
          Transactional implementation of IMap.remove(Object).
 boolean remove(Object key, Object value)
          Transactional implementation of IMap.remove(Object, Object).
 Object replace(Object key, Object value)
          Transactional implementation of IMap.replace(Object, Object).
 boolean replace(Object key, Object oldValue, Object newValue)
          Transactional implementation of IMap.replace(Object, Object, Object).
 void set(Object key, Object value)
          Transactional implementation of IMap.set(Object, Object).
 int size()
          Transactional implementation of Map.size().
 String toString()
           
 Collection<Object> values()
          Transactional implementation of IMap.values().
 Collection values(Predicate predicate)
          Transactional implementation of IMap.values(com.hazelcast.query.Predicate) .
 
Methods inherited from class com.hazelcast.map.impl.tx.TransactionalMapProxySupport
checkTransactionState, containsKeyInternal, getEntries, getForUpdateInternal, getInternal, getName, getServiceName, getTimeInMillis, keySetInternal, putIfAbsentInternal, putInternal, putInternal, queryInternal, removeIfSameInternal, removeInternal, replaceIfSameInternal, replaceInternal, sizeInternal
 
Methods inherited from class com.hazelcast.spi.AbstractDistributedObject
destroy, equals, getId, getNameAsPartitionAwareData, getNodeEngine, getPartitionKey, getService, hashCode, invalidate, postDestroy, throwNotActiveException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getId, getName, getPartitionKey, getServiceName
 

Constructor Detail

TransactionalMapProxy

public TransactionalMapProxy(String name,
                             MapService mapService,
                             NodeEngine nodeEngine,
                             TransactionSupport transaction)
Method Detail

containsKey

public boolean containsKey(Object key)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.containsKey(Object).

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

size

public int size()
Description copied from interface: TransactionalMap
Transactional implementation of Map.size().

Specified by:
size in interface BaseMap
Specified by:
size in interface TransactionalMap
Returns:
the number of entries in this map.
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Description copied from interface: TransactionalMap
Transactional implementation of Map.isEmpty().

Specified by:
isEmpty in interface BaseMap
Specified by:
isEmpty in interface TransactionalMap
Returns:
true if this map contains no entries.
See Also:
Map.isEmpty()

get

public Object get(Object key)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.get(Object).

Specified by:
get in interface BaseMap
Specified by:
get in interface TransactionalMap
Parameters:
key - The specified key.
Returns:
The value for the specified key.
See Also:
IMap.get(Object)

getForUpdate

public Object getForUpdate(Object key)
Description copied from interface: TransactionalMap
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).

Specified by:
getForUpdate in interface TransactionalMap
See Also:
IMap.get(Object)

put

public Object put(Object key,
                  Object value)
Description copied from interface: TransactionalMap
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
Specified by:
put in interface TransactionalMap
Parameters:
key - The specified key.
value - The value to associate with the key.
Returns:
Previous value associated with key or null if there was no mapping for key.
See Also:
IMap.put(Object, Object)

put

public Object put(Object key,
                  Object value,
                  long ttl,
                  TimeUnit timeUnit)
Description copied from interface: TransactionalMap
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.

Specified by:
put in interface TransactionalMap
See Also:
IMap.put(Object, Object, long, java.util.concurrent.TimeUnit)

set

public void set(Object key,
                Object value)
Description copied from interface: TransactionalMap
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
Specified by:
set in interface TransactionalMap
Parameters:
key - The specified key.
value - The value to associate with the key.
See Also:
IMap.set(Object, Object)

putIfAbsent

public Object putIfAbsent(Object key,
                          Object value)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.putIfAbsent(Object, Object).

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

Specified by:
putIfAbsent in interface BaseMap
Specified by:
putIfAbsent in interface TransactionalMap
Parameters:
key - The specified key.
value - The value to associate with the key when there is no previous value.
Returns:
The previous value associated with key, or null if there was no mapping for key.
See Also:
IMap.putIfAbsent(Object, Object)

replace

public Object replace(Object key,
                      Object value)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.replace(Object, Object).

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

Specified by:
replace in interface BaseMap
Specified by:
replace in interface TransactionalMap
Parameters:
key - The specified key.
value - The value to replace the previous value.
Returns:
The previous value associated with key, or null if there was no mapping for key.
See Also:
IMap.replace(Object, Object)

replace

public boolean replace(Object key,
                       Object oldValue,
                       Object newValue)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.replace(Object, Object, Object).

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

Specified by:
replace in interface BaseMap
Specified by:
replace in interface TransactionalMap
Parameters:
key - The specified key.
oldValue - Replace the key value if it is the old value.
newValue - The new value to replace the old value.
Returns:
true if the value was replaced.
See Also:
IMap.replace(Object, Object, Object)

remove

public boolean remove(Object key,
                      Object value)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.remove(Object, Object).

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

Specified by:
remove in interface BaseMap
Specified by:
remove in interface TransactionalMap
Parameters:
key - The specified key.
value - Remove the key if it has this value.
Returns:
true if the value was removed.
See Also:
IMap.remove(Object, Object)

remove

public Object remove(Object key)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.remove(Object).

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

Specified by:
remove in interface BaseMap
Specified by:
remove in interface TransactionalMap
Parameters:
key - Remove the mapping for this key.
Returns:
The previous value associated with key, or null if there was no mapping for key.
See Also:
IMap.remove(Object)

delete

public void delete(Object key)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.delete(Object).

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

Specified by:
delete in interface BaseMap
Specified by:
delete in interface TransactionalMap
Parameters:
key - Remove the mapping for this key.
See Also:
IMap.delete(Object)

keySet

public Set<Object> keySet()
Description copied from interface: TransactionalMap
Transactional implementation of IMap.keySet().

Specified by:
keySet in interface TransactionalMap
See Also:
IMap.keySet()

keySet

public Set keySet(Predicate predicate)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.keySet(com.hazelcast.query.Predicate) .

Specified by:
keySet in interface TransactionalMap
See Also:
IMap.keySet(com.hazelcast.query.Predicate)

values

public Collection<Object> values()
Description copied from interface: TransactionalMap
Transactional implementation of IMap.values().

Specified by:
values in interface TransactionalMap
See Also:
IMap.values()

values

public Collection values(Predicate predicate)
Description copied from interface: TransactionalMap
Transactional implementation of IMap.values(com.hazelcast.query.Predicate) .

Specified by:
values in interface TransactionalMap
See Also:
IMap.values(com.hazelcast.query.Predicate)

toString

public String toString()
Overrides:
toString in class AbstractDistributedObject<MapService>


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