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

Branch: refs/heads/master
Commit: 10af88022d486acafd7b6999d29b9c6e7864374a
Parents: 687eda1
Author: Claus Ibsen <davscl...@apache.org>
Authored: Wed Jul 22 10:53:44 2015 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed Jul 22 10:53:44 2015 +0200

----------------------------------------------------------------------
 .../api/management/mbean/ManagedStopMBean.java  | 21 +++++++++++
 .../DefaultManagementObjectStrategy.java        |  4 +++
 .../camel/management/mbean/ManagedStop.java     | 37 ++++++++++++++++++++
 3 files changed, 62 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/10af8802/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedStopMBean.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedStopMBean.java
 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedStopMBean.java
new file mode 100644
index 0000000..c1fdab5
--- /dev/null
+++ 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedStopMBean.java
@@ -0,0 +1,21 @@
+/**
+ * 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;
+
+public interface ManagedStopMBean extends ManagedProcessorMBean {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/10af8802/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 12fbff1..1704715 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
@@ -74,6 +74,7 @@ import 
org.apache.camel.management.mbean.ManagedSetExchangePattern;
 import org.apache.camel.management.mbean.ManagedSetHeader;
 import org.apache.camel.management.mbean.ManagedSetProperty;
 import org.apache.camel.management.mbean.ManagedSplitter;
+import org.apache.camel.management.mbean.ManagedStop;
 import org.apache.camel.management.mbean.ManagedSuspendableRoute;
 import org.apache.camel.management.mbean.ManagedThreadPool;
 import org.apache.camel.management.mbean.ManagedThreads;
@@ -115,6 +116,7 @@ import org.apache.camel.processor.SetBodyProcessor;
 import org.apache.camel.processor.SetHeaderProcessor;
 import org.apache.camel.processor.SetPropertyProcessor;
 import org.apache.camel.processor.Splitter;
+import org.apache.camel.processor.StopProcessor;
 import org.apache.camel.processor.StreamResequencer;
 import org.apache.camel.processor.ThreadsProcessor;
 import org.apache.camel.processor.Throttler;
@@ -301,6 +303,8 @@ public class DefaultManagementObjectStrategy implements 
ManagementObjectStrategy
                 answer = new ManagedSetExchangePattern(context, 
(ExchangePatternProcessor) target, definition);
             } else if (target instanceof ScriptProcessor) {
                 answer = new ManagedScript(context, (ScriptProcessor) target, 
definition);
+            } else if (target instanceof StopProcessor) {
+                answer = new ManagedStop(context, (StopProcessor) target, 
definition);
             } else if (target instanceof ThreadsProcessor) {
                 answer = new ManagedThreads(context, (ThreadsProcessor) 
target, definition);
             } else if (target instanceof TransformProcessor) {

http://git-wip-us.apache.org/repos/asf/camel/blob/10af8802/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedStop.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedStop.java 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedStop.java
new file mode 100644
index 0000000..8eff563
--- /dev/null
+++ 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedStop.java
@@ -0,0 +1,37 @@
+/**
+ * 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.ManagedStopMBean;
+import org.apache.camel.model.ProcessorDefinition;
+import org.apache.camel.processor.StopProcessor;
+
+/**
+ * @version 
+ */
+@ManagedResource(description = "Managed Stop")
+public class ManagedStop extends ManagedProcessor implements ManagedStopMBean {
+    private final StopProcessor processor;
+
+    public ManagedStop(CamelContext context, StopProcessor processor, 
ProcessorDefinition<?> definition) {
+        super(context, processor, definition);
+        this.processor = processor;
+    }
+
+}

Reply via email to