private void createNewFiltersAndCursors ( ItemStream itemStream ) throws SIResourceException , MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewFiltersAndCursors" , itemStream ) ; LockingCursor cursor = null ; // Instantiate a new array of Filters and associated cursors. If there is // no message classification, then we'll instantiate a single filter and // cursor pair. if ( classifyingMessages ) { // Classifying messages for XD. // this work should be done under the classifications readlock acquired higher // up in the stack JSConsumerClassifications classifications = consumerSet . getClassifications ( ) ; int numClasses = classifications . getNumberOfClasses ( ) ; consumerKeyFilter = new LocalQPConsumerKeyFilter [ numClasses + 1 ] ; for ( int i = 0 ; i < numClasses + 1 ; i ++ ) { String classificationName = null ; // The zeroth filter belongs to the default classification, which has a // null classification name if ( i > 0 ) classificationName = classifications . getClassification ( i ) ; consumerKeyFilter [ i ] = new LocalQPConsumerKeyFilter ( this , i , classificationName ) ; cursor = itemStream . newLockingItemCursor ( consumerKeyFilter [ i ] , ! forwardScanning ) ; consumerKeyFilter [ i ] . setLockingCursor ( cursor ) ; } } else { // No message classification consumerKeyFilter = new LocalQPConsumerKeyFilter [ 1 ] ; consumerKeyFilter [ 0 ] = new LocalQPConsumerKeyFilter ( this , 0 , null ) ; cursor = itemStream . newLockingItemCursor ( consumerKeyFilter [ 0 ] , ! forwardScanning ) ; consumerKeyFilter [ 0 ] . setLockingCursor ( cursor ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewFiltersAndCursors" ) ; }
Create the filters and cursors for this Key . If XD has registered a MessageController we ll need a cursor - filter pair for each classification .