java.lang.Object
org.omnifaces.cdi.viewscope.ViewScopeStorageInSession
- All Implemented Interfaces:
Serializable,ViewScopeStorage
@SessionScoped
public class ViewScopeStorageInSession
extends Object
implements ViewScopeStorage, Serializable
Stores view scoped bean instances in a LRU map in HTTP session.
- Since:
- 2.6
- Author:
- Bauke Scholtz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroyBeans(FacesContext context, UUID beanStorageId) Destroys all beans associated with given bean storage identifier.getBeanStorage(UUID beanStorageId) Returns the bean storage identified by given ID, or null if it does not exist.Returns currently active bean storage ID, or null if it does not exist.booleanisRecentlyUnloaded(FacesContext context) Returnstrueif given faces context is recently unloaded.voidCreate a new LRU map of active view scopes with maximum weighted capacity depending on several context params.voidThis method is invoked during session destroy, in that case destroy all beans in all active view scopes.voidsetBeanStorage(UUID beanStorageId, BeanStorage beanStorage) Sets the given bean storage identified by the given ID.
-
Constructor Details
-
ViewScopeStorageInSession
public ViewScopeStorageInSession()
-
-
Method Details
-
postConstructSession
Create a new LRU map of active view scopes with maximum weighted capacity depending on several context params. See javadoc ofViewScopedfor details. -
getBeanStorageId
Description copied from interface:ViewScopeStorageReturns currently active bean storage ID, or null if it does not exist.- Specified by:
getBeanStorageIdin interfaceViewScopeStorage- Returns:
- Currently active bean storage ID, or null if it does not exist.
-
getBeanStorage
Description copied from interface:ViewScopeStorageReturns the bean storage identified by given ID, or null if it does not exist.- Specified by:
getBeanStoragein interfaceViewScopeStorage- Parameters:
beanStorageId- The bean storage identifier.- Returns:
- The bean storage identified by given ID, or null if it does not exist.
-
setBeanStorage
Description copied from interface:ViewScopeStorageSets the given bean storage identified by the given ID.- Specified by:
setBeanStoragein interfaceViewScopeStorage- Parameters:
beanStorageId- The bean storage identifier.beanStorage- The bean storage.
-
destroyBeans
Destroys all beans associated with given bean storage identifier.- Parameters:
context- The involved faces context.beanStorageId- The bean storage identifier.
-
isRecentlyUnloaded
Returnstrueif given faces context is recently unloaded.- Parameters:
context- The involved faces context.- Returns:
trueif given faces context is recently unloaded.- Since:
- 2.7.27
-
preDestroySession
This method is invoked during session destroy, in that case destroy all beans in all active view scopes.
-