You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/05/20 10:35:07 UTC

svn commit: r658164 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/management/ camel-core/src/main/java/org/apache/camel/processor/ components/camel-cxf/src/main/java/org/apache/camel/component/cxf/

Author: ningjiang
Date: Tue May 20 01:35:07 2008
New Revision: 658164

URL: http://svn.apache.org/viewvc?rev=658164&view=rev
Log:
CAMEL-530 applied patch with thanks to Glen

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java?rev=658164&r1=658163&r2=658164&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationLifecycleStrategy.java Tue May 20 01:35:07 2008
@@ -82,8 +82,8 @@
                 // retrieve the per-route intercept for this route
                 InstrumentationProcessor interceptor = interceptorMap.get(route.getEndpoint());
                 if (interceptor == null) {
-                    LOG.warn("Instrumentation processor not found for route endpoint " +
-                            route.getEndpoint());
+                    LOG.warn("Instrumentation processor not found for route endpoint "
+                             + route.getEndpoint());
                 } else {
                     interceptor.setCounter(mr);
                 }
@@ -109,7 +109,7 @@
 
         // Create a map (ProcessorType -> PerformanceCounter)
         // to be passed to InstrumentationInterceptStrategy.
-        Map<ProcessorType, PerformanceCounter> counterMap = 
+        Map<ProcessorType, PerformanceCounter> counterMap =
             new HashMap<ProcessorType, PerformanceCounter>();
 
         // Each processor in a route will have its own performance counter

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java?rev=658164&r1=658163&r2=658164&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Pipeline.java Tue May 20 01:35:07 2008
@@ -64,7 +64,7 @@
         while (true) {
             if (nextExchange.isFailed()) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug("Mesage exchange has failed so breaking out of pipeline: " + nextExchange
+                    LOG.debug("Message exchange has failed so breaking out of pipeline: " + nextExchange
                               + " exception: " + nextExchange.getException() + " fault: "
                               + nextExchange.getFault(false));
                 }
@@ -114,7 +114,7 @@
 
                     if (nextExchange.isFailed()) {
                         if (LOG.isDebugEnabled()) {
-                            LOG.debug("Mesage exchange has failed so breaking out of pipeline: " + nextExchange + " exception: " + nextExchange.getException() + " fault: "
+                            LOG.debug("Message exchange has failed so breaking out of pipeline: " + nextExchange + " exception: " + nextExchange.getException() + " fault: "
                                     + nextExchange.getFault(false));
                         }
                         break;

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?rev=658164&r1=658163&r2=658164&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java Tue May 20 01:35:07 2008
@@ -63,22 +63,25 @@
         this.endpoint = endpoint;
         dataFormat = CxfEndpointUtils.getDataFormat(endpoint);
         if (dataFormat.equals(DataFormat.POJO)) {
-            client = createClientFormClientFactoryBean(null);
+            client = createClientFromClientFactoryBean(null);
         } else {
-            // Create CxfClient for message
-            client = createClientForStreamMessge();
+            // Create CxfClient for message or payload type
+            client = createClientForStreamMessage();
         }
     }
 
-    private Client createClientForStreamMessge() throws CamelException {
+    private Client createClientForStreamMessage() throws CamelException {
         CxfClientFactoryBean cfb = new CxfClientFactoryBean();
         Class serviceClass = null;
         if (endpoint.isSpringContextEndpoint()) {
             CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();
             serviceClass = cxfEndpointBean.getServiceClass();
         } else {
+            if (endpoint.getServiceClass() == null) {
+                throw new CamelException("serviceClass setting missing from CXF endpoint configuration");
+            }
             try {
-                serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
+               serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
             } catch (ClassNotFoundException e) {
                 throw new CamelException(e);
             }
@@ -98,11 +101,11 @@
         }
         cfb.setFeatures(features);
 
-        return createClientFormClientFactoryBean(cfb);
+        return createClientFromClientFactoryBean(cfb);
     }
 
     // If cfb is null, we will try to find the right cfb to use.
-    private Client createClientFormClientFactoryBean(ClientFactoryBean cfb) throws CamelException {
+    private Client createClientFromClientFactoryBean(ClientFactoryBean cfb) throws CamelException {
         Bus bus = BusFactory.getDefaultBus();
         if (endpoint.isSpringContextEndpoint()) {
             CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();