Examples of YieldingGloballyExclusiveClusterLockSupport


Examples of org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport

   @Override
   protected YieldingGloballyExclusiveClusterLockSupport createClusteredLockManager(String serviceHAName,
         HAPartition partition, LocalLockHandler handler)
   {
      return new YieldingGloballyExclusiveClusterLockSupport(serviceHAName, partition, handler);
   }
View Full Code Here

Examples of org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport

   }

   public void testBasicRemoteLock() throws Exception
   {
      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));
     
      resetToStrict(handler);     
      replay(handler);
     
View Full Code Here

Examples of org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport

   }
  
   public void testContestedRemoteLock() throws Exception
   {
      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));
     
      resetToStrict(handler);     
      replay(handler);
     
View Full Code Here

Examples of org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport

    * @throws Exception
    */
   public void testDeadMemberCleanupAllowsRemoteLock() throws Exception
   {
      TesteeSet<YieldingGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
      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));
     
      resetToStrict(handler);     
      replay(handler);
     
      RemoteLockResponse rsp = target.remoteLock("test", caller1, 1000);
     
      assertEquals(RemoteLockResponse.Flag.OK, rsp.flag);
      assertNull(rsp.holder);
     
      verify(handler);
     
      // Change the view
      Vector<ClusterNode> dead = new Vector<ClusterNode>();
      dead.add(caller1);
     
      Vector<ClusterNode> all = new Vector<ClusterNode>(members);
      all.remove(caller1);
     
      resetToStrict(handler);
      replay(handler);
     
      testee.membershipChanged(dead, new Vector<ClusterNode>(), all);
     
      verify(handler);
     
      // A call from a different caller should work
      resetToStrict(handler);
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.