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

    Only way to remove a managedcomponent is to remove its deplo

    Charles Crouch Expert

      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);

      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:


      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.