camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [1/2] camel git commit: MetaDataExtension : allow to retrieve attributes directly
Date Thu, 24 Aug 2017 14:08:33 GMT
Repository: camel
Updated Branches:
  refs/heads/master 60d0ed8b4 -> 2e2df2cb7


MetaDataExtension : allow to retrieve attributes directly


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

Branch: refs/heads/master
Commit: 2e2df2cb798c6ce4abd5ba2d1b34accae2cbe16f
Parents: 4da9afd
Author: lburgazzoli <lburgazzoli@gmail.com>
Authored: Thu Aug 24 16:07:37 2017 +0200
Committer: lburgazzoli <lburgazzoli@gmail.com>
Committed: Thu Aug 24 16:08:23 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/component/extension/MetaDataExtension.java    | 6 +++++-
 .../camel/component/extension/metadata/DefaultMetaData.java    | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2e2df2cb/camel-core/src/main/java/org/apache/camel/component/extension/MetaDataExtension.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/extension/MetaDataExtension.java
b/camel-core/src/main/java/org/apache/camel/component/extension/MetaDataExtension.java
index 9361e66..efbf612 100644
--- a/camel-core/src/main/java/org/apache/camel/component/extension/MetaDataExtension.java
+++ b/camel-core/src/main/java/org/apache/camel/component/extension/MetaDataExtension.java
@@ -35,7 +35,6 @@ public interface MetaDataExtension extends ComponentExtension {
         String JAVA_TYPE = "Java-Type";
 
         /**
-         *
          * Returns an attribute associated with this meta data by name.
          *
          * @param name the attribute name
@@ -44,6 +43,11 @@ public interface MetaDataExtension extends ComponentExtension {
         Object getAttribute(String name);
 
         /**
+         * @return a red-only list of attributes.
+         */
+        Map<String, Object> getAttributes();
+
+        /**
          *
          * Returns an attribute associated with this meta data by name and
          * specifying the type required.

http://git-wip-us.apache.org/repos/asf/camel/blob/2e2df2cb/camel-core/src/main/java/org/apache/camel/component/extension/metadata/DefaultMetaData.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/extension/metadata/DefaultMetaData.java
b/camel-core/src/main/java/org/apache/camel/component/extension/metadata/DefaultMetaData.java
index b1e2df4..47e8375 100644
--- a/camel-core/src/main/java/org/apache/camel/component/extension/metadata/DefaultMetaData.java
+++ b/camel-core/src/main/java/org/apache/camel/component/extension/metadata/DefaultMetaData.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.extension.metadata;
 
+import java.util.Collections;
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
@@ -38,6 +39,11 @@ public class DefaultMetaData implements MetaDataExtension.MetaData {
     }
 
     @Override
+    public Map<String, Object> getAttributes() {
+        return Collections.unmodifiableMap(attributes);
+    }
+
+    @Override
     public <T> T getAttribute(String name, Class<T> type) {
         Object value = attributes.get(name);
         if (camelContext != null) {


Mime
View raw message