接口 ApplicationEventMulticaster

    • 方法详细资料

      • addApplicationListenerBean

        void addApplicationListenerBean​(String listenerBeanName)
        Add a listener bean to be notified of all events.
        参数:
        listenerBeanName - the name of the listener bean to add
      • removeApplicationListenerBean

        void removeApplicationListenerBean​(String listenerBeanName)
        Remove a listener bean from the notification list.
        参数:
        listenerBeanName - the name of the listener bean to remove
      • 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 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.

        参数:
        event - the event to multicast
        eventType - the type of event (can be null)
        从以下版本开始:
        4.2