Skip to content

Commit

Permalink
Corrects old name and var decl
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed May 31, 2023
1 parent 27dc057 commit 642ee12
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/org/datadog/jmxfetch/BeanNotificationListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
@Slf4j
class BeanNotificationListener implements NotificationListener {
private final BlockingQueue<MBeanServerNotification> 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
Expand All @@ -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);
}
}
}

0 comments on commit 642ee12

Please sign in to comment.