|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.data.core.TransactionContext
public class TransactionContext
Represents the transaction on behalf of the component that wants to
explicitly demarcate transaction boundaries. After having been prepared,
schedules a task that rolls back the transaction if some time passes without
any further action. This will guarantee that global objects locked by one
of the resources' InternalXAResource.prepare(org.apache.jackrabbit.data.core.TransactionContext) method, are eventually
unlocked.
| Constructor Summary | |
|---|---|
TransactionContext(Xid xid,
InternalXAResource[] resources)
Create a new instance of this class. |
|
| Method Summary | |
|---|---|
void |
commit()
Commit the transaction identified by this context. |
Object |
getAttribute(String name)
Return an attribute value on this transaction. |
static Object |
getCurrentThreadId()
Returns the current thread identifier. |
static boolean |
isSameThreadId(Object a,
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(String name)
Remove an attribute on this transaction. |
void |
rollback()
Rollback the transaction identified by this context. |
void |
setAttribute(String name,
Object value)
Set an attribute on this transaction. |
void |
setSuspended(boolean suspended)
Set a flag indicating whether the association is suspended. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionContext(Xid xid,
InternalXAResource[] resources)
xid - associated xidresources - transactional resources| Method Detail |
|---|
public void setAttribute(String name,
Object value)
null, it is semantically equivalent to
removeAttribute(java.lang.String).
name - attribute namevalue - attribute valuepublic Object getAttribute(String name)
name - attribute name
null if no attribute with that
name existspublic void removeAttribute(String name)
name - attribute name
public void prepare()
throws XAException
XAException - if an error occurs
public void commit()
throws XAException
XAException - if an error occurs
public void rollback()
throws XAException
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 Object getCurrentThreadId()
XidWrapper, when running under a transaction.
public static boolean isSameThreadId(Object a,
Object b)
getCurrentThreadId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||