Java 类hudson.model.LoadBalancer 实例源码

项目:jenkins-docker-build-plugin    文件:DockerJobPlugin.java   
public void start() throws Exception {
    LOG.info("Initializing Docker Job Plugin");
    Jenkins jenkins = Jenkins.getInstance();

    LoadBalancer existingLoadBalancer = firstNonNull(jenkins.getQueue().getLoadBalancer(), NULL_LOAD_BALANCER);
    DockerJobLoadBalancer dockerLoadBalancer = new DockerJobLoadBalancer(jenkins, existingLoadBalancer);

    LOG.log(FINE, "Injecting docker job plugin load balancer: fallback={0}", existingLoadBalancer);
    jenkins.getQueue().setLoadBalancer(dockerLoadBalancer);
}
项目:scoring-load-balancer    文件:ScoringLoadBalancer.java   
/**
 * Replaces {@link LoadBalancer} registered to Jenkins to ScoringLoadBalancer.
 * 
 * The {@link LoadBalancer} originally registered are used as one to fall back.
 */
@Initializer(after=InitMilestone.PLUGINS_STARTED, fatal=false)
public static void installLoadBalancer()
{
    LOGGER.info("Replace LoadBalancer to ScoringLoadBalancer");
    Queue q = Jenkins.getInstance().getQueue();
    LoadBalancer fallback = q.getLoadBalancer();
    q.setLoadBalancer(new ScoringLoadBalancer(fallback));
}
项目:jenkins-docker-build-plugin    文件:DockerJobLoadBalancer.java   
public DockerJobLoadBalancer(Jenkins jenkins, LoadBalancer fallback) {
    _jenkins = checkNotNull(jenkins);
    _fallback = checkNotNull(fallback);
}
项目:scoring-load-balancer    文件:ScoringLoadBalancer.java   
/**
 * @return {@link LoadBalancer} to fall back
 */
public LoadBalancer getFallback()
{
    return fallback;
}
项目:scoring-load-balancer    文件:ScoringLoadBalancer.java   
/**
 * Constructor.
 * 
 * @param fallback LoadBalancer to fall back. Specify originally registered LoadBalancer.
 */
public ScoringLoadBalancer(LoadBalancer fallback)
{
    this.fallback = fallback;
}