Examples of Updater


Examples of net.gravitydevelopment.updater.Updater

      this.saveConfig();

      // Start timed permissions cleaner timer
      this.permissionsManager.initTimer();
      if (config.updaterEnabled()) {
        final Updater updater = new Updater(this, BUKKITDEV_ID, this.getFile(), Updater.UpdateType.DEFAULT, false) {
          /**
           * Customized update check function.
           * If update is only a difference in minor version (supermajor.major.minor)
           * @param localVerString Local version in string form
           * @param remoteVerString Remote version in string format
           * @return
           */
          @Override
          public boolean shouldUpdate(String localVerString, String remoteVerString) {
            if (localVerString.equals(remoteVerString)) { // Versions are equal
              return false;
            }

            if (config.alwaysUpdate()) {
              return true;
            }

            if (localVerString.endsWith("-SNAPSHOT") || remoteVerString.endsWith("-SNAPSHOT")) { // Don't update when a dev build is involved
              return false;
            }

            String[] localVer = localVerString.split("\\.");
            int localSuperMajor = Integer.parseInt(localVer[0]);
            int localMajor = localVer.length > 1 ? Integer.parseInt(localVer[1]) : 0;
            int localMinor = localVer.length > 2 ? Integer.parseInt(localVer[2]) : 0;
            String[] remoteVer = remoteVerString.split("\\.");
            int remoteSuperMajor = Integer.parseInt(remoteVer[0]);
            int remoteMajor = remoteVer.length > 1 ? Integer.parseInt(remoteVer[1]) : 0;
            int remoteMinor = remoteVer.length > 2 ? Integer.parseInt(remoteVer[2]) : 0;

            if (localSuperMajor > remoteSuperMajor
                || (localSuperMajor == remoteSuperMajor && localMajor > remoteMajor)
                || (localSuperMajor == remoteSuperMajor && localMajor == remoteMajor && localMinor >= remoteMinor)) {
              return false; // Local version is newer or same as remote version
            }
            if (localSuperMajor == remoteSuperMajor && localMajor == remoteMajor) {
              // Versions aren't equal but major version is, this is a minor update
              return true;
            } else {
              getLogger().warning("An update to " + getDescription().getName() + " version " + remoteVerString + " is available to download from" +
                  " http://dev.bukkit.org/bukkit-plugins/permissionsex/. Please review the changes and update as soon as possible!");
              return false;
            }

          }
        };
        getServer().getScheduler().runTaskAsynchronously(this, new Runnable() {
          @Override
          public void run() {
            switch (updater.getResult()) {
              case SUCCESS:
                getLogger().info("An update to " + updater.getLatestName() + " was downloaded and will be applied on next server launch.");
            }
          }
        });
      }
      if (getConfiguration().useNetEvents()) {
View Full Code Here

Examples of net.gravitydevelopment.updater.mcmmo.Updater

        this.plugin = plugin;
    }

    @Override
    public void run() {
        Updater updater = new Updater(plugin, 31030, plugin.mcmmo, Updater.UpdateType.NO_DOWNLOAD, false);

        if (updater.getResult() != Updater.UpdateResult.UPDATE_AVAILABLE) {
            plugin.setUpdateAvailable(false);
            return;
        }

        if (updater.getLatestType().equals("beta") && !Config.getInstance().getPreferBeta()) {
            plugin.setUpdateAvailable(false);
            return;
        }

        plugin.setUpdateAvailable(true);
View Full Code Here

Examples of nodebox.versioncheck.Updater

            }
        });
    }

    private void checkForUpdates() {
        updater = new Updater(Application.this);
        updater.checkForUpdatesInBackground();
    }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

        }

        /** Call delegate then pop <code>Updater</code> */
        public void end(ReadContext context) throws Exception {
            delegate.end(context);
            Updater updater = context.popUpdater();
        }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

                            log.trace("Attr URL:" + attributeDescriptor.getURI());
                            log.trace("Attr LocalName:" + attributeDescriptor.getLocalName() );
                            log.trace(value);
                        }
                       
                        Updater updater = attributeDescriptor.getUpdater();
                        log.trace(updater);
                        if ( updater != null && value != null ) {
                            updater.update( context, value );
                        }
                    }
                }
               
                addChildRules();
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

     */
    public void end() {
        if ( createdBean ) {
           
            // force any setters of the parent bean to be called for this new bean instance
            Updater updater = descriptor.getUpdater();
            Object instance = context.getBean();

            Object top = digester.pop();
            if (digester.getCount() == 0) {
                context.setBean(null);
            }else{
                context.setBean( digester.peek() );
            }

            if ( updater != null ) {
                if ( log.isDebugEnabled() ) {
                    log.debug( "Calling updater for: " + descriptor + " with: "
                        + instance + " on bean: " + context.getBean() );
                }
                updater.update( context, instance );
            } else {
                if ( log.isDebugEnabled() ) {
                    log.debug( "No updater for: " + descriptor + " with: "
                        + instance + " on bean: " + context.getBean() );
                }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

            if (bodyTextdescriptor != null) {
                if (log.isTraceEnabled()) {
                    log.trace("Setting mixed content for:");
                    log.trace(bodyTextdescriptor);
                }
                Updater updater = bodyTextdescriptor.getUpdater();
                if (log.isTraceEnabled())
                {   
                    log.trace("Updating mixed content with:");
                    log.trace(updater);
                }
                if (updater != null && text != null) {
                    updater.update(context, text);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

    }

    private void update(ReadContext context, Object value) throws Exception {
        Log log = context.getLog();

        Updater updater = context.getCurrentUpdater();
       
        if ( updater == null ) {
            if ( context.getLog().isTraceEnabled() ) {
                context.getLog().trace("No updater for " + context.getCurrentElement());
            }
        } else {
            updater.update(context, value);
        }

        String poppedElement = context.popElement();
    }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

            ElementDescriptor currentDescriptor = getCurrentDescriptor();
            if (currentDescriptor != null) {
                nextDescriptor = currentDescriptor.getElementDescriptor(elementName);
            }
        }
        Updater updater = null;
        Options options = null;
        if (nextDescriptor != null) {
            updater = nextDescriptor.getUpdater();
            options = nextDescriptor.getOptions();
        }
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Updater

       
        XMLBeanInfo mappedClassInfo = getXMLIntrospector().introspect(mappedClazz);
        ElementDescriptor mappedElementDescriptor = mappedClassInfo.getElementDescriptor();
        descriptorStack.push(mappedElementDescriptor);
       
        Updater updater = mappedElementDescriptor.getUpdater();
        updaterStack.push(updater);
  }
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.