This commit introduces one protected method to allow overriding injector creation in GuiceVaadinServlet.
This helps when there is already a prepared Guice Injector in the application used by some other
component and it is required to reuse its contents and state in the Vaadin app.
My original use-case: The app consists of two parts: Jersey-based REST API and Vaadin Admin UI App.
I use com.squarespace.jersey2-guice to install Guice injector into Jersey in a servlet context listener
and I need the services in that Injector to be accessible in my Vaadin Admin App.
So I put my injector creation method into a static java singleton and install it to the both places:
via JerseyGuiceUtils.install(..) in the servlet context listener;
via creating its child injector including the modules pre-initialized by GuiceVaadinServlet in the Vaadin app.
sorry for the late answer. I would rather make the existing injector public in some way, like through a static method, than to meddle with "replacing" it from the outside.
This commit introduces one protected method to allow overriding injector creation in GuiceVaadinServlet. This helps when there is already a prepared Guice Injector in the application used by some other component and it is required to reuse its contents and state in the Vaadin app. My original use-case: The app consists of two parts: Jersey-based REST API and Vaadin Admin UI App. I use com.squarespace.jersey2-guice to install Guice injector into Jersey in a servlet context listener and I need the services in that Injector to be accessible in my Vaadin Admin App. So I put my injector creation method into a static java singleton and install it to the both places: