I am using JMX of spring Version 2.5 in which I am using JMX as shown below..
@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);
}
Now I want to remove the @Managedoperation annaotation and want to configure it with in XML , please advsie how can I configure the @Managedoperation , as i wan the same functionality to be run from xml itself, Please advise.
one way to achieve this is implement your own MBeanInfoAssembler (or subclass one of the standard ones). please advise is there any other way to achieve this, Any early help would be appreciated.
The simplest way might be to use a
InterfaceBasedMBeanInfoAssembler
.First, expose the JMX interface as an explicitly-defined interface in your code. (Having such an interface is probably a good idea anyway.) Then you just tell the
InterfaceBasedMBeanInfoAssembler
to expose a particular interface (or interfaces) via itsmanagedInterfaces
property. Apart from the defining the interface in the first place (which you might or might not have already done) the rest is entirely possible from XML configuration. But you won't be able to supply very detailed metadata this way; it's a trade-off.If you're going to stick with a
MetadataMBeanInfoAssembler
, you could instead try a customJmxAttributeSource
so that you're only reinventing half the wheel and not the whole lot…