|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dellroad.stuff.vaadin.VaadinApplicationScope
public class VaadinApplicationScope
A Spring custom Scope for Vaadin applications.
This works for applications that subclass ContextApplication; objects will be scoped to each
ContextApplication instance. Spring destroy-methods
will be invoked when the ContextApplication 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.vaadin.VaadinApplicationScope"/>
"vaadinApplication".
| Field Summary | |
|---|---|
static String |
APPLICATION_KEY
Key to the current application instance. |
static String |
SCOPE_NAME
The name of this scope (i.e., "vaadinApplication"). |
| Constructor Summary | |
|---|---|
VaadinApplicationScope()
|
|
| Method Summary | |
|---|---|
void |
applicationClosed(ContextApplication.CloseEvent closeEvent)
Notification upon ContextApplication closing. |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String APPLICATION_KEY
resolveContextualObject(java.lang.String).
public static final String SCOPE_NAME
"vaadinApplication").
| Constructor Detail |
|---|
public VaadinApplicationScope()
| Method Detail |
|---|
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory in interface BeanFactoryPostProcessorpublic void applicationClosed(ContextApplication.CloseEvent closeEvent)
ContextApplication.CloseListenerContextApplication closing.
applicationClosed in interface ContextApplication.CloseListener
public Object get(String name,
ObjectFactory<?> objectFactory)
get in interface Scopepublic Object remove(String name)
remove in interface Scope
public void registerDestructionCallback(String name,
Runnable callback)
registerDestructionCallback in interface Scopepublic String getConversationId()
getConversationId in interface Scopepublic Object resolveContextualObject(String key)
resolveContextualObject in interface Scope
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||