public interface XAResourceHolder<T extends XAResourceHolder<T>> extends XAStatefulHolder<T>
XAResource wrappers must implement this interface. It defines a way to get access to the transactional
state of this XAResourceHolder.XAResourceHolderStateXAStatefulHolder.State| Modifier and Type | Method and Description |
|---|---|
void |
acceptVisitorForXAResourceHolderStates(Uid gtrid,
XAResourceHolderStateVisitor visitor)
This method implements a standard Visitor Pattern.
|
ResourceBean |
getResourceBean()
Get the ResourceBean which created this XAResourceHolder.
|
XAResource |
getXAResource()
Get the vendor's
XAResource implementation of the wrapped resource. |
int |
getXAResourceHolderStateCountForGtrid(Uid gtrid)
Get a count of
XAResourceHolderStates for the specified GTRID. |
boolean |
hasStateForXAResource(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder)
Check if this
XAResourceHolder contains a state for a specific XAResourceHolder. |
boolean |
isExistXAResourceHolderStatesForGtrid(Uid gtrid)
Checks whether there are
XAResourceHolderStates for the specified GTRID. |
void |
putXAResourceHolderState(BitronixXid xid,
XAResourceHolderState xaResourceHolderState)
Add a
XAResourceHolderState of this wrapped resource. |
void |
removeXAResourceHolderState(BitronixXid xid)
Remove all states related to a specific Xid from this wrapped resource.
|
addStateChangeEventListener, close, getConnectionHandle, getCreationDate, getLastReleaseDate, getState, getXAResourceHolders, removeStateChangeEventListener, setStateXAResource getXAResource()
XAResource implementation of the wrapped resource.void acceptVisitorForXAResourceHolderStates(Uid gtrid, XAResourceHolderStateVisitor visitor)
XAResourceHolderStateVisitor's visit() method is called for each matching
XAResourceHolderState in the order they were added. This method was introduced
as a replacement for the old getXAResourceHolderStatesForGtrid(Uid) method. The old
getXAResourceHolderStatesForGtrid method exported an internal collection which was unsynchronized
yet was iterated over by the callers. Using the Visitor Pattern allows us to perform the same
iteration within the context of a lock, and avoids exposing internal state and implementation
details to callers.gtrid - the GTRID of the transaction state to visit XAResourceHolderStates forvisitor - a XAResourceHolderStateVisitor instanceboolean isExistXAResourceHolderStatesForGtrid(Uid gtrid)
XAResourceHolderStates for the specified GTRID.gtrid - the GTRID of the transaction state to check existence forXAResourceHolderStates, false otherwiseint getXAResourceHolderStateCountForGtrid(Uid gtrid)
XAResourceHolderStates for the specified GTRID.gtrid - the GTRID to get a XAResourceHolderState count forXAResourceHolderStates, or 0 if there are no states for the
specified GTRIDvoid putXAResourceHolderState(BitronixXid xid, XAResourceHolderState xaResourceHolderState)
XAResourceHolderState of this wrapped resource.xid - the Xid of the transaction state to add.xaResourceHolderState - the XAResourceHolderState to set.void removeXAResourceHolderState(BitronixXid xid)
xid - the Xid of the transaction state to remove.boolean hasStateForXAResource(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder)
XAResourceHolder contains a state for a specific XAResourceHolder.
In other words: has the XAResourceHolder's XAResource been enlisted in some transaction ?xaResourceHolder - the XAResourceHolder to look for.XAResourceHolder is enlisted in some transaction, false otherwise.ResourceBean getResourceBean()
Copyright © 2006-2016 Bitronix Software. All Rights Reserved.