ManageableRepository mr = service.getRepository(repositoryName);
for (String wsName : mr.getWorkspaceNames())
{
WorkspaceContainerFacade wc = mr.getWorkspaceContainer(wsName);
SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
sessionRegistry.closeSessions(wsName);
}
service.removeRepository(repositoryName);
}