for (DataSourceDefinitionDescriptor dsd : env.getDataSourceDefinitionDescriptors()) {
Collection<ResourceDeployer> resourceDeployers = habitat.getAllByContract(ResourceDeployer.class);
try{
if(dsd.isDeployed()){
ResourceDeployer deployer = getResourceDeployer(dsd, resourceDeployers);
deployer.undeployResource(dsd);
dsd.setDeployed(false);
}
}catch(Exception e){
_logger.log(Level.WARNING, "unable to undeploy DataSourceDefinition [ " + dsd.getName() + " ] ", e);
}