1 Reply Latest reply on Nov 18, 2008 2:25 PM by starksm64

    Only way to remove a managedcomponent is to remove its deplo

    ccrouch

      I know we've discussed this before but I wanted bring it up again now we have a concrete api to work with. Right now the only way to remove a component appears to be as follows:

      ManagementView mgtView = ProfileServiceFactory.getCurrentProfileView();
      ManagedComponent managedComponent = getManagedComponent();
      ManagedDeployment deployment = managedComponent.getDeployment();
      mgtView.removeDeployment(deployment.getName(), ManagedDeployment.DeploymentPhase.APPLICATION);
      mgtView.process();
      


      But if you have other things defined in the deployment, e.g. the hsqldb-ds.xml deployment contains jboss:service=Hypersonic,database=localDB service as well as the datasource, you end up blowing the whole lot away.

      There is an api on the deployment which *looks* like it would help, but does not:

      deployment.removeComponent(managedComponent.getName());


      So in the spirit of API completeness for GA I'd like to discuss what api changes we should look to support removing a single component, rather than entire deployment.

      First idea:
      -Treat a delete like an update. Don't alter the underlying deployment descriptor, just add a management override that says don't process component foo.

      Cheers