Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.webservices11.wscoor.client;
  
  import  org.jboss.ws.api.addressing.MAP;
  
 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 WSCOORClient
 {
     // TODO -- do we really need a thread local here or can we just use one service?
     
thread local which maintains a per thread activation service instance
 
     private static ThreadLocal<ActivationServiceactivationService = new ThreadLocal<ActivationService>();

    
thread local which maintains a per thread activation service instance
 
     private static ThreadLocal<RegistrationServiceregistrationService = new ThreadLocal<RegistrationService>();

    
fetch a coordinator activation service unique to the current thread

Returns:
 
     private static synchronized ActivationService getActivationService()
     {
         if (.get() == null) {
             // activationService.set(new ActivationService(null, new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "ActivationService")));
             .set(new ActivationService());
         }
         return .get();
     }

    
fetch a coordinator registration service unique to the current thread

Returns:
 
     private static synchronized RegistrationService getRegistrationService()
     {
         if (.get() == null) {
             // registrationService.set(new RegistrationService(null, new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "RegistrationService")));
             .set(new RegistrationService());
         }
         return .get();
     }
 
     public static ActivationPortType getActivationPort(MAP map,
                                                        String action)
     {
         ActivationService service = getActivationService();
         ActivationPortType port = service.getPort(ActivationPortType.classnew AddressingFeature(truetrue));
         BindingProvider bindingProvider = (BindingProvider)port;
         String to = map.getTo();
         /*
          * 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();
         AddressingHelper.configureRequestContext(requestContextmapto,  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
     public static RegistrationPortType getRegistrationPort(W3CEndpointReference endpointReferenceString actionString messageID)
     {
         RegistrationService service = getRegistrationService();
         RegistrationPortType port = service.getPort(endpointReferenceRegistrationPortType.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 map = AddressingHelper.outboundMap(requestContext);
         AddressingHelper.installActionMessageID(mapactionmessageID);
         // we should not need to do this but JBossWS does not pick up the value in the addressing properties
        AddressingHelper.configureRequestContext(requestContextmap.getTo(), action);
        return port;
    }
New to GrepCode? Check out our FAQ X