热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

hudson.model.Node.getSelfLabel()方法的使用及代码示例

本文整理了Java中hudson.model.Node.getSelfLabel()方法的一些代码示例,展示了Node.getSelfLabel()

本文整理了Java中hudson.model.Node.getSelfLabel()方法的一些代码示例,展示了Node.getSelfLabel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getSelfLabel()方法的具体详情如下:
包路径:hudson.model.Node
类名称:Node
方法名:getSelfLabel

Node.getSelfLabel介绍

[英]Gets the special label that represents this node itself.
[中]获取表示此节点本身的特殊标签。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
* Returns true if this label is a "self label",
* which means the label is the name of a {@link Node}.
*/
public boolean isSelfLabel() {
Set nodes = getNodes();
return nodes.size() == 1 && nodes.iterator().next().getSelfLabel() == this;
}

代码示例来源:origin: jenkinsci/jenkins

/**
* Assigns this job to the given node. A convenience method over {@link #setAssignedLabel(Label)}.
*/
public void setAssignedNode(Node l) throws IOException {
setAssignedLabel(l.getSelfLabel());
}

代码示例来源:origin: jenkinsci/jenkins

/**
* Returns projects that are tied on this node.
*/
public List getTiedJobs() {
Node node = getNode();
return (node != null) ? node.getSelfLabel().getTiedJobs() : Collections.EMPTY_LIST;
}

代码示例来源:origin: jenkinsci/jenkins

/**
* Returns the possibly empty set of labels that are assigned to this node,
* including the automatic {@link #getSelfLabel() self label}, manually
* assigned labels and dynamically assigned labels via the
* {@link LabelFinder} extension point.
*
* This method has a side effect of updating the hudson-wide set of labels
* and should be called after events that will change that - e.g. a agent
* connecting.
*/
@Exported
public Set getAssignedLabels() {
Set r = Label.parse(getLabelString());
r.add(getSelfLabel());
r.addAll(getDynamicLabels());
return Collections.unmodifiableSet(r);
}

代码示例来源:origin: jenkinsci/jenkins

private PollingResult pollWithWorkspace(TaskListener listener, SCM scm, R lb, @Nonnull FilePath ws, WorkspaceList l) throws InterruptedException, IOException {
// if doing non-concurrent build, acquire a workspace in a way that causes builds to block for this workspace.
// this prevents multiple workspaces of the same job --- the behavior of Hudson <1.319.
//
// OTOH, if a concurrent build is chosen, the user is willing to create a multiple workspace,
// so better throughput is achieved over time (modulo the initial cost of creating that many workspaces)
// by having multiple workspaces
Node node = lb.getBuiltOn();
Launcher launcher = ws.createLauncher(listener).decorateByEnv(getEnvironment(node,listener));
WorkspaceList.Lease lease = l.acquire(ws, !concurrentBuild);
try {
String nodeName = node != null ? node.getSelfLabel().getName() : "[node_unavailable]";
listener.getLogger().println("Polling SCM changes on " + nodeName);
LOGGER.fine("Polling SCM changes of " + getName());
if (pollingBaseline==null) // see NOTE-NO-BASELINE above
calcPollingBaseline(lb,launcher,listener);
PollingResult r = scm.poll(this, launcher, ws, listener, pollingBaseline);
pollingBaseline = r.remote;
return r;
} finally {
lease.release();
}
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
* Assigns this job to the given node. A convenience method over {@link #setAssignedLabel(Label)}.
*/
public void setAssignedNode(Node l) throws IOException {
setAssignedLabel(l.getSelfLabel());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
* Assigns this job to the given node. A convenience method over {@link #setAssignedLabel(Label)}.
*
* @param node node.
* @throws java.io.IOException exception
*/
public void setAssignedNode(Node node) throws IOException {
setAssignedLabel(node.getSelfLabel());
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
* Returns true if this label is a "self label",
* which means the label is the name of a {@link Node}.
*/
public boolean isSelfLabel() {
Set nodes = getNodes();
return nodes.size() == 1 && nodes.iterator().next().getSelfLabel() == this;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
* Returns true if this label is a "self label", which means the label is
* the name of a {@link Node}.
*/
public boolean isSelfLabel() {
Set nodes = getNodes();
return nodes.size() == 1 && nodes.iterator().next().getSelfLabel() == this;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
* Assigns this job to the given node. A convenience method over {@link #setAssignedLabel(Label)}.
*
* @param node node.
* @throws java.io.IOException exception
*/
public void setAssignedNode(Node node) throws IOException {
setAssignedLabel(node.getSelfLabel());
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
* Returns true if this label is a "self label",
* which means the label is the name of a {@link Node}.
*/
public boolean isSelfLabel() {
Set nodes = getNodes();
return nodes.size() == 1 && nodes.iterator().next().getSelfLabel() == this;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
* Assigns this job to the given node. A convenience method over
* {@link #setAssignedLabel(Label)}.
*
* @param node node.
* @throws java.io.IOException exception
*/
public void setAssignedNode(Node node) throws IOException {
setAssignedLabel(node.getSelfLabel());
}

代码示例来源:origin: org.jenkins-ci.plugins/nodelabelparameter

private List getNodeNamesForLabelExpression(String labelExp) {
List nodeNames = new ArrayList();
try {
Label label = LabelExpression.parseExpression(labelExp);
for (Node node : label.getNodes()) {
nodeNames.add(node.getSelfLabel().getName());
}
} catch (ANTLRException e) {
LOGGER.log(Level.SEVERE, "failed to parse label [" + labelExp + "]", e);
}
return nodeNames;
}

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

/**
* {@link MavenModule} uses the workspace of the {@link MavenModuleSet},
* so it always needs to be built on the same slave as the parent.
*/
@Override
public Label getAssignedLabel() {
Node n = getParent().getLastBuiltOn();
if(n==null) return null;
return n.getSelfLabel();
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
* Returns projects that are tied on this node.
*/
public List getTiedJobs() {
Node node = getNode();
return (node != null) ? node.getSelfLabel().getTiedJobs() : Collections.EMPTY_LIST;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
* Returns projects that are tied on this node.
*/
public List getTiedJobs() {
return getNode().getSelfLabel().getTiedJobs();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
* Returns projects that are tied on this node.
*/
public List getTiedJobs() {
return getNode().getSelfLabel().getTiedJobs();
}

代码示例来源:origin: jenkinsci/maven-plugin

/**
* {@link MavenModule} uses the workspace of the {@link MavenModuleSet},
* so it always needs to be built on the same slave as the parent.
*/
@Override
public Label getAssignedLabel() {
Node n = getParent().getLastBuiltOn();
if(n==null) return null;
return n.getSelfLabel();
}

代码示例来源:origin: org.jenkins-ci.plugins/ivy

/**
* {@link IvyModule} uses the workspace of the {@link IvyModuleSet}, so it
* always needs to be built on the same slave as the parent.
*/
@Override
public Label getAssignedLabel() {
Node n = getParent().getLastBuiltOn();
if (n == null)
return null;
return n.getSelfLabel();
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
* Returns projects that are tied on this node.
*/
public List getTiedJobs() {
return getNode().getSelfLabel().getTiedJobs();
}

推荐阅读
author-avatar
songaihua853185820299
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有