Package com.google.gerrit.server.plugins

Examples of com.google.gerrit.server.plugins.InvalidPluginException


      throws InvalidPluginException {
    Preconditions.checkState(command != null, "pluginName must be provided");
    if (Command.class.isAssignableFrom(type)) {
      Class<Command> old = commands.get(export.value());
      if (old != null) {
        throw new InvalidPluginException(String.format(
            "@Export(\"%s\") has duplicate bindings:\n  %s\n  %s",
            export.value(), old.getName(), type.getName()));
      }
      commands.put(export.value(), (Class<Command>) type);
    } else {
      throw new InvalidPluginException(String.format(
          "Class %s with @Export(\"%s\") must extend %s or implement %s",
          type.getName(), export.value(),
          SshCommand.class.getName(), Command.class.getName()));
    }
  }
View Full Code Here


  public void export(Export export, Class<?> type)
      throws InvalidPluginException {
    if (HttpServlet.class.isAssignableFrom(type)) {
      Class<HttpServlet> old = serve.get(export.value());
      if (old != null) {
        throw new InvalidPluginException(String.format(
            "@Export(\"%s\") has duplicate bindings:\n  %s\n  %s",
            export.value(), old.getName(), type.getName()));
      }
      serve.put(export.value(), (Class<HttpServlet>) type);
    } else {
      throw new InvalidPluginException(String.format(
          "Class %s with @Export(\"%s\") must extend %s",
          type.getName(), export.value(),
          HttpServlet.class.getName()));
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gerrit.server.plugins.InvalidPluginException

Copyright © 2018 www.massapicom. 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.