This commit adds a functional style registration of an application listener for a particular event. Rather than introducing another method at the ConfigurableApplicationContext interface level, this commit provides a factory method in GenericApplicationListener. Closes gh-21411