com.hazelcast.client.txn
Class TransactionContextProxy

java.lang.Object
  extended by com.hazelcast.client.txn.TransactionContextProxy
All Implemented Interfaces:
TransactionalTaskContext, TransactionContext

public class TransactionContextProxy
extends Object
implements TransactionContext


Constructor Summary
TransactionContextProxy(ClientTransactionManager transactionManager, TransactionOptions options)
           
 
Method Summary
 void beginTransaction()
          Begins a transaction.
 void commitTransaction()
          Commits a transaction.
 HazelcastClientInstanceImpl getClient()
           
 ClientConnection getConnection()
           
<E> TransactionalList<E>
getList(String name)
          Returns the transactional list instance with the specified name.
<K,V> TransactionalMap<K,V>
getMap(String name)
          Returns the transactional distributed map instance with the specified name.
<K,V> TransactionalMultiMap<K,V>
getMultiMap(String name)
          Returns the transactional multimap instance with the specified name.
<E> TransactionalQueue<E>
getQueue(String name)
          Returns the transactional queue instance with the specified name.
<E> TransactionalSet<E>
getSet(String name)
          Returns the transactional set instance with the specified name.
<T extends TransactionalObject>
T
getTransactionalObject(String serviceName, String name)
           
 ClientTransactionManager getTransactionManager()
           
 String getTxnId()
          Gets the id that uniquely identifies the transaction.
 XAResource getXaResource()
          Gets xaResource which will participate in XATransaction
 boolean isXAManaged()
          Indicates that related transaction is managed by XAResource
 void rollbackTransaction()
          Rollback of the current transaction.
 boolean setTransactionTimeout(int seconds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionContextProxy

public TransactionContextProxy(ClientTransactionManager transactionManager,
                               TransactionOptions options)
Method Detail

getTxnId

public String getTxnId()
Description copied from interface: TransactionContext
Gets the id that uniquely identifies the transaction.

Specified by:
getTxnId in interface TransactionContext
Returns:
the transaction id.

beginTransaction

public void beginTransaction()
Description copied from interface: TransactionContext
Begins a transaction.

Specified by:
beginTransaction in interface TransactionContext

commitTransaction

public void commitTransaction()
                       throws TransactionException
Description copied from interface: TransactionContext
Commits a transaction.

Specified by:
commitTransaction in interface TransactionContext
Throws:
TransactionException - if no transaction is active or the transaction could not be committed.

rollbackTransaction

public void rollbackTransaction()
Description copied from interface: TransactionContext
Rollback of the current transaction.

Specified by:
rollbackTransaction in interface TransactionContext

getMap

public <K,V> TransactionalMap<K,V> getMap(String name)
Description copied from interface: TransactionalTaskContext
Returns the transactional distributed map instance with the specified name.

Specified by:
getMap in interface TransactionalTaskContext
Parameters:
name - name of the distributed map
Returns:
transactional distributed map instance with the specified name

getQueue

public <E> TransactionalQueue<E> getQueue(String name)
Description copied from interface: TransactionalTaskContext
Returns the transactional queue instance with the specified name.

Specified by:
getQueue in interface TransactionalTaskContext
Parameters:
name - name of the queue
Returns:
transactional queue instance with the specified name

getMultiMap

public <K,V> TransactionalMultiMap<K,V> getMultiMap(String name)
Description copied from interface: TransactionalTaskContext
Returns the transactional multimap instance with the specified name.

Specified by:
getMultiMap in interface TransactionalTaskContext
Parameters:
name - name of the multimap
Returns:
transactional multimap instance with the specified name

getList

public <E> TransactionalList<E> getList(String name)
Description copied from interface: TransactionalTaskContext
Returns the transactional list instance with the specified name.

Specified by:
getList in interface TransactionalTaskContext
Parameters:
name - name of the list
Returns:
transactional list instance with the specified name

getSet

public <E> TransactionalSet<E> getSet(String name)
Description copied from interface: TransactionalTaskContext
Returns the transactional set instance with the specified name.

Specified by:
getSet in interface TransactionalTaskContext
Parameters:
name - name of the set
Returns:
transactional set instance with the specified name

getTransactionalObject

public <T extends TransactionalObject> T getTransactionalObject(String serviceName,
                                                                String name)
Specified by:
getTransactionalObject in interface TransactionalTaskContext

getConnection

public ClientConnection getConnection()

getClient

public HazelcastClientInstanceImpl getClient()

getTransactionManager

public ClientTransactionManager getTransactionManager()

getXaResource

public XAResource getXaResource()
Description copied from interface: TransactionContext
Gets xaResource which will participate in XATransaction

Specified by:
getXaResource in interface TransactionContext
Returns:
the xaResource.

isXAManaged

public boolean isXAManaged()
Description copied from interface: TransactionContext
Indicates that related transaction is managed by XAResource

Specified by:
isXAManaged in interface TransactionContext
Returns:
true if related transaction is managed by XAResource, false otherwise

setTransactionTimeout

public boolean setTransactionTimeout(int seconds)


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