private void setUrlParserFromEndpoints ( List < String > endpoints , int port ) { List < HostAddress > addresses = new ArrayList <> ( ) ; for ( String endpoint : endpoints ) { HostAddress newHostAddress = new HostAddress ( endpoint , port , null ) ; addresses . add ( newHostAddress ) ; } synchronized ( urlParser ) { urlParser . setHostAddresses ( addresses ) ; } }
Sets urlParser accordingly to discovered hosts .