org.springframework.context.event

## Class EventListenerMethodProcessor

- java.lang.Object
- - org.springframework.context.event.EventListenerMethodProcessor

- All Implemented Interfaces:
    Aware, BeanFactoryPostProcessor, SmartInitializingSingleton, ApplicationContextAware

      public class EventListenerMethodProcessor
      extends Object
      implements SmartInitializingSingleton, ApplicationContextAware, BeanFactoryPostProcessor

  Registers `EventListener` methods as individual `ApplicationListener` instances. Implements `BeanFactoryPostProcessor` (as of 5.1) primarily for early retrieval, avoiding AOP checks for this processor bean and its `EventListenerFactory` delegates.
  Since:
    4.2
  Author:
    Stephane Nicoll, Juergen Hoeller, Sebastien Deleuze
  See Also:
    `EventListenerFactory`, `DefaultEventListenerFactory`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Log` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventListenerMethodProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterSingletonsInstantiated()` Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already.
    `void` | `postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)` Modify the application context's internal bean factory after its standard initialization.
    `void` | `setApplicationContext(ApplicationContext applicationContext)` Set the ApplicationContext that this object runs in.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected final Log logger

  - ### Constructor Detail

    - #### EventListenerMethodProcessor

          public EventListenerMethodProcessor()

  - ### Method Detail

    - #### setApplicationContext

          public void setApplicationContext(ApplicationContext applicationContext)

      Description copied from interface: `ApplicationContextAware`
      Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

      Invoked after population of normal bean properties but before an init callback such as `InitializingBean.afterPropertiesSet()` or a custom init-method. Invoked after `ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)`, `ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)` and `MessageSourceAware`, if applicable.

      Specified by:
        `setApplicationContext` in interface `ApplicationContextAware`
      Parameters:
        `applicationContext` - the ApplicationContext object to be used by this object
      See Also:
        `BeanInitializationException`

    - #### postProcessBeanFactory

          public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)

      Description copied from interface: `BeanFactoryPostProcessor`
      Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.
      Specified by:
        `postProcessBeanFactory` in interface `BeanFactoryPostProcessor`
      Parameters:
        `beanFactory` - the bean factory used by the application context

    - #### afterSingletonsInstantiated

          public void afterSingletonsInstantiated()

      Description copied from interface: `SmartInitializingSingleton`
      Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already. `ListableBeanFactory.getBeansOfType(java.lang.Class<T>)` calls within this method won't trigger accidental side effects during bootstrap.

      NOTE: This callback won't be triggered for singleton beans lazily initialized on demand after `BeanFactory` bootstrap, and not for any other bean scope either. Carefully use it for beans with the intended bootstrap semantics only.

      Specified by:
        `afterSingletonsInstantiated` in interface `SmartInitializingSingleton`