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();
deployment.removeComponent(managedComponent.getName());
Removing the component is the api that should accomplish that. That is does not is simply a bug/not implemented feature.