Closed
Description
Affects: 2.4.3
According to the JavaDoc of the ApplicationEventMulticaster
I was expecting to be able to remove and/or add ApplicationListeners at runtime.
This currently does not work for @EventListener
annotated methods, which apparently lead to a ApplicationListenerMethodAdapter
instance at runtime.
Would be great, if we could remove this listener as well, either by
- making the Adapter instance injectable and then remove it with
multicaster.removeApplicationListener()
, or - giving the Adapter instance a well defined bean name and remove it with
multicaster.removeApplicationListenerBean()
I've included a small demo app with a failing test to illustrate what I'm trying to achieve: