public interface ApplicationEventMulticaster
ApplicationListener
objects, and publish events to them.
An ApplicationEventPublisher
, typically
a Spring ApplicationContext
, can use an
ApplicationEventMulticaster as a delegate for actually publishing events.
Modifier and Type | Method and Description |
---|---|
void |
addApplicationListener(ApplicationListener<?> listener)
Add a listener to be notified of all events.
|
void |
addApplicationListenerBean(String listenerBeanName)
Add a listener bean to be notified of all events.
|
void |
multicastEvent(ApplicationEvent event)
Multicast the given application event to appropriate listeners.
|
void |
removeAllListeners()
Remove all listeners registered with this multicaster.
|
void |
removeApplicationListener(ApplicationListener<?> listener)
Remove a listener from the notification list.
|
void |
removeApplicationListenerBean(String listenerBeanName)
Remove a listener bean from the notification list.
|
void addApplicationListener(ApplicationListener<?> listener)
listener
- the listener to addvoid addApplicationListenerBean(String listenerBeanName)
listenerBeanName
- the name of the listener bean to addvoid removeApplicationListener(ApplicationListener<?> listener)
listener
- the listener to removevoid removeApplicationListenerBean(String listenerBeanName)
listenerBeanName
- the name of the listener bean to addvoid removeAllListeners()
After a remove call, the multicaster will perform no action on event notification until new listeners are being registered.
void multicastEvent(ApplicationEvent event)
event
- the event to multicast