Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.webservices11.wsat.client;
  
 import  org.jboss.ws.api.addressing.MAPEndpoint;
 import  org.jboss.ws.api.addressing.MAPBuilder;
 import  org.jboss.ws.api.addressing.MAP;
 import  org.jboss.ws.api.addressing.MAPBuilderFactory;
 
The Client side of the Completion Initiator.

Author(s):
kevin
 
 {
    
The client singleton.
 
     private static final CompletionInitiatorClient CLIENT = new CompletionInitiatorClient() ;

    
The committed action.
 
     private String committedAction = null;
    
The aborted action.
 
     private String abortedAction = null;
    
The fault action.
 
     private String faultAction = null;

    
The completion coordinator URI for replies.
 
     private MAPEndpoint completionCoordinator ;

    
The completion coordinator URI for secure replies.
 
     private MAPEndpoint secureCompletionCoordinator ;

    
Construct the completion initiator client.
 
     private CompletionInitiatorClient()
     {
         final MAPBuilder builder = MAPBuilderFactory.getInstance().getBuilderInstance();
 
         final String completionCoordinatorURIString =
             ServiceRegistry.getRegistry().getServiceURI(.false) ;
         final String secureCompletionCoordinatorURIString =
             ServiceRegistry.getRegistry().getServiceURI(.true) ;
          = builder.newEndpoint(completionCoordinatorURIString);
          = builder.newEndpoint(secureCompletionCoordinatorURIString);
     }

    
Send a committed request.

Parameters:
map addressing context initialised with to and message ID.
identifier The identifier of the initiator.
Throws:
com.arjuna.webservices.SoapFault For any errors.
java.io.IOException for any transport errors.
 
     public void sendCommitted(final W3CEndpointReference participantfinal MAP mapfinal InstanceIdentifier identifier)
         throws SoapFaultIOException
     {
         MAPEndpoint coordinator = getCompletionCoordinator(participant);
         AddressingHelper.installFaultTo(mapcoordinatoridentifier);
         CompletionInitiatorPortType port = getPort(participantmap);
         Notification commited = new Notification();
 
         port.committedOperation(commited);
     }

    
Send an aborted request.

Parameters:
map addressing context initialised with to and message ID.
identifier The identifier of the initiator.
Throws:
com.arjuna.webservices.SoapFault For any errors.
java.io.IOException for any transport errors.
 
     public void sendAborted(final W3CEndpointReference participantfinal MAP mapfinal InstanceIdentifier identifier)
        throws SoapFaultIOException
    {
        MAPEndpoint coordinator = getCompletionCoordinator(participant);
        AddressingHelper.installFaultTo(mapcoordinatoridentifier);
        CompletionInitiatorPortType port = getPort(participantmap);
        Notification aborted = new Notification();
        port.abortedOperation(aborted);
    }

    
Send a fault.

Parameters:
map The addressing context.
soapFault The SOAP fault.
identifier The arjuna instance identifier.
Throws:
com.arjuna.webservices.SoapFault For any errors.
java.io.IOException for any transport errors.
    public void sendSoapFault(final W3CEndpointReference participantfinal MAP mapfinal SoapFault soapFaultfinal InstanceIdentifier identifier)
        throws SoapFaultIOException
    {
        CompletionInitiatorPortType port = getPort(participantmap);
        // convert fault to the wire format and dispatch it to the initiator
        soapFault.setAction() ;
        Fault fault = ((SoapFault11)soapFault).toFault();
        port.soapFault(fault);
    }

    
Send a fault for an unknown participant.

Parameters:
map The addressing context.
soapFault The SOAP fault.
identifier The arjuna instance identifier.
Throws:
com.arjuna.webservices.SoapFault For any errors.
java.io.IOException for any transport errors.
    public void sendSoapFault(final MAP mapfinal SoapFault soapFaultfinal InstanceIdentifier identifier)
        throws SoapFaultIOException
    {
        CompletionInitiatorPortType port = getPort(nullmap);
        // convert fault to the wire format and dispatch it to the initiator
        soapFault.setAction() ;
        Fault fault = ((SoapFault11)soapFault).toFault();
        port.soapFault(fault);
    }

    
return a completion coordinator endpoint appropriate to the type of completion initiator

Parameters:
participant
Returns:
either the secure terminaton participant endpoint or the non-secure endpoint
    MAPEndpoint getCompletionCoordinator(W3CEndpointReference participant)
    {
        NativeEndpointReference nativeRef = EndpointHelper.transform(NativeEndpointReference.classparticipant);
        String address = nativeRef.getAddress();
        if (address.startsWith("https")) {
            return ;
        } else {
            return ;
        }
    }

    
Get the Completion Coordinator client singleton.

Returns:
The Completion Coordinator client singleton.
    public static CompletionInitiatorClient getClient()
    {
        return ;
    }

    
obtain a port from the completion participant endpoint configured with the instance identifier handler and the supplied addressing properties supplemented with the given action

Parameters:
participant
map
action
Returns:
    private CompletionInitiatorPortType getPort(final W3CEndpointReference participant,
                                                final MAP map,
                                                final String action)
    {
        AddressingHelper.installNoneReplyTo(map);
        if (participant ==  null) {
            return WSATClient.getCompletionInitiatorPort(actionmap);
        } else {
            return WSATClient.getCompletionInitiatorPort(participantactionmap);
        }
    }
New to GrepCode? Check out our FAQ X