Register DynamicSet, DynamicMap from parent injectors

If the HTTP or SSH injector registers implementations of a type
that is tracked by a DynamicSet or DynamicMap from the system
injector, ensure those are registered when these injectors are
started by the LifecycleManager.

Change-Id: I6d4134f6689c872b162b04f8cf5935d50bd0fd9d
This commit is contained in:
Shawn O. Pearce
2012-05-16 10:08:39 -07:00
parent 020cd7adda
commit 05610b41d9
4 changed files with 191 additions and 54 deletions

View File

@@ -15,6 +15,7 @@
package com.google.gerrit.sshd;
import static com.google.inject.Scopes.SINGLETON;
import static com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.registerInParentInjectors;
import com.google.common.collect.Maps;
import com.google.gerrit.lifecycle.LifecycleModule;
@@ -121,6 +122,7 @@ public class SshModule extends FactoryModule {
.annotatedWith(UniqueAnnotations.create())
.to(SshPluginStarterCallback.class);
listener().toInstance(registerInParentInjectors());
listener().to(SshLog.class);
listener().to(SshDaemon.class);
}