camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/3] camel git commit: CAMEL-7999: More components include documentation
Date Tue, 02 Dec 2014 08:35:04 GMT
CAMEL-7999: More components include documentation


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

Branch: refs/heads/master
Commit: a9ef2ad0538dcc79b09dd78589d55c78079ad051
Parents: c4dc594
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 2 09:33:11 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 2 09:33:11 2014 +0100

----------------------------------------------------------------------
 .../org/apache/camel/language/mvel/MvelComponent.java | 14 +++++++-------
 .../org/apache/camel/language/mvel/MvelEndpoint.java  |  8 ++++++--
 2 files changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a9ef2ad0/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelComponent.java
b/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelComponent.java
index 51acccd..1fe03f3a 100644
--- a/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelComponent.java
+++ b/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelComponent.java
@@ -19,25 +19,25 @@ package org.apache.camel.language.mvel;
 import java.util.Map;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.impl.UriEndpointComponent;
 import org.apache.camel.util.ResourceHelper;
 
 /**
  * An <a href="http://camel.apache.org/mvel.html">Mvel Component</a>
  * for performing transforming messages
  */
-public class MvelComponent extends DefaultComponent {
+public class MvelComponent extends UriEndpointComponent {
+
+    public MvelComponent() {
+        super(MvelEndpoint.class);
+    }
 
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
-        String encoding = getAndRemoveParameter(parameters, "encoding", String.class);
         boolean cache = getAndRemoveParameter(parameters, "contentCache", Boolean.class,
Boolean.TRUE);
 
         MvelEndpoint answer = new MvelEndpoint(uri, this, remaining);
+        setProperties(answer, parameters);
         answer.setContentCache(cache);
-        if (ObjectHelper.isNotEmpty(encoding)) {
-            answer.setEncoding(encoding);
-        }
 
         // if its a http resource then append any remaining parameters and update the resource
uri
         if (ResourceHelper.isHttpUri(remaining)) {

http://git-wip-us.apache.org/repos/asf/camel/blob/a9ef2ad0/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelEndpoint.java
b/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelEndpoint.java
index d8cfe1a..61b5f2d 100644
--- a/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelEndpoint.java
+++ b/components/camel-mvel/src/main/java/org/apache/camel/language/mvel/MvelEndpoint.java
@@ -25,6 +25,8 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Message;
 import org.apache.camel.component.ResourceEndpoint;
 import org.apache.camel.converter.IOConverter;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 import org.apache.camel.util.ExchangeHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.mvel2.ParserContext;
@@ -32,11 +34,13 @@ import org.mvel2.templates.CompiledTemplate;
 import org.mvel2.templates.TemplateCompiler;
 import org.mvel2.templates.TemplateRuntime;
 
+@UriEndpoint(scheme = "mvel", label = "transformation,script")
 public class MvelEndpoint extends ResourceEndpoint {
 
+    @UriParam
     private String encoding;
-    private String template;
-    private CompiledTemplate compiled;
+    private volatile String template;
+    private volatile CompiledTemplate compiled;
 
     public MvelEndpoint(String uri, MvelComponent component, String resourceUri) {
         super(uri, component, resourceUri);


Mime
View raw message