public void addSelectionCriteria ( SelectionCriteria selCriteria ) throws SIDiscriminatorSyntaxException , SISelectorSyntaxException , SIResourceException { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addSelectionCriteria" , new Object [ ] { selCriteria } ) ; // We should really check discriminator access at this stage // However since these checks require access to the connection which // does not belong on this object , I have decided to avoid the checks // at this stage as they will be done at message delivery time // Also, it is the case that in all current usage the discriminators will // be the same for all selectionCriteria boolean duplicateCriteria = _consumerDispatcher . getConsumerDispatcherState ( ) . addSelectionCriteria ( selCriteria ) ; if ( ! duplicateCriteria ) { // Add the new criteria to the matchspace try { _messageProcessor . getMessageProcessorMatching ( ) . addConsumerDispatcherMatchTarget ( _consumerDispatcher , _consumerDispatcher . getDestination ( ) . getUuid ( ) , selCriteria ) ; } catch ( SIDiscriminatorSyntaxException e ) { // No FFDC code needed // Remove the selection criteria as it was added to the list _consumerDispatcher . getConsumerDispatcherState ( ) . removeSelectionCriteria ( selCriteria ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addSelectionCriteria" , e ) ; throw e ; } catch ( SISelectorSyntaxException e ) { // No FFDC code needed // Remove the selection criteria as it was added to the list _consumerDispatcher . getConsumerDispatcherState ( ) . removeSelectionCriteria ( selCriteria ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addSelectionCriteria" , e ) ; throw e ; } // Persist change made to consumerDispatcherState Transaction tran = _messageProcessor . getTXManager ( ) . createAutoCommitTransaction ( ) ; if ( ! _consumerDispatcher . getReferenceStream ( ) . isUpdating ( ) ) { try { _consumerDispatcher . getReferenceStream ( ) . requestUpdate ( tran ) ; } catch ( MessageStoreException e ) { // MessageStoreException shouldn't occur so FFDC. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MPSubscriptionImpl.addSelectionCriteria" , "1:153:1.6" , this ) ; // Remove the selection criteria as it was added to the list _consumerDispatcher . getConsumerDispatcherState ( ) . removeSelectionCriteria ( selCriteria ) ; SibTr . exception ( tc , e ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addSelectionCriteria" , "SIResourceException" ) ; throw new SIResourceException ( e ) ; } } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addSelectionCriteria" ) ; }
Add an additional selection criteria to the to the subscription Duplicate selection criterias are ignored