This method returns the mbean of interest for the event/notification
ObjectName on = null;
QueryExp e = null;
if ( objectKey instanceof EventKey ) {
EventKey eKey = (EventKey) objectKey;
on = eKey.getObjectName();
e = eKey.getQuery();
} else if ( objectKey instanceof ObjectName) {
on = (ObjectName) objectKey;
} else if ( objectKey instanceof String ) {
try {
on = new ObjectName( (String) objectKey);
} catch ( Exception exp ) {
logger.log(Level.WARNING, MALFORMED_OBJECT_KEY, objectKey);
return null;
}
} else {
if ( objectKey != null )
logger.log(Level.WARNING, UNSUPPORTED_TYPE, objectKey.getClass().getName());
return null;
}
return MBeanServerFactory.getMBeanServer().queryMBeans(on, e);