0 Replies Latest reply on Apr 27, 2009 6:55 AM by jaikiran

    EJBTHREE-1812 @Service with a @Management does not uninstall

    jaikiran

      https://jira.jboss.org/jira/browse/EJBTHREE-1812 - The ServiceContainer, in it's registerManagementInterface registers MBean and also install a MC bean:

      mbeanServer.registerMBean(delegate, delegateObjectName);
      // Install into MC
      getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null, delegate);


      But in unregisterManagementInterface (on undeploy), the ServiceContainer just unregisters the MBean but not the MC bean:

      mbeanServer.unregisterMBean(delegateObjectName);


      The unregister method is missing the uninstall call on the kernel abstraction, so adding this to the ServiceContainer

      // Uninstall from MC
       getDeployment().getKernelAbstraction().uninstall(delegateObjectName.getCanonicalName());


      This further needs an additional fix in JBossASKernel (located in AS->ejb3) which currently has a blank uninstall method:

      public void uninstall(String name)
       {
      
       }


      This can be fixed to uninstall the bean (passed as the name) from the MC kernel:

      public void uninstall(String name)
       {
       // uninstalls from MC
       this.kernel.getController().uninstall(name);
       log.debug("Uninstalled from kernel: " + name);
      
       }


      Thoughts?