public class TransactionContextProxy extends Object implements ClientTransactionContext
TransactionalMap
.
Provides client instance and client connection proxies that need to be accessed for sending invocations.Constructor and Description |
---|
TransactionContextProxy(ClientTransactionManagerServiceImpl transactionManager,
TransactionOptions options) |
Modifier and Type | Method and Description |
---|---|
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> |
getTransactionalObject(String serviceName,
String name)
Returns the transactional object instance with the specified name and service name.
|
String |
getTxnId()
Gets the ID that uniquely identifies the transaction.
|
XAResource |
getXaResource()
Gets xaResource which will participate in XATransaction.
|
void |
rollbackTransaction()
Rollback of the current transaction.
|
public TransactionContextProxy(ClientTransactionManagerServiceImpl transactionManager, TransactionOptions options)
public String getTxnId()
TransactionContext
getTxnId
in interface TransactionContext
public void beginTransaction()
TransactionContext
beginTransaction
in interface TransactionContext
public void commitTransaction() throws TransactionException
TransactionContext
commitTransaction
in interface TransactionContext
TransactionException
- if no transaction is active or the transaction could not be committed.public void rollbackTransaction()
TransactionContext
rollbackTransaction
in interface TransactionContext
public <K,V> TransactionalMap<K,V> getMap(String name)
TransactionalTaskContext
getMap
in interface TransactionalTaskContext
name
- name of the distributed transactional mappublic <E> TransactionalQueue<E> getQueue(String name)
TransactionalTaskContext
getQueue
in interface TransactionalTaskContext
name
- name of the transactional queuepublic <K,V> TransactionalMultiMap<K,V> getMultiMap(String name)
TransactionalTaskContext
getMultiMap
in interface TransactionalTaskContext
name
- name of the transactional multimappublic <E> TransactionalList<E> getList(String name)
TransactionalTaskContext
getList
in interface TransactionalTaskContext
name
- name of the transactional listpublic <E> TransactionalSet<E> getSet(String name)
TransactionalTaskContext
getSet
in interface TransactionalTaskContext
name
- name of the transactional setpublic <T extends TransactionalObject> T getTransactionalObject(String serviceName, String name)
TransactionalTaskContext
getTransactionalObject
in interface TransactionalTaskContext
serviceName
- service name for the transactional object instancename
- name of the transactional object instancepublic ClientConnection getConnection()
getConnection
in interface ClientTransactionContext
public HazelcastClientInstanceImpl getClient()
getClient
in interface ClientTransactionContext
public XAResource getXaResource()
TransactionContext
getXaResource
in interface TransactionContext
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.