Make APIMBean name derivation check interface fields as well.
This commit is contained in:
parent
cd9deafc51
commit
781821ac9e
@ -133,6 +133,18 @@ public class APIMBean implements MBeanRegistration {
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
}
|
||||
if (mbeanName == null) {
|
||||
for (Class<?> c : getClass().getInterfaces()) {
|
||||
Field f;
|
||||
try {
|
||||
f = c.getDeclaredField("OBJECT_NAME");
|
||||
f.setAccessible(true);
|
||||
mbeanName = (String) f.get(null);
|
||||
break;
|
||||
} catch (Throwable t) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mbeanName == null) {
|
||||
String name = getClass().getName();
|
||||
int i = name.lastIndexOf('.');
|
||||
|
Loading…
Reference in New Issue
Block a user