use of org.jgroups.stack.DiagnosticsHandler in project JGroups by belaban.
the class ProgrammaticUPerf2 method init.
public void init(String name, String bind_addr, int bind_port) throws Exception {
TP transport = channel.getProtocolStack().getTransport();
disp.setServerObject(this);
channel.setName(name);
if (bind_port > 0)
transport.setBindPort(bind_port);
if (bind_addr != null)
transport.setBindAddress(InetAddress.getByName(bind_addr));
channel.connect(groupname);
DiagnosticsHandler diag_handler = transport.getDiagnosticsHandler();
if (diag_handler != null) {
Set<DiagnosticsHandler.ProbeHandler> probe_handlers = diag_handler.getProbeHandlers();
probe_handlers.removeIf(probe_handler -> {
String[] keys = probe_handler.supportedKeys();
return keys != null && Stream.of(keys).anyMatch(s -> s.startsWith("jmx"));
});
}
transport.registerProbeHandler(h);
local_addr = channel.getAddress();
if (members.size() < 2)
return;
Address coord = members.get(0);
Config config = disp.callRemoteMethod(coord, new CustomCall(GET_CONFIG), new RequestOptions(ResponseMode.GET_ALL, 5000));
if (config != null) {
applyConfig(config);
System.out.println("Fetched config from " + coord + ": " + config + "\n");
} else
System.err.println("failed to fetch config from " + coord);
}
Aggregations