本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例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);
}
示例9: canTake
import hudson.model.Queue; //导入方法依赖的package包/类
public boolean canTake(Queue.BuildableItem item)
{
return (true);
}
示例10: canTake
import hudson.model.Queue; //导入方法依赖的package包/类
public boolean canTake(Queue.BuildableItem item);