hudson.plugins.swarm
Class Client

java.lang.Object
  extended by hudson.plugins.swarm.Client

public class Client
extends java.lang.Object

Swarm client.

Discovers nearby Hudson via UDP broadcast, and pick eligible one randomly and joins it.

Author:
Kohsuke Kawaguchi

Field Summary
 java.lang.String description
           
 int executors
           
 boolean help
           
 java.lang.String labels
           
 java.lang.String master
           
 java.lang.String name
           
 java.io.File remoteFsRoot
           
protected  java.net.DatagramSocket socket
          Used to discover the server.
protected  hudson.plugins.swarm.Client.Candidate target
          The Hudson that we are trying to connect to.
 
Constructor Summary
Client()
           
 
Method Summary
protected  void connect()
           
protected  void createSwarmSlave()
           
protected  java.util.List<java.net.DatagramPacket> discover()
          Discovers Hudson running nearby.
static void main(java.lang.String... args)
           
 void run()
          Finds a Hudson master that supports swarming, and join it.
protected  void sendBroadcast()
           
protected  void verifyThatUrlIsHudson()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected final java.net.DatagramSocket socket
Used to discover the server.


target

protected hudson.plugins.swarm.Client.Candidate target
The Hudson that we are trying to connect to.


name

public java.lang.String name

description

public java.lang.String description

labels

public java.lang.String labels

remoteFsRoot

public java.io.File remoteFsRoot

executors

public int executors

master

public java.lang.String master

help

public boolean help
Constructor Detail

Client

public Client()
       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

main

public static void main(java.lang.String... args)
                 throws java.lang.InterruptedException,
                        java.io.IOException
Throws:
java.lang.InterruptedException
java.io.IOException

run

public void run()
         throws java.lang.InterruptedException
Finds a Hudson master that supports swarming, and join it. This method never returns.

Throws:
java.lang.InterruptedException

discover

protected java.util.List<java.net.DatagramPacket> discover()
                                                    throws java.io.IOException,
                                                           java.lang.InterruptedException,
                                                           RetryException
Discovers Hudson running nearby. To give every nearby Hudson a fair chance, wait for some time until we hear all the responses.

Throws:
java.io.IOException
java.lang.InterruptedException
RetryException

sendBroadcast

protected void sendBroadcast()
                      throws java.io.IOException
Throws:
java.io.IOException

connect

protected void connect()
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

createSwarmSlave

protected void createSwarmSlave()
                         throws java.io.IOException,
                                java.lang.InterruptedException,
                                RetryException
Throws:
java.io.IOException
java.lang.InterruptedException
RetryException

verifyThatUrlIsHudson

protected void verifyThatUrlIsHudson()
                              throws java.lang.InterruptedException,
                                     RetryException
Throws:
java.lang.InterruptedException
RetryException


Copyright © 2009. All Rights Reserved.