Package org.jboss.ha.framework.interfaces

Examples of org.jboss.ha.framework.interfaces.ClusterNode


      log.debug("+++ testKeyListenerDeadlock()");
     
      MBeanServer mbeanServer =
         MBeanServerFactory.createMBeanServer("mockPartition");
      try {
         ClusterNode localAddress = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12345));
         MockHAPartition partition = new MockHAPartition(localAddress);
     
         DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition);

         drm.createService();
View Full Code Here


      log.debug("+++ testRemoteCallBlocking()");
     
      MBeanServer mbeanServer =
         MBeanServerFactory.createMBeanServer("mockPartition");
      try {
         ClusterNode localAddress = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12345));
         MockHAPartition partition = new MockHAPartition(localAddress);
     
         DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition);

         drm.createService();
View Full Code Here

      int count = keys.length;
     
      MBeanServer mbeanServer =
         MBeanServerFactory.createMBeanServer("mockPartition");
      try {
         ClusterNode localAddress = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12345));
         MockHAPartition partition = new MockHAPartition(localAddress);
     
         DistributedReplicantManagerImpl drm = new DistributedReplicantManagerImpl(partition);

         drm.createService();
        
         // Create a fake view for the MockHAPartition
        
         Vector<ClusterNode> remoteAddresses = new Vector<ClusterNode>();
         ClusterNode remote = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12341));
         remoteAddresses.add(remote);
        
         Vector<ClusterNode> allNodes = new Vector<ClusterNode>(remoteAddresses);
         allNodes.add(localAddress);
         partition.setCurrentViewClusterNodes(allNodes);
        
         drm.startService();
        
         MockDeployer deployer = new MockDeployer(drm);
        
         if (!conflicting)
         {
            // Register a MockHASingletonDeployer, but since we're in
            // non-conflicting mode, the DeployerThreads won't deal with it
            MockHASingletonDeployer listener =
                  new MockHASingletonDeployer(deployer, "HASingleton", log);
           
            drm.registerListener("HASingleton", listener);
            drm.add("HASingleton", "HASingleton");           
         }
        
         // Create a semaphore to gate the threads and acquire all its permits
         Semaphore semaphore = new Semaphore(count + 1);
         for (int i = 0; i <= count; i++)
            semaphore.acquire();
        
         DeployerThread[] deployers = new DeployerThread[keys.length];
         for (int i = 0; i < count; i++)
         {
            DistributedReplicantManager.ReplicantListener listener = null;
            if (conflicting)
            {
               listener = new MockHASingletonDeployer(deployer, keys[i], log);
            }
            else
            {
               listener = new NullListener();
            }
            deployers[i] = new DeployerThread(deployer, keys[i], listener, semaphore, log);
            deployers[i].start();
         }
        
         String[] jgKeys = keys;
         if (!conflicting)
         {
            // The JGroups thread also deals with the MockHASingletonDeployer
            // key that the DeployerThreads don't
            jgKeys = new String[keys.length + 1];
            System.arraycopy(keys, 0, jgKeys, 0, keys.length);
            jgKeys[keys.length] = "HASingleton";           
         }
         JGroupsThread jgThread = new JGroupsThread(drm, jgKeys, remote.getName(), semaphore);
         jgThread.start();
        
         // Launch the threads
         semaphore.release(count + 1);
        
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);     
      handler.lockFromCluster("test", caller, 1000);
      replay(handler);
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));
     
      resetToStrict(handler);       
      handler.lockFromCluster("test", caller1, 1000);   
      replay(handler);
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);
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));
     
      resetToStrict(handler);  
      // We throw TimeoutException to indicate "node1" holds the lock
      handler.lockFromCluster("test", caller1, 1000);
View Full Code Here

      NonGloballyExclusiveClusterLockSupport 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);            
      handler.lockFromCluster("test", caller1, 1000);
      replay(handler);
View Full Code Here

      NonGloballyExclusiveClusterLockSupport testee = testeeSet.impl;
      HAPartition partition = testee.getPartition();
      LocalLockHandler handler = testee.getLocalHandler();
      RpcTarget target = testeeSet.target;
     
      ClusterNode caller1 = testee.getCurrentView().get(0);
      ClusterNode caller2 = testee.getCurrentView().get(2);
     
      resetToStrict(partition);
      resetToStrict(handler);
     
      handler.lockFromCluster(eq("test"), eq(caller1), anyLong());
View Full Code Here

public class LookupSucceededFilterUnitTestCase extends TestCase
{
   public void testFilterLogic()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      ClusterNode sender = new ClusterNodeImpl(new IpAddress(12345));
      exerciseFilterLogic(filter, sender);
   }
View Full Code Here

TOP

Related Classes of org.jboss.ha.framework.interfaces.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.