/** * Adds a notification listener to the target bean. * * @throws Exception */ protected void addNotificationListener() throws Exception { JMXEndpoint ep = (JMXEndpoint) getEndpoint(); NotificationFilter nf = ep.getNotificationFilter(); ObjectName objectName = ep.getJMXObjectName(); getServerConnection().addNotificationListener(objectName, this, nf, ep.getHandback()); }
/** Removes the consumer as a listener from the bean. */ protected void removeNotificationListener() throws Exception { JMXEndpoint ep = (JMXEndpoint) getEndpoint(); getServerConnection().removeNotificationListener(ep.getJMXObjectName(), this); }