Coverage Report - org.mule.module.cxf.MuleJAXWSInvoker
 
Classes in this File Line Coverage Branch Coverage Complexity
MuleJAXWSInvoker
0%
0/13
N/A
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.module.cxf;
 8  
 
 9  
 import java.lang.reflect.Method;
 10  
 import java.util.List;
 11  
 import java.util.Map;
 12  
 
 13  
 import javax.xml.ws.handler.MessageContext.Scope;
 14  
 
 15  
 import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 16  
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
 17  
 import org.apache.cxf.jaxws.context.WrappedMessageContext;
 18  
 import org.apache.cxf.message.Exchange;
 19  
 import org.apache.cxf.service.invoker.Invoker;
 20  
 
 21  
 public class MuleJAXWSInvoker extends JAXWSMethodInvoker
 22  
 {
 23  
     private Invoker muleInvoker;
 24  
 
 25  
     public MuleJAXWSInvoker(Invoker muleInvoker)
 26  
     {
 27  0
         super(new Object());
 28  0
         this.muleInvoker = muleInvoker;
 29  0
     }
 30  
 
 31  
     @Override
 32  
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object> params)
 33  
     {
 34  
         // set up the webservice request context
 35  0
         WrappedMessageContext ctx = new WrappedMessageContext(exchange.getInMessage(), Scope.APPLICATION);
 36  
 
 37  0
         Map<String, Object> handlerScopedStuff = removeHandlerProperties(ctx);
 38  
 
 39  0
         WebServiceContextImpl.setMessageContext(ctx);
 40  0
         Object res = null;
 41  
         try
 42  
         {
 43  0
             res = muleInvoker.invoke(exchange, serviceObject);
 44  0
             addHandlerProperties(ctx, handlerScopedStuff);
 45  
             // update the webservice response context
 46  0
             updateWebServiceContext(exchange, ctx);
 47  
         }
 48  
         finally
 49  
         {
 50  
             // clear the WebServiceContextImpl's ThreadLocal variable
 51  0
             WebServiceContextImpl.clear();
 52  0
         }
 53  0
         return res;
 54  
     }
 55  
 }