FileDocCategorySizeDatePackage
TxBasePipe.javaAPI DocExample6208Tue May 29 16:57:16 BST 2007com.sun.xml.ws.tx.common

TxBasePipe

public abstract class TxBasePipe extends Object implements com.sun.xml.ws.api.pipe.Pipe
author
jf39279

Fields Summary
protected final TransactionManagerImpl
txnMgr
protected final com.sun.xml.ws.api.pipe.Pipe
next
next pipe in the chain
Constructors Summary
public TxBasePipe(com.sun.xml.ws.api.pipe.Pipe next)

        this.next = next;
        txnMgr = TransactionManagerImpl.getInstance();
    
Methods Summary
protected com.sun.xml.ws.tx.common.TxBasePipe$OperationATPolicygetOperationATPolicy(com.sun.xml.ws.policy.PolicyMap pmap, com.sun.xml.ws.api.model.wsdl.WSDLPort wsdlModel, com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation wsdlBoundOp)

    

        
              
                
    
        OperationATPolicy opat = new OperationATPolicy();
        try {
            if (pmap != null) {
                PolicyMapKey opKey = pmap.
                        createWsdlOperationScopeKey(
                        wsdlModel.getOwner().getName(), // service
                        wsdlModel.getName(), // port
                        wsdlBoundOp.getName() // operation
                        );
                Policy effectivePolicy =
                        pmap.getOperationEffectivePolicy(opKey);
                if (effectivePolicy != null) {
                    Iterator<AssertionSet> assertionIter = effectivePolicy.iterator();
                    AssertionSet assertionSet;
                    while (assertionIter.hasNext()) {
                        assertionSet = assertionIter.next();
                        for (PolicyAssertion pa : assertionSet) {
                            
                            // Check for 2004 WS-Atomic Transaction Policy Assertions
                            if (pa.getName().equals(AT_ASSERTION)) {
                                opat.atAssertion = (pa.isOptional() ? ALLOWED : MANDATORY);
                                
                                // begin patch for wsit issue 419
                                if (opat.atAssertion == MANDATORY) {
                                    String optionalBoolValue = pa.getAttributeValue(WSP2002_OPTIONAL);
                                    if (optionalBoolValue != null && Boolean.valueOf(optionalBoolValue)) {
                                        opat.atAssertion = ATAssertion.ALLOWED;
                                    }
                                }
                                // end patch
                            } else if (pa.getName().equals(AT_ALWAYS_CAPABILITY)) {
                                opat.ATAlwaysCapability = true;
                            }
                            
                            // TODO: To implement OASIS WS-Atomic Transaction,
                            // check for OASIS WS-Atomic Transaction Policy Assertion ATAssertion here
                        }
                    }
                }
            }
        } catch (PolicyException pe) {
            throw new WebServiceException(pe.getMessage(), pe);
        }
        return opat;
    
public voidpreDestroy()
Invoked before the last copy of the pipeline is about to be discarded, to give Pipes a chance to clean up any resources.

        next.preDestroy();