protected void workspaceAdded ( String workspaceName ) { String workspaceKey = NodeKey . keyForWorkspaceName ( workspaceName ) ; if ( systemWorkspaceKey . equals ( workspaceKey ) ) { // No sequencers for the system workspace! return ; } Collection < SequencingConfiguration > configs = new LinkedList < SequencingConfiguration > ( ) ; // Go through the sequencers to see which apply to this workspace ... for ( Sequencer sequencer : sequencersById . values ( ) ) { boolean updated = false ; for ( SequencerPathExpression expression : pathExpressionsBySequencerId . get ( sequencer . getUniqueId ( ) ) ) { if ( expression . appliesToWorkspace ( workspaceName ) ) { updated = true ; configs . add ( new SequencingConfiguration ( expression , sequencer ) ) ; } } if ( DEBUG && updated ) { LOGGER . debug ( "Updated sequencer '{0}' (id={1}) configuration due to new workspace '{2}' in repository '{3}'" , sequencer . getName ( ) , sequencer . getUniqueId ( ) , workspaceName , repository . name ( ) ) ; } } if ( configs . isEmpty ( ) ) return ; // Otherwise, update the configs by workspace key ... try { configChangeLock . lock ( ) ; // Make a copy of the existing map ... Map < String , Collection < SequencingConfiguration > > configByWorkspaceName = new HashMap < String , Collection < SequencingConfiguration > > ( this . configByWorkspaceName ) ; // Insert the new information ... configByWorkspaceName . put ( workspaceName , configs ) ; // Replace the exisiting map (which is used without a lock) ... this . configByWorkspaceName = configByWorkspaceName ; } finally { configChangeLock . unlock ( ) ; } }
Signal that a new workspace was added .