Package com.arjuna.webservices.wscoor

Examples of com.arjuna.webservices.wscoor.CoordinationContextType


   
            final ArjunaContextImple arjunaContext = ArjunaContextImple.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("urn:"+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) ;
           
            TerminationCoordinatorProcessor.getProcessor().activateParticipant(new BusinessActivityTerminatorImple(), arjunaContext.getTransactionIdentifier()) ;
   
        _theRegistrar.associate();
   
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

            {
                final Element soapHeaderElement = soapMessage.getHeaderElement(CoordinationConstants.WSCOOR_NAMESPACE,
                        CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;
                if (soapHeaderElement != null)
                {
                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;
                    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

    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

    public void testAlreadyRegisteredProtocolIdentifierException()
        throws Exception
    {
        final String messageId = "testAlreadyRegisteredProtocolIdentifierException" ;
        final String protocolIdentifier = TestUtil.ALREADY_REGISTERED_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 AlreadyRegisteredException are) {}
View Full Code Here

    public void testInvalidProtocolProtocolIdentifierException()
        throws Exception
    {
        final String messageId = "testInvalidProtocolProtocolIdentifierException" ;
        final String protocolIdentifier = TestUtil.INVALID_PROTOCOL_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

    public void testInvalidStateProtocolIdentifierException()
        throws Exception
    {
        final String messageId = "testInvalidStateProtocolIdentifierException" ;
        final String protocolIdentifier = TestUtil.INVALID_STATE_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 InvalidStateException ise) {}
View Full Code Here

    public void testNoActivityProtocolIdentifierException()
        throws Exception
    {
        final String messageId = "testNoActivityProtocolIdentifierException" ;
        final String protocolIdentifier = TestUtil.NO_ACTIVITY_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 NoActivityException nae) {}
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.