protected void removeLocalSpaceDefinitions ( boolean isLocalDestruction ) { List < Space > removedSpaces = null ; synchronized ( getSpaceRepositoryMutex ( ) ) { if ( ! this . spaces . isEmpty ( ) ) { removedSpaces = new ArrayList <> ( this . spaces . size ( ) ) ; final Iterator < Entry < SpaceID , Space > > iterator = this . spaces . entrySet ( ) . iterator ( ) ; Space space ; SpaceID id ; while ( iterator . hasNext ( ) ) { final Entry < SpaceID , Space > entry = iterator . next ( ) ; id = entry . getKey ( ) ; space = entry . getValue ( ) ; iterator . remove ( ) ; this . spacesBySpec . remove ( id . getSpaceSpecification ( ) , id ) ; removedSpaces . add ( space ) ; } } } if ( removedSpaces != null ) { for ( final Space s : removedSpaces ) { fireSpaceRemoved ( s , isLocalDestruction ) ; } } }
Remove all the remote spaces .