public abstract class EJBClientTransactionContext extends Attachable
Constructor and Description |
---|
EJBClientTransactionContext() |
Modifier and Type | Method and Description |
---|---|
static EJBClientTransactionContext |
create(TransactionManager transactionManager,
TransactionSynchronizationRegistry synchronizationRegistry)
Create a transaction context which is controlled by an actual transaction manager.
|
static EJBClientTransactionContext |
createLocal()
Create a local client transaction context which is controlled directly via
UserTransaction methods. |
protected abstract TransactionID |
getAssociatedTransactionID(EJBClientInvocationContext invocationContext)
Get the transaction ID to associate with the invocation.
|
static EJBClientTransactionContext |
getCurrent()
Get the current client transaction context.
|
protected abstract String |
getTransactionNode()
Get the node to which this transaction is pinned, if any.
|
protected UserTransaction |
getUserTransaction(String nodeName)
Get a
UserTransaction instance affiliated with a specific remote node to control the transaction
state. |
static EJBClientTransactionContext |
requireCurrent()
Get the current client transaction context, throwing an exception if one is not available.
|
static void |
setGlobalContext(EJBClientTransactionContext context)
Set the singleton, global transaction context.
|
static void |
setSelector(ContextSelector<EJBClientTransactionContext> selector)
Set the client transaction context selector.
|
getAttachment, getAttachments, putAttachment, putAttachmentIfAbsent, removeAttachment, removeAttachment, replaceAttachment, replaceAttachment
protected abstract TransactionID getAssociatedTransactionID(EJBClientInvocationContext invocationContext) throws Exception
invocationContext
- the invocation contextnull
for noneException
- if an exception occursprotected abstract String getTransactionNode()
null
if the transaction is not pinnedpublic static void setSelector(ContextSelector<EJBClientTransactionContext> selector) throws SecurityException
selector
- the selector to setSecurityException
- if a security manager is installed and you do not have the setClientTransactionContextSelector
RuntimePermission
public static void setGlobalContext(EJBClientTransactionContext context) throws SecurityException
setSelector(ContextSelector)
.context
- the context to setSecurityException
- if a security manager is installed and you do not have the setClientTransactionContextSelector
RuntimePermission
public static EJBClientTransactionContext requireCurrent() throws IllegalStateException
IllegalStateException
- if no context is availablepublic static EJBClientTransactionContext getCurrent()
public static EJBClientTransactionContext createLocal()
UserTransaction
methods.public static EJBClientTransactionContext create(TransactionManager transactionManager, TransactionSynchronizationRegistry synchronizationRegistry)
transactionManager
- the transaction managersynchronizationRegistry
- the transaction synchronization registryprotected UserTransaction getUserTransaction(String nodeName)
UserTransaction
instance affiliated with a specific remote node to control the transaction
state. The instance is only usable while there is an active connection with the given peer.nodeName
- the remote node nameCopyright © 2018 JBoss by Red Hat. All rights reserved.