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


Java OfflineCause类代码示例

本文整理汇总了Java中hudson.slaves.OfflineCause的典型用法代码示例。如果您正苦于以下问题:Java OfflineCause类的具体用法?Java OfflineCause怎么用?Java OfflineCause使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: markOffline

import hudson.slaves.OfflineCause; //导入依赖的package包/类
@Override
public boolean markOffline(Computer c, OfflineCause oc) {
	initPython();
	if (pexec.isImplemented(3)) {
		return pexec.execPythonBool("mark_offline", c, oc);
	} else {
		return super.markOffline(c, oc);
	}
}
 
开发者ID:conyx,项目名称:jenkins.py,代码行数:10,代码来源:AbstractNodeMonitorDescriptorPW.java

示例2: checkInternal

import hudson.slaves.OfflineCause; //导入依赖的package包/类
/**
 * Checks if the computer has expired and marks it for deletion.
 * {@link org.jenkinsci.plugins.mesos.MesosCleanupThread} will then come around and terminate those tasks
 * @param c The Mesos Computer
 * @return The number of minutes to check again afterwards
 */
private long checkInternal(MesosComputer c) {
  MesosSlave node = c.getNode();
  if (node == null || node.isPendingDelete()) {
    return 1;
  }

  // If we just launched this computer, check back after 1 min.
  // NOTE: 'c.getConnectTime()' refers to when the Jenkins slave was launched.
  if ((DateTimeUtils.currentTimeMillis() - c.getConnectTime()) <
      MINUTES.toMillis(idleTerminationMinutes < 1 ? 1 : idleTerminationMinutes)) {
    return 1;
  }

  // Terminate the computer if it is idle for longer than
  // 'idleTerminationMinutes'.
  if (isTerminable() && c.isIdle()) {
    final long idleMilliseconds =
        DateTimeUtils.currentTimeMillis() - c.getIdleStartMilliseconds();

    if (idleMilliseconds > MINUTES.toMillis(idleTerminationMinutes)) {
      LOGGER.info("Disconnecting idle computer " + c.getName());
      node.setPendingDelete(true);

      if (!c.isOffline()) {
        c.setTemporarilyOffline(true, OfflineCause.create(Messages._MesosRetentionStrategy_DeletedCause()));
      }
    }
  }
  return 1;
}
 
开发者ID:jenkinsci,项目名称:mesos-plugin,代码行数:37,代码来源:MesosRetentionStrategy.java

示例3: tearDown

import hudson.slaves.OfflineCause; //导入依赖的package包/类
@Override
public void tearDown(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
    Computer computer = workspace.toComputer();
    if (computer == null) {
        throw new IllegalStateException("Computer is null");
    }
    if (MesosComputer.class.isInstance(computer)) {
        String msg = "Taking single-use slave " + computer.getName() + " offline.";
        LOGGER.warning(msg);
        listener.getLogger().println(msg);
        computer.setTemporarilyOffline(true, OfflineCause.create(Messages._MesosSingleUseSlave_OfflineCause()));
    } else {
        listener.getLogger().println("Not a single-use slave, this is a " + computer.getClass());
    }
}
 
开发者ID:jenkinsci,项目名称:mesos-plugin,代码行数:16,代码来源:MesosSingleUseSlave.java

示例4: onTemporarilyOffline

import hudson.slaves.OfflineCause; //导入依赖的package包/类
@Override
public void onTemporarilyOffline(Computer c, OfflineCause cause) {
    // fired when master or slave goes into temporary offline state
    logger.info("---- " + ComputerListenerImpl.class.getName() + ":"
            + " onTemporarilyOffline computer " + c);
    // update functions only when gearman-plugin is enabled
    if (!GearmanPluginConfig.get().enablePlugin()) {
        return;
    }

    // re-register gearman functions on node status change,
    GearmanProxy.getInstance().registerJobs();
}
 
开发者ID:openstack-infra,项目名称:gearman-plugin,代码行数:14,代码来源:ComputerListenerImpl.java

示例5: superMarkOffline

import hudson.slaves.OfflineCause; //导入依赖的package包/类
public boolean superMarkOffline(Computer c, OfflineCause oc) {
	return super.markOffline(c, oc);
}
 
开发者ID:conyx,项目名称:jenkins.py,代码行数:4,代码来源:AbstractNodeMonitorDescriptorPW.java


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