public synchronized void addPerfNotificationListener(NotificationListener listener, Object handback) { timer.addNotificationListener(listener, new NotificationFilter() { @Override public boolean isNotificationEnabled(Notification notification) { return "perfTimer".equals(notification.getType()); } }, handback); perfTimerListeners++; manageTimer(); }
public synchronized void addStructuralNotificationListener(NotificationListener listener, Object handback) { timer.addNotificationListener(listener, new NotificationFilter() { @Override public boolean isNotificationEnabled(Notification notification) { return "structTimer".equals(notification.getType()); } }, handback); structuralTimerListeners++; manageTimer(); }
public synchronized void addPerfNotificationListener(NotificationListener listener, Object handback) { timer.addNotificationListener(listener, new NotificationFilter() { @Override public boolean isNotificationEnabled(Notification notification) { return "perfTimer".equals(notification.getType()); } }, handback); perfTimerListeners++; manageTimer(); }
public synchronized void addStructuralNotificationListener(NotificationListener listener, Object handback) { timer.addNotificationListener(listener, new NotificationFilter() { @Override public boolean isNotificationEnabled(Notification notification) { return "structTimer".equals(notification.getType()); } }, handback); structuralTimerListeners++; manageTimer(); }
private void registerMBean() { try { LOG.info("Registering MBean {}", name); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName mxbeanName = new ObjectName(name); mbs.registerMBean(this, mxbeanName); timer.addNotificationListener(this, new NotificationFilter() { @Override public boolean isNotificationEnabled(Notification notification) { return "tickTimer".equals(notification.getType()); } }, null); this.registered = true; } catch (InstanceAlreadyExistsException ex) { throw new RuntimeException(ex); } catch (MBeanRegistrationException ex) { throw new RuntimeException(ex); } catch (NotCompliantMBeanException ex) { throw new AssertionError(ex); } catch (MalformedObjectNameException ex) { throw new AssertionError(ex); } }
timer.addNotificationListener(new NotificationListener() { @Override public void handleNotification(Notification notification, Object handback) {