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


Java Queue.Executable方法代码示例

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


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

示例1: done

import hudson.model.Queue; //导入方法依赖的package包/类
protected void done(Executor executor) {
    final AbstractCloudComputer<?> c = (AbstractCloudComputer) executor.getOwner();
    Queue.Executable exec = executor.getCurrentExecutable();
    if (executor instanceof OneOffExecutor) {
        LOG.debug("Not terminating {} because {} was a flyweight task", c.getName(), exec);
        return;
    }

    if (exec instanceof ContinuableExecutable && ((ContinuableExecutable) exec).willContinue()) {
        LOG.debug("not terminating {} because {} says it will be continued", c.getName(), exec);
        return;
    }

    LOG.debug("terminating {} since {} seems to be finished", c.getName(), exec);
    done(c);
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:17,代码来源:DockerOnceRetentionStrategy.java

示例2: if

import hudson.model.Queue; //导入方法依赖的package包/类
public static Run<?, ?> $build(FlowExecution execution) throws IOException {
    if (execution != null) {
        FlowExecutionOwner owner = execution.getOwner();
        if (owner != null) {
            Queue.Executable qe = owner.getExecutable();
            if (qe instanceof Run) {
                return (Run) qe;
            }
        }
    }
    return null;
}
 
开发者ID:fabric8io,项目名称:fabric8-jenkins-workflow-steps,代码行数:13,代码来源:Steps.java

示例3: done

import hudson.model.Queue; //导入方法依赖的package包/类
private void done(Executor executor) {
    final DockerComputer c = (DockerComputer) executor.getOwner();
    Queue.Executable exec = executor.getCurrentExecutable();
    if (exec instanceof ContinuableExecutable && ((ContinuableExecutable) exec).willContinue()) {
        LOGGER.log(Level.FINE, "not terminating {0} because {1} says it will be continued", new Object[]{c.getName(), exec});
        return;
    }
    LOGGER.log(Level.FINE, "terminating {0} since {1} seems to be finished", new Object[]{c.getName(), exec});
    done(c);
}
 
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:11,代码来源:DockerOnceRetentionStrategy.java

示例4: waitUntilNoActivityUpTo

import hudson.model.Queue; //导入方法依赖的package包/类
/**
 * Waits until Hudson finishes building everything, including those in the queue, or fail the test
 * if the specified timeout milliseconds is
 * 
 * Ported from Jenkins 1.479.
 */
public void waitUntilNoActivityUpTo(int timeout) throws Exception {
    long startTime = System.currentTimeMillis();
    int streak = 0;

    while (true) {
        Thread.sleep(10);
        if (isSomethingHappening())
            streak=0;
        else
            streak++;

        if (streak>5)   // the system is quiet for a while
            return;

        if (System.currentTimeMillis()-startTime > timeout) {
            List<Queue.Executable> building = new ArrayList<Queue.Executable>();
            for (Computer c : jenkins.getComputers()) {
                for (Executor e : c.getExecutors()) {
                    if (e.isBusy())
                        building.add(e.getCurrentExecutable());
                }
            }
            throw new AssertionError(String.format("Hudson is still doing something after %dms: queue=%s building=%s",
                    timeout, Arrays.asList(jenkins.getQueue().getItems()), building));
        }
    }
}
 
开发者ID:ikedam,项目名称:scoring-load-balancer,代码行数:34,代码来源:ScoringLoadBalancerJenkinsRule.java

示例5: createExecutable

import hudson.model.Queue; //导入方法依赖的package包/类
@Override
public Queue.Executable createExecutable() throws IOException {
    return new MyExecutable(this);
}
 
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:5,代码来源:DockerTask.java

示例6: abortRunning

import hudson.model.Queue; //导入方法依赖的package包/类
public synchronized int abortRunning(int number) throws IllegalAccessException {
        int aborted = 0;

        Computer[] computers = getJenkinsInstance().getComputers();
        for (Computer computer : computers) {
            if (isNull(computer)) {
                continue;
            }

            List<Executor> executors = computer.getExecutors();
            executors.addAll(computer.getOneOffExecutors());

            for (Executor executor : executors) {
                if (isNull(executor) || !executor.isBusy() || nonNull(executor.getCauseOfDeath()) ||
                        !getInterruptCauses(executor).isEmpty() || getInterruptStatus(executor) == Result.ABORTED) {
                    continue;
                }

                Queue.Executable executable = executor.getCurrentExecutable();
                final SubTask parent = executable.getParent();

                if (!(executable instanceof Run)) {
                    continue;
                }
                final Run executableRun = (Run) executable;

                if (!(parent instanceof Job)) {
                    continue;
                }
                final Job parentJob = (Job) parent;

                if (!parentJob.getFullName().equals(job.getFullName())) {
                    // name doesn't match
                    continue;
                }

                if (executableRun.getResult() == Result.ABORTED) {
                    // was already aborted
                    continue;
                }

                if (executableRun instanceof MatrixRun) {
                    // the whole MatrixBuild will be aborted
                    continue;
                }
//                if (executable instanceof MatrixBuild) {
//                    final MatrixBuild executable1 = (MatrixBuild) executable;
//                    executable1.doStop()
//                }

                final GitHubPRCause causeAction = (GitHubPRCause) executableRun.getCause(GitHubPRCause.class);
                if (nonNull(causeAction) && causeAction.getNumber() == number) {
                    LOGGER.info("Aborting '{}', by interrupting '{}'", executableRun, executor);
                    executor.interrupt(Result.ABORTED, new NewPRInterruptCause());
                    aborted++;
                }
            }
        }

        return aborted;
    }
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:62,代码来源:JobRunnerForCause.java

示例7: createExecutable

import hudson.model.Queue; //导入方法依赖的package包/类
public Queue.Executable createExecutable() throws IOException {
    return new ExecutableImpl();
}
 
开发者ID:jenkinsci,项目名称:deployer-framework-plugin,代码行数:4,代码来源:DeployNowTask.java


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