void checkMEs ( JsMessagingEngine [ ] MEList ) throws ResourceException { final String methodName = "checkMEs" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { MEList } ) ; } // Filter out any non preferred MEs. User specified target data is used to perform this filter. // If no target data is set then all the MEs are considered "preferred" for point to point and // non durable pub sub, but none of them are considered preferred for durable pub sub (which has // a preference for the durable subscription home) JsMessagingEngine [ ] preferredMEs = _destinationStrategy . getPreferredLocalMEs ( MEList ) ; // TODO: Can we wrapper the connect call if a try catch block, if engine is being reloaded then absorb the // exception (trace a warning) and let us kick off a timer (if one is needed). // Try to connect to the list of filtered MEs. try { connect ( preferredMEs , _targetType , _targetSignificance , _target , true ) ; SibTr . info ( TRACE , "TARGETTED_CONNECTION_SUCCESSFUL_CWSIV0556" , new Object [ ] { ( ( MDBMessageEndpointFactory ) _messageEndpointFactory ) . getActivationSpecId ( ) , _endpointConfiguration . getDestination ( ) . getDestinationName ( ) } ) ; } catch ( Exception e ) { // After attempting to create connections check to see if we should continue to check for more connections // or not. If we should then kick of a timer to try again after a user specified interval. SibTr . warning ( TRACE , SibTr . Suppressor . ALL_FOR_A_WHILE , "CONNECT_FAILED_CWSIV0782" , new Object [ ] { _endpointConfiguration . getDestination ( ) . getDestinationName ( ) , _endpointConfiguration . getBusName ( ) , ( ( MDBMessageEndpointFactory ) _messageEndpointFactory ) . getActivationSpecId ( ) , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "Failed to obtain a connection - retry after a set interval" ) ; } clearTimer ( ) ; // deactivate will close the connections // The connection might be successful but session might fail due to authorization error // Hence before retrying, old connection must be closed deactivate ( ) ; kickOffTimer ( ) ; } //its possible that there was no exception thrown and connection was not successfull // in that case a check is made to see if an retry attempt is needed if ( _destinationStrategy . isTimerNeeded ( ) ) { clearTimer ( ) ; kickOffTimer ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName ) ; } }
This method will check the supplied MEs to see if they are suitable for connecting to .