Object mbeanFactory = getMBeanFactoryMethod.invoke(null);
Method getMBeanServerMethod = mbeanFactory.getClass().getMethod(GET_MBEAN_SERVER_METHOD);
this.mbeanServer = (MBeanServer) getMBeanServerMethod.invoke(mbeanFactory);
}
catch (ClassNotFoundException ex) {
throw new MBeanServerNotFoundException("Could not find WebSphere's AdminServiceFactory class", ex);
}
catch (InvocationTargetException ex) {
throw new MBeanServerNotFoundException(
"WebSphere's AdminServiceFactory.getMBeanFactory/getMBeanServer method failed", ex.getTargetException());
}
catch (Exception ex) {
throw new MBeanServerNotFoundException(
"Could not access WebSphere's AdminServiceFactory.getMBeanFactory/getMBeanServer method", ex);
}
}