Package com.sun.faces.util

Examples of com.sun.faces.util.LRUMap


    protected String reset = "Unique Id Counter Has Been Reset";

    public String getReset() {
        FacesContext context = FacesContext.getCurrentInstance();
        LRUMap lruMap = new LRUMap(15);
        context.getExternalContext().getSessionMap().put(RequestStateManager.LOGICAL_VIEW_MAP, lruMap);
        StateManagerImpl stateManagerImpl =
            (StateManagerImpl) context.getApplication().getStateManager();
        TestingUtil.setPrivateField("requestIdSerial",
                                    StateManagerImpl.class,
View Full Code Here


           
            String id = null,
                   idInActualMap = null,
                   idInLogicalMap = (String)
                RequestStateManager.get(context, RequestStateManager.LOGICAL_VIEW_MAP);
            LRUMap logicalMap = null, actualMap = null;
            int
                logicalMapSize = getNumberOfViewsParameter(context),
                actualMapSize = getNumberOfViewsInLogicalViewParameter(context);
           
            Object stateArray[] = { treeStructure, componentState };
            Map sessionMap = context.getExternalContext().getSessionMap();
           
       synchronized (this) {
                if (null == (logicalMap = (LRUMap) sessionMap.get(LOGICAL_VIEW_MAP))) {
                    logicalMap = new LRUMap(logicalMapSize);
         sessionMap.put(LOGICAL_VIEW_MAP, logicalMap);
                }
                assert(null != logicalMap);

                if (null == idInLogicalMap) {
                    idInLogicalMap = createUniqueRequestId();
                }
                assert(null != idInLogicalMap);
                idInActualMap = createUniqueRequestId();
     if (null == (actualMap = (LRUMap)
                        logicalMap.get(idInLogicalMap))) {
        actualMap = new LRUMap(actualMapSize);
                    logicalMap.put(idInLogicalMap, actualMap);
     }
                id = idInLogicalMap + NamingContainer.SEPARATOR_CHAR +
                        idInActualMap;
    result = new SerializedView(id, null);
                actualMap.put(idInActualMap, stateArray);
View Full Code Here

TOP

Related Classes of com.sun.faces.util.LRUMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.