synchronized (projects)
{
ISigilProjectModel model = projects.remove(project);
ArrayList<String> flush = new ArrayList<String>();
if ( model != null ) {
ProjectRepositoryManager manager = repositoryManagers.remove(model);
manager.destroy();
for(IBundleRepository rep : manager.getRepositories()) {
flush.add(rep.getId());
}
}
for (ProjectRepositoryManager manager : repositoryManagers.values()) {
for(IBundleRepository rep : manager.getRepositories()) {
flush.remove(rep.getId());
}
}
repositoryCache.discard(flush);