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".
I would just define another method that just delegates to clearCache()
. We do this all of the time when the interface name is confusing. A description = "resets the cache"
inside of the @ManagedOperation
might also be a good idea.
@ManagedOperation(description = "resets the cache")
public void resetCache() {
clearCache();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With