camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-8038: Fixed @UriPath
Date Wed, 26 Nov 2014 10:42:10 GMT
CAMEL-8038: Fixed @UriPath


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd364a95
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd364a95
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd364a95

Branch: refs/heads/master
Commit: bd364a95fe6b858e81168bc7c2b34c1e0852ec70
Parents: 4883e1f
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Nov 26 11:40:59 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Nov 26 11:41:54 2014 +0100

----------------------------------------------------------------------
 .../camel/component/cxf/CxfComponent.java       |  4 +-
 .../apache/camel/component/cxf/CxfEndpoint.java | 43 +++++++++++++-------
 .../component/cxf/jaxrs/CxfRsComponent.java     |  5 ++-
 .../component/cxf/jaxrs/CxfRsEndpoint.java      | 41 ++++++++++++-------
 4 files changed, 61 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bd364a95/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
index b2af474..9fa8e00 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfComponent.java
@@ -43,6 +43,7 @@ public class CxfComponent extends HeaderFilterStrategyComponent {
     public void setAllowStreaming(Boolean b) {
         allowStreaming = b;
     }
+
     public Boolean getAllowStreaming() {
         return allowStreaming;
     }
@@ -73,7 +74,8 @@ public class CxfComponent extends HeaderFilterStrategyComponent {
             if (getCamelContext().equals(result.getCamelContext())) {
                 result.setCamelContext(getCamelContext());
             }
-            
+            result.setBeanId(beanId);
+
         } else {
             // endpoint URI does not specify a bean
             result = new CxfEndpoint(remaining, this);

http://git-wip-us.apache.org/repos/asf/camel/blob/bd364a95/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index c116117..dffc1d7 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -60,6 +60,7 @@ import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.HeaderFilterStrategyAware;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
@@ -110,15 +111,20 @@ import org.slf4j.LoggerFactory;
  * {@link CxfBinding}, and {@link HeaderFilterStrategy}.  The default DataFormat
  * mode is {@link DataFormat#POJO}.
  */
-@UriEndpoint(scheme = "cxf", consumerClass = CxfConsumer.class)
+@UriEndpoint(scheme = "cxf", consumerClass = CxfConsumer.class, label = "http,soap,webservice")
 public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, Service,
Cloneable {
 
     private static final Logger LOG = LoggerFactory.getLogger(CxfEndpoint.class);
 
     protected Bus bus;
-    @UriParam
-    private boolean createBus;
 
+    @UriPath(description = "To lookup an existing configured CxfEndpoint. Must used bean:
as prefix.")
+    private String beanId;
+    @UriPath
+    private String address;
+
+    @UriParam(defaultValue = "false")
+    private boolean createBus;
     @UriParam
     private String wsdlURL;
     private Class<?> serviceClass;
@@ -140,31 +146,28 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     private Boolean wrappedStyle;
     @UriParam
     private Boolean allowStreaming;
-    @UriParam
+    @UriParam(defaultValue = "POJO")
     private DataFormat dataFormat = DataFormat.POJO;
     @UriParam
     private String publishedEndpointUrl;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean inOut = true;
     private CxfBinding cxfBinding;
     private HeaderFilterStrategy headerFilterStrategy;
-    @UriParam
     private AtomicBoolean getBusHasBeenCalled = new AtomicBoolean(false);
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean isSetDefaultBus;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean loggingFeatureEnabled;
     @UriParam
     private int loggingSizeLimit;
-    @UriParam
-    private String address;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean mtomEnabled;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean skipPayloadMessagePartCheck;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean skipFaultLogging;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean mergeProtocolHeaders;
     private Map<String, Object> properties;
     private List<Interceptor<? extends Message>> in = new ModCountCopyOnWriteArrayList<Interceptor<?
extends Message>>();
@@ -187,7 +190,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     private CxfEndpointConfigurer configurer;
     
     // The continuation timeout value for CXF continuation to use
-    @UriParam
+    @UriParam(defaultValue = "30000")
     private long continuationTimeout = 30000;
     
     // basic authentication option for the CXF client
@@ -699,6 +702,15 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     // Properties
     // -------------------------------------------------------------------------
 
+
+    public String getBeanId() {
+        return beanId;
+    }
+
+    public void setBeanId(String beanId) {
+        this.beanId = beanId;
+    }
+
     public DataFormat getDataFormat() {
         return dataFormat;
     }
@@ -819,6 +831,7 @@ public class CxfEndpoint extends DefaultEndpoint implements HeaderFilterStrategy
     public void setAllowStreaming(Boolean b) {
         allowStreaming = b;
     }
+
     public Boolean getAllowStreaming() {
         return allowStreaming;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/bd364a95/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
index 270773f..1bedb55 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java
@@ -70,8 +70,9 @@ public class CxfRsComponent extends HeaderFilterStrategyComponent {
                 setProperties(answer, copy);      
             }
             // setup the skipFaultLogging
-           
-            
+
+            answer.setBeanId(beanId);
+
         } else {
             // endpoint URI does not specify a bean
             answer = new CxfRsEndpoint(remaining, this);

http://git-wip-us.apache.org/repos/asf/camel/blob/bd364a95/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
index 8e7eca0..73dbc72 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsEndpoint.java
@@ -36,6 +36,7 @@ import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.HeaderFilterStrategyAware;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -52,8 +53,9 @@ import org.apache.cxf.message.Message;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@UriEndpoint(scheme = "cxfrs", consumerClass = CxfRsConsumer.class)
+@UriEndpoint(scheme = "cxfrs", consumerClass = CxfRsConsumer.class, label = "http,rest")
 public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware,
Service {
+
     public enum BindingStyle {
         /**
          * <i>Only available for consumers.</i>
@@ -73,7 +75,6 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
          * A custom binding set by the user.
          */
         Custom
-
     }
 
     private static final Logger LOG = LoggerFactory.getLogger(CxfRsEndpoint.class);
@@ -84,32 +85,35 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     
     protected List<String> schemaLocations;
 
+    @UriPath(description = "To lookup an existing configured CxfRsEndpoint. Must used bean:
as prefix.")
+    private String beanId;
+    @UriPath
+    private String address;
+
     private Map<String, String> parameters;
     private List<Class<?>> resourceClasses;
     private HeaderFilterStrategy headerFilterStrategy;
     private CxfRsBinding binding;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean httpClientAPI = true;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean ignoreDeleteMethodMessageBody;
-    @UriParam
-    private String address;
-    @UriParam
+    @UriParam(defaultValue = "true")
     private boolean throwExceptionOnFailure = true;
-    @UriParam
+    @UriParam(defaultValue = "10")
     private int maxClientCacheSize = 10;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean loggingFeatureEnabled;
     @UriParam
     private int loggingSizeLimit;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean skipFaultLogging;
-    @UriParam
+    @UriParam(defaultValue = "Default")
     private BindingStyle bindingStyle = BindingStyle.Default;
     // The continuation timeout value for CXF continuation to use
-    @UriParam
+    @UriParam(defaultValue = "30000")
     private long continuationTimeout = 30000;
-    @UriParam
+    @UriParam(defaultValue = "false")
     private boolean isSetDefaultBus;
     
     private List<Feature> features = new ModCountCopyOnWriteArrayList<Feature>();
@@ -332,6 +336,7 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setResourceClasses(List<Class<?>> resourceClasses) {
         this.resourceClasses = resourceClasses;
     }
+
     public void setResourceClasses(Class<?>... classes) {
         setResourceClasses(Arrays.asList(classes));
     }
@@ -496,7 +501,15 @@ public class CxfRsEndpoint extends DefaultEndpoint implements HeaderFilterStrate
     public void setBindingStyle(BindingStyle bindingStyle) {
         this.bindingStyle = bindingStyle;
     }
-    
+
+    public String getBeanId() {
+        return beanId;
+    }
+
+    public void setBeanId(String beanId) {
+        this.beanId = beanId;
+    }
+
     @Override
     protected void doStart() throws Exception {
         if (headerFilterStrategy == null) {


Mime
View raw message