Search in sources :

Example 1 with SUPERVISOR

use of org.jgroups.protocols.rules.SUPERVISOR in project JGroups by belaban.

the class SUPERVISOR_Test method createChannel.

protected JChannel createChannel(String name) throws Exception {
    JChannel ch = new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new FD(), new NAKACK2().setValue("use_mcast_xmit", false), new UNICAST3(), new STABLE().setValue("max_bytes", 50000), new GMS().setValue("print_local_addr", false), new SUPERVISOR());
    ch.setName(name);
    return ch;
}
Also used : NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) SUPERVISOR(org.jgroups.protocols.rules.SUPERVISOR) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS)

Example 2 with SUPERVISOR

use of org.jgroups.protocols.rules.SUPERVISOR in project JGroups by belaban.

the class SUPERVISOR_Test method testFailureDetectionRule.

public void testFailureDetectionRule() {
    SUPERVISOR sva = (SUPERVISOR) a.getProtocolStack().findProtocol(SUPERVISOR.class);
    sva.installRule(500, new RestartFailureDetector());
    SUPERVISOR svb = (SUPERVISOR) b.getProtocolStack().findProtocol(SUPERVISOR.class);
    svb.installRule(500, new RestartFailureDetector());
    assertFailureDetectorRunning(a, b);
    System.out.println("stopping failure detection, waiting for failure detection restart rule to restart failure detection");
    stopFailureDetection(a, b);
    for (int i = 0; i < 10; i++) {
        if (isFailureDetectionRunning(a, b))
            break;
        Util.sleep(500);
    }
    assertFailureDetectorRunning(a, b);
}
Also used : SUPERVISOR(org.jgroups.protocols.rules.SUPERVISOR)

Aggregations

SUPERVISOR (org.jgroups.protocols.rules.SUPERVISOR)2 JChannel (org.jgroups.JChannel)1 GMS (org.jgroups.protocols.pbcast.GMS)1 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)1 STABLE (org.jgroups.protocols.pbcast.STABLE)1