public void RemoveNotificationListener(ObjectName name, NotificationCallback callback) { name = GetNameWithDomain(name); IDynamicMBean bean; INotificationEmitter emitter = GetEmitterMBean(name, out bean); TestPermissions(bean.GetMBeanInfo().ClassName, null, name, MBeanPermissionAction.RemoveNotificationListener); emitter.RemoveNotificationListener(callback); }
public StandardMBean(object impl, Type intfType) { _internalInfo = MBeanInternalInfo.GetCached(intfType); _info = _internalInfo.MBeanInfo;//CreateMBeanInfo(impl, intfType); _impl = impl; _registration = impl as IMBeanRegistration; _notifListener = impl as INotificationListener; _notifEmitter = impl as INotificationEmitter; }
private INotificationEmitter GetEmitterMBean(ObjectName name, out IDynamicMBean bean) { bean = GetMBean(name); INotificationEmitter emitter = bean as INotificationEmitter; if (emitter != null) { return(emitter); } throw new OperationsException(string.Format("Bean \"{0}\" is not a notification emitter.", name)); }
public void RemoveNotificationListener(ObjectName name, ObjectName listener, NotificationFilterCallback filterCallback, object handback) { name = GetNameWithDomain(name); listener = GetNameWithDomain(listener); IDynamicMBean bean; INotificationEmitter emitter = GetEmitterMBean(name, out bean); TestPermissions(bean.GetMBeanInfo().ClassName, null, name, MBeanPermissionAction.RemoveNotificationListener); INotificationListener listenerBean = GetListenerMBean(name, out bean); NotificationCallback callback = new NotificationCallback(listenerBean.HandleNotification); emitter.RemoveNotificationListener(callback, filterCallback, handback); }
public ObjectName PreRegister(IMBeanServer server, ObjectName name) { ObjectName newName = name; if (_registration != null) { newName = _registration.PreRegister(server, name); } _objectName = newName; if (_notifEmitter == null) { _notificationSupport = new NotificationEmitterSupport(); _notificationSupport.Initialize(newName.ToString(), _info.Notifications); _notifEmitter = _notificationSupport; AttachNotifications(); } return(newName); }
public ObjectName PreRegister(IMBeanServer server, ObjectName name) { ObjectName newName = name; if (_registration != null) { newName = _registration.PreRegister(server, name); } _objectName = newName; if (_notifEmitter == null) { _notificationSupport = new NotificationEmitterSupport(); _notificationSupport.Initialize(newName.ToString(), _info.Notifications); _notifEmitter = _notificationSupport; AttachNotifications(); } return newName; }