Make hooks/events listen to the new API Events.

Create a ChangeHookApiListener to listen to the new API Events and
forward these events to the old legacy ChangeHookRunner.  This decouples
the hooks and stream events from the internal events.  This also
decouples the ChangeHooks interface (and implementations) from all
internal classes except for the new ChangeHookApiListener.  This
decoupling should now make it very easy to move all of these classes to
plugins.

Change-Id: I9153dca45727f1c7ea10a8d003e1acf2171b39ac
This commit is contained in:
Martin Fick
2015-11-10 14:53:43 -07:00
committed by David Pursehouse
parent 59cdd227a9
commit d432c83a72
33 changed files with 465 additions and 387 deletions

View File

@@ -18,6 +18,7 @@ import static com.google.inject.Scopes.SINGLETON;
import static com.google.inject.Stage.PRODUCTION;
import com.google.common.base.Splitter;
import com.google.gerrit.common.ChangeHookApiListener;
import com.google.gerrit.common.ChangeHookRunner;
import com.google.gerrit.common.EventBroker;
import com.google.gerrit.gpg.GpgModule;
@@ -298,6 +299,7 @@ public class WebAppInitializer extends GuiceServletContextListener
modules.add(new EventBroker.Module());
modules.add(new AccountPatchReviewStoreImpl.Module());
modules.add(cfgInjector.getInstance(GitRepositoryManagerModule.class));
modules.add(new ChangeHookApiListener.Module());
modules.add(new ChangeHookRunner.Module());
modules.add(new ReceiveCommitsExecutorModule());
modules.add(new DiffExecutorModule());