public class PortletContextScope extends Object implements org.springframework.beans.factory.config.Scope, org.springframework.beans.factory.DisposableBean
Scope wrapper for a PortletContext, i.e. for global web application attributes.
This differs from traditional Spring singletons in that it exposes attributes in the PortletContext. Those attributes will get destroyed whenever the entire application shuts down, which might be earlier or later than the shutdown of the containing Spring ApplicationContext.
The associated destruction mechanism relies on a
ContextCleanupListener being registered in
web.xml. Note that ContextLoaderListener
includes ContextCleanupListener's functionality.
This scope is registered as default scope with key
"application".
ContextCleanupListener| Constructor and Description |
|---|
PortletContextScope(PortletContext portletContext)
Create a new Scope wrapper for the given PortletContext.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Invoke all registered destruction callbacks.
|
Object |
get(String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
String |
getConversationId() |
void |
registerDestructionCallback(String name,
Runnable callback) |
Object |
remove(String name) |
Object |
resolveContextualObject(String key) |
public PortletContextScope(PortletContext portletContext)
portletContext - the PortletContext to wrappublic Object get(String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
get in interface org.springframework.beans.factory.config.Scopepublic Object remove(String name)
remove in interface org.springframework.beans.factory.config.Scopepublic void registerDestructionCallback(String name, Runnable callback)
registerDestructionCallback in interface org.springframework.beans.factory.config.Scopepublic Object resolveContextualObject(String key)
resolveContextualObject in interface org.springframework.beans.factory.config.Scopepublic String getConversationId()
getConversationId in interface org.springframework.beans.factory.config.Scopepublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanContextCleanupListener