public void installMBean(ObjectName on, DependencyPolicy dependencies, Object service) { try { server.registerMBean(service, on); install(on.getCanonicalName(), dependencies, null, service); // EJBTHREE-606: emulate the ServiceController calls MBeanInfo info = server.getMBeanInfo(on); // redundant call for speed invokeOptionalMethod(on, info, "create"); invokeOptionalMethod(on, info, "start"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }