java jmx教程_【JAVA】JMX简单使用方法

[BEAN] 配置

value-ref="emailInterfaceServer" />  

class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler">

class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" />

[使用注解实现JMX页面显示]

package com.star.sms.business.collection.jmx;

// 省略

/**

* 客户帐单邮件提醒管理Bean

*

* @author liuyong 2014-01-22

* @version 5.4.4.9

*

*/

@ManagedResource(description = "Bill Remind Email Manager")  //描述用于页面显示

public class CollmgmtEmailJmx {

@ManagedOperation(description = "Send remind Email for customer ,The email contains the billing information")

public void sendBillEmails() {

//这是一个无参数的方法

}

@ManagedOperation(description = "[ Testing ]: send remind Email to one cusomer by customer code")

//描述用于页面显示

@ManagedOperationParameters( {

@ManagedOperationParameter(name = "customerCode", description = "Customer Code"),  //参数名称,及参数描述

@ManagedOperationParameter(name = "targetEmail", description = "Target Email") })

public void sendBillEmailTesting(String customerCode, String targetEmail) {

//这是一个带参数的方法

}

}

}

[JMX效果]

84d683c7f09877d87fa84df197240452.png

[JMX相关方法信息]

fc37a81e4ac98b51e010dd06facd65be.png

453257b29e486a79762a4962e3ea72a0.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值