java.lang.Object | |
↳ | org.springframework.context.event.AbstractApplicationEventMulticaster |
Known Direct Subclasses |
Abstract implementation of the ApplicationEventMulticaster
interface,
providing the basic listener registration facility.
Doesn't permit multiple instances of the same listener by default, as it keeps listeners in a linked Set. The collection class used to hold ApplicationListener objects can be overridden through the "collectionClass" bean property.
Implementing ApplicationEventMulticaster's actual multicastEvent(ApplicationEvent)
method
is left to subclasses. SimpleApplicationEventMulticaster
simply multicasts
all events to all registered listeners, invoking them in the calling thread.
Alternative implementations could be more sophisticated in those respects.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a listener to be notified of all events.
| |||||||||||
Add a listener bean to be notified of all events.
| |||||||||||
Remove all listeners registered with this multicaster.
| |||||||||||
Remove a listener from the notification list.
| |||||||||||
Remove a listener bean from the notification list.
| |||||||||||
Callback that supplies the owning factory to a bean instance.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return a Collection containing all ApplicationListeners.
| |||||||||||
Return a Collection of ApplicationListeners matching the given
event type.
| |||||||||||
Determine whether the given listener supports the given event.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.BeanFactoryAware
| |||||||||||
From interface
org.springframework.context.event.ApplicationEventMulticaster
|
Add a listener to be notified of all events.
listener | the listener to add |
---|
Add a listener bean to be notified of all events.
listenerBeanName | the name of the listener bean to add |
---|
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.
Remove a listener from the notification list.
listener | the listener to remove |
---|
Remove a listener bean from the notification list.
listenerBeanName | the name of the listener bean to add |
---|
Callback that supplies the owning factory to a bean instance.
Invoked after the population of normal bean properties
but before an initialization callback such as
afterPropertiesSet()
or a custom init-method.
beanFactory | owning BeanFactory (never null ).
The bean can immediately call methods on the factory. |
---|
Return a Collection containing all ApplicationListeners.
Return a Collection of ApplicationListeners matching the given event type. Non-matching listeners get excluded early.
event | the event to be propagated. Allows for excluding non-matching listeners early, based on cached matching information. |
---|
Determine whether the given listener supports the given event.
The default implementation detects the SmartApplicationListener
interface. In case of a standard ApplicationListener
, a
GenericApplicationListenerAdapter
will be used to introspect
the generically declared type of the target listener.
listener | the target listener to check |
---|---|
eventType | the event type to check against |
sourceType | the source type to check against |