@groovy.transform.CompileStatic class ConfigurableApplicationContextEventPublisher extends java.lang.Object implements ConfigurableApplicationEventPublisher, org.springframework.context.ApplicationContextAware
Bridge to Spring ApplicationContext event publishing
| Type | Name and description |
|---|---|
org.springframework.context.ConfigurableApplicationContext |
applicationContextVolatile because it is no longer final. |
| Constructor and description |
|---|
ConfigurableApplicationContextEventPublisher()Takes the context from the container. |
ConfigurableApplicationContextEventPublisher(org.springframework.context.ConfigurableApplicationContext applicationContext) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addApplicationListener(org.springframework.context.ApplicationListener<? extends org.springframework.context.ApplicationEvent> listener) |
|
void |
publishEvent(org.springframework.context.ApplicationEvent event) |
|
void |
publishEvent(java.lang.Object event) |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)Narrowed rather than cast. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Volatile because it is no longer final. A publisher built without a context is completed by a container callback, on whichever thread the container refreshes on, and read later on whichever thread publishes an event -- so what one wrote has to be what the other sees.
Takes the context from the container. A bean definition built this way holds no already-constructed object, which is what allows it to be processed ahead of time.
Narrowed rather than cast. This is a container callback, so a context that is not configurable would throw a java.lang.ClassCastException out of the container's own setup rather than out of anything this was asked to do. Left unset instead, which context() reports if it is ever used.