org.springframework.context.event

Interface ApplicationEventMulticaster

    • Method Detail

      • addApplicationListener

        void addApplicationListener(ApplicationListener<?> listener)
        Add a listener to be notified of all events.
        Parameters:
        listener - the listener to add
      • addApplicationListenerBean

        void addApplicationListenerBean(java.lang.String listenerBeanName)
        Add a listener bean to be notified of all events.
        Parameters:
        listenerBeanName - the name of the listener bean to add
      • removeApplicationListener

        void removeApplicationListener(ApplicationListener<?> listener)
        Remove a listener from the notification list.
        Parameters:
        listener - the listener to remove
      • removeApplicationListenerBean

        void removeApplicationListenerBean(java.lang.String listenerBeanName)
        Remove a listener bean from the notification list.
        Parameters:
        listenerBeanName - the name of the listener bean to add
      • removeAllListeners

        void removeAllListeners()
        Remove all listeners registered with this multicaster.

        After a remove call, the multicaster will perform no action on event notification until new listeners are being registered.

      • multicastEvent

        void multicastEvent(ApplicationEvent event,
                            @Nullable
                            ResolvableType eventType)
        Multicast the given application event to appropriate listeners.

        If the eventType is null, a default type is built based on the event instance.

        Parameters:
        event - the event to multicast
        eventType - the type of event (can be null)
        Since:
        4.2