// close all opened sessions
for (String workspaceName : repositorty.getWorkspaceNames())
{
WorkspaceContainerFacade wc = repositorty.getWorkspaceContainer(workspaceName);
SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
sessionRegistry.closeSessions(workspaceName);
}
// remove repository from configuration
repositoryService.removeRepository(repositoryName, forceRemove);
repositoryService.getConfig().retain();