Package com.vaadin.flow.spring.scopes
Class VaadinSessionScope
java.lang.Object
com.vaadin.flow.spring.scopes.VaadinSessionScope
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor
,org.springframework.beans.factory.config.Scope
Implementation of Spring's
Scope
that binds the beans
to the current VaadinSession
(as opposed to
the current Servlet session). Registered by default as the scope "
"vaadin-session"".- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.spring.scopes.BeanStore
Gets bean store for this scope.protected VaadinSession
Gets current Vaadin session.void
postProcessBeanFactory
(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) void
registerDestructionCallback
(String name, Runnable callback)
-
Field Details
-
VAADIN_SESSION_SCOPE_NAME
- See Also:
-
-
Constructor Details
-
VaadinSessionScope
public VaadinSessionScope()
-
-
Method Details
-
postProcessBeanFactory
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) -
getConversationId
-
getBeanStore
protected com.vaadin.flow.spring.scopes.BeanStore getBeanStore()Gets bean store for this scope.- Returns:
- bean store for the scope
-
resolveContextualObject
- Specified by:
resolveContextualObject
in interfaceorg.springframework.beans.factory.config.Scope
-
get
- Specified by:
get
in interfaceorg.springframework.beans.factory.config.Scope
-
remove
- Specified by:
remove
in interfaceorg.springframework.beans.factory.config.Scope
-
registerDestructionCallback
- Specified by:
registerDestructionCallback
in interfaceorg.springframework.beans.factory.config.Scope
-
getVaadinSession
Gets current Vaadin session.Throws
IllegalStateException
if there is no current Vaadin session scope or it's not opened.- Returns:
- the current Vaadin session
-