aplex commented on a change in pull request #3281:
URL: https://github.com/apache/gobblin/pull/3281#discussion_r643416785
##########
File path:
gobblin-restli/gobblin-restli-utils/src/main/java/org/apache/gobblin/restli/EmbeddedRestliServer.java
##########
@@ -69,6 +70,7 @@
* * name - defaults to the name of the first resource in the resource
collection.
* * injector - an {@link Injector} to inject dependencies into the Rest.li
resources.
*/
+@Singleton
Review comment:
Normally, if the class is marked with Singleton annotation , Guice will
create only one instance of it. All other classes that depend on this one will
get the same instance.
However, in this case the class is created by our provider, and not by Guice
directly, so we need an extra step to make sure only one instance exists. I've
updated Guice module like this:
`
binder.bind(EmbeddedRestliServer.class).toProvider(EmbeddedRestliServerProvider.class).in(Singleton.class)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]