use of org.talend.designer.runtime.visualization.MBean.IMBeanNotification in project tdi-studio-se by Talend.
the class MBeanNotification method clear.
/*
* @see IMBeanNotification#clear(ObjectName)
*/
@Override
public void clear(ObjectName objectName) {
List<Notification> notification = notifications.get(objectName);
if (notification == null) {
return;
}
notification.clear();
JvmModel.getInstance().fireJvmModelChangeEvent(new JvmModelEvent(State.JvmModified, activeJvm));
}
use of org.talend.designer.runtime.visualization.MBean.IMBeanNotification in project tdi-studio-se by Talend.
the class MBeanNotification method subscribe.
/*
* @see IMBeanNotification#subscribe(ObjectName)
*/
@Override
public void subscribe(final ObjectName objectName) throws JvmCoreException {
NotificationListener listener = new NotificationListener() {
@Override
public void handleNotification(Notification notification, Object handback) {
List<Notification> list = notifications.get(objectName);
if (list == null) {
list = new ArrayList<Notification>();
}
list.add(new DecoratedNotification(notification));
notifications.put(objectName, list);
}
};
activeJvm.getMBeanServer().addNotificationListener(objectName, listener);
listeners.put(objectName, listener);
JvmModel.getInstance().fireJvmModelChangeEvent(new JvmModelEvent(State.JvmModified, activeJvm));
}
Aggregations