//We want to check if container exists before we actually delete them.
//We need this because getContainer will create a container object if container doesn't exists.
if (ZooKeeperUtils.exists(curator, ZkPath.CONTAINER.getPath(name)) != null) {
Container container = fabricService.getContainer(name);
//We want to go through container destroy method so that cleanup methods are properly invoked.
container.destroy();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}