Package com.google.gerrit.extensions.registration

Examples of com.google.gerrit.extensions.registration.RegistrationHandle


  private void install(Plugin plugin) {
    GuiceFilter filter = load(plugin);
    final String name = plugin.getName();
    final PluginHolder holder = new PluginHolder(plugin, filter);
    plugin.add(new RegistrationHandle() {
      @Override
      public void remove() {
        plugins.remove(name, holder);
      }
    });
View Full Code Here


      } catch (ServletException e) {
        log.warn(String.format("Plugin %s failed to initialize HTTP", name), e);
        return null;
      }

      plugin.add(new RegistrationHandle() {
        @Override
        public void remove() {
          filter.destroy();
        }
      });
View Full Code Here

    }
  }

  private static <T> void replace(Plugin newPlugin,
      ReloadableRegistrationHandle<T> h, Binding<T> b) {
    RegistrationHandle n = h.replace(b.getKey(), b.getProvider());
    if (n != null){
      newPlugin.add(n);
    }
  }
View Full Code Here

      final Provider<Command> cmd) {
    final ConcurrentMap<String, Provider<Command>> m = getMap();
    if (m.putIfAbsent(name.value(), cmd) != null) {
      throw new IllegalArgumentException(name.value() + " exists");
    }
    return new RegistrationHandle() {
      @Override
      public void remove() {
        m.remove(name.value(), cmd);
      }
    };
View Full Code Here

  public RegistrationHandle replace(final CommandName name,
      final Provider<Command> cmd) {
    final ConcurrentMap<String, Provider<Command>> m = getMap();
    m.put(name.value(), cmd);
    return new RegistrationHandle() {
      @Override
      public void remove() {
        m.remove(name.value(), cmd);
      }
    };
View Full Code Here

TOP

Related Classes of com.google.gerrit.extensions.registration.RegistrationHandle

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.