当前位置: 首页>>代码示例>>Java>>正文


Java Queue.BuildableItem方法代码示例

本文整理汇总了Java中hudson.model.Queue.BuildableItem方法的典型用法代码示例。如果您正苦于以下问题:Java Queue.BuildableItem方法的具体用法?Java Queue.BuildableItem怎么用?Java Queue.BuildableItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Queue的用法示例。


在下文中一共展示了Queue.BuildableItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
public CauseOfBlockage canTake(Node node,
                               Queue.BuildableItem item) {
    // Ask the AvailabilityMonitor for this node if it's okay to
    // run this build.
    ExecutorWorkerThread workerThread = null;

    synchronized(gewtHandles) {
        Computer computer = node.toComputer();
        for (ExecutorWorkerThread t : gewtHandles) {
            if (t.getComputer() == computer) {
                workerThread = t;
                break;
            }
        }
    }

    if (workerThread != null) {
        if (workerThread.getAvailability().canTake(item)) {
            return null;
        } else {
            return new CauseOfBlockage.BecauseNodeIsBusy(node);
        }
    }
    return null;
}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:26,代码来源:GearmanProxy.java

示例2: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
public boolean canTake(Queue.BuildableItem item)
{
    // Jenkins calls this from within the scheduler maintenance
    // function (while owning the queue monitor).  If we are
    // locked, only allow the build we are expecting to run.
    logger.debug("AvailabilityMonitor canTake request for " +
                 workerHoldingLock);

    NodeParametersAction param = item.getAction(NodeParametersAction.class);
    if (param != null) {
        logger.debug("AvailabilityMonitor canTake request for UUID " +
                     param.getUuid() + " expecting " + expectedUUID);

        if (expectedUUID == param.getUuid()) {
            return true;
        }
    }
    return (workerHoldingLock == null);
}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:20,代码来源:NodeAvailabilityMonitor.java

示例3: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public CauseOfBlockage canTake(Queue.BuildableItem item) {
    // hack for some core issue
    if (item.task instanceof Queue.FlyweightTask) {
        return new FlyweightCauseOfBlockage();
    }
    return super.canTake(item);
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:9,代码来源:DockerSlave.java

示例4: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public CauseOfBlockage canTake(Queue.BuildableItem item) {
    if (item.task instanceof DeployNowTask) {
        return null;
    }
    return CauseOfBlockage.fromMessage(Messages._DeployNowSlave_OnlyAcceptsDeployNowTasks());
}
 
开发者ID:jenkinsci,项目名称:deployer-framework-plugin,代码行数:8,代码来源:DeployNowSlave.java

示例5: onEnterBuildable

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void onEnterBuildable(Queue.BuildableItem bi) {
    JenkinsMetricProviderImpl instance = JenkinsMetricProviderImpl.instance();
    if (instance != null && instance.jenkinsJobBuildableTime != null) {
        synchronized (buildable) {
            if (!buildable.containsKey(bi)) {
                buildable.put(bi, instance.jenkinsJobBuildableTime.time());
            }
        }
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:12,代码来源:JenkinsMetricProviderImpl.java

示例6: onLeaveBuildable

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void onLeaveBuildable(Queue.BuildableItem bi) {
    synchronized (buildable) {
        Timer.Context context = buildable.remove(bi);
        if (context != null) {
            context.stop();
        }
    }
}
 
开发者ID:jenkinsci,项目名称:metrics-plugin,代码行数:10,代码来源:JenkinsMetricProviderImpl.java

示例7: onEnterBuildable

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public void onEnterBuildable(Queue.BuildableItem item) {
    final Jenkins jenkins = Jenkins.getInstance();
    final Label label = item.getAssignedLabel();
    for (Cloud cloud : Jenkins.getInstance().clouds) {
        if (cloud instanceof DockerCloud && cloud.canProvision(label)) {
            final NodeProvisioner provisioner = (label == null
                    ? jenkins.unlabeledNodeProvisioner
                    : label.nodeProvisioner);
            provisioner.suggestReviewNow();
        }
    }
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:14,代码来源:FastNodeProvisionerStrategy.java

示例8: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public CauseOfBlockage canTake(Node node,
                               Queue.BuildableItem item) {
    // update only when gearman-plugin is enabled
    if (!GearmanPluginConfig.get().enablePlugin()) {
        return null;
    }

    return GearmanProxy.getInstance().canTake(node, item);
}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:11,代码来源:QueueTaskDispatcherImpl.java

示例9: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
public boolean canTake(Queue.BuildableItem item)
{
    return (true);
}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:5,代码来源:NoopAvailabilityMonitor.java

示例10: canTake

import hudson.model.Queue; //导入方法依赖的package包/类
public boolean canTake(Queue.BuildableItem item); 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:2,代码来源:AvailabilityMonitor.java


注:本文中的hudson.model.Queue.BuildableItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。