Examples of ReferenceMap


Examples of org.apache.commons.collections.map.ReferenceMap

        this.session = session;
        this.rootNodeDef = rootNodeDef;
        this.rootNodeId = rootNodeId;

        // setup item cache with weak references to items
        itemCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
        itemStateProvider.addListener(this);
    }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

        /**
         * Create a new instance of this class.
         */
        public ShareableNodesCache() {
            cache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.HARD);
        }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

         *
         * @param id node id
         * @return node or <code>null</code>
         */
        public AbstractNodeData retrieveFirst(NodeId id) {
            ReferenceMap map = (ReferenceMap) cache.get(id);
            if (map != null) {
                Iterator<AbstractNodeData> iter = map.values().iterator();
                try {
                    while (iter.hasNext()) {
                        AbstractNodeData data = iter.next();
                        if (data != null) {
                            return data;
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

         * @param id node id
         * @param parentId parent id
         * @return node or <code>null</code>
         */
        public AbstractNodeData retrieve(NodeId id, NodeId parentId) {
            ReferenceMap map = (ReferenceMap) cache.get(id);
            if (map != null) {
                return (AbstractNodeData) map.get(parentId);
            }
            return null;
        }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

         *
         * @param data data to cache
         */
        public void cache(AbstractNodeData data) {
            NodeId id = data.getNodeState().getNodeId();
            ReferenceMap map = (ReferenceMap) cache.get(id);
            if (map == null) {
                map = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
                cache.put(id, map);
            }
            Object old = map.put(data.getPrimaryParentId(), data);
            if (old != null) {
                log.warn("overwriting cached item: " + old);
            }
        }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

         * Evict some node from the cache.
         *
         * @param data data to evict
         */
        public void evict(AbstractNodeData data) {
            ReferenceMap map = (ReferenceMap) cache.get(data.getId());
            if (map != null) {
                map.remove(data.getPrimaryParentId());
            }
        }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

        this.ntReg = ntReg;
        this.ntReg.addListener(this);
        this.valueFactory = mgrProvider.getJcrValueFactory();

        // setup caches with soft references to node type
        ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        pdCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        ndCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
    }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

        this.session = session;
        this.rootNodeDef = rootNodeDef;
        this.rootNodeId = rootNodeId;

        // setup item cache with weak references to items
        itemCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
        itemStateProvider.addListener(this);

        // setup shareable nodes cache
        shareableNodesCache = new ShareableNodesCache();
    }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

        this.ntReg.addListener(this);
        this.store = store;

        // setup caches with soft references to node type
        // & item definition instances
        ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        pdCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        ndCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);

        rootNodeDef =
            new NodeDefinitionImpl(ntReg.getRootNodeDef(), this, session);
        ndCache.put(rootNodeDef.unwrap().getId(), rootNodeDef);
    }
View Full Code Here

Examples of org.apache.commons.collections.map.ReferenceMap

        this.sessionContext = sessionContext;
        this.session = sessionContext.getSessionImpl();
        this.rootNodeDef = sessionContext.getNodeTypeManager().getRootNodeDefinition();

        // setup item cache with weak references to items
        itemCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);

        // setup shareable nodes cache
        shareableNodesCache = new ShareableNodesCache();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.