You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the background thread is started by a GET on /api/wakeup in a ServletContextListener (see BackgroundTaskStarter). It is done this way in order to have EntityManagerFactory and SwitchControl injected. However, this is more a workaround than an elegant solution.
(A non-solution for me would be to write a separate instantiation for EntityManagerFactory and SwitchControl - the instantiation should happen in one place only!)
Possible more elegant ways:
Find a way of using jersey's dependency injector to inject these dependencies directly into BackgroundTaskStarter (I haven't found any...)
Use a different dependency injection framework that is available both in REST resource classes and servlet context listeners
The text was updated successfully, but these errors were encountered:
Currently, the background thread is started by a GET on /api/wakeup in a ServletContextListener (see BackgroundTaskStarter). It is done this way in order to have EntityManagerFactory and SwitchControl injected. However, this is more a workaround than an elegant solution.
(A non-solution for me would be to write a separate instantiation for EntityManagerFactory and SwitchControl - the instantiation should happen in one place only!)
Possible more elegant ways:
The text was updated successfully, but these errors were encountered: