public class VaadinApplicationScope extends Object implements Scope, BeanFactoryPostProcessor, SessionDestroyListener
Scope for Vaadin applications.
This scopes beans to the lifetime of the VaadinSession (formerly known as "Vaadin application").
Spring destroy-methods
will be invoked when the VaadinSession is closed.
To enable this scope, simply add this bean to your application context as a singleton (it will register itself):
Then declare scoped beans normally using the scope name<!-- Enable the "vaadinApplication" custom scope --> <bean class="org.dellroad.stuff.vaadin7.VaadinApplicationScope"/>
"vaadinApplication".| Modifier and Type | Field and Description |
|---|---|
static String |
SCOPE_NAME
The name of this scope (i.e.,
"vaadinApplication"). |
static String |
VAADIN_SERVICE_SESSION_KEY
Key to the current
VaadinSession instance. |
| Constructor and Description |
|---|
VaadinApplicationScope() |
| Modifier and Type | Method and Description |
|---|---|
Object |
get(String name,
ObjectFactory<?> objectFactory) |
String |
getConversationId() |
void |
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) |
void |
registerDestructionCallback(String name,
Runnable callback) |
Object |
remove(String name) |
Object |
resolveContextualObject(String key) |
void |
sessionDestroy(SessionDestroyEvent event) |
public static final String VAADIN_SERVICE_SESSION_KEY
VaadinSession instance. For use by resolveContextualObject(java.lang.String).public static final String SCOPE_NAME
"vaadinApplication").public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory in interface BeanFactoryPostProcessorpublic void sessionDestroy(SessionDestroyEvent event)
sessionDestroy in interface SessionDestroyListenerpublic Object get(String name, ObjectFactory<?> objectFactory)
public void registerDestructionCallback(String name, Runnable callback)
registerDestructionCallback in interface Scopepublic String getConversationId()
getConversationId in interface Scopepublic Object resolveContextualObject(String key)
resolveContextualObject in interface ScopeCopyright © 2017. All rights reserved.