Skip to content

Commit

Permalink
fix: remove duplicate builtin services (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
junfuchen99 authored Sep 21, 2022
1 parent dd8e059 commit 0ff5dc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/aws/greengrass/lifecyclemanager/Kernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,9 @@ private GreengrassService locateGreengrassService(Context.Value v, String name,
ret = (GreengrassService) context.newInstance(clazz);
}

// Force plugins to be singletons
if (clazz.getAnnotation(Singleton.class) != null || PluginService.class.isAssignableFrom(clazz)) {
// Force plugins and built-in services to be singletons
if (clazz.getAnnotation(Singleton.class) != null || PluginService.class.isAssignableFrom(clazz)
|| clazz.getAnnotation(ImplementsService.class) != null) {
context.put(ret.getClass(), v);
}
if (clazz.getAnnotation(ImplementsService.class) != null) {
Expand Down

0 comments on commit 0ff5dc4

Please sign in to comment.