public void UnregisterMBean(ObjectName name) { name = GetNameWithDomain(name); IDynamicMBean bean = GetMBean(name); MBeanInfo info = bean.GetMBeanInfo(); TestPermissions(info.ClassName, null, name, MBeanPermissionAction.UnregisterMBean); IMBeanRegistration registration = new MBeanRegistrationHelper(bean as IMBeanRegistration); registration.PreDeregister(); _beans.Remove(name); registration.PostDeregister(); _delegate.SendNotification(new MBeanServerNotification(MBeanServerNotification.UnregistrationNotification, null, -1, name)); _domainSet.Remove(name.Domain); }
private ObjectInstance RegisterMBeanInternal(ObjectName name, IDynamicMBean bean) { IMBeanRegistration registration = new MBeanRegistrationHelper(bean as IMBeanRegistration); name = registration.PreRegister(this, name); string className = bean.GetMBeanInfo().ClassName; TestPermissions(className, null, name, MBeanPermissionAction.RegisterMBean); if (_beans.ContainsKey(name)) { registration.PostRegister(false); throw new InstanceAlreadyExistsException(name.ToString()); } _beans[name] = bean; registration.PostRegister(true); _delegate.SendNotification(new MBeanServerNotification(MBeanServerNotification.RegistrationNotification, null, -1, name)); _domainSet[name.Domain] = true; return(new ObjectInstance(name, bean.GetMBeanInfo().ClassName)); }
private ObjectInstance RegisterMBeanInternal(ObjectName name, IDynamicMBean bean) { IMBeanRegistration registration = new MBeanRegistrationHelper(bean as IMBeanRegistration); name = registration.PreRegister(this, name); string className = bean.GetMBeanInfo().ClassName; TestPermissions(className, null, name, MBeanPermissionAction.RegisterMBean); if (_beans.ContainsKey(name)) { registration.PostRegister(false); throw new InstanceAlreadyExistsException(name.ToString()); } _beans[name] = bean; registration.PostRegister(true); _delegate.SendNotification(new MBeanServerNotification(MBeanServerNotification.RegistrationNotification, null, -1, name)); _domainSet[name.Domain] = true; return new ObjectInstance(name, bean.GetMBeanInfo().ClassName); }