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:38 UTC

[3/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/1db6c64f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1db6c64f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1db6c64f

Branch: refs/heads/master
Commit: 1db6c64f992bbf9a65773b86afd282a5d1d18ea2
Parents: 3e1c7f6
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 22 09:32:45 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 22 09:32:45 2015 +0200

----------------------------------------------------------------------
 .../mbean/ManagedRemoveHeadersMBean.java        | 29 +++++++++++
 .../mbean/ManagedRemovePropertiesMBean.java     | 29 +++++++++++
 .../DefaultManagementObjectStrategy.java        |  8 +++
 .../management/mbean/ManagedRemoveHeaders.java  | 52 ++++++++++++++++++++
 .../mbean/ManagedRemoveProperties.java          | 52 ++++++++++++++++++++
 5 files changed, 170 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1db6c64f/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeadersMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeadersMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeadersMBean.java
new file mode 100644
index 0000000..c390616
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemoveHeadersMBean.java
@@ -0,0 +1,29 @@
+/**
+ * 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 ManagedRemoveHeadersMBean extends ManagedProcessorMBean {
+
+    @ManagedAttribute(description = "Name or pattern of headers to remove")
+    String getPattern();
+
+    @ManagedAttribute(description = "Name or pattern of headers to not remove")
+    String getExcludePattern();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1db6c64f/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertiesMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertiesMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertiesMBean.java
new file mode 100644
index 0000000..231233b
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedRemovePropertiesMBean.java
@@ -0,0 +1,29 @@
+/**
+ * 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 ManagedRemovePropertiesMBean extends ManagedProcessorMBean {
+
+    @ManagedAttribute(description = "Name or pattern of exchange properties to remove")
+    String getPattern();
+
+    @ManagedAttribute(description = "Name or pattern of exchange properties to not remove")
+    String getExcludePattern();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1db6c64f/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 f62f8ab..be87c46 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
@@ -54,6 +54,8 @@ 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.ManagedRemoveHeaders;
+import org.apache.camel.management.mbean.ManagedRemoveProperties;
 import org.apache.camel.management.mbean.ManagedRemoveProperty;
 import org.apache.camel.management.mbean.ManagedResequencer;
 import org.apache.camel.management.mbean.ManagedRoute;
@@ -91,6 +93,8 @@ 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.RemoveHeadersProcessor;
+import org.apache.camel.processor.RemovePropertiesProcessor;
 import org.apache.camel.processor.RemovePropertyProcessor;
 import org.apache.camel.processor.Resequencer;
 import org.apache.camel.processor.RoutingSlip;
@@ -270,10 +274,14 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
                 answer = new ManagedSetBody(context, (SetBodyProcessor) target, 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);
             } 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);
             } else if (target instanceof ThreadsProcessor) {

http://git-wip-us.apache.org/repos/asf/camel/blob/1db6c64f/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeaders.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeaders.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeaders.java
new file mode 100644
index 0000000..723e4d7
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveHeaders.java
@@ -0,0 +1,52 @@
+/**
+ * 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.ManagedRemoveHeadersMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.RemoveHeadersProcessor;
+
+/**
+ * @version 
+ */
+@ManagedResource(description = "Managed RemoveHeaders")
+public class ManagedRemoveHeaders extends ManagedProcessor implements ManagedRemoveHeadersMBean {
+    private final RemoveHeadersProcessor processor;
+    private final String exclude;
+
+    public ManagedRemoveHeaders(CamelContext context, RemoveHeadersProcessor processor, ProcessorDefinition<?> definition) {
+        super(context, processor, definition);
+        this.processor = processor;
+        if (processor.getExcludePattern() != null) {
+            exclude = processor.getExcludePattern().toString();
+        } else {
+            exclude = null;
+        }
+    }
+
+    @Override
+    public String getPattern() {
+        return processor.getPattern();
+    }
+
+    @Override
+    public String getExcludePattern() {
+        return exclude;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/1db6c64f/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperties.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperties.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperties.java
new file mode 100644
index 0000000..f01a0a8
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRemoveProperties.java
@@ -0,0 +1,52 @@
+/**
+ * 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.ManagedRemovePropertiesMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.RemovePropertiesProcessor;
+
+/**
+ * @version 
+ */
+@ManagedResource(description = "Managed RemoveProperties")
+public class ManagedRemoveProperties extends ManagedProcessor implements ManagedRemovePropertiesMBean {
+    private final RemovePropertiesProcessor processor;
+    private final String exclude;
+
+    public ManagedRemoveProperties(CamelContext context, RemovePropertiesProcessor processor, ProcessorDefinition<?> definition) {
+        super(context, processor, definition);
+        this.processor = processor;
+        if (processor.getExcludePattern() != null) {
+            exclude = processor.getExcludePattern().toString();
+        } else {
+            exclude = null;
+        }
+    }
+
+    @Override
+    public String getPattern() {
+        return processor.getPattern();
+    }
+
+    @Override
+    public String getExcludePattern() {
+        return exclude;
+    }
+}