Package com.arjuna.webservices.wscoor

Examples of com.arjuna.webservices.wscoor.CoordinationContextType


                ArjunaContextImple arjunaContext = (ArjunaContextImple)manager.context();

                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
                final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
               
                final CoordinationContextType coordinationContext = new CoordinationContextType() ;
                coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
                coordinationContext.setIdentifier(new AttributedURIType(arjunaContext.getTransactionIdentifier())) ;
                final int transactionExpires = arjunaContext.getTransactionExpires() ;
                if (transactionExpires > 0)
                {
                    coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
                }
                final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
                InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, arjunaContext.getTransactionIdentifier()) ;
                coordinationContext.setRegistrationService(registrationCoordinator) ;

                return coordinationContext;
          }
          catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
          {
View Full Code Here


                final SOAPHeader soapHeader = soapEnvelope.getHeader() ;
                final SOAPHeaderElement soapHeaderElement = getHeaderElement(soapHeader, CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;

                if (soapHeaderElement != null)
                {
                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapEnvelope, soapHeaderElement) ;
                    final String coordinationType = cc.getCoordinationType().getValue() ;
                    if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
                    {
                        clearMustUnderstand(soapHeader, soapHeaderElement) ;
                        TxContext txContext = new com.arjuna.mwlabs.wst.at.context.TxContextImple(cc) ;
                        if (installSubordinateTx) {
View Full Code Here

     */
    public static CoordinationContextType deserialise(final SOAPEnvelope env, final SOAPHeaderElement headerElement)
        throws XMLStreamException
    {
        final XMLStreamReader in = new SAAJXMLStreamReader(headerElement) ;
        return new CoordinationContextType(in) ;
    }
View Full Code Here

     */
    public static CoordinationContextType deserialise(final Element headerElement)
        throws XMLStreamException
    {
        final XMLStreamReader in = new DOMXMLStreamReader(headerElement) ;
        return new CoordinationContextType(in) ;
    }
View Full Code Here

            else
            {
                baContext = null ;
            }

            final CoordinationContextType coordinationContext ;
            if (atContext != null)
            {
                coordinationContext = atContext.getCoordinationContext() ;
            }
            else if (baContext != null)
View Full Code Here

                final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope() ;
                final SOAPHeaderElement soapHeaderElement = getHeaderElement(soapEnvelope, CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;

                if (soapHeaderElement != null)
                {
                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapEnvelope, soapHeaderElement) ;
                    if (cc != null)
                    {
                        final String coordinationType = cc.getCoordinationType().getValue() ;
                        if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
                        {
                            final TxContext txContext = new com.arjuna.mwlabs.wst.at.context.TxContextImple(cc) ;
                            TransactionManagerFactory.transactionManager().resume(txContext) ;
                        }
View Full Code Here

            final String coordinationType = createCoordinationContext.getCoordinationType().getValue() ;
            final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
           
            if (contextFactory != null)
            {
                final CoordinationContextType coordinationContext ;
                final AddressingContext responseAddressingContext ;
                try
                {
                    final AttributedUnsignedIntType expiresElement = createCoordinationContext.getExpires() ;
                    final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
View Full Code Here

       
                final JTAContextImple jtaContext = JTAContextImple.getContext() ;
                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
                final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
               
                final CoordinationContextType coordinationContext = new CoordinationContextType() ;
                coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
                coordinationContext.setIdentifier(new AttributedURIType(jtaContext.getTransactionIdentifier())) ;
                final int transactionExpires = jtaContext.getTransactionExpires() ;
                if (transactionExpires > 0)
                {
                    coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
                }
                final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
                InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, jtaContext.getTransactionIdentifier()) ;
                coordinationContext.setRegistrationService(registrationCoordinator) ;

            /*
             * Now add the registrar for this specific coordinator to
             * the mapper.
             */
 
View Full Code Here

    public void testKnownCoordinationType()
        throws Exception
    {
        final String messageId = "testKnownCoordinationType" ;
        final String protocolIdentifier = TestUtil.PROTOCOL_IDENTIFIER ;
        final CoordinationContextType coordinationContext = new CoordinationContextType() ;
        coordinationContext.setCoordinationType(new URI(TestUtil.COORDINATION_TYPE)) ;
        coordinationContext.setIdentifier(new AttributedURIType("identifier")) ;
        coordinationContext.setRegistrationService(registrationCoordinator) ;
        try
        {
            final EndpointReferenceType registerResponse = RegistrationCoordinator.register(coordinationContext, messageId, registrationRequester, protocolIdentifier) ;
           
            assertNotNull(registerResponse) ;
View Full Code Here

    public void testUnknownCoordinationType()
        throws Exception
    {
        final String messageId = "testUnknownCoordinationType" ;
        final String protocolIdentifier = TestUtil.UNKNOWN_PROTOCOL_IDENTIFIER ;
        final CoordinationContextType coordinationContext = new CoordinationContextType() ;
        coordinationContext.setCoordinationType(new URI(TestUtil.COORDINATION_TYPE)) ;
        coordinationContext.setIdentifier(new AttributedURIType("identifier")) ;
        coordinationContext.setRegistrationService(registrationCoordinator) ;
        try
        {
            RegistrationCoordinator.register(coordinationContext, messageId, registrationRequester, protocolIdentifier) ;
        }
        catch (final InvalidProtocolException ipe) {}
View Full Code Here

TOP

Related Classes of com.arjuna.webservices.wscoor.CoordinationContextType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.