コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: MBeanServer.cs プロジェクト: SzymonPobiega/NetMX
        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);
        }
コード例 #4
0
ファイル: MBeanServer.cs プロジェクト: SzymonPobiega/NetMX
        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);
        }