Search in sources :

Example 11 with UNICAST3

use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.

the class MessageBeforeConnectedTest method createChannel.

protected static JChannel createChannel(String name) throws Exception {
    JChannel ch = new JChannel(new SHARED_LOOPBACK(), new SHARED_LOOPBACK_PING(), new NAKACK2().setBecomeServerQueueSize(10), new UNICAST3(), new GMS().printLocalAddress(false));
    ch.setName(name);
    return ch;
}
Also used : SHARED_LOOPBACK(org.jgroups.protocols.SHARED_LOOPBACK) NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) SHARED_LOOPBACK_PING(org.jgroups.protocols.SHARED_LOOPBACK_PING) GMS(org.jgroups.protocols.pbcast.GMS) UNICAST3(org.jgroups.protocols.UNICAST3)

Example 12 with UNICAST3

use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.

the class MergeTest3 method createChannel.

protected static JChannel createChannel(String name) throws Exception {
    JChannel retval = new JChannel(new SHARED_LOOPBACK(), new DISCARD().discardAll(true), new SHARED_LOOPBACK_PING(), new NAKACK2().useMcastXmit(false).logDiscardMessages(false).logNotFoundMessages(false), new UNICAST3(), new STABLE().setMaxBytes(50000), new GMS().printLocalAddress(false).setJoinTimeout(1).setLeaveTimeout(100).setMergeTimeout(5000).logViewWarnings(false).setViewAckCollectionTimeout(50).logCollectMessages(false)).name(name);
    retval.connect("MergeTest3");
    JmxConfigurator.registerChannel(retval, Util.getMBeanServer(), name, retval.getClusterName(), true);
    return retval;
}
Also used : SHARED_LOOPBACK(org.jgroups.protocols.SHARED_LOOPBACK) NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) DISCARD(org.jgroups.protocols.DISCARD) SHARED_LOOPBACK_PING(org.jgroups.protocols.SHARED_LOOPBACK_PING) STABLE(org.jgroups.protocols.pbcast.STABLE) GMS(org.jgroups.protocols.pbcast.GMS) UNICAST3(org.jgroups.protocols.UNICAST3)

Example 13 with UNICAST3

use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.

the class ForkChannelTest method testSimpleSend.

public void testSimpleSend() throws Exception {
    a.connect(CLUSTER);
    fc1 = new ForkChannel(a, "stack", "fc1").connect("bla");
    fc2 = new ForkChannel(a, "stack", "fc2").connect("bla");
    b = new JChannel(protocols()).name("B").connect(CLUSTER);
    fc3 = new ForkChannel(b, "stack", "fc1").connect("bla");
    fc4 = new ForkChannel(b, "stack", "fc2").connect("bla");
    MyReceiver<Message> r3 = new MyReceiver<Message>().rawMsgs(true), r4 = new MyReceiver<Message>().rawMsgs(true);
    fc3.setReceiver(r3);
    fc4.setReceiver(r4);
    fc1.send(null, "hello");
    List<Message> l3 = r3.list(), l4 = r4.list();
    Util.waitUntil(10000, 500, () -> !l3.isEmpty() || !l4.isEmpty());
    assert !l3.isEmpty();
    assert l4.isEmpty();
    l3.clear();
    Address dest = fc3.getAddress();
    fc1.send(dest, "hello2");
    for (int i = 0; i < 10; i++) {
        if (!l3.isEmpty() || !l4.isEmpty())
            break;
        Util.sleep(1000);
    }
    assert !l3.isEmpty();
    assert l4.isEmpty();
    l3.clear();
    // send to non-existing member:
    UNICAST3 ucast = a.getProtocolStack().findProtocol(UNICAST3.class);
    ucast.setConnCloseTimeout(10000);
    Util.close(fc3, fc4, b);
    Util.sleep(1000);
    System.out.printf("---- sending message to non-existing member %s\n", dest);
    fc1.send(dest, "hello3");
    for (int i = 0; i < 10; i++) {
        if (!l3.isEmpty() || !l4.isEmpty())
            break;
        Util.sleep(500);
    }
    assert l3.isEmpty();
    assert l4.isEmpty();
}
Also used : ForkChannel(org.jgroups.fork.ForkChannel) UNICAST3(org.jgroups.protocols.UNICAST3)

Example 14 with UNICAST3

use of org.jgroups.protocols.UNICAST3 in project JGroups by belaban.

the class FrozenCoordinatorTest method create.

protected JChannel create(String name) throws Exception {
    FILE_PING ping = new FILE_PING().setLocation(root_dir.toString()).removeAllDataOnViewChange(true);
    Protocol[] protocols = { new SHARED_LOOPBACK(), ping, new NAKACK2(), new UNICAST3(), new STABLE(), new GMS().setJoinTimeout(1000).setMaxJoinAttempts(5) };
    return new JChannel(protocols).name(name);
}
Also used : SHARED_LOOPBACK(org.jgroups.protocols.SHARED_LOOPBACK) FILE_PING(org.jgroups.protocols.FILE_PING) NAKACK2(org.jgroups.protocols.pbcast.NAKACK2) JChannel(org.jgroups.JChannel) STABLE(org.jgroups.protocols.pbcast.STABLE) Protocol(org.jgroups.stack.Protocol) GMS(org.jgroups.protocols.pbcast.GMS) UNICAST3(org.jgroups.protocols.UNICAST3)

Aggregations

UNICAST3 (org.jgroups.protocols.UNICAST3)14 GMS (org.jgroups.protocols.pbcast.GMS)9 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)9 SHARED_LOOPBACK (org.jgroups.protocols.SHARED_LOOPBACK)6 STABLE (org.jgroups.protocols.pbcast.STABLE)6 JChannel (org.jgroups.JChannel)4 SHARED_LOOPBACK_PING (org.jgroups.protocols.SHARED_LOOPBACK_PING)4 Message (org.jgroups.Message)3 Protocol (org.jgroups.stack.Protocol)3 ArrayList (java.util.ArrayList)2 Event (org.jgroups.Event)2 DISCARD (org.jgroups.protocols.DISCARD)2 PING (org.jgroups.protocols.PING)2 TCP (org.jgroups.protocols.TCP)2 ByteBuffer (java.nio.ByteBuffer)1 Collection (java.util.Collection)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 BlockingQueue (java.util.concurrent.BlockingQueue)1 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)1 CountDownLatch (java.util.concurrent.CountDownLatch)1