Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added jmx

  • Loading branch information...
commit 9224532ef6730f70e211c7b60f86d22aee3b3cc1 1 parent 04879d4
@belaban authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 src/org/jgroups/protocols/MERGE2.java
View
18 src/org/jgroups/protocols/MERGE2.java
@@ -39,7 +39,7 @@
* Requires: FIND_INITIAL_MBRS event from below<br>
* Provides: sends MERGE event with list of coordinators up the stack<br>
* @author Bela Ban, Oct 16 2001
- * @version $Id: MERGE2.java,v 1.66 2009/08/17 06:49:35 belaban Exp $
+ * @version $Id: MERGE2.java,v 1.67 2009/08/24 06:41:32 belaban Exp $
*/
@MBean(description="Protocol to discover subgroups existing due to a network partition")
@DeprecatedProperty(names={"use_separate_thread"})
@@ -55,7 +55,14 @@
@ManagedAttribute(description="Maximum time between runs to discover other clusters", writable=true)
@Property(description="Upper bound in msec to run merge protocol. Default is 20000 msec")
private long max_interval=20000;
-
+
+
+ /* ---------------------------------------------- JMX -------------------------------------------------------- */
+ @ManagedAttribute
+ boolean isMergeTaskRunning() {
+ return task.isRunning();
+ }
+
/* --------------------------------------------- Fields ------------------------------------------------------ */
@@ -122,6 +129,9 @@ public void sendMergeSolicitation() {
task.findAndNotify();
}
+ @ManagedOperation public void startMergeTask() {task.start();}
+
+ @ManagedOperation public void stopMergeTask() {task.stop();}
public void stop() {
is_coord=false;
@@ -191,6 +201,10 @@ public synchronized void stop() {
}
}
+ public synchronized boolean isRunning() {
+ return future != null && !future.isDone() && !future.isCancelled();
+ }
+
public void findAndNotify() {
List<PingData> initial_mbrs=findInitialMembers();
Please sign in to comment.
Something went wrong with that request. Please try again.