Example #1
0
  public RootDispatcher(IGitblit gitblit, SshDaemonClient client, String cmdLine) {
    super();
    setContext(new SshCommandContext(gitblit, client, cmdLine));

    UserModel user = client.getUser();
    register(user, VersionCommand.class);
    register(user, GitDispatcher.class);
    register(user, KeysDispatcher.class);
    register(user, PluginDispatcher.class);

    List<DispatchCommand> exts = gitblit.getExtensions(DispatchCommand.class);
    for (DispatchCommand ext : exts) {
      Class<? extends DispatchCommand> extClass = ext.getClass();
      PluginWrapper wrapper = gitblit.whichPlugin(extClass);
      String plugin = wrapper.getDescriptor().getPluginId();
      CommandMetaData meta = extClass.getAnnotation(CommandMetaData.class);
      log.debug("Dispatcher {} is loaded from plugin {}", meta.name(), plugin);
      register(user, ext);
    }
  }