Package com.sun.xml.ws.tx.at
Class WSATHelper<T>
java.lang.Object
com.sun.xml.ws.tx.at.WSATHelper<T>
This singleton serves not only as a helper and utility but as the core of the WS-AT resource manager and
holds the datastructures that maintain the endpoint references for durable/XAResource and volatile/Synchronization
WS-AT transaction participants.
Rather than translate back and forth between the WS-AT and internal Xid, the WS-AT could simply be used for
the keys in this class, however, we are working with Xids as keys and identity for convenience and
better debug logging information as there do not appear to be any substantial performance implications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WSATVersion<T>static final WSATHelperstatic final WSATHelper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringvoidbeforeCompletion(EndpointReference epr, Xid xid, WSATSynchronization wsatSynchronization) beforeCompletion call on volatile participantvoidcommit(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) Unlike rollback, Xids are not added to the durable participant XAResource map during commit as prepare must always be called in WS-AT (there is no onePhase commit) and prepare must add the Xid to the map.Called by Coordinator to get/create XidgetCoordinatorPort(EndpointReference epr, Xid xid) Called from ForeignRecoveryContext.runjakarta.transaction.TransactionCalled by transactionservices enlistResource before calling wsatgatewayrm.enliststatic WSATHelperstatic WSATHelpergetInstance(Transactional.Version version) getParticipantPort(EndpointReference epr, Xid xid, String bqual) Creates and returns a ParticipantPortType, whether it be durable or volatile, for the provided address, Xid, and reference parameter Elements/Nodesstatic TransactionServicesReturn the TransactionServices See interface for details...Map<Xid,ParticipantIF<T>> intAmount of time to wait for a reply from a prepare, rollback, commit, or beforeCompletion call before throwing the appropriate exception, errorcode, etc.Used by getXidFromWebServiceContextHeaderList in WSATHelper and replayOperation of Coordinator serviceGiven a WebServiceContext extract and return the WS-AT transaction id and return the translated Xidstatic booleanNeed to check if debug is enabled before all logging to prevent unnecessary object creation.voidprepare(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) Get/create participant port and place it in the cache, issue prepare upon it, and place the WSATXAResource in the map.voidputToXidToTransactionMap(Xid xid, jakarta.transaction.Transaction transaction) Called by client side outbound tube where suspended tx is placedvoidvoidrollback(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) Rollback can be called before or after prepare so we could do a state check here to avoid the redundant put in the latter case, but it is harmless to re-put and likely not a drastic performance concern.booleansetDurableParticipantStatus(Xid xid, String status) Called by Coordinator in order to update status and unblock async/one-way calls made for durable participants
-
Field Details
-
V10
-
V11
-
builderFactory
-
-
Constructor Details
-
WSATHelper
protected WSATHelper()
-
-
Method Details
-
getInstance
-
getInstance
-
getTransactionServices
Return the TransactionServices See interface for details...- Returns:
- TransactionServices which interfaces WS-AT with underlying transaction processing system
-
getWaitForReplyTimeout
public int getWaitForReplyTimeout()Amount of time to wait for a reply from a prepare, rollback, commit, or beforeCompletion call before throwing the appropriate exception, errorcode, etc.- Returns:
- time in milliseconds
-
setDurableParticipantStatus
Called by Coordinator in order to update status and unblock async/one-way calls made for durable participants- Parameters:
xid- XIdstatus- String- Returns:
- boolean true if the status was set successfully
-
prepare
public void prepare(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) throws XAException Get/create participant port and place it in the cache, issue prepare upon it, and place the WSATXAResource in the map.- Parameters:
epr- EndpointReference participant endpoint referencexid- Xid of transaction as obtained from WSATXAResourcewsatXAResource- WSATXAResource- Throws:
XAException- xaException
-
commit
public void commit(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) throws XAException Unlike rollback, Xids are not added to the durable participant XAResource map during commit as prepare must always be called in WS-AT (there is no onePhase commit) and prepare must add the Xid to the map.- Parameters:
epr- EndpointReference participant endpoint referencexid- Xid of transaction as obtained from WSATXAResourcewsatXAResource- WSATXAResource- Throws:
XAException- xaException
-
rollback
public void rollback(EndpointReference epr, Xid xid, WSATXAResource wsatXAResource) throws XAException Rollback can be called before or after prepare so we could do a state check here to avoid the redundant put in the latter case, but it is harmless to re-put and likely not a drastic performance concern.- Parameters:
epr- EndpointReference participant endpoint referencexid- Xid of transaction as obtained from WSATXAResourcewsatXAResource- WSATXAResource- Throws:
XAException- xaException
-
beforeCompletion
public void beforeCompletion(EndpointReference epr, Xid xid, WSATSynchronization wsatSynchronization) throws SOAPException beforeCompletion call on volatile participant- Parameters:
epr- EndpointReference participant endpoint referencexid- Xid of transactionwsatSynchronization- WSATSynchronization- Throws:
SOAPException- soapException
-
getParticipantPort
public ParticipantIF<T> getParticipantPort(EndpointReference epr, Xid xid, String bqual) throws SOAPException Creates and returns a ParticipantPortType, whether it be durable or volatile, for the provided address, Xid, and reference parameter Elements/Nodes- Parameters:
epr- EndpointReference participant endpoint referencexid- Xid of transactionbqual- String bqual of transaction- Returns:
- ParticipantPortType created
- Throws:
SOAPException- soapException
-
getCoordinatorPort
Called from ForeignRecoveryContext.run- Parameters:
epr- EndpointReference for toxid- Xid to find- Returns:
- CoordinatorIF Coordinator port for Xid
-
getRoutingAddress
-
getRegistrationCoordinatorAddress
-
getCoordinatorAddress
-
getParticipantAddress
-
getRegistrationRequesterAddress
-
getXidFromWebServiceContextHeaderList
Given a WebServiceContext extract and return the WS-AT transaction id and return the translated Xid- Parameters:
context- WebServiceContext- Returns:
- WLXid found in WebServiceContext or fault
-
getWSATTidFromWebServiceContextHeaderList
Used by getXidFromWebServiceContextHeaderList in WSATHelper and replayOperation of Coordinator service- Parameters:
context- WebServiceContext- Returns:
- WS-AT Txid String
-
getBQualFromWebServiceContextHeaderList
Called by Coordinator to get/create Xid- Parameters:
context- WebServiceContext- Returns:
- String bqual
-
isDebugEnabled
public static boolean isDebugEnabled()Need to check if debug is enabled before all logging to prevent unnecessary object creation.- Returns:
- true if debug for the WS-AT logger is enabled, false otherwise
-
getDurableParticipantPortMap
-
getVolatileParticipantSynchronizationMap
-
getVolatileParticipantPortMap
-
putToXidToTransactionMap
Called by client side outbound tube where suspended tx is placed -
getFromXidToTransactionMap
Called by transactionservices enlistResource before calling wsatgatewayrm.enlist- Parameters:
xid- Xid- Returns:
- Transaction associated with Xid
-
removeFromXidToTransactionMap
-
assignUUID
-