public ConnectionParams resolve ( String correlationId ) throws ApplicationException { if ( _connections . size ( ) == 0 ) return null ; // Return connection that doesn't require discovery for ( ConnectionParams connection : _connections ) { if ( ! connection . useDiscovery ( ) ) return connection ; } // Return connection that require discovery for ( ConnectionParams connection : _connections ) { if ( connection . useDiscovery ( ) ) { ConnectionParams resolvedConnection = resolveInDiscovery ( correlationId , connection ) ; if ( resolvedConnection != null ) { // Merge configured and new parameters resolvedConnection = new ConnectionParams ( ConfigParams . mergeConfigs ( connection , resolvedConnection ) ) ; return resolvedConnection ; } } } return null ; }
Resolves a single component connection . If connections are configured to be retrieved from Discovery service it finds a IDiscovery and resolves the connection there .