diff --git a/src/main/java/org/datadog/jmxfetch/BeanNotificationListener.java b/src/main/java/org/datadog/jmxfetch/BeanNotificationListener.java index 89c137a8a..026ca39f9 100644 --- a/src/main/java/org/datadog/jmxfetch/BeanNotificationListener.java +++ b/src/main/java/org/datadog/jmxfetch/BeanNotificationListener.java @@ -14,18 +14,17 @@ @Slf4j class BeanNotificationListener implements NotificationListener { private final BlockingQueue queue; - private final BeanTracker beanListener; + private final BeanTracker beanTracker; - public BeanNotificationListener(final BeanTracker bl) { - this.beanListener = bl; + public BeanNotificationListener(final BeanTracker bt) { + this.beanTracker = bt; this.queue = new LinkedBlockingQueue<>(); new Thread(new Runnable() { @Override public void run() { while (true) { - MBeanServerNotification mbs; try { - mbs = queue.take(); + MBeanServerNotification mbs = queue.take(); processMBeanServerNotification(mbs); } catch (InterruptedException e) { // ignore @@ -51,9 +50,9 @@ private void processMBeanServerNotification(MBeanServerNotification notif) { notif.getMessage()); ObjectName beanName = notif.getMBeanName(); if (notif.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) { - beanListener.trackBean(beanName); + beanTracker.trackBean(beanName); } else if (notif.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) { - beanListener.untrackBean(beanName); + beanTracker.untrackBean(beanName); } } } \ No newline at end of file