public class TransactionContext
extends java.lang.Object
InternalXAResource.prepare(org.apache.jackrabbit.data.core.TransactionContext)
method, are eventually
unlocked.Constructor and Description |
---|
TransactionContext(javax.transaction.xa.Xid xid,
InternalXAResource[] resources)
Create a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commit the transaction identified by this context.
|
java.lang.Object |
getAttribute(java.lang.String name)
Return an attribute value on this transaction.
|
static java.lang.Object |
getCurrentThreadId()
Returns the current thread identifier.
|
static boolean |
isSameThreadId(java.lang.Object a,
java.lang.Object b)
Compares the given thread identifiers for equality.
|
boolean |
isSuspended()
Return a flag indicating whether the association is suspended.
|
void |
prepare()
Prepare the transaction identified by this context.
|
void |
removeAttribute(java.lang.String name)
Remove an attribute on this transaction.
|
void |
rollback()
Rollback the transaction identified by this context.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set an attribute on this transaction.
|
void |
setSuspended(boolean suspended)
Set a flag indicating whether the association is suspended.
|
public TransactionContext(javax.transaction.xa.Xid xid, InternalXAResource[] resources)
xid
- associated xidresources
- transactional resourcespublic void setAttribute(java.lang.String name, java.lang.Object value)
null
, it is semantically equivalent to
removeAttribute(java.lang.String)
.name
- attribute namevalue
- attribute valuepublic java.lang.Object getAttribute(java.lang.String name)
name
- attribute namenull
if no attribute with that
name existspublic void removeAttribute(java.lang.String name)
name
- attribute namepublic void prepare() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if an error occurspublic void commit() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if an error occurspublic void rollback() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if an error occurspublic boolean isSuspended()
true
if the association is suspended;
false
otherwisepublic void setSuspended(boolean suspended)
suspended
- flag whether that the association is suspended.public static java.lang.Object getCurrentThreadId()
XidWrapper
, when running under a transaction.public static boolean isSameThreadId(java.lang.Object a, java.lang.Object b)
getCurrentThreadId()
Copyright © 2010 - 2020 Adobe. All Rights Reserved