I would like to register and unregister Spring ApplicationListeners dynamically at run-time and not in a Spring config file.
If I can't remove them dynamically, I'll have a memory leak.
Here's my best guess:
I could call AbstractApplicationContext.getApplicationEventMulticaster().add/removeApplicationListener()
.
Is that the recommended method?
Does anyone remove listeners dynamically?