Package org.apache.jackrabbit.mk.api

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


    private NodeState committed;

    KernelNodeStoreBranch(KernelNodeStore store) {
        this.store = store;

        MicroKernel kernel = store.getKernel();
        this.branchRevision = kernel.branch(null);
        this.currentRoot = new KernelNodeState(kernel, "/", branchRevision);
        this.base = currentRoot;
        this.committed = currentRoot;
    }
View Full Code Here


        return true;
    }

    @Override
    public KernelNodeState merge() throws CommitFailedException {
        MicroKernel kernel = store.getKernel();
        CommitEditor editor = store.getEditor();

        NodeState oldRoot = base;
        NodeState toCommit = editor.editCommit(store, oldRoot, currentRoot);
        setRoot(toCommit);

        try {
            String mergedRevision = kernel.merge(branchRevision, null);
            branchRevision = null;
            currentRoot = null;
            committed = null;
            KernelNodeState committed = new KernelNodeState(kernel, "/", mergedRevision);
            return committed;
View Full Code Here

        return node;
    }

    private void commit(String jsop) {
        MicroKernel kernel = store.getKernel();
        branchRevision = kernel.commit("/", jsop, branchRevision, null);
        currentRoot = new KernelNodeState(kernel, "/", branchRevision);
        committed = currentRoot;
    }
View Full Code Here

public class SimpleKernelImplFixture implements MicroKernelFixture {

    @Override
    public void setUpCluster(MicroKernel[] cluster) {
        MicroKernel mk =
                new SimpleKernelImpl("mem:SimpleKernelImplFixture");
        for (int i = 0; i < cluster.length; i++) {
            cluster[i] = mk;
        }
    }
View Full Code Here

    @Override
    public Object addingService(ServiceReference reference) {
        Object service = context.getService(reference);
        if (service instanceof MicroKernel) {
            MicroKernel kernel = (MicroKernel) service;
            services.put(reference, context.registerService(
                    ContentRepository.class.getName(),
                    new ContentRepositoryImpl(kernel, indexProvider, validatorProvider),
                    new Properties()));
            return service;
View Full Code Here

public class MicroKernelImplFixture implements MicroKernelFixture {

    @Override
    public void setUpCluster(MicroKernel[] cluster) {
        MicroKernel mk = new MicroKernelImpl();
        for (int i = 0; i < cluster.length; i++) {
            cluster[i] = mk;
        }
    }
View Full Code Here

            }
        }
    }

    private void addMount(String mount, String url, String[] paths) {
        MicroKernel mk = MicroKernelFactory.getInstance(url);
        mounts.put(mount, MicroKernelWrapperBase.wrap(mk));
        for (String p : paths) {
            dir.put(p, mount);
        }
    }
View Full Code Here

            }
        }
        String revision = null;
        for (Entry<String, JsopWriter> e : builders.entrySet()) {
            String mount = e.getKey();
            MicroKernel m = mounts.get(mount);
            String jsop = e.getValue().toString();
            revision = m.commit("/", jsop, revisionId, message);
            revisions.put(mount, revision);
        }
        builders.clear();
        return getHeadRevision();
    }
View Full Code Here

        String mount = getMount(path);
        if (mount == null) {
            throw ExceptionFactory.get("Not mapped: " + path);
        }
        String rev = getRevision(mount, revisionId);
        MicroKernel mk = mounts.get(mount);
        return mk.nodeExists(path, rev);
    }
View Full Code Here

        String mount = getMount(path);
        if (mount == null) {
            throw ExceptionFactory.get("Not mapped: " + path);
        }
        String rev = getRevision(mount, revisionId);
        MicroKernel mk = mounts.get(mount);
        return mk.getChildNodeCount(path, rev);
    }
View Full Code Here

TOP

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

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.