private void createMultipleListeners ( final SibRaMessagingEngineConnection connection ) throws ResourceException { final String methodName = "createMultipleListeners" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , connection ) ; } try { final SICoreConnection coreConnection = connection . getConnection ( ) ; /* * Create destination listener */ final DestinationListener destinationListener = new SibRaDestinationListener ( connection , _messageEndpointFactory ) ; /* * Determine destination type */ final DestinationType destinationType = _endpointConfiguration . getDestinationType ( ) ; /* * Register destination listener */ final SIDestinationAddress [ ] destinations = coreConnection . addDestinationListener ( _endpointConfiguration . getDestinationName ( ) , destinationListener , destinationType , DestinationAvailability . RECEIVE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( P2PTRACE , "Found " + destinations . length + " destinations that make the wildcard" ) ; } /* * Create a listener for each destination ... */ for ( int j = 0 ; j < destinations . length ; j ++ ) { try { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( P2PTRACE , "Creating a consumer for destination " + destinations [ j ] ) ; } connection . createListener ( destinations [ j ] , _messageEndpointFactory ) ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:877:1.45" , this ) ; SibTr . error ( TRACE , "CREATE_LISTENER_FAILED_CWSIV0803" , new Object [ ] { exception , destinations [ j ] . getDestinationName ( ) , connection . getConnection ( ) . getMeName ( ) , connection . getBusName ( ) } ) ; } } } catch ( final SIException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:889:1.45" , this ) ; SibTr . error ( TRACE , "ADD_DESTINATION_LISTENER_FAILED_CWSIV0804" , new Object [ ] { exception , connection . getConnection ( ) . getMeName ( ) , connection . getBusName ( ) } ) ; _connections . remove ( connection . getConnection ( ) . getMeUuid ( ) ) ; connection . close ( ) ; } if ( connection . getNumberListeners ( ) == 0 ) { SibTr . warning ( TRACE , "NO_LISTENERS_CREATED_CWSIV0809" , new Object [ ] { _endpointConfiguration . getDestinationName ( ) , connection . getConnection ( ) . getMeName ( ) , connection . getBusName ( ) } ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
This method will create a listener to each destination that matches the wildcarded destination