public void cleanUpRemoteSessions(){
synchronized (remoteSessionSet) {
    for (Iterator iter=remoteSessionSet.iterator(); iter.hasNext(); ) {
      SessionID sessionID=(SessionID)iter.next();
      String hostServer=null;
      try {
        hostServer=getCurrentHostServer(sessionID);
      }
 catch (      Exception ex) {
      }
      if (!serverConfig.isLocalServer(hostServer)) {
        iter.remove();
      }
    }
  }
}

public void cleanUpRemoteSessions ( ) { synchronized ( remoteSessionSet ) { for ( Iterator iter = remoteSessionSet . iterator ( ) ; iter . hasNext ( ) ; ) { SessionID sessionID = ( SessionID ) iter . next ( ) ; String hostServer = null ; try { hostServer = getCurrentHostServer ( sessionID ) ; } catch ( Exception ex ) { } if ( ! serverConfig . isLocalServer ( hostServer ) ) { iter . remove ( ) ; } } } }
function to remove remote sessions when primary server is up .
