Coverage Report - org.mule.module.cxf.builder.WsdlClientMessageProcessorBuilder
 
Classes in this File Line Coverage Branch Coverage Complexity
WsdlClientMessageProcessorBuilder
0%
0/13
0%
0/4
1
 
 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.builder;
 8  
 
 9  
 
 10  
 import javax.xml.namespace.QName;
 11  
 
 12  
 import org.apache.cxf.endpoint.Client;
 13  
 import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
 14  
 
 15  
 /**
 16  
  * Builds an outbound CXF MessageProcessor based on a WSDL using CXF's
 17  
  * {@link DynamicClientFactory}. The <code>wsdlLocation</code> attribute
 18  
  * is required. The port and service attributes can also be supplied to 
 19  
  * select the correct service and port in the WSDL.
 20  
  */
 21  
 public class WsdlClientMessageProcessorBuilder extends AbstractOutboundMessageProcessorBuilder
 22  
 {
 23  0
     private final static Object CLIENT_CREATION_LOCK = new Object();
 24  
     
 25  
     private String service;
 26  
     private String port;
 27  
     
 28  
     public WsdlClientMessageProcessorBuilder()
 29  
     {
 30  0
         super();
 31  0
     }
 32  
     
 33  
     protected Client createClient() throws Exception
 34  
     {
 35  0
         synchronized (CLIENT_CREATION_LOCK)
 36  
         {
 37  0
             DynamicClientFactory cf = DynamicClientFactory.newInstance(getBus());
 38  0
             return cf.createClient(getWsdlLocation(), 
 39  
                (service == null ? null : QName.valueOf(service)), 
 40  
                (getPort() == null ? null : QName.valueOf(getPort())));
 41  0
         }
 42  
     }
 43  
 
 44  
     public String getService()
 45  
     {
 46  0
         return service;
 47  
     }
 48  
 
 49  
     public void setService(String service)
 50  
     {
 51  0
         this.service = service;
 52  0
     }
 53  
 
 54  
     public String getPort()
 55  
     {
 56  0
         return port;
 57  
     }
 58  
 
 59  
     public void setPort(String port)
 60  
     {
 61  0
         this.port = port;
 62  0
     }
 63  
 
 64  
 }