private void createSingleListener ( final SibRaMessagingEngineConnection connection ) throws ResourceException { final String methodName = "createSingleListener" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , connection ) ; } final SIDestinationAddress destination = _endpointConfiguration . getDestination ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Creating a consumer to consume from destination " + destination + " on ME " + connection . getConnection ( ) . getMeName ( ) ) ; } try { connection . createListener ( destination , _messageEndpointFactory ) ; SibTr . info ( TRACE , "CONNECTED_CWSIV0777" , new Object [ ] { connection . getConnection ( ) . getMeName ( ) , _endpointConfiguration . getDestination ( ) . getDestinationName ( ) , _endpointConfiguration . getBusName ( ) } ) ; } catch ( final IllegalStateException exception ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Failed to create a session - blowing away the connection - rethrow the exception" ) ; } _connections . remove ( connection . getConnection ( ) . getMeUuid ( ) ) ; connection . close ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } throw exception ; } catch ( final ResourceException exception ) { // No FFDC code needed // Failed to create a consumer so blow away the connection and try // again if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Failed to create a session - blowing away the connection - a retry should occur" ) ; SibTr . debug ( TRACE , "Exception cause was " + exception . getCause ( ) ) ; } _connections . remove ( connection . getConnection ( ) . getMeUuid ( ) ) ; connection . close ( ) ; throw exception ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
This method will create a listener to the specified destination