@Test public void testJmxNotificationSubscriptionForSensor() throws Exception { final String one = "notification.one", two = "notification.two"; final StandardEmitterMBean mbean = jmxService.registerMBean(ImmutableList.of(one, two), objectName); final AtomicInteger sequence = new AtomicInteger(0); feed = JmxFeed.builder() .entity(entity) .subscribeToNotification(new JmxNotificationSubscriptionConfig<Integer>(intAttribute) .objectName(objectName) .notificationFilter(JmxNotificationFilters.matchesType(one))) .build(); Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT_MS), new Runnable() { public void run() { sendNotification(mbean, one, sequence.getAndIncrement(), 123); assertEquals(entity.getAttribute(intAttribute), (Integer)123); }}); sendNotification(mbean, two, sequence.getAndIncrement(), -1); Asserts.succeedsEventually(ImmutableMap.of("timeout", TIMEOUT_MS), new Runnable() { public void run() { assertEquals(entity.getAttribute(intAttribute), (Integer)123); }}); }
public static Builder builder() { return new Builder(); }
JmxFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } }
JmxFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } JmxFeed(); protected  JmxFeed(Builder builder); }
JmxFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } JmxFeed(); protected  JmxFeed(Builder builder); static Builder builder(); @Override void setEntity(EntityLocal entity); String getJmxUri(); @Override String toString(); }
JmxFeed extends AbstractFeed { public static Builder builder() { return new Builder(); } JmxFeed(); protected  JmxFeed(Builder builder); static Builder builder(); @Override void setEntity(EntityLocal entity); String getJmxUri(); @Override String toString(); static final Logger log; static final long JMX_CONNECTION_TIMEOUT_MS; static final ConfigKey<JmxHelper> HELPER; static final ConfigKey<Boolean> OWN_HELPER; static final ConfigKey<String> JMX_URI; static final ConfigKey<Long> JMX_CONNECTION_TIMEOUT; @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<String, JmxAttributePollConfig<?>>> ATTRIBUTE_POLLS; @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<List<?>, JmxOperationPollConfig<?>>> OPERATION_POLLS; @SuppressWarnings("serial")
    static final ConfigKey<SetMultimap<NotificationFilter, JmxNotificationSubscriptionConfig<?>>> NOTIFICATION_SUBSCRIPTIONS; }