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();
}
}
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;
}
}
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);
}
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());
}
}
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);
}
}
Aggregations