Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.arjuna.wsc11;
 
Wrapper around low level Registration Coordinator messaging.

Author(s):
kevin
{
    
Register the participant in the protocol.

Parameters:
coordinationContext The current coordination context
messageID The messageID to use.
participantProtocolService The participant protocol service.
protocolIdentifier The protocol identifier.
Returns:
The endpoint reference of the coordinator protocol service.
Throws:
com.arjuna.wsc.AlreadyRegisteredException If the participant is already registered.
com.arjuna.wsc.InvalidProtocolException If the protocol is unsupported.
com.arjuna.wsc.InvalidStateException If the state is invalid
com.arjuna.wsc.NoActivityException If there is to activity context active.
com.arjuna.webservices.SoapFault for errors during processing.
    public static W3CEndpointReference register(final CoordinationContextType coordinationContext,
        final String messageIDfinal W3CEndpointReference participantProtocolService,
        final String protocolIdentifier)
            InvalidStateExceptionSoapFault
    {
        final W3CEndpointReference endpointReference = coordinationContext.getRegistrationService() ;
        try
        {
            RegisterType registerType = new RegisterType();
            RegisterResponseType response;
            registerType.setProtocolIdentifier(protocolIdentifier);
            registerType.setParticipantProtocolService(participantProtocolService);
            RegistrationPortType port = WSCOORClient.getRegistrationPort(endpointReference.messageID);
            response = port.registerOperation(registerType);
            return response.getCoordinatorProtocolService();
        } catch (SOAPFaultException sfe) {
            final SOAPFault soapFault = sfe.getFault() ;
            final QName subcode = soapFault.getFaultCodeAsQName() ;
            {
                Detail detail = soapFault.getDetail();
                String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
                throw new CannotRegisterException(message) ;
            }
            else if (..equals(subcode))
            {
                Detail detail = soapFault.getDetail();
                String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
                throw new InvalidProtocolException(message) ;
            }
            else if (..equals(subcode))
            {
                Detail detail = soapFault.getDetail();
                String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
                throw new InvalidStateException(message) ;
            }
            throw SoapFault11.create(sfe);
        }
    }
New to GrepCode? Check out our FAQ X