You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/07/22 09:48:37 UTC

[2/4] camel git commit: CAMEL-8526: Add more EIP as specialized mbeans

CAMEL-8526: Add more EIP as specialized mbeans


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

Branch: refs/heads/master
Commit: 3e1c7f6d902e5228851d4c1a8aab5693802d3dcc
Parents: 6ad65fb
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 22 09:26:26 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 22 09:26:26 2015 +0200

----------------------------------------------------------------------
 .../mbean/ManagedRemoveHeaderMBean.java         | 26 ++++++++++++
 .../mbean/ManagedRemovePropertyMBean.java       | 26 ++++++++++++
 .../DefaultManagementObjectStrategy.java        |  8 ++++
 .../management/mbean/ManagedRemoveHeader.java   | 42 ++++++++++++++++++++
 .../management/mbean/ManagedRemoveProperty.java | 41 +++++++++++++++++++
 5 files changed, 143 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c7f6d/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeaderMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeaderMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeaderMBean.java
new file mode 100644
index 0000000..97d53d2
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeaderMBean.java
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.api.management.mbean;
+
+import org.apache.camel.api.management.ManagedAttribute;
+
+public interface ManagedRemoveHeaderMBean extends ManagedProcessorMBean {
+
+    @ManagedAttribute(description = "Name of message header to remove")
+    String getHeaderName();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c7f6d/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertyMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertyMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertyMBean.java
new file mode 100644
index 0000000..f70c30e
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertyMBean.java
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.api.management.mbean;
+
+import org.apache.camel.api.management.ManagedAttribute;
+
+public interface ManagedRemovePropertyMBean extends ManagedProcessorMBean {
+
+    @ManagedAttribute(description = "Name of exchange property to remove")
+    String getPropertyName();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c7f6d/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 460ee47..f62f8ab 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
@@ -53,6 +53,8 @@ import org.apache.camel.management.mbean.ManagedPollEnricher;
 import org.apache.camel.management.mbean.ManagedProcessor;
 import org.apache.camel.management.mbean.ManagedProducer;
 import org.apache.camel.management.mbean.ManagedRecipientList;
+import org.apache.camel.management.mbean.ManagedRemoveHeader;
+import org.apache.camel.management.mbean.ManagedRemoveProperty;
 import org.apache.camel.management.mbean.ManagedResequencer;
 import org.apache.camel.management.mbean.ManagedRoute;
 import org.apache.camel.management.mbean.ManagedRoutingSlip;
@@ -88,6 +90,8 @@ import org.apache.camel.processor.MulticastProcessor;
 import org.apache.camel.processor.Pipeline;
 import org.apache.camel.processor.PollEnricher;
 import org.apache.camel.processor.RecipientList;
+import org.apache.camel.processor.RemoveHeaderProcessor;
+import org.apache.camel.processor.RemovePropertyProcessor;
 import org.apache.camel.processor.Resequencer;
 import org.apache.camel.processor.RoutingSlip;
 import org.apache.camel.processor.SamplingThrottler;
@@ -264,8 +268,12 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
                 answer = new ManagedResequencer(context, (StreamResequencer) target, definition);
             } else if (target instanceof SetBodyProcessor) {
                 answer = new ManagedSetBody(context, (SetBodyProcessor) target, definition);
+            } else if (target instanceof RemoveHeaderProcessor) {
+                answer = new ManagedRemoveHeader(context, (RemoveHeaderProcessor) target, definition);
             } else if (target instanceof SetHeaderProcessor) {
                 answer = new ManagedSetHeader(context, (SetHeaderProcessor) target, definition);
+            } else if (target instanceof RemovePropertyProcessor) {
+                answer = new ManagedRemoveProperty(context, (RemovePropertyProcessor) target, definition);
             } else if (target instanceof SetPropertyProcessor) {
                 answer = new ManagedSetProperty(context, (SetPropertyProcessor) target, definition);
             } else if (target instanceof ThreadsProcessor) {

http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c7f6d/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeader.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeader.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeader.java
new file mode 100644
index 0000000..069255e
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeader.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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.ManagedRemoveHeaderMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.RemoveHeaderProcessor;
+
+/**
+ * @version 
+ */
+@ManagedResource(description = "Managed RemoveHeader")
+public class ManagedRemoveHeader extends ManagedProcessor implements ManagedRemoveHeaderMBean {
+    private final RemoveHeaderProcessor processor;
+
+    public ManagedRemoveHeader(CamelContext context, RemoveHeaderProcessor processor, ProcessorDefinition<?> definition) {
+        super(context, processor, definition);
+        this.processor = processor;
+    }
+
+    @Override
+    public String getHeaderName() {
+        return processor.getHeaderName();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/3e1c7f6d/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperty.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperty.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperty.java
new file mode 100644
index 0000000..61eaa79
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperty.java
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+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.ManagedRemovePropertyMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.RemovePropertyProcessor;
+
+/**
+ * @version 
+ */
+@ManagedResource(description = "Managed RemoveProperty")
+public class ManagedRemoveProperty extends ManagedProcessor implements ManagedRemovePropertyMBean {
+    private final RemovePropertyProcessor processor;
+
+    public ManagedRemoveProperty(CamelContext context, RemovePropertyProcessor processor, ProcessorDefinition<?> definition) {
+        super(context, processor, definition);
+        this.processor = processor;
+    }
+
+    @Override
+    public String getPropertyName() {
+        return processor.getPropertyName();
+    }
+}