本文整理了Java中jenkins.model.Jenkins.toComputer()
方法的一些代码示例,展示了Jenkins.toComputer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.toComputer()
方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:toComputer
暂无
代码示例来源:origin: jenkinsci/jenkins
if (toComputer() == null) {
future.put("master", RemotingDiagnostics.getThreadDumpAsync(FilePath.localChannel));
代码示例来源:origin: jenkinsci/jenkins
@Override
public void onRestart() {
Computer computer = Jenkins.getInstance().toComputer();
if (computer == null) return;
RestartCause cause = new RestartCause();
for (ComputerListener listener: ComputerListener.all()) {
listener.onOffline(computer, cause);
}
}
代码示例来源:origin: jenkinsci/jenkins
final Computer c = toComputer();
if(c != null) {
for (ComputerListener cl : ComputerListener.all()) {
代码示例来源:origin: jenkinsci/jenkins
return createFlyWeightTaskRunnable(p, h.toComputer());
} else {
return null;
代码示例来源:origin: jenkinsci/jenkins
/**
* Accepts submission from the node configuration page.
*/
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
checkPermission(ADMINISTER);
BulkChange bc = new BulkChange(this);
try {
JSONObject json = req.getSubmittedForm();
ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json);
getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
} finally {
bc.commit();
}
updateComputerList();
rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page
}
代码示例来源:origin: jenkinsci/azure-vm-agents-plugin
public void resetShutdownVMStatus(final AzureVMAgent agent) {
Computer computer = Jenkins.getInstance().toComputer();
if (computer != null
&& System.currentTimeMillis() - computer.getConnectTime() < LAPSE_START_JENKINS) {
Computer.threadPoolForRemoting.submit(new Runnable() {
@Override
public void run() {
if (agent.getTemplate().isShutdownOnIdle()) {
agent.setEligibleForReuse(false);
agent.shutdown(agent.getCleanUpReason());
agent.blockCleanUpAction();
}
}
});
}
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
if (toComputer() == null) {
future.put("master", RemotingDiagnostics.getThreadDumpAsync(FilePath.localChannel));
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public void onRestart() {
Computer computer = Jenkins.getInstance().toComputer();
if (computer == null) return;
RestartCause cause = new RestartCause();
for (ComputerListener listener: ComputerListener.all()) {
listener.onOffline(computer, cause);
}
}
代码示例来源:origin: jenkinsci/envinject-plugin
if (forceOnMaster) {
computer = jenkins.toComputer();
} else {
computer = Computer.currentComputer();
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
final Computer c = toComputer();
if(c != null) {
for (ComputerListener cl : ComputerListener.all()) {
代码示例来源:origin: org.jenkins-ci.plugins/git
environment = ((Job) item).getEnvironment(jenkins, TaskListener.NULL);
} else {
environment = jenkins.toComputer().buildEnvironment(TaskListener.NULL);
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Accepts submission from the node configuration page.
*/
@RequirePOST
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException {
checkPermission(ADMINISTER);
BulkChange bc = new BulkChange(this);
try {
JSONObject json = req.getSubmittedForm();
MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class);
if (mbc!=null)
mbc.configure(req,json);
getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
} finally {
bc.commit();
}
updateComputerList();
rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page
}
代码示例来源:origin: jenkinsci/workflow-cps-plugin
private void liveness() {
assertFalse(jenkins().toComputer().isIdle());
Executor e = b.getOneOffExecutor();
assertNotNull(e);
assertEquals(e, b.getExecutor());
assertTrue(e.isActive());
/* TODO seems flaky:
assertFalse(e.isAlive());
*/
}
代码示例来源:origin: org.jenkins-ci.plugins/metrics
if (jenkins.getNumExecutors() > 0) {
nodeCount++;
Computer computer = jenkins.toComputer();
if (computer != null) {
if (!computer.isOffline()) {
内容来源于网络,如有侵权,请联系作者删除!