@ServerEndpoint("/monitoredEndpoint1")
public class MonitoredEndpoint1 {
@OnOpen
public void onOpen(Session session) throws IOException {
if (isEndpointRegistered("/mbean-test", new EndpointClassNamePathPair("/monitoredEndpoint1", MonitoredEndpoint1.class.getName()))
&& isEndpointRegistered("/mbean-test", new EndpointClassNamePathPair("/monitoredEndpoint2", MonitoredEndpoint2.class.getName()))) {
session.getBasicRemote().sendText("OK");
return;
}
session.getBasicRemote().sendText("NOK");
}