code: private int forceCloseSession(String repositoryName, String workspaceName) throws RepositoryException,
        RepositoryConfigurationException
     {
        ManageableRepository mr = repositoryService.getRepository(repositoryName);
        WorkspaceContainerFacade wc = mr.getWorkspaceContainer(workspaceName);
  
        SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);
  
        return sessionRegistry.closeSessions(workspaceName);
     }
docs: Close sessions on specific workspace.
  
  @param repositoryName
  repository name
  @param workspaceName
  workspace name
  @return int return the how many sessions was closed
  @throws RepositoryConfigurationException
  will be generate RepositoryConfigurationException
  @throws RepositoryException
  will be generate RepositoryException