Package org.apache.jackrabbit.core.cluster.SimpleEventListener

Examples of org.apache.jackrabbit.core.cluster.SimpleEventListener.LockEvent


    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(UUID.randomUUID()), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here


    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(UUID.randomUUID()), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

        // add blocking consumer to slave, this will block on the first non-empty sync()
        BlockingConsumer consumer = new BlockingConsumer();
        slave.getJournal().register(consumer);
       
        // add first entry
        LockEvent event = new LockEvent(NodeId.randomId(), true, "admin");
        channel.create(event.getNodeId(), event.isDeep(), event.getUserId()).ended(true);
       
        // start a manual sync on the slave and ...
        Thread syncOnce = new Thread(new Runnable() {
            public void run() {
                try {
                    slave.sync();
                } catch (ClusterException e) {
                    /* ignore */
                }
            }
        });
        syncOnce.start();

        // ... wait until it blocks
        consumer.waitUntilBlocked();
       
        // add second entry
        event = new LockEvent(NodeId.randomId(), true, "admin");
        channel.create(event.getNodeId(), event.isDeep(), event.getUserId()).ended(true);
       
        // now unblock slave
        consumer.unblock();

        // wait for the sync to finish
View Full Code Here

    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(NodeId.randomId(), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(UUID.randomUUID()), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

    /**
     * Test producing and consuming a lock operation.
     * @throws Exception
     */
    public void testLockOperation() throws Exception {
        LockEvent event = new LockEvent(new NodeId(UUID.randomUUID()), true, "admin");

        master.createLockChannel(DEFAULT_WORKSPACE).create(event.getNodeId(),
                event.isDeep(), event.getUserId()).ended(true);

        SimpleEventListener listener = new SimpleEventListener();
        slave.createLockChannel(DEFAULT_WORKSPACE).setListener(listener);
        slave.sync();

View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.cluster.SimpleEventListener.LockEvent

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.