camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/4] camel git commit: CAMEL-8992: EIP mbeans should output better expression/preidcate.
Date Wed, 22 Jul 2015 17:47:27 GMT
CAMEL-8992: EIP mbeans should output better expression/preidcate.


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

Branch: refs/heads/master
Commit: 2ed525a0d6b6648968386d9bccc41ffde67cedba
Parents: 2f9d595
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Jul 22 18:29:53 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Jul 22 19:54:19 2015 +0200

----------------------------------------------------------------------
 .../mbean/ManagedRecipientListMBean.java          |  3 +++
 .../management/mbean/ManagedRoutingSlipMBean.java |  3 +++
 .../api/management/mbean/ManagedScriptMBean.java  |  3 +++
 .../api/management/mbean/ManagedSetBodyMBean.java |  3 +++
 .../management/mbean/ManagedSetHeaderMBean.java   |  3 +++
 .../management/mbean/ManagedSetPropertyMBean.java |  3 +++
 .../management/mbean/ManagedSplitterMBean.java    |  3 +++
 .../management/mbean/ManagedTransformMBean.java   |  3 +++
 .../management/mbean/ManagedValidateMBean.java    |  3 +++
 .../DefaultManagementObjectStrategy.java          | 18 +++++++++---------
 .../management/mbean/ManagedRecipientList.java    | 16 +++++++++++++---
 .../management/mbean/ManagedRoutingSlip.java      | 15 +++++++++++++--
 .../camel/management/mbean/ManagedScript.java     | 18 +++++++++++++-----
 .../camel/management/mbean/ManagedSetBody.java    | 18 +++++++++++++-----
 .../camel/management/mbean/ManagedSetHeader.java  | 18 +++++++++++++-----
 .../management/mbean/ManagedSetProperty.java      | 18 +++++++++++++-----
 .../camel/management/mbean/ManagedSplitter.java   | 16 +++++++++++++---
 .../management/mbean/ManagedTransformer.java      | 18 +++++++++++++-----
 .../camel/management/mbean/ManagedValidate.java   | 16 +++++++++++++---
 .../management/ManagedRecipientListTest.java      |  5 ++++-
 .../camel/management/ManagedRoutingSlipTest.java  |  5 ++++-
 .../camel/management/ManagedSplitterTest.java     |  7 +++++--
 22 files changed, 166 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRecipientListMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRecipientListMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRecipientListMBean.java
