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:36 UTC
[1/4] camel git commit: CAMEL-8526: Add more EIP as specialized mbeans
Repository: camel
Updated Branches:
refs/heads/master fbe97105b -> 542ab3e8c
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/6ad65fb0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6ad65fb0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6ad65fb0
Branch: refs/heads/master
Commit: 6ad65fb057fd437f2d0a0e24173546bb1d2ec245
Parents: fbe9710
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 22 08:34:17 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 22 08:34:17 2015 +0200
----------------------------------------------------------------------
.../mbean/ManagedConvertBodyMBean.java | 29 +++++++
.../DefaultManagementObjectStrategy.java | 6 +-
.../management/mbean/ManagedConvertBody.java | 46 ++++++++++
.../camel/model/ConvertBodyDefinition.java | 4 +-
.../camel/processor/ConvertBodyProcessor.java | 4 +
.../management/ManagedConvertBodyTest.java | 90 ++++++++++++++++++++
6 files changed, 176 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedConvertBodyMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedConvertBodyMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedConvertBodyMBean.java
new file mode 100644
index 0000000..74961db
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedConvertBodyMBean.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 ManagedConvertBodyMBean extends ManagedProcessorMBean {
+
+ @ManagedAttribute(description = "The java type to convert to")
+ String getType();
+
+ @ManagedAttribute(description = "To use a specific charset when converting")
+ String getCharset();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/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 2a870b6..460ee47 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
@@ -38,6 +38,7 @@ import org.apache.camel.management.mbean.ManagedBrowsableEndpoint;
import org.apache.camel.management.mbean.ManagedCamelContext;
import org.apache.camel.management.mbean.ManagedComponent;
import org.apache.camel.management.mbean.ManagedConsumer;
+import org.apache.camel.management.mbean.ManagedConvertBody;
import org.apache.camel.management.mbean.ManagedDelayer;
import org.apache.camel.management.mbean.ManagedDynamicRouter;
import org.apache.camel.management.mbean.ManagedEndpoint;
@@ -76,6 +77,7 @@ import org.apache.camel.model.ModelCamelContext;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RecipientListDefinition;
import org.apache.camel.model.ThreadsDefinition;
+import org.apache.camel.processor.ConvertBodyProcessor;
import org.apache.camel.processor.Delayer;
import org.apache.camel.processor.DynamicRouter;
import org.apache.camel.processor.Enricher;
@@ -234,7 +236,9 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
}
// look for specialized processor which we should prefer to use
- if (target instanceof Delayer) {
+ if (target instanceof ConvertBodyProcessor) {
+ answer = new ManagedConvertBody(context, (ConvertBodyProcessor) target, definition);
+ } else if (target instanceof Delayer) {
answer = new ManagedDelayer(context, (Delayer) target, definition);
} else if (target instanceof Throttler) {
answer = new ManagedThrottler(context, (Throttler) target, definition);
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConvertBody.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConvertBody.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConvertBody.java
new file mode 100644
index 0000000..01aae9f
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedConvertBody.java
@@ -0,0 +1,46 @@
+/**
+ * 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.ManagedConvertBodyMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.ConvertBodyProcessor;
+
+/**
+ * @version
+ */
+@ManagedResource(description = "Managed ConvertBody")
+public class ManagedConvertBody extends ManagedProcessor implements ManagedConvertBodyMBean {
+ private final ConvertBodyProcessor processor;
+
+ public ManagedConvertBody(CamelContext context, ConvertBodyProcessor processor, ProcessorDefinition<?> definition) {
+ super(context, processor, definition);
+ this.processor = processor;
+ }
+
+ @Override
+ public String getType() {
+ return processor.getType().getCanonicalName();
+ }
+
+ @Override
+ public String getCharset() {
+ return processor.getCharset();
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
index 402790e..9e5ae31 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ConvertBodyDefinition.java
@@ -52,12 +52,12 @@ public class ConvertBodyDefinition extends NoOutputDefinition<ConvertBodyDefinit
public ConvertBodyDefinition(Class<?> typeClass) {
setTypeClass(typeClass);
- setType(typeClass.getName());
+ setType(typeClass.getCanonicalName());
}
public ConvertBodyDefinition(Class<?> typeClass, String charset) {
setTypeClass(typeClass);
- setType(typeClass.getName());
+ setType(typeClass.getCanonicalName());
setCharset(charset);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
index d42eae4..6723731 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
@@ -125,6 +125,10 @@ public class ConvertBodyProcessor extends ServiceSupport implements AsyncProcess
return type;
}
+ public String getCharset() {
+ return charset;
+ }
+
@Override
protected void doStart() throws Exception {
// noop
http://git-wip-us.apache.org/repos/asf/camel/blob/6ad65fb0/camel-core/src/test/java/org/apache/camel/management/ManagedConvertBodyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedConvertBodyTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedConvertBodyTest.java
new file mode 100644
index 0000000..f070426
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedConvertBodyTest.java
@@ -0,0 +1,90 @@
+/**
+ * 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;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.openmbean.TabularData;
+
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version
+ */
+public class ManagedConvertBodyTest extends ManagementTestSupport {
+
+ public void testManageConvertBody() throws Exception {
+ // JMX tests dont work well on AIX CI servers (hangs them)
+ if (isPlatform("aix")) {
+ return;
+ }
+
+ MockEndpoint foo = getMockEndpoint("mock:foo");
+ foo.expectedMessageCount(1);
+
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "123");
+
+ assertMockEndpointsSatisfied();
+
+ // get the stats for the route
+ MBeanServer mbeanServer = getMBeanServer();
+
+ // get the object name for the delayer
+ ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"mysend\"");
+
+ // should be on route1
+ String routeId = (String) mbeanServer.getAttribute(on, "RouteId");
+ assertEquals("route1", routeId);
+
+ String camelId = (String) mbeanServer.getAttribute(on, "CamelId");
+ assertEquals("camel-1", camelId);
+
+ String state = (String) mbeanServer.getAttribute(on, "State");
+ assertEquals(ServiceStatus.Started.name(), state);
+
+ String uri = (String) mbeanServer.getAttribute(on, "Type");
+ assertEquals("byte[]", uri);
+
+ TabularData data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{false}, new String[]{"boolean"});
+ assertNotNull(data);
+ assertEquals(2, data.size());
+
+ data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{true}, new String[]{"boolean"});
+ assertNotNull(data);
+ assertEquals(4, data.size());
+
+ String json = (String) mbeanServer.invoke(on, "informationJson", null, null);
+ assertNotNull(json);
+ assertTrue(json.contains("\"description\": \"Converts the message body to another type"));
+ assertTrue(json.contains("byte[]"));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .convertBodyTo(byte[].class).id("mysend")
+ .to("mock:foo");
+ }
+ };
+ }
+
+}
[4/4] camel git commit: CAMEL-8526: Add more EIP as specialized mbeans
Posted by da...@apache.org.
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/542ab3e8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/542ab3e8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/542ab3e8
Branch: refs/heads/master
Commit: 542ab3e8c7e6fd74bf7053b8a75039dc0f0c5094
Parents: 1db6c64
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 22 09:46:23 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 22 09:53:18 2015 +0200
----------------------------------------------------------------------
.../management/mbean/ManagedProcessMBean.java | 29 ++++++
.../DefaultManagementObjectStrategy.java | 7 +-
.../camel/management/mbean/ManagedProcess.java | 62 ++++++++++++
.../camel/management/ManagedProcessTest.java | 100 +++++++++++++++++++
.../camel/management/ManagementTestSupport.java | 7 --
.../camel/management/MyDummyProcessor.java | 28 ++++++
6 files changed, 224 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessMBean.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessMBean.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessMBean.java
new file mode 100644
index 0000000..1b1a2ab
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedProcessMBean.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 ManagedProcessMBean extends ManagedProcessorMBean {
+
+ @ManagedAttribute(description = "Reference to the Processor to lookup in the registry to use")
+ String getRef();
+
+ @ManagedAttribute(description = "The class name of the Processor in use (may be null if not resolved yet)")
+ String getProcessorClassName();
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/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 be87c46..a86f6c2 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
@@ -50,6 +50,7 @@ import org.apache.camel.management.mbean.ManagedIdempotentConsumer;
import org.apache.camel.management.mbean.ManagedLoop;
import org.apache.camel.management.mbean.ManagedMulticast;
import org.apache.camel.management.mbean.ManagedPollEnricher;
+import org.apache.camel.management.mbean.ManagedProcess;
import org.apache.camel.management.mbean.ManagedProcessor;
import org.apache.camel.management.mbean.ManagedProducer;
import org.apache.camel.management.mbean.ManagedRecipientList;
@@ -78,6 +79,7 @@ import org.apache.camel.management.mbean.ManagedTransformer;
import org.apache.camel.management.mbean.ManagedValidate;
import org.apache.camel.management.mbean.ManagedWireTapProcessor;
import org.apache.camel.model.ModelCamelContext;
+import org.apache.camel.model.ProcessDefinition;
import org.apache.camel.model.ProcessorDefinition;
import org.apache.camel.model.RecipientListDefinition;
import org.apache.camel.model.ThreadsDefinition;
@@ -243,7 +245,6 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
return false;
}
- // look for specialized processor which we should prefer to use
if (target instanceof ConvertBodyProcessor) {
answer = new ManagedConvertBody(context, (ConvertBodyProcessor) target, definition);
} else if (target instanceof Delayer) {
@@ -336,7 +337,9 @@ public class DefaultManagementObjectStrategy implements ManagementObjectStrategy
}
}
- if (answer == null) {
+ if (answer == null && definition instanceof ProcessDefinition) {
+ answer = new ManagedProcess(context, target, (ProcessDefinition) definition);
+ } else if (answer == null) {
// fallback to a generic processor
answer = new ManagedProcessor(context, target, definition);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcess.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcess.java b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcess.java
new file mode 100644
index 0000000..34720fa
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedProcess.java
@@ -0,0 +1,62 @@
+/**
+ * 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.DelegateProcessor;
+import org.apache.camel.Processor;
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.api.management.mbean.ManagedProcessMBean;
+import org.apache.camel.model.ProcessDefinition;
+import org.apache.camel.util.ObjectHelper;
+
+/**
+ * @version
+ */
+@ManagedResource(description = "Managed Process")
+public class ManagedProcess extends ManagedProcessor implements ManagedProcessMBean {
+ private final Processor processor;
+ private String processorClassName;
+
+ public ManagedProcess(CamelContext context, Processor processor, ProcessDefinition definition) {
+ super(context, processor, definition);
+ this.processor = processor;
+ }
+
+ @Override
+ public ProcessDefinition getDefinition() {
+ return (ProcessDefinition) super.getDefinition();
+ }
+
+ @Override
+ public String getRef() {
+ return getDefinition().getRef();
+ }
+
+ @Override
+ public String getProcessorClassName() {
+ if (processorClassName != null) {
+ return processorClassName;
+ }
+ Processor target = processor;
+ if (target instanceof DelegateProcessor) {
+ target = ((DelegateProcessor) target).getProcessor();
+ }
+ processorClassName = ObjectHelper.className(target);
+ return processorClassName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/camel-core/src/test/java/org/apache/camel/management/ManagedProcessTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedProcessTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedProcessTest.java
new file mode 100644
index 0000000..334a67c
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedProcessTest.java
@@ -0,0 +1,100 @@
+/**
+ * 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;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.openmbean.TabularData;
+
+import org.apache.camel.ServiceStatus;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.JndiRegistry;
+
+/**
+ * @version
+ */
+public class ManagedProcessTest extends ManagementTestSupport {
+
+ @Override
+ protected JndiRegistry createRegistry() throws Exception {
+ JndiRegistry jndi = super.createRegistry();
+ jndi.bind("foo", new MyDummyProcessor());
+ return jndi;
+ }
+
+ public void testManageProcess() throws Exception {
+ // JMX tests dont work well on AIX CI servers (hangs them)
+ if (isPlatform("aix")) {
+ return;
+ }
+
+ MockEndpoint foo = getMockEndpoint("mock:foo");
+ foo.expectedMessageCount(1);
+
+ template.sendBodyAndHeader("direct:start", "Hello World", "foo", "123");
+
+ assertMockEndpointsSatisfied();
+
+ // get the stats for the route
+ MBeanServer mbeanServer = getMBeanServer();
+
+ // get the object name for the delayer
+ ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=processors,name=\"mysend\"");
+
+ // should be on route1
+ String routeId = (String) mbeanServer.getAttribute(on, "RouteId");
+ assertEquals("route1", routeId);
+
+ String camelId = (String) mbeanServer.getAttribute(on, "CamelId");
+ assertEquals("camel-1", camelId);
+
+ String state = (String) mbeanServer.getAttribute(on, "State");
+ assertEquals(ServiceStatus.Started.name(), state);
+
+ String ref = (String) mbeanServer.getAttribute(on, "Ref");
+ assertEquals("foo", ref);
+
+ String processorClassName = (String) mbeanServer.getAttribute(on, "ProcessorClassName");
+ assertEquals("org.apache.camel.management.MyDummyProcessor", processorClassName);
+
+ TabularData data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{false}, new String[]{"boolean"});
+ assertNotNull(data);
+ assertEquals(2, data.size());
+
+ data = (TabularData) mbeanServer.invoke(on, "explain", new Object[]{true}, new String[]{"boolean"});
+ assertNotNull(data);
+ assertEquals(3, data.size());
+
+ String json = (String) mbeanServer.invoke(on, "informationJson", null, null);
+ assertNotNull(json);
+ assertTrue(json.contains("\"description\": \"Calls a Camel processor."));
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start")
+ .process("foo").id("mysend")
+ .to("mock:foo");
+ }
+ };
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/camel-core/src/test/java/org/apache/camel/management/ManagementTestSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagementTestSupport.java b/camel-core/src/test/java/org/apache/camel/management/ManagementTestSupport.java
index 8680fa7..cb10885 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagementTestSupport.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagementTestSupport.java
@@ -18,9 +18,7 @@ package org.apache.camel.management;
import javax.management.MBeanServer;
-import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
-import org.apache.camel.impl.DefaultCamelContext;
/**
* Base class for JMX tests.
@@ -34,11 +32,6 @@ public abstract class ManagementTestSupport extends ContextTestSupport {
return true;
}
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = new DefaultCamelContext();
- return context;
- }
-
protected MBeanServer getMBeanServer() {
return context.getManagementStrategy().getManagementAgent().getMBeanServer();
}
http://git-wip-us.apache.org/repos/asf/camel/blob/542ab3e8/camel-core/src/test/java/org/apache/camel/management/MyDummyProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/MyDummyProcessor.java b/camel-core/src/test/java/org/apache/camel/management/MyDummyProcessor.java
new file mode 100644
index 0000000..1a8ef4b
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/management/MyDummyProcessor.java
@@ -0,0 +1,28 @@
+/**
+ * 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;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+
+public class MyDummyProcessor implements Processor {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ exchange.getIn().setBody("Bye World");
+ }
+}
[2/4] camel git commit: CAMEL-8526: Add more EIP as specialized mbeans
Posted by da...@apache.org.
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();
+ }
+}
[3/4] camel git commit: CAMEL-8526: Add more EIP as specialized mbeans
Posted by da...@apache.org.
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;
+ }
+}