Package hudson.model

Examples of hudson.model.Queue.cancel()


                // if the build was aborted in the middle. Cancel all the configuration builds.
                Queue q = Jenkins.getInstance().getQueue();
                synchronized(q) {// avoid micro-locking in q.cancel.
                    final int n = getNumber();
                    for (MatrixConfiguration c : p.getActiveConfigurations()) {
                        if(q.cancel(c))
                            logger.println(Messages.MatrixBuild_Cancelled(ModelHyperlinkNote.encodeTo(c)));
                        MatrixRun b = c.getBuildByNumber(n);
                        if(b!=null && b.isBuilding()) {// executor can spend some time in post production state, so only cancel in-progress builds.
                            Executor exe = b.getExecutor();
                            if(exe!=null) {
View Full Code Here


        synchronized (q) {
            final int n = dynamicBuild.getNumber();
            for (Item i : q.getItems()) {
                ParentBuildAction parentBuildAction = i.getAction(ParentBuildAction.class);
                if (parentBuildAction != null && dynamicBuild.equals(parentBuildAction.getParent())) {
                    q.cancel(i);
                }
            }
            for (DynamicSubProject c : dynamicBuild.getAllSubProjects()) {
                DynamicSubBuild b = c.getBuildByNumber(n);
                if (b != null && b.isBuilding()) {
View Full Code Here

                    if(mayInterruptIfRunning)
                        for (Executor e : executors)
                            e.interrupt();
                    return mayInterruptIfRunning;
                }
                return q.cancel(task);
            }
        }
    }

    synchronized void addExecutor(Executor executor) {
View Full Code Here

        LOGGER.info("Cancelling Item ");
        try {

            if (item != null) {
                Queue queue = Queue.getInstance();
                boolean canceled = queue.cancel(item);
                LOGGER.warning("Build " + label + " " + builderName
                        + " has been canceled");
            }
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE,
View Full Code Here

        // if the build is still in the queue, abort it.
        // BuildTriggerListener will report the failure, so this method shouldn't call getContext().onFailure()
        for (Queue.Item i : q.getItems()) {
            BuildTriggerAction bta = i.getAction(BuildTriggerAction.class);
            if (bta!=null && bta.getStepContext().equals(getContext())) {
                q.cancel(i);
            }
        }

        // if there's any in-progress build already, abort that.
        // when the build is actually aborted, BuildTriggerListener will take notice and report the failure,
View Full Code Here

            } finally {
                // if the build was aborted in the middle. Cancel all the configuration builds.
                Queue q = Hudson.getInstance().getQueue();
                synchronized (q) {// avoid micro-locking in q.cancel.
                    for (MatrixConfiguration c : activeConfigurations) {
                        if (q.cancel(c)) {
                            logger.println(Messages.MatrixBuild_Cancelled(c.getDisplayName()));
                        }
                        MatrixRun b = c.getBuildByNumber(n);
                        if (b != null) {
                            Executor exe = b.getExecutor();
View Full Code Here

                    if(mayInterruptIfRunning)
                        for (Executor e : executors)
                            e.interrupt();
                    return mayInterruptIfRunning;
                }
                return q.cancel(task);
            }
        }
    }

    synchronized void addExecutor(Executor executor) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.