To answer my own question: yes, this is done using reflection, which effectively goes around Spring and gives you an instantiated object that doesn't have anything @Autowired
.
However, you could manually initialize your beans in your LoginModule
's initialize()
method. The LoginModule
class should implement org.springframework.context.ApplicationContextAware
and you must have a private static ApplicationContext context
. This way the context
is injected for you and you can load the beans from there on.
Far from optimal, but it seems to be doing the trick. If anybody has a better solution, please share it, as I would be happy to hear it!