protected void update ( CollectionUpdateType force ) throws IOException { // this may be called from a background thread, or from checkState() request thread State localState ; synchronized ( lock ) { if ( first ) { state = checkState ( ) ; state . lastInvChange = System . currentTimeMillis ( ) ; return ; } // do the update in a local object localState = state . copy ( ) ; } updateCollection ( localState , force ) ; // makeDatasetTop(localState); localState . lastInvChange = System . currentTimeMillis ( ) ; // switch to live synchronized ( lock ) { state = localState ; } }
Collection was changed update internal objects . called by CollectionUpdater trigger via handleCollectionEvent so in a quartz scheduler thread