Package org.apache.jackrabbit.oak.plugins.document

Examples of org.apache.jackrabbit.oak.plugins.document.NodeDocument.seal()


                oldDoc.deepCopy(newDoc);
                oldDoc.seal();
            }
            CacheValue key = new StringValue(updateOp.getId());
            UpdateUtils.applyChanges(newDoc, updateOp, comparator);
            newDoc.seal();

            NodeDocument cached = addToCache(newDoc);
            if (cached == newDoc) {
                // successful
                return;
View Full Code Here


                oldDoc.deepCopy(newDoc);
                oldDoc.seal();
            }
            CacheValue key = new StringValue(updateOp.getId());
            UpdateUtils.applyChanges(newDoc, updateOp, comparator);
            newDoc.seal();

            NodeDocument cached = addToCache(newDoc);
            if (cached == newDoc) {
                // successful
                return;
View Full Code Here

                        doc = nodesCache.get(cacheKey, new Callable<NodeDocument>() {
                            @Override
                            public NodeDocument call() throws Exception {
                                NodeDocument doc = (NodeDocument) readDocument(collection, id);
                                if (doc != null) {
                                    doc.seal();
                                }
                                return wrap(doc);
                            }
                        });
                        if (maxCacheAge == 0 || maxCacheAge == Integer.MAX_VALUE) {
View Full Code Here

                        doc = nodesCache.get(cacheKey, new Callable<NodeDocument>() {
                            @Override
                            public NodeDocument call() throws Exception {
                                NodeDocument doc = (NodeDocument) readDocumentUncached(collection, id);
                                if (doc != null) {
                                    doc.seal();
                                }
                                return wrap(doc);
                            }
                        });
                        if (maxCacheAge == 0 || maxCacheAge == Integer.MAX_VALUE) {
View Full Code Here

                }
            }
        }

        NodeDocument fresh = (NodeDocument) SR.fromRow(collection, row);
        fresh.seal();

        Lock lock = getAndLock(id);
        try {
            inCache = nodesCache.getIfPresent(cacheKey);
            if (inCache != null && inCache != NodeDocument.NULL) {
View Full Code Here

                }
                doc.put(key, value);
            }

            //Seal the doc once all changes done
            doc.seal();

            return doc;
        }

    }
View Full Code Here

                        doc = nodesCache.get(cacheKey, new Callable<NodeDocument>() {
                            @Override
                            public NodeDocument call() throws Exception {
                                NodeDocument doc = (NodeDocument) readDocument(collection, id);
                                if (doc != null) {
                                    doc.seal();
                                }
                                return wrap(doc);
                            }
                        });
                        if (maxCacheAge == 0 || maxCacheAge == Integer.MAX_VALUE) {
View Full Code Here

    @Test
    public void nodeDocSerialization() {
        long time = System.currentTimeMillis();
        NodeDocument doc = new NodeDocument(store,time);
        doc.seal();
        checkSame(doc, (NodeDocument) deserialize(doc));

        doc = new NodeDocument(store,time);
        doc.put("_id","b1");
        doc.put("a2","b2");
View Full Code Here

        checkSame(doc, (NodeDocument) deserialize(doc));

        doc = new NodeDocument(store,time);
        doc.put("_id","b1");
        doc.put("a2","b2");
        doc.seal();
        checkSame(doc, (NodeDocument) deserialize(doc));

        doc = new NodeDocument(store,time);
        doc.put("_id","b1");
        doc.put("a2",createRevisionMap());
View Full Code Here

        doc = new NodeDocument(store,time);
        doc.put("_id","b1");
        doc.put("a2",createRevisionMap());
        doc.put("a3",createRevisionMap());
        doc.seal();

        NodeDocument deserDoc = (NodeDocument) deserialize(doc);
        checkSame(doc, deserDoc);

        //Assert that revision keys are sorted
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.