bitronix.tm.resource.common
Interface XAResourceHolder

All Superinterfaces:
XAStatefulHolder
All Known Implementing Classes:
AbstractXAResourceHolder, DualSessionWrapper, JdbcPooledConnection, RecoveryXAResourceHolder

public interface XAResourceHolder
extends XAStatefulHolder

XAResource wrappers must implement this interface. It defines a way to get access to the transactional state of this XAResourceHolder.

© Bitronix Software

Author:
lorban
See Also:
XAResourceHolderState

Field Summary
 
Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder
STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE
 
Method Summary
 javax.transaction.xa.XAResource getXAResource()
          Get the vendor's XAResource implementation of the wrapped resource.
 XAResourceHolderState getXAResourceHolderState()
          Get the XAResourceHolderState of this wrapped resource.
 boolean hasStateForXAResource(XAResourceHolder xaResourceHolder)
          Check if this XAResourceHolder contains a state for a specific XAResourceHolder.
 boolean removeXAResourceHolderState(XAResourceHolderState xaResourceHolderState)
          Remove the specified state from this wrapped resource.
 void setXAResourceHolderState(XAResourceHolderState xaResourceHolderState)
          Set the XAResourceHolderState of this wrapped resource.
 
Methods inherited from interface bitronix.tm.resource.common.XAStatefulHolder
addStateChangeEventListener, close, getConnectionHandle, getLastReleaseDate, getState, getXAResourceHolders, removeStateChangeEventListener, setState
 

Method Detail

getXAResource

javax.transaction.xa.XAResource getXAResource()
Get the vendor's XAResource implementation of the wrapped resource.

Returns:
the vendor's XAResource implementation.

getXAResourceHolderState

XAResourceHolderState getXAResourceHolderState()
Get the XAResourceHolderState of this wrapped resource.

Since a XAResourceHolder can participate in more than one transaction at a time (when suspending a context for instance) the transaction manager guarantees that the XAResourceHolderState related to the current transaction context will be returned.

Returns:
the XAResourceHolderState.

setXAResourceHolderState

void setXAResourceHolderState(XAResourceHolderState xaResourceHolderState)
Set the XAResourceHolderState of this wrapped resource.

Parameters:
xaResourceHolderState - the XAResourceHolderState to set.

removeXAResourceHolderState

boolean removeXAResourceHolderState(XAResourceHolderState xaResourceHolderState)
Remove the specified state from this wrapped resource.

Parameters:
xaResourceHolderState - the XAResourceHolderState to remove.
Returns:
true if the state actually existed before removal, false otherwise.

hasStateForXAResource

boolean hasStateForXAResource(XAResourceHolder xaResourceHolder)
Check if this XAResourceHolder contains a state for a specific XAResourceHolder. In other words: has the XAResourceHolder's XAResource been enlisted in some transaction ?

Parameters:
xaResourceHolder - the XAResourceHolder to look for.
Returns:
true if the XAResourceHolder is enlisted in some transaction, false otherwise.