Polishing
This commit is contained in:
@@ -46,10 +46,10 @@ public class PayloadApplicationEvent<T> extends ApplicationEvent implements Reso
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResolvableType getResolvableType() {
|
||||
return ResolvableType.forClassWithGenerics(getClass(),
|
||||
ResolvableType.forInstance(getPayload()));
|
||||
return ResolvableType.forClassWithGenerics(getClass(), ResolvableType.forInstance(getPayload()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -334,11 +334,26 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
publishEvent(event, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish the given event to all listeners.
|
||||
* <p>Note: Listeners get initialized after the MessageSource, to be able
|
||||
* to access it within listener implementations. Thus, MessageSource
|
||||
* implementations cannot publish events.
|
||||
* @param event the event to publish (may be an {@link ApplicationEvent}
|
||||
* or a payload object to be turned into a {@link PayloadApplicationEvent})
|
||||
*/
|
||||
@Override
|
||||
public void publishEvent(Object event) {
|
||||
publishEvent(event, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish the given event to all listeners.
|
||||
* @param event the event to publish (may be an {@link ApplicationEvent}
|
||||
* or a payload object to be turned into a {@link PayloadApplicationEvent})
|
||||
* @param eventType the resolved event type, if known
|
||||
* @since 4.2
|
||||
*/
|
||||
protected void publishEvent(Object event, ResolvableType eventType) {
|
||||
Assert.notNull(event, "Event must not be null");
|
||||
if (logger.isTraceEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user