Class CreationItemListener

    • Constructor Detail

      • CreationItemListener

        public CreationItemListener()
    • Method Detail

      • onJenkinsStart

        public static void onJenkinsStart()
        This function will wait until it thinks all static jobs have been loaded and then tries to generate the transients before letting Jenkins attain the InitMilestone.JOB_LOADED milestone.

        Do note that this is just a time-based heuristic and is the only way to reliably trigger before Jenkins calls Queue.init(Jenkins) and restores aborted Runs from it.

        But since that is unreliable, we trigger the recreation again via onJenkinsJobsGuaranteedLoaded().

      • onJenkinsJobsGuaranteedLoaded

        public static void onJenkinsJobsGuaranteedLoaded()
        This method does the same as onJenkinsStart(), except that it has no reason to wait, since all static Jobs are guaranteed to have been created by then. Unfortunately, Jenkins has most likely already called Queue.init(Jenkins) by this point, so the other function is also important.

        In other words, this functions ensures the reliable creation of all transient jobs; whereas the other one tries to promise a reliable restoration of jobs that were stuck in the previous Queue.