Package org.apache.jackrabbit.mk.api

Examples of org.apache.jackrabbit.mk.api.MicroKernelException


                    unsaved.put(path, prev);
                    String msg = String.format("Attempt to update " +
                            "unsavedLastRevision for %s with %s, which is " +
                            "older than current %s.",
                            path, rev, prev);
                    throw new MicroKernelException(msg);
                }
            }
        }
        String key = path + "@" + rev;
        Node.Children c = nodeChildrenCache.getIfPresent(key);
View Full Code Here


    Revision reset(@Nonnull Revision branchHead, @Nonnull Revision ancestor) {
        checkNotNull(branchHead);
        checkNotNull(ancestor);
        Branch b = getBranches().getBranch(branchHead);
        if (b == null) {
            throw new MicroKernelException("Empty branch cannot be reset");
        }
        if (!b.getCommits().last().equals(branchHead)) {
            throw new MicroKernelException(branchHead + " is not the head " +
                    "of a branch");
        }
        if (!b.containsCommit(ancestor)) {
            throw new MicroKernelException(ancestor + " is not " +
                    "an ancestor revision of " + branchHead);
        }
        if (branchHead.equals(ancestor)) {
            // trivial
            return branchHead;
View Full Code Here

        try {
            String jdbcurl = "jdbc:h2:mem:oaknodes";
            Connection connection = DriverManager.getConnection(jdbcurl, "sa", "");
            initialize(connection);
        } catch (Exception ex) {
            throw new MicroKernelException("initializing SQL blob store", ex);
        }
    }
View Full Code Here

    public SQLBlobStore(String jdbcurl, String username, String password) {
        try {
            Connection connection = DriverManager.getConnection(jdbcurl, username, password);
            initialize(connection);
        } catch (Exception ex) {
            throw new MicroKernelException("initializing SQL blob store", ex);
        }
    }
View Full Code Here

     */
    public SQLBlobStore(DataSource ds) {
        try {
            initialize(ds.getConnection());
        } catch (Exception ex) {
            throw new MicroKernelException("initializing SQL blob store", ex);
        }
    }
View Full Code Here

    public void dispose() {
        try {
            this.connection.close();
            this.connection = null;
        } catch (SQLException ex) {
            throw new MicroKernelException(ex);
        }
    }
View Full Code Here

        long start = start();
        try {
            WriteResult writeResult = dbCollection.remove(getByKeyQuery(key).get(), WriteConcern.SAFE);
            invalidateCache(collection, key);
            if (writeResult.getError() != null) {
                throw new MicroKernelException("Remove failed: " + writeResult.getError());
            }
        } finally {
            end("remove", start);
        }
    }
View Full Code Here

            }
            T oldDoc = convertFromDBObject(collection, oldNode);
            applyToCache(collection, oldDoc, updateOp);
            return oldDoc;
        } catch (Exception e) {
            throw new MicroKernelException(e);
        } finally {
            lock.unlock();
            end("findAndModify", start);
        }
    }
View Full Code Here

                }
            }
            try {
                WriteResult writeResult = dbCollection.update(query.get(), update, false, true, WriteConcern.SAFE);
                if (writeResult.getError() != null) {
                    throw new MicroKernelException("Update failed: " + writeResult.getError());
                }
                // update cache
                for (Entry<String, NodeDocument> entry : cachedDocs.entrySet()) {
                    Lock lock = getAndLock(entry.getKey());
                    try {
                        if (entry.getValue() == null) {
                            // make sure concurrently loaded document is invalidated
                            nodesCache.invalidate(entry.getKey());
                        } else {
                            applyToCache(Collection.NODES, entry.getValue(),
                                    new UpdateOp(entry.getKey(), updateOp));
                        }
                    } finally {
                        lock.unlock();
                    }
                }
            } catch (MongoException e) {
                throw new MicroKernelException(e);
            }
        } finally {
            end("update", start);
        }
    }
View Full Code Here

    void addNode(Node n) {
        if (operations.containsKey(n.path)) {
            String msg = "Node already added: " + n.path;
            LOG.error(msg);
            throw new MicroKernelException(msg);
        }
        operations.put(n.path, n.asOperation(true));
        addedNodes.add(n.path);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.api.MicroKernelException

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.