|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.internal.XAResourceManager
public class XAResourceManager
Every BitronixTransaction
contains an instance of this class that is used to register
and keep track of resources enlisted in a transaction.
Constructor Summary | |
---|---|
XAResourceManager(Uid gtrid)
Create a resource manager for the specified GTRID. |
Method Summary | |
---|---|
void |
clearXAResourceHolderStates()
Remove this transaction's XAResourceHolderState from all enlisted
XAResourceHolder s. |
java.util.Set |
collectUniqueNames()
Get a Set of unique names of all the enlisted XAResourceHolderState s. |
boolean |
delist(XAResourceHolderState xaResourceHolderState,
int flag)
Delist the specified XAResourceHolderState . |
void |
enlist(XAResourceHolderState xaResourceHolderState)
Enlist the specified XAResourceHolderState . |
XAResourceHolderState |
findXAResourceHolderState(javax.transaction.xa.XAResource xaResource)
Look if an XAResource has already been enlisted. |
java.util.List |
getAllResources()
|
Uid |
getGtrid()
Get the GTRID of the transaction the XAResourceManager instance is attached to. |
java.util.SortedSet |
getNaturalOrderPositions()
|
java.util.List |
getNaturalOrderResourcesForPosition(java.lang.Object positionKey)
|
java.util.SortedSet |
getReverseOrderPositions()
|
java.util.List |
getReverseOrderResourcesForPosition(java.lang.Object positionKey)
|
void |
resume()
Resume all enlisted resources in the current transaction context. |
int |
size()
Get the enlisted resources count. |
void |
suspend()
Suspend all enlisted resources from the current transaction context. |
java.lang.String |
toString()
Return a human-readable representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XAResourceManager(Uid gtrid)
gtrid
- the transaction's GTRID this XAResourceManager will be assigned to.Method Detail |
---|
public void enlist(XAResourceHolderState xaResourceHolderState) throws javax.transaction.xa.XAException, BitronixSystemException
XAResourceHolderState
. A XID is generated and the resource is started with
XAResource.TMNOFLAGS or XAResource.TMJOIN if it could be joined with another previously enlisted one.
XAResourceHolderState
is enlisted:
XAResourceHolderState
and drop the previous one. if you cannot join, it's the same as case 3XAResourceHolderState
xaResourceHolderState
- the XAResourceHolderState
to be enlisted.
javax.transaction.xa.XAException
- if a resource error occured.
BitronixSystemException
- if an internal error occured.public boolean delist(XAResourceHolderState xaResourceHolderState, int flag) throws javax.transaction.xa.XAException, BitronixSystemException
XAResourceHolderState
. A reference to the resource is kept anyway.
xaResourceHolderState
- the XAResourceHolderState
to be delisted.flag
- the delistment flag.
javax.transaction.xa.XAException
- if the resource threw an exception during delistment.
BitronixSystemException
- if an internal error occured.public void suspend() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if the resource threw an exception during suspend.public void resume() throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
- if the resource threw an exception during resume.public XAResourceHolderState findXAResourceHolderState(javax.transaction.xa.XAResource xaResource) throws BitronixSystemException
XAResource
has already been enlisted.
xaResource
- the XAResource
to look for.
XAResourceHolderState
of the enlisted resource or null if the XAResource
has not
been enlisted in this XAResourceManager
.
BitronixSystemException
- if an internal error happens.public void clearXAResourceHolderStates()
XAResourceHolderState
from all enlisted
XAResourceHolder
s.
public java.util.Set collectUniqueNames()
Set
of unique names of all the enlisted XAResourceHolderState
s.
Set
of unique names of all the enlisted XAResourceHolderState
s.public java.util.SortedSet getNaturalOrderPositions()
public java.util.SortedSet getReverseOrderPositions()
public java.util.List getNaturalOrderResourcesForPosition(java.lang.Object positionKey)
public java.util.List getReverseOrderResourcesForPosition(java.lang.Object positionKey)
public java.util.List getAllResources()
public int size()
public Uid getGtrid()
XAResourceManager
instance is attached to.
XAResourceManager
instance is attached to.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |