use of org.jgroups.JChannel in project JGroups by belaban.
the class FalseSuspicionTest method getTotalSuspectedMembers.
protected int getTotalSuspectedMembers() {
int total = 0;
for (JChannel ch : channels) {
FD_SOCK fd_sock = ch.getProtocolStack().findProtocol(FD_SOCK.class);
total += fd_sock.getNumSuspectedMembers();
}
return total;
}
use of org.jgroups.JChannel in project JGroups by belaban.
the class LockServiceTest method setProp.
protected static void setProp(Class<? extends Locking> clazz, boolean value, JChannel... channels) {
for (JChannel ch : channels) {
Locking prot = ch.getProtocolStack().findProtocol(clazz);
prot.useThreadIdForLockOwner(value);
}
}
use of org.jgroups.JChannel in project JGroups by belaban.
the class NAKACK_RetransmitTest method stopRetransmission.
protected static void stopRetransmission(JChannel... channels) throws Exception {
for (JChannel ch : channels) {
NAKACK2 nak = ch.getProtocolStack().findProtocol(NAKACK2.class);
STOP_RETRANSMISSION.invoke(nak);
}
}
use of org.jgroups.JChannel in project JGroups by belaban.
the class FILE_PING_Test method injectView.
protected static void injectView(JChannel... channels) {
Address coord = channels[0].getAddress();
long current_view_id = ((GMS) channels[0].getProtocolStack().findProtocol(GMS.class)).view().getViewId().getId();
View v = View.create(coord, current_view_id + 1, Stream.of(channels).map(JChannel::getAddress).collect(Collectors.toList()));
Stream.of(channels).forEach(ch -> ((GMS) ch.getProtocolStack().findProtocol(GMS.class)).installView(v));
}
use of org.jgroups.JChannel in project JGroups by belaban.
the class TLSTest method verifyForbiddenJoiner.
private void verifyForbiddenJoiner(String name) throws Exception {
JChannel channel = create(name);
GMS gms = channel.getProtocolStack().findProtocol(GMS.class);
gms.setMaxJoinAttempts(1);
try {
channel.connect(cluster_name);
} catch (Exception ex) {
}
for (int i = 0; i < 10; i++) {
if (a.getView().size() > 3)
break;
Util.sleep(500);
}
Arrays.asList(a, b, c).forEach(ch -> {
View view = ch.getView();
assertEquals(3, view.size());
assertTrue(view.containsMembers(a.getAddress(), b.getAddress(), c.getAddress()));
});
}
Aggregations