protected synchronized void afterSpaceModeChange(SpaceMode newMode){
  if (_logger.isLoggable(Level.FINER))   _logger.finer("Invoking afterSpaceModeChange event, new mode is " + newMode);
  Queue<ISpaceModeListener> remoteListeners=new LinkedList<ISpaceModeListener>();
  for (Iterator<ISpaceModeListener> iter=_primarySpaceModeListeners.iterator(); iter.hasNext(); ) {
    ISpaceModeListener listener=iter.next();
    try {
      if (LRMIUtilities.isRemoteProxy(listener)) {
        if (_logger.isLoggable(Level.FINEST))         _logger.finest("located remote listener for afterSpaceModeChange, adding to asynchronous dispatch queue [" + listener.toString() + "]");
        remoteListeners.add(listener);
        continue;
      }
      listener.afterSpaceModeChange(newMode);
    }
 catch (    Exception rex) {
      if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE,"Failed to invoke remote method ISpaceModeListener.afterSpaceModeChange(...) implemented by listener [" + listener + "]. Action Taken: Unregistered listener",rex);
      }
      _primarySpaceModeListeners.removeListener(listener);
    }
  }
  if (remoteListeners.size() > 0)   dispatchAfterEventToRemoteListeners(remoteListeners,newMode);
  if (_logger.isLoggable(Level.FINEST))   _logger.finest("completed invoking synchronous afterSpaceModeChange event with mode " + newMode);
}

protected synchronized void afterSpaceModeChange ( SpaceMode newMode ) { if ( _logger . isLoggable ( Level . FINER ) ) _logger . finer ( "Invoking afterSpaceModeChange event, new mode is " + newMode ) ; Queue < ISpaceModeListener > remoteListeners = new LinkedList < ISpaceModeListener > ( ) ; for ( Iterator < ISpaceModeListener > iter = _primarySpaceModeListeners . iterator ( ) ; iter . hasNext ( ) ; ) { ISpaceModeListener listener = iter . next ( ) ; try { if ( LRMIUtilities . isRemoteProxy ( listener ) ) { if ( _logger . isLoggable ( Level . FINEST ) ) _logger . finest ( "located remote listener for afterSpaceModeChange, adding to asynchronous dispatch queue [" + listener . toString ( ) + "]" ) ; remoteListeners . add ( listener ) ; continue ; } listener . afterSpaceModeChange ( newMode ) ; } catch ( Exception rex ) { if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "Failed to invoke remote method ISpaceModeListener.afterSpaceModeChange(...) implemented by listener [" + listener + "]. Action Taken: Unregistered listener" , rex ) ; } _primarySpaceModeListeners . removeListener ( listener ) ; } } if ( remoteListeners . size ( ) > 0 ) dispatchAfterEventToRemoteListeners ( remoteListeners , newMode ) ; if ( _logger . isLoggable ( Level . FINEST ) ) _logger . finest ( "completed invoking synchronous afterSpaceModeChange event with mode " + newMode ) ; }
notify the listeners about the event
