public class XAResourceManager extends Object
BitronixTransaction contains an instance of this class that is used to register
and keep track of resources enlisted in a transaction.| Constructor and Description |
|---|
XAResourceManager(Uid gtrid)
Create a resource manager for the specified GTRID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearXAResourceHolderStates()
Remove this transaction's
XAResourceHolderState from all enlisted
XAResourceHolders. |
Set<String> |
collectUniqueNames()
Get a
Set of unique names of all the enlisted XAResourceHolderStates. |
boolean |
delist(XAResourceHolderState xaResourceHolderState,
int flag)
Delist the specified
XAResourceHolderState. |
void |
enlist(XAResourceHolderState xaResourceHolderState)
Enlist the specified
XAResourceHolderState. |
XAResourceHolderState |
findXAResourceHolderState(XAResource xaResource)
Look if an
XAResource has already been enlisted. |
List<XAResourceHolderState> |
getAllResources() |
Uid |
getGtrid()
Get the GTRID of the transaction the
XAResourceManager instance is attached to. |
SortedSet<Integer> |
getNaturalOrderPositions() |
List<XAResourceHolderState> |
getNaturalOrderResourcesForPosition(Integer position) |
SortedSet<Integer> |
getReverseOrderPositions() |
List<XAResourceHolderState> |
getReverseOrderResourcesForPosition(Integer position) |
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.
|
String |
toString()
Return a human-readable representation of this object.
|
public XAResourceManager(Uid gtrid)
gtrid - the transaction's GTRID this XAResourceManager will be assigned to.public void enlist(XAResourceHolderState xaResourceHolderState) throws 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 3XAResourceHolderStatexaResourceHolderState - the XAResourceHolderState to be enlisted.XAException - if a resource error occured.BitronixSystemException - if an internal error occured.public boolean delist(XAResourceHolderState xaResourceHolderState, int flag) throws XAException, BitronixSystemException
XAResourceHolderState. A reference to the resource is kept anyway.xaResourceHolderState - the XAResourceHolderState to be delisted.flag - the delistment flag.XAException - if the resource threw an exception during delistment.BitronixSystemException - if an internal error occured.public void suspend()
throws XAException
XAException - if the resource threw an exception during suspend.public void resume()
throws XAException
XAException - if the resource threw an exception during resume.public XAResourceHolderState findXAResourceHolderState(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
XAResourceHolders.public Set<String> collectUniqueNames()
Set of unique names of all the enlisted XAResourceHolderStates.Set of unique names of all the enlisted XAResourceHolderStates.public List<XAResourceHolderState> getNaturalOrderResourcesForPosition(Integer position)
public List<XAResourceHolderState> getReverseOrderResourcesForPosition(Integer position)
public List<XAResourceHolderState> getAllResources()
public int size()
public Uid getGtrid()
XAResourceManager instance is attached to.XAResourceManager instance is attached to.Copyright © 2006-2016 Bitronix Software. All Rights Reserved.