Skip to content

Commit

Permalink
added jmx
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Aug 24, 2009
1 parent 04879d4 commit 9224532
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/org/jgroups/protocols/MERGE2.java
Expand Up @@ -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"})
Expand All @@ -55,7 +55,14 @@ public class MERGE2 extends Protocol {
@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 ------------------------------------------------------ */

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9224532

Please sign in to comment.