I used org.springframework.jmx.export.annotation.@ManagedOperation
to expose a method as MBean.
I want the operation name different from the method name, but managed operation doesn't have any attribute for it.
For example:
@ManagedOperation
public synchronized void clearCache()
{
// do something
}
and I want this operation exposed with name = "ResetCache".
Create a custom annotation:
And a custom subclass of
MetadataMBeanInfoAssembler
:and you should get it to work if you wire the CustomMetadataMBeanInfoAssembler (and use the annotation):