use of org.apache.myfaces.util.lang.LRULinkedHashMap in project myfaces by apache.
the class ClientWindowScopeContextualStorageHolder method init.
@PostConstruct
@Override
public void init() {
super.init();
FacesContext facesContext = FacesContext.getCurrentInstance();
Integer numberOfClientWindowsInSession = MyfacesConfig.getCurrentInstance(facesContext).getNumberOfClientWindows();
clientWindowExpirationStack = new LRULinkedHashMap<>(numberOfClientWindowsInSession, (eldest) -> {
destroyAll(FacesContext.getCurrentInstance(), eldest.getKey());
});
pushClientWindow(facesContext, facesContext.getExternalContext().getClientWindow());
}
use of org.apache.myfaces.util.lang.LRULinkedHashMap in project myfaces by apache.
the class SerializedViewCollection method putLastWindowKey.
public synchronized void putLastWindowKey(FacesContext context, String id, SerializedViewKey key) {
if (_lastWindowKeys == null) {
Integer i = getNumberOfSequentialViewsInSession(context);
int j = getNumberOfViewsInSession(context);
if (i != null && i > 0) {
_lastWindowKeys = new LRULinkedHashMap<>((j / i) + 1);
} else {
_lastWindowKeys = new LRULinkedHashMap(j + 1);
}
}
_lastWindowKeys.put(id, key);
}
use of org.apache.myfaces.util.lang.LRULinkedHashMap in project myfaces by apache.
the class FlowScopeContextualStorageHolder method init.
@PostConstruct
@Override
public void init() {
super.init();
activeFlowMapKeys = new ConcurrentHashMap<>();
FacesContext facesContext = FacesContext.getCurrentInstance();
Integer numberOfClientWindowsInSession = MyfacesConfig.getCurrentInstance(facesContext).getNumberOfClientWindows();
clientWindowExpirationStack = new LRULinkedHashMap<>(numberOfClientWindowsInSession, (eldest) -> {
clearFlowMap(FacesContext.getCurrentInstance(), eldest.getKey());
});
refreshClientWindow(facesContext);
}
Aggregations