Add the option to endpoint and use in configuring the factory.

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

Branch: refs/heads/master
Commit: e9e862b3d474adacdca31d754576a8b52fe549ab
Parents: fc28915
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sun Oct 9 09:31:17 2016 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Oct 9 09:31:17 2016 +0200

----------------------------------------------------------------------
 .../camel-cxf/src/main/docs/cxfrs-component.adoc   |  4 ++--
 .../camel/component/cxf/jaxrs/CxfRsEndpoint.java   | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e9e862b3/components/camel-cxf/src/main/docs/cxfrs-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-cxf/src/main/docs/cxfrs-component.adoc 
b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
index 6970c07..b1b7ee8 100644
--- a/components/camel-cxf/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/src/main/docs/cxfrs-component.adoc
@@ -81,7 +81,7 @@ The CXF-RS component supports 1 options which are listed 
below.
 
 
 // endpoint options: START
-The CXF-RS component supports 29 endpoint options which are listed below:
+The CXF-RS component supports 30 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -99,6 +99,7 @@ The CXF-RS component supports 29 endpoint options which are 
listed below:
 | skipFaultLogging | common | false | boolean | This option controls whether 
the PhaseInterceptorChain skips logging the Fault that it catches.
 | bindingStyle | consumer | Default | BindingStyle | Sets how requests and 
responses will be mapped to/from Camel. Two values are possible: 
SimpleConsumer: This binding style processes request parameters multiparts etc. 
and maps them to IN headers IN attachments and to the message body. It aims to 
eliminate low-level processing of org.apache.cxf.message.MessageContentsList. 
It also also adds more flexibility and simplicity to the response mapping. Only 
available for consumers. Default: The default style. For consumers this passes 
on a MessageContentsList to the route requiring low-level processing in the 
route. This is the traditional binding style which simply dumps the 
org.apache.cxf.message.MessageContentsList coming in from the CXF stack onto 
the IN message body. The user is then responsible for processing it according 
to the contract defined by the JAX-RS method signature. Custom: allows you to 
specify a custom binding through the binding option.
 | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the 
consumer to the Camel routing Error Handler which mean any exceptions occurred 
while the consumer is trying to pickup incoming messages or the likes will now 
be processed as a message and handled by the routing Error Handler. By default 
the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions that will be logged at WARN/ERROR level and ignored.
+| publishedEndpointUrl | consumer |  | String | This option can override the 
endpointUrl that published from the WADL which can be accessed with resource 
address url plus _wadl
 | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the 
consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler 
is enabled then this options is not in use. By default the consumer will deal 
with exceptions that will be logged at WARN/ERROR level and ignored.
 | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the 
exchange pattern when the consumer creates an exchange.
 | hostnameVerifier | producer |  | HostnameVerifier | The hostname verifier to 
be used. Use the notation to reference a HostnameVerifier from the registry.
@@ -116,7 +117,6 @@ The CXF-RS component supports 29 endpoint options which are 
listed below:
 | performInvocation | advanced | false | boolean | When the option is true 
Camel will perform the invocation of the resource class instance and put the 
response object into the exchange for further processing.
 | propagateContexts | advanced | false | boolean | When the option is true 
JAXRS UriInfo HttpHeaders Request and SecurityContext contexts will be 
available to custom CXFRS processors as typed Camel exchange properties. These 
contexts can be used to analyze the current requests using JAX-RS API.
 | synchronous | advanced | false | boolean | Sets whether synchronous 
processing should be strictly used or Camel is allowed to use asynchronous 
processing (if supported).
-| publishedEndpointUrl | producer |  | String | This option can override the 
endpointUrl that published from the WADL which can be accessed with resource 
address url plus ?_wadl
 |=======================================================================
 {% endraw %}
 // endpoint options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/e9e862b3/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 cb5dff4..097c442 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
@@ -85,6 +85,8 @@ public class CxfRsEndpoint extends DefaultEndpoint implements 
HeaderFilterStrate
     private String modelRef;
     @UriParam(label = "consumer", defaultValue = "Default")
     private BindingStyle bindingStyle = BindingStyle.Default;
+    @UriParam(label = "consumer")
+    private String publishedEndpointUrl;
     @UriParam(label = "advanced")
     private HeaderFilterStrategy headerFilterStrategy;
     @UriParam(label = "advanced")
@@ -318,6 +320,10 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
             factory.getFeatures().addAll(getFeatures());
         }
 
+        if (publishedEndpointUrl != null) {
+            factory.setPublishedEndpointUrl(publishedEndpointUrl);
+        }
+
         // we need to avoid flushing the setting from spring or blueprint
         if (!interceptorHolder.getInInterceptors().isEmpty()) {
             factory.setInInterceptors(interceptorHolder.getInInterceptors());
@@ -441,6 +447,17 @@ public class CxfRsEndpoint extends DefaultEndpoint 
implements HeaderFilterStrate
         return resolvePropertyPlaceholders(address);
     }
 
+    public String getPublishedEndpointUrl() {
+        return publishedEndpointUrl;
+    }
+
+    /**
+     * This option can override the endpointUrl that published from the WADL 
which can be accessed with resource address url plus ?_wadl
+     */
+    public void setPublishedEndpointUrl(String publishedEndpointUrl) {
+        this.publishedEndpointUrl = publishedEndpointUrl;
+    }
+
     /**
      * This option enables CXF Logging Feature which writes inbound and 
outbound REST messages to log.
      */

Reply via email to