throw new RepositoryException("Repository " + name + " in use. If you want to "
+ " remove repository close all open sessions");
try
{
RepositoryEntry repconfig = config.getRepositoryConfiguration(name);
RepositoryImpl repo = (RepositoryImpl) getRepository(name);
for (WorkspaceEntry wsEntry : repconfig.getWorkspaceEntries())
{
repo.internalRemoveWorkspace(wsEntry.getName());
}
repconfig.getWorkspaceEntries().clear();
RepositoryContainer repositoryContainer = repositoryContainers.get(name);
repositoryContainer.stopContainer();
repositoryContainer.stop();
repositoryContainers.remove(name);
config.getRepositoryConfigurations().remove(repconfig);