java.lang.Object | |
↳ | org.springframework.web.portlet.handler.SimplePortletPostProcessor |
Bean post-processor that applies initialization and destruction callbacks to beans that implement the Portlet interface.
After initialization of the bean instance, the Portlet init
method will be called with a PortletConfig that contains the bean name
of the Portlet and the PortletContext that it is running in.
Before destruction of the bean instance, the Portlet destroy
will be called.
Note that this post-processor does not support Portlet initialization parameters. Bean instances that implement the Portlet interface are 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.
Alternatively, consider wrapping a Portlet with Spring's PortletWrappingController. This is particularly appropriate for existing Portlet classes, allowing to specify Portlet initialization parameters etc.
SimplePortletHandlerAdapter
GenericPortletBean
PortletWrappingController
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Apply this BeanPostProcessor to the given new bean instance after any bean
initialization callbacks (like InitializingBean's
afterPropertiesSet
or a custom init-method). | |||||||||||
Apply this BeanPostProcessor to the given bean instance before
its destruction.
| |||||||||||
Apply this BeanPostProcessor to the given new bean instance before any bean
initialization callbacks (like InitializingBean's
afterPropertiesSet
or a custom init-method). | |||||||||||
Set the PortletConfigthat this object runs in.
| |||||||||||
Set the PortletContext that this object runs in.
| |||||||||||
Set whether to use the shared PortletConfig object passed in
through
setPortletConfig , if available. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.config.BeanPostProcessor
| |||||||||||
From interface
org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor
| |||||||||||
From interface
org.springframework.web.portlet.context.PortletConfigAware
| |||||||||||
From interface
org.springframework.web.portlet.context.PortletContextAware
|
Apply this BeanPostProcessor to the given new bean instance after any bean
initialization callbacks (like InitializingBean's afterPropertiesSet
or a custom init-method). The bean will already be populated with property values.
The returned bean instance may be a wrapper around the original.
In case of a FactoryBean, this callback will be invoked for both the FactoryBean
instance and the objects created by the FactoryBean (as of Spring 2.0). The
post-processor can decide whether to apply to either the FactoryBean or created
objects or both through corresponding bean instanceof FactoryBean
checks.
This callback will also be invoked after a short-circuiting triggered by a
postProcessBeforeInstantiation(Class>, String)
method,
in contrast to all other BeanPostProcessor callbacks.
bean | the new bean instance |
---|---|
beanName | the name of the bean |
null
, no subsequent BeanPostProcessors will be invokedBeansException |
---|
Apply this BeanPostProcessor to the given bean instance before its destruction. Can invoke custom destruction callbacks.
Like DisposableBean's destroy
and a custom destroy method,
this callback just applies to singleton beans in the factory (including
inner beans).
bean | the bean instance to be destroyed |
---|---|
beanName | the name of the bean |
BeansException |
---|
Apply this BeanPostProcessor to the given new bean instance before any bean
initialization callbacks (like InitializingBean's afterPropertiesSet
or a custom init-method). The bean will already be populated with property values.
The returned bean instance may be a wrapper around the original.
bean | the new bean instance |
---|---|
beanName | the name of the bean |
null
, no subsequent BeanPostProcessors will be invokedBeansException |
---|
Set the PortletConfigthat this object runs in.
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.
portletConfig | PortletConfig object to be used by this object |
---|
Set the PortletContext that this object runs in.
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.
portletContext | PortletContext object to be used by this object |
---|
Set whether to use the shared PortletConfig object passed in
through setPortletConfig
, if available.
Default is "true". Turn this setting to "false" to pass in a mock PortletConfig object with the bean name as portlet name, holding the current PortletContext.