@SpringJMX中XML配置方式的Managedoperation替代方案

@SpringJMX中XML配置方式的Managedoperation替代方案,spring,jmx,spring-jmx,Spring,Jmx,Spring Jmx,我使用的是Spring2.5版的JMX,我在其中使用的是JMX 如下图所示 @ManagedOperation(description = "Mark the Entry corresponding ABC flow") @ManagedOperationParameters(value = { @ManagedOperationParameter(name = "def", description = "Ids of the entries that needs to be S

我使用的是Spring2.5版的JMX,我在其中使用的是JMX 如下图所示

@ManagedOperation(description = "Mark the Entry corresponding ABC flow")
@ManagedOperationParameters(value = {
        @ManagedOperationParameter(name = "def", description = "Ids of the entries that needs to be STOP"),
        @ManagedOperationParameter(name = "Comments", description = "Note on why these entries are being marked as stop") })
public void abcstop(String def, String gtr){
    StringBuffer gfhtrPresent= jmxService.abcd(Ids, comments);
    if(idsNotPresent.length()>0) 
        throw new IOARuntimeException("<font color=red><b>No data found for the following id/id's </b></font>"+idsNotPresent);
}
现在我想删除@Managedoperation Annotation并想在XML中配置它,请建议如何配置@Managedoperation,因为我希望从XML本身运行相同的功能,请建议


实现这一点的一种方法是实现您自己的MBeanInfoAssembler或将其中一个标准的MBeanInfoAssembler子类化。请告知是否有其他方法可以实现此目的,如能尽早提供帮助,我们将不胜感激。

最简单的方法可能是使用

首先,在代码中将JMX接口公开为显式定义的接口。无论如何,拥有这样一个界面可能是个好主意。然后,您只需告诉InterfaceBasedMBeanInfoAssembler通过其managedInterfaces属性公开一个或多个特定接口。除了首先定义接口(您可能已经做过,也可能没有做过)之外,其余的都可以通过XML配置来完成。但是,您无法以这种方式提供非常详细的元数据;这是一种权衡


如果你要坚持使用MetadataMBeanInfoAssembler,你可以改为尝试一个定制,这样你只需要重新设计一半的轮子,而不是全部…

非常感谢你能给我一个例子吗?任何例子都可以帮助我理解更多为什么你问了一个新问题,而你已经要求我对最初问题的答案提供更多帮助?你至少应该在这里提供这个问题的链接。我现在更新了另一个答案,提供了更多细节。