ApplicationListener beans get obtained on demand, supporting non-singletons as well; ApplicationListeners will be called in the order according to the Ordered contract; generified ApplicationListener interface
This commit is contained in:
@@ -35,7 +35,6 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
@@ -102,7 +101,8 @@ import org.springframework.web.portlet.context.XmlPortletApplicationContext;
|
||||
* @see #setContextConfigLocation
|
||||
* @see #setNamespace
|
||||
*/
|
||||
public abstract class FrameworkPortlet extends GenericPortletBean implements ApplicationListener {
|
||||
public abstract class FrameworkPortlet extends GenericPortletBean
|
||||
implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
/**
|
||||
* Default context class for FrameworkPortlet.
|
||||
@@ -417,11 +417,9 @@ public abstract class FrameworkPortlet extends GenericPortletBean implements App
|
||||
* triggering a refresh of this servlet's context-dependent state.
|
||||
* @param event the incoming ApplicationContext event
|
||||
*/
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (event instanceof ContextRefreshedEvent) {
|
||||
this.refreshEventReceived = true;
|
||||
onRefresh(((ContextRefreshedEvent) event).getApplicationContext());
|
||||
}
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
this.refreshEventReceived = true;
|
||||
onRefresh(event.getApplicationContext());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user