Package org.jboss.as.clustering

Examples of org.jboss.as.clustering.ClusterNode


        T testee = testeeSet.impl;
        GroupRpcDispatcher rpcDispatcher = testee.getGroupRpcDispatcher();
        LocalLockHandler handler = testee.getLocalHandler();
        final RpcTarget target = testeeSet.target;

        ClusterNode inferiorNode = testee.getCurrentView().get(2);
        assertFalse(node1.equals(inferiorNode));

        ClusterNode superiorNode = testee.getCurrentView().get(0);
        assertFalse(node1.equals(superiorNode));

        // When caller 1 invokes, block before giving response
        CountDownLatch answerAwaitLatch = new CountDownLatch(1);
        CountDownLatch answerStartLatch = new CountDownLatch(1);
View Full Code Here


        TesteeSet<T> testeeSet = getTesteeSet(node1, 1, 2);
        AbstractClusterLockSupport testee = testeeSet.impl;
        GroupRpcDispatcher rpcDispatcher = testee.getGroupRpcDispatcher();
        LocalLockHandler handler = testee.getLocalHandler();

        ClusterNode other = testee.getCurrentView().get(0);

        ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
        rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));

        when(rpcDispatcher.getMethodCallTimeout()).thenReturn(60000l);
View Full Code Here

         * Record interest in obtaining the lock. If the lock is unheld and <code>registrant</code> was the last holder of the
         * lock, then <code>registrant</code> will be made holder of the lock.
         * @return a LockState with a lock count one higher than this one and with the current thread as latestRegistrant
         */
        LockState register(ClusterNode registrant) {
            ClusterNode newHolder = (lockHolder == null && lastHolder == registrant) ? registrant : lockHolder;
            ClusterNode newLast = newHolder == null ? lastHolder : null;
            return new LockState(localLockCount + 1, newHolder, newLast, Thread.currentThread(), invalid);
        }
View Full Code Here

        TesteeSet<YieldingGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 2);
        YieldingGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        ClusterNode caller = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller));

        RemoteLockResponse rsp = target.remoteLock("test", caller, 1000);

        verify(handler).lockFromCluster("test", caller, 1000);
View Full Code Here

        TesteeSet<YieldingGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
        YieldingGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        ClusterNode caller1 = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller1));

        ClusterNode caller2 = testee.getCurrentView().get(2);
        assertFalse(node1.equals(caller2));

        RemoteLockResponse rsp = target.remoteLock("test", caller1, 1000);

        verify(handler).lockFromCluster("test", caller1, 1000);
View Full Code Here

        YieldingGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        List<ClusterNode> members = testee.getCurrentView();
        ClusterNode caller1 = members.get(0);
        assertFalse(node1.equals(caller1));

        ClusterNode caller2 = members.get(2);
        assertFalse(node1.equals(caller2));

        RemoteLockResponse rsp = target.remoteLock("test", caller1, 1000);

        verify(handler).lockFromCluster("test", caller1, 1000);
View Full Code Here

        TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 2);
        NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        ClusterNode caller = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller));

//        resetToStrict(handler);
        RemoteLockResponse rsp = target.remoteLock("test", caller, 1000);
View Full Code Here

        TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
        NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        ClusterNode caller1 = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller1));

        ClusterNode caller2 = testee.getCurrentView().get(2);
        assertFalse(node1.equals(caller2));

        RemoteLockResponse rsp = target.remoteLock("test", caller1, 1000);

        assertEquals(RemoteLockResponse.Flag.OK, rsp.flag);
View Full Code Here

        TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
        NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        final RpcTarget target = testeeSet.target;

        ClusterNode caller1 = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller1));

        ClusterNode caller2 = testee.getCurrentView().get(2);
        assertFalse(node1.equals(caller2));

//        resetToStrict(handler);
//        makeThreadSafe(handler, true);
        // When caller 1 invokes, block before giving response
View Full Code Here

        TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 2);
        NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
        LocalLockHandler handler = testee.getLocalHandler();
        RpcTarget target = testeeSet.target;

        ClusterNode caller1 = testee.getCurrentView().get(0);
        assertFalse(node1.equals(caller1));

        // We throw TimeoutException to indicate "node1" holds the lock
        // A second attempt should succeed if the local lock is released
        // We return normally to indicate success
View Full Code Here

TOP

Related Classes of org.jboss.as.clustering.ClusterNode

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.