Search in sources :

Example 36 with JChannel

use of org.jgroups.JChannel in project JGroups by belaban.

the class MergeTest5 method checkInconsistencies.

protected static void checkInconsistencies(JChannel... channels) {
    for (JChannel ch : channels) {
        MERGE3 merge = ch.getProtocolStack().findProtocol(MERGE3.class);
        merge.checkInconsistencies();
    }
}
Also used : JChannel(org.jgroups.JChannel) MERGE3(org.jgroups.protocols.MERGE3)

Example 37 with JChannel

use of org.jgroups.JChannel in project JGroups by belaban.

the class JmxTest method testPrefix.

public void testPrefix() throws Exception {
    try (JChannel ch = new JChannel(Util.getTestStack()).name("A")) {
        JmxConfigurator.registerChannel(ch, server, new ObjectName("domain:userProvided=test42"), "cluster", true);
        JmxConfigurator.registerChannel(ch, server, new ObjectName("domain:userProvided=test42"), "cluster", true);
        Set<ObjectName> objectNames = server.queryNames(new ObjectName("domain:userProvided=test42,type=channel,*"), null);
        assert objectNames.size() == 2;
        JmxConfigurator.unregisterChannel(ch, server, new ObjectName("domain:userProvided=test42"), "cluster");
        objectNames = server.queryNames(new ObjectName("domain:userProvided=test42,type=channel,*"), null);
        // the duplicate is still registered
        assert objectNames.size() == 1;
    }
}
Also used : JChannel(org.jgroups.JChannel)

Example 38 with JChannel

use of org.jgroups.JChannel in project JGroups by belaban.

the class LockServiceConcurrencyTest method init.

protected void init(Class<? extends Locking> locking_class) throws Exception {
    a = new JChannel(Util.getTestStack(locking_class.getDeclaredConstructor().newInstance())).name("A");
    ls_a = new LockService(a);
    a.connect("LockServiceConcurrencyTest");
    b = new JChannel(Util.getTestStack(locking_class.getDeclaredConstructor().newInstance())).name("B");
    ls_b = new LockService(b);
    b.connect("LockServiceConcurrencyTest");
    Util.waitUntilAllChannelsHaveSameView(10000, 1000, a, b);
}
Also used : JChannel(org.jgroups.JChannel) LockService(org.jgroups.blocks.locking.LockService)

Example 39 with JChannel

use of org.jgroups.JChannel in project JGroups by belaban.

the class LockServiceConcurrencyTest method printLocks.

protected static void printLocks(JChannel... channels) {
    for (JChannel ch : channels) {
        Locking l = ch.getProtocolStack().findProtocol(Locking.class);
        System.out.printf("**** server locks on %s: %s\n", ch.getAddress(), l.printServerLocks());
    }
}
Also used : JChannel(org.jgroups.JChannel) Locking(org.jgroups.protocols.Locking)

Example 40 with JChannel

use of org.jgroups.JChannel in project JGroups by belaban.

the class MergeTest5 method injectView.

protected static void injectView(View view, JChannel... channels) {
    for (JChannel ch : channels) {
        GMS gms = ch.getProtocolStack().findProtocol(GMS.class);
        gms.installView(view);
    }
}
Also used : JChannel(org.jgroups.JChannel) GMS(org.jgroups.protocols.pbcast.GMS)

Aggregations

JChannel (org.jgroups.JChannel)119 GMS (org.jgroups.protocols.pbcast.GMS)22 NAKACK2 (org.jgroups.protocols.pbcast.NAKACK2)21 Protocol (org.jgroups.stack.Protocol)18 STABLE (org.jgroups.protocols.pbcast.STABLE)15 View (org.jgroups.View)14 Message (org.jgroups.Message)10 ArrayList (java.util.ArrayList)9 Address (org.jgroups.Address)7 IOException (java.io.IOException)6 Test (org.testng.annotations.Test)5 InetSocketAddress (java.net.InetSocketAddress)4 HashMap (java.util.HashMap)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)4 LockService (org.jgroups.blocks.locking.LockService)4 Test (org.junit.Test)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 ChannelBroadcastEndpointFactory (org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory)3