|
1 | 1 | /* |
2 | | - * Copyright 2002-2012 the original author or authors. |
| 2 | + * Copyright 2002-2015 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
36 | 36 | import org.springframework.web.portlet.context.PortletContextAware; |
37 | 37 |
|
38 | 38 | /** |
39 | | - * Bean post-processor that applies initialization and destruction callbacks |
40 | | - * to beans that implement the Portlet interface. |
| 39 | + * {@link org.springframework.beans.factory.config.BeanPostProcessor} |
| 40 | + * that applies initialization and destruction callbacks to beans that |
| 41 | + * implement the {@link javax.portlet.Portlet} interface. |
41 | 42 | * |
42 | 43 | * <p>After initialization of the bean instance, the Portlet {@code init} |
43 | 44 | * method will be called with a PortletConfig that contains the bean name |
|
51 | 52 | * supposed to be configured like any other Spring bean, that is, through |
52 | 53 | * constructor arguments or bean properties. |
53 | 54 | * |
54 | | - * <p>For reuse of a Portlet implementation in a plain Portlet container and as |
55 | | - * a bean in a Spring context, consider deriving from Spring's GenericPortletBean |
56 | | - * base class that applies Portlet initialization parameters as bean properties, |
57 | | - * supporting both initialization styles. |
| 55 | + * <p>For reuse of a Portlet implementation in a plain Portlet container |
| 56 | + * and as a bean in a Spring context, consider deriving from Spring's |
| 57 | + * {@link org.springframework.web.portlet.GenericPortletBean} base class that |
| 58 | + * applies Portlet initialization parameters as bean properties, supporting |
| 59 | + * both the standard Portlet and the Spring bean initialization style. |
58 | 60 | * |
59 | 61 | * <p><b>Alternatively, consider wrapping a Portlet with Spring's |
60 | | - * PortletWrappingController.</b> This is particularly appropriate for |
61 | | - * existing Portlet classes, allowing to specify Portlet initialization |
62 | | - * parameters etc. |
| 62 | + * {@link org.springframework.web.portlet.mvc.PortletWrappingController}.</b> |
| 63 | + * This is particularly appropriate for existing Portlet classes, |
| 64 | + * allowing to specify Portlet initialization parameters etc. |
63 | 65 | * |
64 | 66 | * @author Juergen Hoeller |
65 | 67 | * @author John A. Lewis |
@@ -132,6 +134,11 @@ public void postProcessBeforeDestruction(Object bean, String beanName) throws Be |
132 | 134 | } |
133 | 135 | } |
134 | 136 |
|
| 137 | + @Override |
| 138 | + public boolean requiresDestruction(Object bean) { |
| 139 | + return (bean instanceof Portlet); |
| 140 | + } |
| 141 | + |
135 | 142 |
|
136 | 143 | /** |
137 | 144 | * Internal implementation of the PortletConfig interface, to be passed |
|
0 commit comments