Esempio n. 1
0
 public void unprepareServerPluginService() throws Exception {
   if (serverPluginService != null) {
     serverPluginService.stopMasterPluginContainer();
     serverPluginService.stop();
     getJBossMBeanServer().unregisterMBean(ServerPluginService.OBJECT_NAME);
     serverPluginService = null;
   }
 }
Esempio n. 2
0
  public void unprepareServerPluginService() throws Exception {
    if (serverPluginService != null) {
      serverPluginService.stopMasterPluginContainer();
      serverPluginService.stop();
      serverPluginService = null;
    }

    MBeanServer mbs = getPlatformMBeanServer();
    if (mbs.isRegistered(ServerPluginService.OBJECT_NAME)) {
      mbs.unregisterMBean(ServerPluginService.OBJECT_NAME);
    }
  }
Esempio n. 3
0
 /**
  * If you need to test server plugins, you must first prepare the server plugin service. After
  * this returns, the caller must explicitly start the PC by using the appropriate API on the given
  * mbean; this method will only start the service, it will NOT start the master PC.
  *
  * @param testServiceMBean the object that will house your test server plugins
  * @throws RuntimeException
  */
 public void prepareCustomServerPluginService(ServerPluginService testServiceMBean) {
   try {
     MBeanServer mbs = getJBossMBeanServer();
     testServiceMBean.start();
     mbs.registerMBean(testServiceMBean, ServerPluginServiceManagement.OBJECT_NAME);
     serverPluginService = testServiceMBean;
     return;
   } catch (Exception e) {
     throw new RuntimeException(e);
   }
 }
Esempio n. 4
0
  /**
   * If you need to test server plugins, you must first prepare the server plugin service. After
   * this returns, the caller must explicitly start the PC by using the appropriate API on the given
   * mbean; this method will only start the service, it will NOT start the master PC.
   *
   * @param testServiceMBean the object that will house your test server plugins
   * @throws RuntimeException
   */
  public void prepareCustomServerPluginService(ServerPluginService testServiceMBean) {
    try {
      // first, unregister the real service...
      MBeanServer mbs = getPlatformMBeanServer();
      if (mbs.isRegistered(ServerPluginService.OBJECT_NAME)) {
        mbs.unregisterMBean(ServerPluginService.OBJECT_NAME);
      }

      // Now replace with the test service...
      testServiceMBean.start();
      mbs.registerMBean(testServiceMBean, ServerPluginServiceMBean.OBJECT_NAME);
      serverPluginService = testServiceMBean;

    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }