{
for ( BuildAgentConfiguration agent : agents )
{
if ( agent.isEnabled() && !overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
{
SlaveBuildAgentTransportService client = null;
try
{
client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
}
catch ( MalformedURLException e )
{
log.error( "Invalid build agent URL {}, not creating distributed build queue", agent.getUrl() );
throw new ContinuumException( "Malformed build agent url " + agent.getUrl() );
}
catch ( Exception e )
{
agent.setEnabled( false );
configurationService.updateBuildAgent( agent );
log.error( "Error binding build agent {} service : {} ", agent.getUrl(),
ContinuumUtils.throwableToString( e ) );
throw new ContinuumException( e.getMessage() );
}
boolean ping = false;
try
{
ping = client.ping();
}
catch ( Exception e )
{
agent.setEnabled( false );
log.error( "Unable to ping build agent '{}': {}", agent.getUrl(),