Move DynamicMap<DynamicBean> binding into sys injector
This is a requirement in order to support plugin options over the extension API, which is bound in the sys injector; otherwise, there would be no way for the extension API implementation to access a DynamicMap<DynamicBean> from a child injector. The downside is it silently breaks existing plugins that bind their DynamicBean implementations in HTTP/SSH modules. In other words, the tests would fail if we didn't change them; the same goes for plugins. The upside for plugin authors is that this can make plugin implementations simpler (as in the test): plugins that aren't actually contributing SSH commands or HTTP endpoints will no longer need to define separate modules just to register DyamicBeans. Overall, this change has only minor downsides for plugin authors, and this is outweighed by the upside of making it possible to pass plugin options to the extension API. Change-Id: I3fd7de21565f6f65519936f47694bcf23e05a9fd
This commit is contained in:
@@ -20,10 +20,8 @@ import static com.google.inject.Scopes.SINGLETON;
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.gerrit.extensions.registration.DynamicItem;
|
||||
import com.google.gerrit.extensions.registration.DynamicMap;
|
||||
import com.google.gerrit.extensions.registration.DynamicSet;
|
||||
import com.google.gerrit.lifecycle.LifecycleModule;
|
||||
import com.google.gerrit.server.DynamicOptions;
|
||||
import com.google.gerrit.server.PeerDaemonUser;
|
||||
import com.google.gerrit.server.RemotePeer;
|
||||
import com.google.gerrit.server.config.GerritConfigListener;
|
||||
@@ -102,7 +100,6 @@ public class SshModule extends LifecycleModule {
|
||||
.annotatedWith(UniqueAnnotations.create())
|
||||
.to(SshPluginStarterCallback.class);
|
||||
|
||||
DynamicMap.mapOf(binder(), DynamicOptions.DynamicBean.class);
|
||||
DynamicItem.itemOf(binder(), SshCreateCommandInterceptor.class);
|
||||
|
||||
listener().toInstance(registerInParentInjectors());
|
||||
|
||||
Reference in New Issue
Block a user