Add DynamicItem for extension points with one implementation

Some extension points should only have one implementation provided,
such as a provider of avatar images.  In this case it doesn't make
sense to have multiple providers.  For this use-case we need
DynamicItem.

Change-Id: If5166c3f42c5619daea56d79dea8feb70f9ee084
This commit is contained in:
Brad Larson
2012-12-12 14:09:24 -06:00
committed by Shawn Pearce
parent 095a25143c
commit ae984a98e2
5 changed files with 388 additions and 1 deletions

View File

@@ -236,7 +236,12 @@ class AutoRegisterModules {
if (rawType.getAnnotation(ExtensionPoint.class) != null) {
TypeLiteral<?> tl = TypeLiteral.get(type);
if (env.hasDynamicSet(tl)) {
if (env.hasDynamicItem(tl)) {
sysSingletons.add(clazz);
sysListen.put(tl, clazz);
httpGen.listen(tl, clazz);
sshGen.listen(tl, clazz);
} else if (env.hasDynamicSet(tl)) {
sysSingletons.add(clazz);
sysListen.put(tl, clazz);
httpGen.listen(tl, clazz);