Coverage Report - org.apache.camel.component.cxf.transport.CamelTransportFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
CamelTransportFactory
0% 
0% 
0
 
 1  
 /**
 2  
  *
 3  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 4  
  * contributor license agreements.  See the NOTICE file distributed with
 5  
  * this work for additional information regarding copyright ownership.
 6  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 7  
  * (the "License"); you may not use this file except in compliance with
 8  
  * the License.  You may obtain a copy of the License at
 9  
  *
 10  
  * http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 package org.apache.camel.component.cxf.transport;
 19  
 
 20  
 import org.apache.camel.CamelContext;
 21  
 import org.apache.cxf.Bus;
 22  
 import org.apache.cxf.configuration.Configurer;
 23  
 import org.apache.cxf.service.model.EndpointInfo;
 24  
 import org.apache.cxf.transport.AbstractTransportFactory;
 25  
 import org.apache.cxf.transport.Conduit;
 26  
 import org.apache.cxf.transport.ConduitInitiator;
 27  
 import org.apache.cxf.transport.Destination;
 28  
 import org.apache.cxf.transport.DestinationFactory;
 29  
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 30  
 
 31  
 import javax.annotation.Resource;
 32  
 import java.io.IOException;
 33  
 import java.util.HashSet;
 34  
 import java.util.Set;
 35  
 
 36  
 /**
 37  
  * @version $Revision: 522906 $
 38  
  */
 39  0
 public class CamelTransportFactory extends AbstractTransportFactory implements ConduitInitiator, DestinationFactory {
 40  0
     private static final Set<String> URI_PREFIXES = new HashSet<String>();
 41  
 
 42  
     static {
 43  0
         URI_PREFIXES.add("camel://");
 44  0
     }
 45  
 
 46  
     private Bus bus;
 47  
     private CamelContext camelContext;
 48  
 
 49  
     @Resource
 50  
     public void setBus(Bus b) {
 51  0
         bus = b;
 52  0
     }
 53  
 
 54  
     public Bus getBus() {
 55  0
         return bus;
 56  
     }
 57  
 
 58  
     public CamelContext getCamelContext() {
 59  0
         return camelContext;
 60  
     }
 61  
 
 62  
     @Resource
 63  
     public void setCamelContext(CamelContext camelContext) {
 64  0
         this.camelContext = camelContext;
 65  0
     }
 66  
 
 67  
     public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
 68  0
         return getConduit(targetInfo, null);
 69  
     }
 70  
 
 71  
     public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) throws IOException {
 72  0
         return new CamelConduit(camelContext, bus, endpointInfo, target);
 73  
     }
 74  
 
 75  
     public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
 76  0
         CamelDestination destination = new CamelDestination(camelContext, bus, this, endpointInfo);
 77  0
         Configurer configurer = bus.getExtension(Configurer.class);
 78  0
         if (null != configurer) {
 79  0
             configurer.configureBean(destination);
 80  
         }
 81  0
         return destination;
 82  
     }
 83  
 
 84  
     public Set<String> getUriPrefixes() {
 85  0
         return URI_PREFIXES;
 86  
     }
 87  
 }
 88