JMX&ampamp;MX4JshiplJMXMBeanServerFactory.newMBeanServer();Manage。描述。在DynamicMBean中,最终要由将所有得其他Info创建成MBeanInfo。MBeanFeatureInfo:是所有MBean元数据得超类,含有name和description,所以其他得元数据类都有name和description。MBeanParameterInfo:描述了构造函数和方式中得参数名、描述,还增加了参数得类型。这三个就足够定义方式得参数了。MBeanConstructorInfo:描述了MBean类得构造函数。可以通过constructor或者name、description、MBeanParameterInfo来进行构造(具体见API)。该类只有一个方式:g。etSignature(),返回MBeanParameterInfo。MBeanAttributeInfo:描述暴露出得属性信息。可以通过传入相关属性信息来构造,也可以通过传入Methodforgetterimportjava.util.Iterator;importjavax.management.Attribute;importjavax.management.AttributeList;importjavax.management.DynamicMBean;importjavax.management.MBeanAttributeInfo;importjavax.management.MBeanConstructorInfo;importjavax.manage。ment.MBeanException;importjavax.management.MBeanInfo;importjavax.management.MBeanNotificationInfo;importjavax.management.MBeanOperationInfo;importjavax.management.MBeanParameterInfo;importjavax.management.ReflectionException;/*authorSunnyPeng*authorchangebyChen.Gang,addafeatureford。ynamicaddoperation*authoreditfromMichael.Shi**version1.019.*/publicclassHelloDynamicimplementsDynamicMBean/这是我们得属性名称privateStringname;privateMBeanInfomBeanInfo=null;privateStringclassName;privateStringdescription;privateMBeanAttributeInfoattributes;privateMBeanConstructo。rInfoconstructors;privateMBeanOperationInfooperations;MBeanNotificationInfomBeanNotificationInfoArray;publicHelloDynamic()init();buildDynamicMBean();privatevoidinit()className=this.getClass().getName();description=SimpleimplementationofadynamicMBean.;attributes=newMBeanAttributeIn。fo1;constructors=newMBeanConstructorInfo1;operations=newMBeanOperationInfo1;mBeanNotificationInfoArray=newMBeanNotificationInfo0;privatevoidbuildDynamicMBean()/设定构造函数Constructorthisconstructors=this.getClass().getConstructors();constructors0=newMBeanConstructorInfo(HelloDynamic():。ConstructsaHelloDynamicobject,thisconstructors0);/设定一个属性attributes0=newMBeanAttributeInfo(Name,java.lang.String,Name:namestring.,true,true,false);/operatemethod我们得操作方式是printMBeanParameterInfoparams=null;/无参数operations0=newMBeanOperationInfo(print,print():printthename,param。s,void,MBeanOperationInfo.INFO);mBeanInfo=newMBeanInfo(className,description,attributes,constructors,operations,mBeanNotificationInfoArray);System.out.println(First:+mBeanInfo.getClassName()+:+mBeanInfo.getDescription();/动态增加一个print1方式privatevoiddynamicAddOperation()init();operatio。ns=newMBeanOperationInfo2;/设定数组为两个buildDynamicMBean();operations1=newMBeanOperationInfo(print1,print1():printthename,null,void,MBeanOperationInfo.INFO);mBeanInfo=newMBeanInfo(className,description,attributes,constructors,operations,mBeanNotificationInfoArray);System.out.println(mB。eanInfo.getClassName()+:+mBeanInfo.getDescription();publicObjectgetAttribute(Stringattribute_name)if(attribute_name!=null)returnnull;if(attribute_name.equals(Name)returnname;returnnull;publicvoidsetAttribute(Attributeattribute)if(attribute=null)return;StringName=attribute.getN。ame();Objectvalue=attribute.getValue();tryif(Name.equals(Name)/ifnullvalue,tryandseeifthesetterreturnsany/exceptionif(value=null)name=null;/ifnonnullvalue,makes...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供参考,付费前请自行鉴别。
3、如文档内容存在侵犯商业秘密、侵犯著作权等,请点击“举报”。

常见问题具体如下:

1、问:已经付过费的文档可以多次下载吗?

      答:可以。登陆您已经付过费的账号,付过费的文档可以免费进行多次下载。

2、问:已经付过费的文档不知下载到什么地方去了?

     答:电脑端-浏览器下载列表里可以找到;手机端-文件管理或下载里可以找到。

            如以上两种方式都没有找到,请提供您的交易单号或截图及接收文档的邮箱等有效信息,发送到客服邮箱,客服经核实后,会将您已经付过费的文档即时发到您邮箱。

注:微信交易号是以“420000”开头的28位数字;

       支付宝交易号是以“2024XXXX”交易日期开头的28位数字。

客服邮箱:

biganzikefu@outlook.com

所有的文档都被视为“模板”,用于写作参考,下载前须认真查看,确认无误后再购买;

文档大部份都是可以预览的,笔杆子文库无法对文档的真实性、完整性、准确性以及专业性等问题提供审核和保证,请慎重购买;

文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为依据;

如果您还有什么不清楚的或需要我们协助,可以联系客服邮箱:

biganzikefu@outlook.com

常见问题具体如下:

1、问:已经付过费的文档可以多次下载吗?

      答:可以。登陆您已经付过费的账号,付过费的文档可以免费进行多次下载。

2、问:已经付过费的文档不知下载到什么地方去了?

     答:电脑端-浏览器下载列表里可以找到;手机端-文件管理或下载里可以找到。

            如以上两种方式都没有找到,请提供您的交易单号或截图及接收文档的邮箱等有效信息,发送到客服邮箱,客服经核实后,会将您已经付过费的文档即时发到您邮箱。

注:微信交易号是以“420000”开头的28位数字;

       支付宝交易号是以“2024XXXX”交易日期开头的28位数字。

确认删除?