Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.webservices11.wsarjtx.client;
  
  import  org.jboss.ws.api.addressing.MAPBuilder;
  import  org.jboss.ws.api.addressing.MAP;
  import  org.jboss.ws.api.addressing.MAPBuilderFactory;
  
 import java.util.Map;
Created by IntelliJ IDEA. User: adinn Date: Oct 7, 2007 Time: 3:14:28 PM To change this template use File | Settings | File Templates.
 
 public class WSARJTXClient
 {
     // TODO -- do we really need a thread local here or can we just use one service?
     
thread local which maintains a per thread termination coordinator service instance
 
thread local which maintains a per thread termination participant service instance
 
thread local which maintains a per thread termination coordinator service instance
 
builder used to construct addressing info for calls
 
     private static MAPBuilder builder = MAPBuilderFactory.getInstance().getBuilderInstance();

    
fetch a termination coordinator service unique to the current thread

Returns:
 
     private static synchronized TerminationCoordinatorService getTerminationCoordinatorService()
     {
         if (.get() == null) {
             //terminationCoordinatorService.set(new TerminationCoordinatorService(null, new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationCoordinatorService")));
         }
         return .get();
     }

    
fetch a termination participant service unique to the current thread

Returns:
 
     private static synchronized TerminationParticipantService getTerminationParticipantService()
     {
         if (.get() == null) {
             //terminationParticipantService.set(new TerminationParticipantService(null, new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationParticipantService")));
         }
         return .get();
     }

    
fetch a termination coordinator service unique to the current thread

Returns:
 
     {
         if (.get() == null) {
             //terminationCoordinatorService.set(new TerminationCoordinatorService(null, new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationCoordinatorService")));
         }
         return .get();
     }
 
                                                                                 String action,
                                                                                 MAP map)
     {
         TerminationCoordinatorPortType port = service.getPort(endpointReferenceTerminationCoordinatorPortType.classnew AddressingFeature(truetrue));
         BindingProvider bindingProvider = (BindingProvider)port;
         /*
          * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
         List<Handler> customHandlerChain = new ArrayList<Handler>();
 		customHandlerChain.add(new WSAddressingClientHandler());
 		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
          */
 
        Map<StringObjectrequestContext = bindingProvider.getRequestContext();
        MAP requestMap = AddressingHelper.outboundMap(requestContext);
        map.setAction(action);
        AddressingHelper.installCallerProperties(maprequestMap);
        AddressingHelper.configureRequestContext(requestContextrequestMap.getTo(), action);
        return port;
    }
    // don't think we ever need this as we get a registration port from the endpoint ref returned by
    // the activation port request
                                                                               String action,
                                                                               MAP map)
    {
        TerminationParticipantPortType port = service.getPort(endpointReferenceTerminationParticipantPortType.classnew AddressingFeature(truetrue));
        BindingProvider bindingProvider = (BindingProvider)port;
        /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
         */
        Map<StringObjectrequestContext = bindingProvider.getRequestContext();
        MAP requestMap = AddressingHelper.outboundMap(requestContext);
        map.setAction(action);
        AddressingHelper.installCallerProperties(maprequestMap);
        AddressingHelper.configureRequestContext(requestContextrequestMap.getTo(), action);
        return port;
    }
    // we use this in situations where we don't have a proper endpoint but we do have caller addressing properties
                                                                               String action,
                                                                               MAP map)
    {
        TerminationParticipantPortType port = service.getPort(TerminationParticipantPortType.classnew AddressingFeature(truetrue));
        BindingProvider bindingProvider = (BindingProvider)port;
        /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
         */
        Map<StringObjectrequestContext = bindingProvider.getRequestContext();
        Element refParam = InstanceIdentifier.createInstanceIdentifierElement(identifier.getInstanceIdentifier());
        map.addReferenceParameter(refParam);
        map.setAction(action);
        AddressingHelper.configureRequestContext(requestContextmapmap.getTo(), action);
        return port;
    }
                                                                                  String action,
                                                                                  MAP map)
    {
        TerminationCoordinatorRPCPortType port = service.getPort(endpointReferenceTerminationCoordinatorRPCPortType.classnew AddressingFeature(truetrue));
        BindingProvider bindingProvider = (BindingProvider)port;
        /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
         */
        Map<StringObjectrequestContext = bindingProvider.getRequestContext();
        MAP requestMap = AddressingHelper.outboundMap(requestContext);
        map.setAction(action);
        AddressingHelper.installCallerProperties(maprequestMap);
        AddressingHelper.configureRequestContext(requestContextrequestMap.getTo(), action);
        return port;
    }
New to GrepCode? Check out our FAQ X