public void modified ( List < String > newSources ) { if ( collectorMgr == null || isInit == false ) { this . sourcesList = newSources ; return ; } try { //Old sources ArrayList < String > oldSources = new ArrayList < String > ( sourcesList ) ; //Sources to remove -> In Old Sources, the difference between oldSource and newSource ArrayList < String > sourcesToRemove = new ArrayList < String > ( oldSources ) ; sourcesToRemove . removeAll ( newSources ) ; collectorMgr . unsubscribe ( this , convertToSourceIDList ( sourcesToRemove ) ) ; //Sources to Add -> In New Sources, the difference bewteen newSource and oldSource ArrayList < String > sourcesToAdd = new ArrayList < String > ( newSources ) ; sourcesToAdd . removeAll ( oldSources ) ; collectorMgr . subscribe ( this , convertToSourceIDList ( sourcesToAdd ) ) ; sourcesList = newSources ; //new master sourcesList } catch ( Exception e ) { e . printStackTrace ( ) ; } }
Without osgi this modified method is called explicility from the update method in JsonTrService