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 Coordinator.

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

    
The commit action.
 
     private String commitAction = null;
    
The rollback action.
 
     private String rollbackAction = null;

    
The completion initiator URI for replies.
 
     private MAPEndpoint completionInitiator ;

    
The completion initiator URI for secure replies.
 
     private MAPEndpoint secureCompletionInitiator ;

    
Construct the completion coordinator client.
 
     private CompletionCoordinatorClient()
     {
         final MAPBuilder builder = MAPBuilderFactory.getInstance().getBuilderInstance();
         // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
 
         // Add WS-Addressing
         // AddressingPolicy.register(handlerRegistry) ;
         // Add client policies
         // ClientPolicy.register(handlerRegistry) ;
 
         final String completionInitiatorURIString =
             ServiceRegistry.getRegistry().getServiceURI(.false) ;
         final String secureCompletionInitiatorURIString =
             ServiceRegistry.getRegistry().getServiceURI(.true) ;
          = builder.newEndpoint(completionInitiatorURIString);
          = builder.newEndpoint(secureCompletionInitiatorURIString);
     }

    
Send a commit 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 sendCommit(final W3CEndpointReference endpointfinal MAP mapfinal InstanceIdentifier identifier)
         throws SoapFaultIOException
     {
         MAPEndpoint initiator = getCompletionInitiator(endpoint);
         AddressingHelper.installFromFaultTo(mapinitiatoridentifier);
         CompletionCoordinatorPortType port = getPort(endpointmap);
         Notification commit = new Notification();
 
         port.commitOperation(commit);
     }

    
Send a rollback 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 sendRollback(final W3CEndpointReference endpointfinal MAP mapfinal InstanceIdentifier identifier)
         throws SoapFaultIOException
    {
        MAPEndpoint initiator = getCompletionInitiator(endpoint);
        AddressingHelper.installFromFaultTo(mapinitiatoridentifier);
        CompletionCoordinatorPortType port = getPort(endpointmap);
        Notification rollback = new Notification();
                
        port.rollbackOperation(rollback);
    }

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

Parameters:
participant
Returns:
either the secure terminaton participant endpoint or the non-secure endpoint
    MAPEndpoint getCompletionInitiator(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 CompletionCoordinatorClient getClient()
    {
        return ;
    }

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

Parameters:
endpoint
map
action
Returns:
                                                  final MAP map,
                                                  final String action)
    {
        AddressingHelper.installNoneReplyTo(map);
        return WSATClient.getCompletionCoordinatorPort(endpointactionmap);
    }
New to GrepCode? Check out our FAQ X