public ObjectName getObjectNameFromArguments(Invocation invocation) {
String method = invocation.getMethod().getName();
if (method.equals("invoke") ||
method.equals("setAttribute") ||
method.equals("setAttributes") ||
method.equals("addNotificationListener") ||
method.equals("removeNotificationListener"))
{
return (ObjectName) invocation.getArguments()[0];
}
return null;
}
Return any target object name relevent for this invocation.
Methods that don't pass arguments that could be custom classes are ignored.
Classloading and registerMBean are ignored,
they shouldn't be available remotely |