Interface ApplicationEventPublisher
- All Known Subinterfaces:
ApplicationContext
,ConfigurableApplicationContext
,ConfigurableWebApplicationContext
,WebApplicationContext
- All Known Implementing Classes:
AbstractApplicationContext
,AbstractRefreshableApplicationContext
,AbstractRefreshableConfigApplicationContext
,AbstractRefreshableWebApplicationContext
,AbstractXmlApplicationContext
,AnnotationConfigApplicationContext
,AnnotationConfigWebApplicationContext
,ClassPathXmlApplicationContext
,FileSystemXmlApplicationContext
,GenericApplicationContext
,GenericGroovyApplicationContext
,GenericWebApplicationContext
,GenericXmlApplicationContext
,GroovyWebApplicationContext
,StaticApplicationContext
,StaticWebApplicationContext
,XmlWebApplicationContext
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Serves as a super-interface for ApplicationContext
.
- Since:
- 1.1.1
- Author:
- Juergen Hoeller, Stephane Nicoll
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
publishEvent
(Object event) Notify all matching listeners registered with this application of an event.default void
publishEvent
(ApplicationEvent event) Notify all matching listeners registered with this application of an application event.
-
Method Details
-
publishEvent
Notify all matching listeners registered with this application of an application event. Events may be framework events (such as ContextRefreshedEvent) or application-specific events.Such an event publication step is effectively a hand-off to the multicaster and does not imply synchronous/asynchronous execution or even immediate execution at all. Event listeners are encouraged to be as efficient as possible, individually using asynchronous execution for longer-running and potentially blocking operations.
- Parameters:
event
- the event to publish- See Also:
-
publishEvent
Notify all matching listeners registered with this application of an event.If the specified
event
is not anApplicationEvent
, it is wrapped in aPayloadApplicationEvent
.Such an event publication step is effectively a hand-off to the multicaster and does not imply synchronous/asynchronous execution or even immediate execution at all. Event listeners are encouraged to be as efficient as possible, individually using asynchronous execution for longer-running and potentially blocking operations.
- Parameters:
event
- the event to publish- Since:
- 4.2
- See Also:
-