Пример #1
0
 /** Saves the configuration info to the disk. */
 public synchronized void save() {
   if (BulkChange.contains(this)) return;
   try {
     getConfigFile().write(this);
     SaveableListener.fireOnChange(this, getConfigFile());
   } catch (IOException e) {
     LOGGER.log(Level.WARNING, "Failed to save " + getConfigFile(), e);
   }
 }
Пример #2
0
  /**
   * Loads the data from the disk into this object.
   *
   * <p>The constructor of the derived class must call this method. (If we do that in the base
   * class, the derived class won't get a chance to set default values.)
   */
  public synchronized void load() {
    XmlFile file = getConfigFile();
    if (!file.exists()) return;

    try {
      file.unmarshal(this);
    } catch (IOException e) {
      LOGGER.log(Level.WARNING, "Failed to load " + file, e);
    }
  }
Пример #3
0
 /**
  * Look out for a typical error a plugin developer makes. See
  * http://hudson.361315.n4.nabble.com/Help-Hint-needed-Post-build-action-doesn-t-stay-activated-td2308833.html
  */
 private T verifyNewInstance(T t) {
   if (t != null && t.getDescriptor() != this) {
     // TODO: should this be a fatal error?
     LOGGER.warning(
         "Father of "
             + t
             + " and its getDescriptor() points to two different instances. Probably malplaced @Extension. See http://hudson.361315.n4.nabble.com/Help-Hint-needed-Post-build-action-doesn-t-stay-activated-td2308833.html");
   }
   return t;
 }