All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zeroturnaround.jenkins.updateModes.Hotpatch Maven / Gradle / Ivy

Go to download

LiveRebel Plugin helps to run updates to your JEE containers faster. LiveRebel is a tool for hot updates without downtime, lost sessions and OutOfMemoryErrors. You have to have a running LiveRebel Command Center to use this plugin.

The newest version!
package org.zeroturnaround.jenkins.updateModes;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.kohsuke.stapler.DataBoundConstructor;
import org.zeroturnaround.liverebel.plugins.PluginUtil;

import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Hudson;


public class Hotpatch extends UpdateMode{
  public final boolean updateWithWarnings;
  public final int requestPause;
  public final UpdateMode fallback;

  public Hotpatch() {
    this.fallback = null;
    updateWithWarnings = false;
    requestPause = PluginUtil.DEFAULT_REQUEST_PAUSE;
  }
  @DataBoundConstructor
  public Hotpatch(boolean updateWithWarnings, int requestPause, UpdateMode fallback) {
    this.updateWithWarnings = updateWithWarnings;
    this.requestPause = requestPause;
    this.fallback = fallback;
  }

  @Override
  public String toString() {
    return "Hotpatch";
  }

  @Extension
  public static class DescriptorImpl extends Descriptor {

    public Descriptor getDefaultFallbackUpdate() {
      DescriptorExtensionList> allDescriptors = Hudson.getInstance().getDescriptorList(org.zeroturnaround.jenkins.updateModes.UpdateMode.class);
      Iterator> it = allDescriptors.iterator();
      while (it.hasNext()) {
        Descriptor next = it.next();
        if (next.clazz == RollingRestarts.class) {
          return next;
        }
      }
      return null;
    }

    public List> getFallbackUpdateModes() {
      DescriptorExtensionList> allDescriptors = Hudson.getInstance().getDescriptorList(org.zeroturnaround.jenkins.updateModes.UpdateMode.class);
      List> fallbackUpdateModes = new ArrayList>();
      Iterator> it = allDescriptors.iterator();

      while (it.hasNext()) {
        Descriptor next = it.next();
        if (next.clazz != Hotpatch.class) {
          fallbackUpdateModes.add(next);
        }
      }
      return fallbackUpdateModes;
    }

    @Override
    public String getDisplayName() {
      return "Hotpatch";
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy