private Set getRequiredMessagingEngines ( final JsMessagingEngine messagingEngine ) throws NotSupportedException , ResourceAdapterInternalException { final String methodName = "getRequiredMessagingEngines" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } final Set < String > requiredMessagingEngines = new HashSet < String > ( ) ; /* * Obtain the local messaging engines configured on the given bus */ final JsMessagingEngine [ ] localMessagingEngines = SibRaEngineComponent . getMessagingEngines ( _endpointConfiguration . getBusName ( ) ) ; /* * Validate the specified destination */ final String destinationUuid = validateDestination ( messagingEngine , _endpointConfiguration . getDestination ( ) . getBusName ( ) , _endpointConfiguration . getDestination ( ) . getDestinationName ( ) , _endpointConfiguration . getDestinationType ( ) ) ; if ( DestinationType . TOPICSPACE == _endpointConfiguration . getDestinationType ( ) ) { if ( _endpointConfiguration . isDurableSubscription ( ) ) { /* * For a durable subscription, if the durable subscription home * is local then only connect to that */ _remoteDestination = true ; for ( int i = 0 ; i < localMessagingEngines . length ; i ++ ) { if ( localMessagingEngines [ i ] . getName ( ) . equals ( _endpointConfiguration . getDurableSubscriptionHome ( ) ) ) { requiredMessagingEngines . add ( localMessagingEngines [ i ] . getUuid ( ) . toString ( ) ) ; _remoteDestination = false ; break ; } } } else { /* * For a non-durable subscription the destination is never * remote */ _remoteDestination = false ; } } else { /* * For a destination other than a topic, connect to all local * messaging engines that have a localisation */ final Set destinationLocalisations ; try { destinationLocalisations = messagingEngine . getSIBDestinationLocalitySet ( _endpointConfiguration . getDestination ( ) . getBusName ( ) , destinationUuid ) ; } catch ( final SIBExceptionBase exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_3 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw new ResourceAdapterInternalException ( NLS . getFormattedMessage ( ( "DESTINATION_LOCALITY_CWSIV0753" ) , new Object [ ] { exception , destinationUuid } , null ) , exception ) ; } _remoteDestination = true ; for ( int i = 0 ; i < localMessagingEngines . length ; i ++ ) { final String meUuid = localMessagingEngines [ i ] . getUuid ( ) . toString ( ) ; if ( destinationLocalisations . contains ( meUuid ) ) { requiredMessagingEngines . add ( meUuid ) ; _remoteDestination = false ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , requiredMessagingEngines ) ; } return requiredMessagingEngines ; }
Determines which of the local messaging engines the resource adapter should try and obtain connections to .