index 73d4a3e..e0ac299 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRecipientListMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRecipientListMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedRecipientListMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression that returns which endpoints (url) to send
the message to (the recipients).", mask = true)
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRoutingSlipMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRoutingSlipMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRoutingSlipMBean.java
index 22fb510..828384f 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRoutingSlipMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRoutingSlipMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedRoutingSlipMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to define the routing slip, which defines
which endpoints to route the message in a pipeline style.", mask = true)
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedScriptMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedScriptMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedScriptMBean.java
index 6397179..ae353ee 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedScriptMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedScriptMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedScriptMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to return the transformed message body (the
new message body to use)")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetBodyMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetBodyMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetBodyMBean.java
index 28e27fe..e94fda3c 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetBodyMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetBodyMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedSetBodyMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to return the transformed message body (the
new message body to use)")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetHeaderMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetHeaderMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetHeaderMBean.java
index 97d391c..bc6d338 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetHeaderMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetHeaderMBean.java
@@ -23,6 +23,9 @@ public interface ManagedSetHeaderMBean extends ManagedProcessorMBean {
     @ManagedAttribute(description = "Name of message header to set a new value")
     String getHeaderName();
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to return the value of the header")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetPropertyMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetPropertyMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetPropertyMBean.java
index 7556435..846dbbb 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetPropertyMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSetPropertyMBean.java
@@ -23,6 +23,9 @@ public interface ManagedSetPropertyMBean extends ManagedProcessorMBean {
     @ManagedAttribute(description = "Name of exchange property to set a new value")
     String getPropertyName();
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to return the value of the message exchange
property")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSplitterMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSplitterMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSplitterMBean.java
index ee72f51..8757f7f 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSplitterMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedSplitterMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedSplitterMBean extends ManagedMulticastMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression of how to split the message body, such as
as-is, using a tokenizer, or using an xpath.")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTransformMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTransformMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTransformMBean.java
index adc948f..fab0a3a 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTransformMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedTransformMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedTransformMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the expression")
+    String getExpressionLanguage();
+
     @ManagedAttribute(description = "Expression to return the transformed message body (the
new message body to use)")
     String getExpression();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedValidateMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedValidateMBean.java
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedValidateMBean.java
index d00e943..da6a616 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedValidateMBean.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedValidateMBean.java
@@ -20,6 +20,9 @@ import org.apache.camel.api.management.ManagedAttribute;
 
 public interface ManagedValidateMBean extends ManagedProcessorMBean {
 
+    @ManagedAttribute(description = "The language for the predicate")
+    String getPredicateLanguage();
+
     @ManagedAttribute(description = "Predicate to determine if the message is valid or not")
     String getPredicate();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
index 7b94ff6..3f6800f 100644
--- a/camel-core/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/management/DefaultManagementObjectStrategy.java
@@ -274,7 +274,7 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
             } else if (target instanceof DynamicRouter) {
                 answer = new ManagedDynamicRouter(context, (DynamicRouter) target, (org.apache.camel.model.DynamicRouterDefinition)
definition);
             } else if (target instanceof RoutingSlip) {
-                answer = new ManagedRoutingSlip(context, (RoutingSlip) target, definition);
+                answer = new ManagedRoutingSlip(context, (RoutingSlip) target, (org.apache.camel.model.RoutingSlipDefinition)
definition);
             } else if (target instanceof FilterProcessor) {
                 answer = new ManagedFilter(context, (FilterProcessor) target, (org.apache.camel.model.FilterDefinition)
definition);
             } else if (target instanceof LogProcessor) {
@@ -286,9 +286,9 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
             } else if (target instanceof UnmarshalProcessor) {
                 answer = new ManagedUnmarshal(context, (UnmarshalProcessor) target, (org.apache.camel.model.UnmarshalDefinition)
definition);
             } else if (target instanceof RecipientList) {
-                answer = new ManagedRecipientList(context, (RecipientList) target, definition);
+                answer = new ManagedRecipientList(context, (RecipientList) target, (RecipientListDefinition)
definition);
             } else if (target instanceof Splitter) {
-                answer = new ManagedSplitter(context, (Splitter) target, definition);
+                answer = new ManagedSplitter(context, (Splitter) target, (org.apache.camel.model.SplitDefinition)
definition);
             } else if (target instanceof MulticastProcessor) {
                 answer = new ManagedMulticast(context, (MulticastProcessor) target, definition);
             } else if (target instanceof SamplingThrottler) {
@@ -300,23 +300,23 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
             } else if (target instanceof StreamResequencer) {
                 answer = new ManagedResequencer(context, (StreamResequencer) target, definition);
             } else if (target instanceof SetBodyProcessor) {
-                answer = new ManagedSetBody(context, (SetBodyProcessor) target, definition);
+                answer = new ManagedSetBody(context, (SetBodyProcessor) target, (org.apache.camel.model.SetBodyDefinition)
definition);
             } else if (target instanceof RemoveHeaderProcessor) {
                 answer = new ManagedRemoveHeader(context, (RemoveHeaderProcessor) target,
definition);
             } else if (target instanceof RemoveHeadersProcessor) {
                 answer = new ManagedRemoveHeaders(context, (RemoveHeadersProcessor) target,
definition);
             } else if (target instanceof SetHeaderProcessor) {
-                answer = new ManagedSetHeader(context, (SetHeaderProcessor) target, definition);
+                answer = new ManagedSetHeader(context, (SetHeaderProcessor) target, (org.apache.camel.model.SetHeaderDefinition)
definition);
             } else if (target instanceof RemovePropertyProcessor) {
                 answer = new ManagedRemoveProperty(context, (RemovePropertyProcessor) target,
definition);
             } else if (target instanceof RemovePropertiesProcessor) {
                 answer = new ManagedRemoveProperties(context, (RemovePropertiesProcessor)
target, definition);
             } else if (target instanceof SetPropertyProcessor) {
-                answer = new ManagedSetProperty(context, (SetPropertyProcessor) target, definition);
+                answer = new ManagedSetProperty(context, (SetPropertyProcessor) target, (org.apache.camel.model.SetPropertyDefinition)
definition);
             } else if (target instanceof ExchangePatternProcessor) {
                 answer = new ManagedSetExchangePattern(context, (ExchangePatternProcessor)
target, definition);
             } else if (target instanceof ScriptProcessor) {
-                answer = new ManagedScript(context, (ScriptProcessor) target, definition);
+                answer = new ManagedScript(context, (ScriptProcessor) target, (org.apache.camel.model.ScriptDefinition)
definition);
             } else if (target instanceof StopProcessor) {
                 answer = new ManagedStop(context, (StopProcessor) target, definition);
             } else if (target instanceof ThreadsProcessor) {
@@ -324,9 +324,9 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
             } else if (target instanceof ThrowExceptionProcessor) {
                 answer = new ManagedThrowException(context, (ThrowExceptionProcessor) target,
definition);
             } else if (target instanceof TransformProcessor) {
-                answer = new ManagedTransformer(context, (TransformProcessor) target, definition);
+                answer = new ManagedTransformer(context, (TransformProcessor) target, (org.apache.camel.model.TransformDefinition)
definition);
             } else if (target instanceof PredicateValidatingProcessor) {
-                answer = new ManagedValidate(context, (PredicateValidatingProcessor) target,
definition);
+                answer = new ManagedValidate(context, (PredicateValidatingProcessor) target,
(org.apache.camel.model.ValidateDefinition) definition);
             } else if (target instanceof WireTapProcessor) {
                 answer = new ManagedWireTapProcessor(context, (WireTapProcessor) target,
definition);
             } else if (target instanceof SendDynamicProcessor) {

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRecipientList.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRecipientList.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRecipientList.java
index 91046d0..1033d60 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRecipientList.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRecipientList.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedRecipientListMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.RecipientListDefinition;
 import org.apache.camel.processor.RecipientList;
 import org.apache.camel.spi.ManagementStrategy;
 import org.apache.camel.util.URISupport;
@@ -32,7 +32,7 @@ public class ManagedRecipientList extends ManagedProcessor implements ManagedRec
     private final RecipientList processor;
     private String uri;
 
-    public ManagedRecipientList(CamelContext context, RecipientList processor, ProcessorDefinition<?>
definition) {
+    public ManagedRecipientList(CamelContext context, RecipientList processor, RecipientListDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
     }
@@ -41,13 +41,23 @@ public class ManagedRecipientList extends ManagedProcessor implements
ManagedRec
     public void init(ManagementStrategy strategy) {
         super.init(strategy);
         boolean sanitize = strategy.getManagementAgent().getMask() != null ? strategy.getManagementAgent().getMask()
: false;
-        uri = processor.getExpression().toString();
+        uri = getDefinition().getExpression().getExpression();
         if (sanitize) {
             uri = URISupport.sanitizeUri(uri);
         }
     }
 
     @Override
+    public RecipientListDefinition getDefinition() {
+        return (RecipientListDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getExpression() {
         return uri;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoutingSlip.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoutingSlip.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoutingSlip.java
index 1ea0da9..d977334 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoutingSlip.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoutingSlip.java
@@ -20,6 +20,7 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedRoutingSlipMBean;
 import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.RoutingSlipDefinition;
 import org.apache.camel.processor.RoutingSlip;
 import org.apache.camel.spi.ManagementStrategy;
 import org.apache.camel.util.URISupport;
@@ -32,7 +33,7 @@ public class ManagedRoutingSlip extends ManagedProcessor implements ManagedRouti
     private final RoutingSlip processor;
     private String uri;
 
-    public ManagedRoutingSlip(CamelContext context, RoutingSlip processor, ProcessorDefinition<?>
definition) {
+    public ManagedRoutingSlip(CamelContext context, RoutingSlip processor, RoutingSlipDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
     }
@@ -41,13 +42,23 @@ public class ManagedRoutingSlip extends ManagedProcessor implements ManagedRouti
     public void init(ManagementStrategy strategy) {
         super.init(strategy);
         boolean sanitize = strategy.getManagementAgent().getMask() != null ? strategy.getManagementAgent().getMask()
: false;
-        uri = processor.getExpression().toString();
+        uri = getDefinition().getExpression().getExpression();
         if (sanitize) {
             uri = URISupport.sanitizeUri(uri);
         }
     }
 
     @Override
+    public RoutingSlipDefinition getDefinition() {
+        return (RoutingSlipDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getExpression() {
         return uri;
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScript.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScript.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScript.java
index 74e1a85..51ea141 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScript.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedScript.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedScriptMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.ScriptDefinition;
 import org.apache.camel.processor.ScriptProcessor;
 
 /**
@@ -28,16 +28,24 @@ import org.apache.camel.processor.ScriptProcessor;
 @ManagedResource(description = "Managed Script")
 public class ManagedScript extends ManagedProcessor implements ManagedScriptMBean {
     private final ScriptProcessor processor;
-    private final String expression;
 
-    public ManagedScript(CamelContext context, ScriptProcessor processor, ProcessorDefinition<?>
definition) {
+    public ManagedScript(CamelContext context, ScriptProcessor processor, ScriptDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
-        this.expression = processor.getExpression().toString();
+    }
+
+    @Override
+    public ScriptDefinition getDefinition() {
+        return (ScriptDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
     }
 
     @Override
     public String getExpression() {
-        return expression;
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetBody.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetBody.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetBody.java
index f396d45..0a2c5c9 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetBody.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetBody.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedSetBodyMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SetBodyDefinition;
 import org.apache.camel.processor.SetBodyProcessor;
 
 /**
@@ -28,16 +28,24 @@ import org.apache.camel.processor.SetBodyProcessor;
 @ManagedResource(description = "Managed SetBody")
 public class ManagedSetBody extends ManagedProcessor implements ManagedSetBodyMBean {
     private final SetBodyProcessor processor;
-    private final String expression;
 
-    public ManagedSetBody(CamelContext context, SetBodyProcessor processor, ProcessorDefinition<?>
definition) {
+    public ManagedSetBody(CamelContext context, SetBodyProcessor processor, SetBodyDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
-        this.expression = processor.getExpression().toString();
+    }
+
+    @Override
+    public SetBodyDefinition getDefinition() {
+        return (SetBodyDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
     }
 
     @Override
     public String getExpression() {
-        return expression;
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetHeader.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetHeader.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetHeader.java
index 6c7941d..ac65967 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetHeader.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetHeader.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedSetHeaderMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SetHeaderDefinition;
 import org.apache.camel.processor.SetHeaderProcessor;
 
 /**
@@ -28,12 +28,15 @@ import org.apache.camel.processor.SetHeaderProcessor;
 @ManagedResource(description = "Managed SetHeader")
 public class ManagedSetHeader extends ManagedProcessor implements ManagedSetHeaderMBean {
     private final SetHeaderProcessor processor;
-    private final String expression;
 
-    public ManagedSetHeader(CamelContext context, SetHeaderProcessor processor, ProcessorDefinition<?>
definition) {
+    public ManagedSetHeader(CamelContext context, SetHeaderProcessor processor, SetHeaderDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
-        this.expression = processor.getExpression().toString();
+    }
+
+    @Override
+    public SetHeaderDefinition getDefinition() {
+        return (SetHeaderDefinition) super.getDefinition();
     }
 
     @Override
@@ -42,7 +45,12 @@ public class ManagedSetHeader extends ManagedProcessor implements ManagedSetHead
     }
 
     @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getExpression() {
-        return expression;
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetProperty.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetProperty.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetProperty.java
index e5e12e1..2b5e6cf 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetProperty.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSetProperty.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedSetPropertyMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SetPropertyDefinition;
 import org.apache.camel.processor.SetPropertyProcessor;
 
 /**
@@ -28,12 +28,15 @@ import org.apache.camel.processor.SetPropertyProcessor;
 @ManagedResource(description = "Managed SetProperty")
 public class ManagedSetProperty extends ManagedProcessor implements ManagedSetPropertyMBean
{
     private final SetPropertyProcessor processor;
-    private final String expression;
 
-    public ManagedSetProperty(CamelContext context, SetPropertyProcessor processor, ProcessorDefinition<?>
definition) {
+    public ManagedSetProperty(CamelContext context, SetPropertyProcessor processor, SetPropertyDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
-        this.expression = processor.getExpression().toString();
+    }
+
+    @Override
+    public SetPropertyDefinition getDefinition() {
+        return (SetPropertyDefinition) super.getDefinition();
     }
 
     @Override
@@ -42,7 +45,12 @@ public class ManagedSetProperty extends ManagedProcessor implements ManagedSetPr
     }
 
     @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getExpression() {
-        return expression;
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSplitter.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSplitter.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSplitter.java
index b2b1733..857b99e 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSplitter.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedSplitter.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedSplitterMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.SplitDefinition;
 import org.apache.camel.processor.Splitter;
 
 /**
@@ -29,13 +29,23 @@ import org.apache.camel.processor.Splitter;
 public class ManagedSplitter extends ManagedMulticast implements ManagedSplitterMBean {
     private final Splitter processor;
 
-    public ManagedSplitter(CamelContext context, Splitter processor, ProcessorDefinition<?>
definition) {
+    public ManagedSplitter(CamelContext context, Splitter processor, SplitDefinition definition)
{
         super(context, processor, definition);
         this.processor = processor;
     }
 
     @Override
+    public SplitDefinition getDefinition() {
+        return (SplitDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getExpression() {
-        return processor.getExpression().toString();
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTransformer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTransformer.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTransformer.java
index f467441..970aaa7 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTransformer.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedTransformer.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedTransformMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.TransformDefinition;
 import org.apache.camel.processor.TransformProcessor;
 
 /**
@@ -28,16 +28,24 @@ import org.apache.camel.processor.TransformProcessor;
 @ManagedResource(description = "Managed Transformer")
 public class ManagedTransformer extends ManagedProcessor implements ManagedTransformMBean
{
     private final TransformProcessor processor;
-    private final String expression;
 
-    public ManagedTransformer(CamelContext context, TransformProcessor processor, ProcessorDefinition<?>
definition) {
+    public ManagedTransformer(CamelContext context, TransformProcessor processor, TransformDefinition
definition) {
         super(context, processor, definition);
         this.processor = processor;
-        this.expression = processor.getExpression().toString();
+    }
+
+    @Override
+    public TransformDefinition getDefinition() {
+        return (TransformDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getExpressionLanguage() {
+        return getDefinition().getExpression().getLanguage();
     }
 
     @Override
     public String getExpression() {
-        return expression;
+        return getDefinition().getExpression().getExpression();
     }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedValidate.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedValidate.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedValidate.java
index 552444d..bead620 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedValidate.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedValidate.java
@@ -19,7 +19,7 @@ package org.apache.camel.management.mbean;
 import org.apache.camel.CamelContext;
 import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.api.management.mbean.ManagedValidateMBean;
-import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.model.ValidateDefinition;
 import org.apache.camel.processor.validation.PredicateValidatingProcessor;
 
 /**
@@ -29,14 +29,24 @@ import org.apache.camel.processor.validation.PredicateValidatingProcessor;
 public class ManagedValidate extends ManagedProcessor implements ManagedValidateMBean {
     private final PredicateValidatingProcessor processor;
 
-    public ManagedValidate(CamelContext context, PredicateValidatingProcessor processor,
ProcessorDefinition<?> definition) {
+    public ManagedValidate(CamelContext context, PredicateValidatingProcessor processor,
ValidateDefinition definition) {
         super(context, processor, definition);
         this.processor = processor;
     }
 
     @Override
+    public ValidateDefinition getDefinition() {
+        return (ValidateDefinition) super.getDefinition();
+    }
+
+    @Override
+    public String getPredicateLanguage() {
+        return getDefinition().getExpression().getLanguage();
+    }
+
+    @Override
     public String getPredicate() {
-        return processor.getPredicate().toString();
+        return getDefinition().getExpression().getExpression();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/test/java/org/apache/camel/management/ManagedRecipientListTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRecipientListTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedRecipientListTest.java
index 3b2661f3..b7a1721 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRecipientListTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedRecipientListTest.java
@@ -61,8 +61,11 @@ public class ManagedRecipientListTest extends ManagementTestSupport {
         Boolean parallel = (Boolean) mbeanServer.getAttribute(on, "ParallelProcessing");
         assertEquals(false, parallel.booleanValue());
 
+        String lan = (String) mbeanServer.getAttribute(on, "ExpressionLanguage");
+        assertEquals("header", lan);
+
         String uri = (String) mbeanServer.getAttribute(on, "Expression");
-        assertEquals("header(foo)", uri);
+        assertEquals("foo", uri);
 
         TabularData data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{false},
new String[]{"boolean"});
         assertNotNull(data);

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/test/java/org/apache/camel/management/ManagedRoutingSlipTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRoutingSlipTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedRoutingSlipTest.java
index 0cb0ae4..7876d25 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRoutingSlipTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedRoutingSlipTest.java
@@ -58,8 +58,11 @@ public class ManagedRoutingSlipTest extends ManagementTestSupport {
         String state = (String) mbeanServer.getAttribute(on, "State");
         assertEquals(ServiceStatus.Started.name(), state);
 
+        String lan = (String) mbeanServer.getAttribute(on, "ExpressionLanguage");
+        assertEquals("header", lan);
+
         String uri = (String) mbeanServer.getAttribute(on, "Expression");
-        assertEquals("header(whereTo)", uri);
+        assertEquals("whereTo", uri);
 
         TabularData data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{false},
new String[]{"boolean"});
         assertNotNull(data);

http://git-wip-us.apache.org/repos/asf/camel/blob/2ed525a0/camel-core/src/test/java/org/apache/camel/management/ManagedSplitterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedSplitterTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedSplitterTest.java
index bafff6d..c13b342 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedSplitterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedSplitterTest.java
@@ -58,8 +58,11 @@ public class ManagedSplitterTest extends ManagementTestSupport {
         String state = (String) mbeanServer.getAttribute(on, "State");
         assertEquals(ServiceStatus.Started.name(), state);
 
-        String uri = (String) mbeanServer.getAttribute(on, "Expression");
-        assertEquals("Simple: ${body}", uri);
+        String lan = (String) mbeanServer.getAttribute(on, "Expression");
+        assertEquals("${body}", lan);
+
+        String exp = (String) mbeanServer.getAttribute(on, "Expression");
+        assertEquals("${body}", exp);
 
         String xml = (String) mbeanServer.invoke(on, "dumpProcessorAsXml", null, null);
         assertTrue(xml.contains("<split"));


Mime
View raw message