@SessionScoped public class ViewScopeBeanHolder extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
VIEW_SCOPE_PREFIX_KEY |
Constructor and Description |
---|
ViewScopeBeanHolder() |
Modifier and Type | Method and Description |
---|---|
void |
destroyBeans()
This method properly destroys all current @WindowScoped beans
of the active session and also prepares the storage for new beans.
|
void |
destroyBeans(String viewScopeId) |
void |
destroyBeansOnPreDestroy() |
Map<String,ViewScopeContextualStorage> |
forceNewStorage()
This method will replace the storageMap and with
a new empty one.
|
String |
generateUniqueViewScopeId() |
ViewScopeContextualStorage |
getContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager,
String viewScopeId)
This method will return the ViewScopeContextualStorage or create a new one
if no one is yet assigned to the current windowId.
|
Map<String,ViewScopeContextualStorage> |
getStorageMap() |
void |
init() |
public static final String VIEW_SCOPE_PREFIX_KEY
@PostConstruct public void init()
public ViewScopeContextualStorage getContextualStorage(javax.enterprise.inject.spi.BeanManager beanManager, String viewScopeId)
beanManager
- we need the CDI BeanManager
for serialisation.windowId
- the windowId for the current browser tab or window.public Map<String,ViewScopeContextualStorage> getStorageMap()
public Map<String,ViewScopeContextualStorage> forceNewStorage()
Contextual.destroy(Object, javax.enterprise.context.spi.CreationalContext)
should be performed on the returned old storage map.public void destroyBeans()
public void destroyBeans(String viewScopeId)
@PreDestroy public void destroyBeansOnPreDestroy()
public String generateUniqueViewScopeId()
Copyright © 2020 The Apache Software Foundation. All rights reserved.