public void addNotificationListener(ObjectName objectName, NotificationListener listener) { addNotificationListener(objectName, listener, null); }
public void addNotificationListener(String objectName, NotificationListener listener) { addNotificationListener(createObjectName(objectName), listener, null); }
public void addNotificationListener(String objectName, NotificationListener listener, NotificationFilter filter) { addNotificationListener(createObjectName(objectName), listener, filter); }
getHelper().addNotificationListener(objectName, listener, filter);
@Test public void testSubscribeToJmxNotificationsDirectlyWithJmxHelper() throws Exception { StandardEmitterMBean mbean = jmxService.registerMBean(ImmutableList.of("one"), objectName); int sequence = 0; final List<Notification> received = Lists.newArrayList(); jmxHelper.addNotificationListener(jmxObjectName, new NotificationListener() { @Override public void handleNotification(Notification notif, Object callback) { received.add(notif); }}); final Notification notif = sendNotification(mbean, "one", sequence++, "abc"); Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT_MS), new Runnable() { @Override public void run() { assertEquals(received.size(), 1); assertNotificationsEqual(received.get(0), notif); }}); }
jmxHelper.addNotificationListener(jmxObjectName, new NotificationListener() { @Override public void handleNotification(Notification notif, Object callback) {