Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.6)

Part Number E13941-07

weblogic.wsee.wstx.wsat
Class WSATHelper<T>

java.lang.Object
  extended by weblogic.wsee.wstx.wsat.WSATHelper<T>

public class WSATHelper<T>
extends Object

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 WLS WS-AT and internal Xid, the WLS 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
protected  weblogic.wsee.wstx.wsat.common.WSATVersion<T> builderFactory
           
static WSATHelper V10
           
static WSATHelper V11
           
 
Constructor Summary
protected WSATHelper()
           
 
Method Summary
static String assignUUID()
           
 void beforeCompletion(EndpointReference epr, Xid xid, WSATSynchronization wsatSynchronization)
          beforeCompletion call on volatile participant
 void commit(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.
 void debug(String msg)
           
 String getBQualFromWebServiceContextHeaderList(WebServiceContext context)
          Called by Coordinator to get/create Xid
 String getCoordinatorAddress()
           
 weblogic.wsee.wstx.wsat.common.CoordinatorIF<T> getCoordinatorPort(EndpointReference epr, Xid xid)
          Called from ForeignRecoveryContext.run
 Map<WSATXAResource,weblogic.wsee.wstx.wsat.common.ParticipantIF<T>> getDurableParticipantPortMap()
           
static WSATHelper getInstance()
           
static WSATHelper getInstance(Transactional.Version version)
           
 String getParticipantAddress()
           
 weblogic.wsee.wstx.wsat.common.ParticipantIF<T> 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/Nodes
 String getRegistrationCoordinatorAddress()
           
 String getRegistrationRequesterAddress()
           
 String getRoutingAddress()
           
static weblogic.wsee.wstx.TransactionServices getTransactionServices()
          Return the TransactionServices See interface for details...
 Map<Xid,weblogic.wsee.wstx.wsat.common.ParticipantIF<T>> getVolatileParticipantPortMap()
           
 Map<Xid,WSATSynchronization> getVolatileParticipantSynchronizationMap()
           
 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.
 String getWSATTidFromWebServiceContextHeaderList(WebServiceContext context)
          Used by getXidFromWebServiceContextHeaderList in WSATHelper and replayOperation of Coordinator service
 WLXid getXidFromWebServiceContextHeaderList(WebServiceContext context)
          Given a WebServiceContext extract and return the WLS WS-AT transaction id and return the translated WLSXid
static boolean isDebugEnabled()
          Need to check if debug is enabled before all logging to prevent unnecessary object creation.
 void prepare(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.
 void rollback(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.
 boolean setDurableParticipantStatus(Xid xid, String status)
          Called by Coordinator in order to update status and unblock async/one-way calls made for durable participants
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

V10

public static final WSATHelper V10

V11

public static final WSATHelper V11

builderFactory

protected weblogic.wsee.wstx.wsat.common.WSATVersion<T> builderFactory
Constructor Detail

WSATHelper

protected WSATHelper()
Method Detail

getInstance

public static WSATHelper getInstance()

getInstance

public static WSATHelper getInstance(Transactional.Version version)

getTransactionServices

public static weblogic.wsee.wstx.TransactionServices 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

public boolean setDurableParticipantStatus(Xid xid,
                                           String status)
Called by Coordinator in order to update status and unblock async/one-way calls made for durable participants

Parameters:
xid - XId
status - 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 reference
xid - Xid of transaction as obtained from WSATXAResource
wsatXAResource - 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 reference
xid - Xid of transaction as obtained from WSATXAResource
wsatXAResource - 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 reference
xid - Xid of transaction as obtained from WSATXAResource
wsatXAResource - 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 reference
xid - Xid of transaction
wsatSynchronization - WSATSynchronization
Throws:
SOAPException - soapException

getParticipantPort

public weblogic.wsee.wstx.wsat.common.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 reference
xid - Xid of transaction
bqual - String bqual of transaction
Returns:
ParticipantPortType created
Throws:
SOAPException - soapException

getCoordinatorPort

public weblogic.wsee.wstx.wsat.common.CoordinatorIF<T> getCoordinatorPort(EndpointReference epr,
                                                                          Xid xid)
Called from ForeignRecoveryContext.run

Parameters:
epr - EndpointReference for to
xid - Xid to find
Returns:
CoordinatorIF Coordinator port for Xid

getRoutingAddress

public String getRoutingAddress()

getRegistrationCoordinatorAddress

public String getRegistrationCoordinatorAddress()

getCoordinatorAddress

public String getCoordinatorAddress()

getParticipantAddress

public String getParticipantAddress()

getRegistrationRequesterAddress

public String getRegistrationRequesterAddress()

getXidFromWebServiceContextHeaderList

public WLXid getXidFromWebServiceContextHeaderList(WebServiceContext context)
Given a WebServiceContext extract and return the WLS WS-AT transaction id and return the translated WLSXid

Parameters:
context - WebServiceContext
Returns:
WLXid found in WebServiceContext or fault

getWSATTidFromWebServiceContextHeaderList

public String getWSATTidFromWebServiceContextHeaderList(WebServiceContext context)
Used by getXidFromWebServiceContextHeaderList in WSATHelper and replayOperation of Coordinator service

Parameters:
context - WebServiceContext
Returns:
WS-AT Txid String

getBQualFromWebServiceContextHeaderList

public String getBQualFromWebServiceContextHeaderList(WebServiceContext context)
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

public Map<WSATXAResource,weblogic.wsee.wstx.wsat.common.ParticipantIF<T>> getDurableParticipantPortMap()

getVolatileParticipantSynchronizationMap

public Map<Xid,WSATSynchronization> getVolatileParticipantSynchronizationMap()

getVolatileParticipantPortMap

public Map<Xid,weblogic.wsee.wstx.wsat.common.ParticipantIF<T>> getVolatileParticipantPortMap()

debug

public void debug(String msg)

assignUUID

public static String assignUUID()

Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.6)

Part Number E13941-07