Examples of CommitHook


Examples of com.basho.riak.pbc.CommitHook

       
        if (p.getPrecommitHooks() != null) {
            List<CommitHook> hooklist = new ArrayList<CommitHook>();
            for (NamedFunction f : p.getPrecommitHooks()) {
                if (f instanceof NamedJSFunction) {
                    hooklist.add(new CommitHook(((NamedJSFunction) f).getFunction()));
                } else {
                    hooklist.add(new CommitHook(((NamedErlangFunction)f).getMod(),
                                                ((NamedErlangFunction)f).getFun()));
                }
            }
            props.precommitHooks(hooklist);
        }
           
        if (p.getPostcommitHooks() != null) {
            List<CommitHook> hooklist = new ArrayList<CommitHook>();
            for (NamedErlangFunction f : p.getPostcommitHooks()) {
                hooklist.add(new CommitHook(f.getMod(), f.getFun()));
            }
            props.postcommitHooks(hooklist);
        }
       
        if (p.getLinkWalkFunction() != null) {
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

                CompositeHook.compose(initHooks));

        // add index hooks later to prevent the OakInitializer to do excessive indexing
        with(new IndexUpdateProvider(indexEditors));
        withEditorHook();
        CommitHook commitHook = CompositeHook.compose(commitHooks);
        return new ContentRepositoryImpl(
                store,
                commitHook,
                defaultWorkspaceName,
                indexProvider,
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

                                  @Nonnull RepositoryInitializer initializer,
                                  @Nonnull IndexEditorProvider indexEditor) {
        try {
            NodeBuilder builder = store.getRoot().builder();
            initializer.initialize(builder);
            CommitHook hook = new EditorHook(new IndexUpdateProvider(indexEditor));
            store.merge(builder, hook, null);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

        NodeBuilder builder = store.getRoot().builder();
        for (WorkspaceInitializer wspInit : initializer) {
            wspInit.initialize(builder, workspaceName, indexProvider, commitHook);
        }
        try {
            CommitHook hook = new EditorHook(new IndexUpdateProvider(indexEditor));
            store.merge(builder, hook, null);
        } catch (CommitFailedException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

                CompositeHook.compose(initHooks));

        // add index hooks later to prevent the OakInitializer to do excessive indexing
        with(new IndexUpdateProvider(indexEditors));
        withEditorHook();
        CommitHook commitHook = CompositeHook.compose(commitHooks);
        return new ContentRepositoryImpl(
                store,
                commitHook,
                defaultWorkspaceName,
                indexProvider,
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

        CommitFailedException exception = EditorDiff.process(indexUpdate,
                before, after);
        if (exception == null && callback.dirty) {
            async.setProperty(name, checkpoint);
            try {
                store.merge(builder, new CommitHook() {
                    @Override @Nonnull
                    public NodeState processCommit(NodeState before,
                            NodeState after) throws CommitFailedException {
                        // check for concurrent updates by this async task
                        PropertyState stateAfterRebase = before
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

                provider, name, after, builder), before, after);
        if (exception == null) {
            try {
                async.setProperty(name, checkpoint);
                postAsyncRunStatus(builder);
                store.merge(builder, new CommitHook() {
                    @Override
                    @Nonnull
                    public NodeState processCommit(NodeState before,
                            NodeState after) throws CommitFailedException {
                        // check for concurrent updates by this async task
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

        newNodeBuilder.setProperty("n", 42);

        testBuilder.getChildNode("a").remove();

        store.merge(rootBuilder, new CommitHook() {
            @Override
            public NodeState processCommit(NodeState before, NodeState after) {
                NodeBuilder rootBuilder = after.builder();
                NodeBuilder testBuilder = rootBuilder.child("test");
                testBuilder.child("fromHook");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

                CompositeHook.compose(initHooks));

        // add index hooks later to prevent the OakInitializer to do excessive indexing
        with(new IndexUpdateProvider(indexEditors));
        withEditorHook();
        CommitHook commitHook = CompositeHook.compose(commitHooks);
        return new ContentRepositoryImpl(
                store,
                commitHook,
                defaultWorkspaceName,
                indexProvider,
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.commit.CommitHook

        assertFalse(store.getRoot().hasProperty("bar"));

        NodeBuilder b = store.getRoot().builder();
        b.setProperty("bar", "xyz");
        store.setMaximumBackoff(100);
        store.merge(b, new CommitHook() {
            @Override @Nonnull
            public NodeState processCommit(NodeState before, NodeState after) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
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.