/** * Undeploy the artifacts found in the artifact to be undeployed list * * @param artifactsToUndeploy list of artifacts to undeploy */ public void undeployArtifacts(List<Artifact> artifactsToUndeploy) { for (Object artifact : artifactsToUndeploy) { Artifact artifactToUnDeploy = (Artifact) artifact; try { Deployer deployer = getDeployer(artifactToUnDeploy.getType()); if (deployer != null) { deployer.undeploy(artifactToUnDeploy.getKey()); removeFromDeployedArtifacts(artifactToUnDeploy); } else { throw new CarbonDeploymentException( "Deployer instance cannot be found for " + "the type : " + artifactToUnDeploy.getType()); } } catch (CarbonDeploymentException e) { logger.error("Error while undeploying artifacts", e); } } }