diff --git a/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java b/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java index ab19823824..a44318fc35 100644 --- a/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java +++ b/spring-web/src/test/java/org/springframework/web/context/request/SessionScopeTests.java @@ -172,6 +172,11 @@ public class SessionScopeTests { @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { } + + @Override + public boolean requiresDestruction(Object bean) { + return true; + } } @@ -195,6 +200,11 @@ public class SessionScopeTests { ((BeanNameAware) bean).setBeanName(null); } } + + @Override + public boolean requiresDestruction(Object bean) { + return true; + } } } diff --git a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java index 62a79e4b71..bd1e8572d6 100644 --- a/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java +++ b/spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/handler/SimplePortletPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,8 +36,9 @@ import org.springframework.web.portlet.context.PortletConfigAware; import org.springframework.web.portlet.context.PortletContextAware; /** - * Bean post-processor that applies initialization and destruction callbacks - * to beans that implement the Portlet interface. + * {@link org.springframework.beans.factory.config.BeanPostProcessor} + * that applies initialization and destruction callbacks to beans that + * implement the {@link javax.portlet.Portlet} interface. * *

After initialization of the bean instance, the Portlet {@code init} * method will be called with a PortletConfig that contains the bean name @@ -51,15 +52,16 @@ import org.springframework.web.portlet.context.PortletContextAware; * supposed to be configured like any other Spring bean, that is, through * constructor arguments or bean properties. * - *

For reuse of a Portlet implementation in a plain Portlet container and as - * a bean in a Spring context, consider deriving from Spring's GenericPortletBean - * base class that applies Portlet initialization parameters as bean properties, - * supporting both initialization styles. + *

For reuse of a Portlet implementation in a plain Portlet container + * and as a bean in a Spring context, consider deriving from Spring's + * {@link org.springframework.web.portlet.GenericPortletBean} base class that + * applies Portlet initialization parameters as bean properties, supporting + * both the standard Portlet and the Spring bean initialization style. * *

Alternatively, consider wrapping a Portlet with Spring's - * PortletWrappingController. This is particularly appropriate for - * existing Portlet classes, allowing to specify Portlet initialization - * parameters etc. + * {@link org.springframework.web.portlet.mvc.PortletWrappingController}. + * This is particularly appropriate for existing Portlet classes, + * allowing to specify Portlet initialization parameters etc. * * @author Juergen Hoeller * @author John A. Lewis @@ -132,6 +134,11 @@ public class SimplePortletPostProcessor } } + @Override + public boolean requiresDestruction(Object bean) { + return (bean instanceof Portlet); + } + /** * Internal implementation of the PortletConfig interface, to be passed diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java index 49e2e3c813..a83c99d594 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/SimpleServletPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -126,6 +126,11 @@ public class SimpleServletPostProcessor implements } } + @Override + public boolean requiresDestruction(Object bean) { + return (bean instanceof Servlet); + } + /** * Internal implementation of the {@link ServletConfig} interface,