Examples of ClusterNode


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

      Assert.assertSame(this.candidates.get(1), master);
   }
  
   public void testUseDefaultMasterNoPreference()
   {
      ClusterNode master = this.policy.elect(this.candidates);
     
      Assert.assertSame(this.candidates.get(0), master);
     
      this.policy.setPosition(1);
     
View Full Code Here

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

  
   public void testUseDefaultMasterEmptyPreference()
   {
      this.policy.setPreferredMaster("");
     
      ClusterNode master = this.policy.elect(this.candidates);
     
      Assert.assertSame(this.candidates.get(0), master);
     
      this.policy.setPosition(1);
     
View Full Code Here

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

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

         drm.createService();
View Full Code Here

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

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

         drm.createService();
View Full Code Here

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

     
      MBeanServer mbeanServer =
         MBeanServerFactory.createMBeanServer("mockPartition");
      try {
       
         ClusterNode localAddress = factory.getClusterNode(new IpAddress("localhost", 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 = factory.getClusterNode(new IpAddress("localhost", 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

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

      if (this.electionPolicy == null)
      {
         return this.isDRMMasterReplica();
      }
     
      ClusterNode electedNode = this.election();
     
      return (electedNode != null) ? electedNode.equals(this.getHAPartition().getClusterNode()) : false;
   }
View Full Code Here

Examples of org.qzerver.model.domain.entities.cluster.ClusterNode

        ClusterGroup clusterGroup = new ClusterGroup();
        clusterGroup.setName("Test cluster group");
        businessEntityDao.save(clusterGroup);

        ClusterNode clusterNode1 = new ClusterNode();
        clusterNode1.setAddress("10.2.0.1");
        clusterNode1.setDescription("test node");
        clusterNode1.setEnabled(true);
        clusterNode1.setGroup(clusterGroup);
        clusterGroup.getNodes().add(clusterNode1);

        ClusterNode clusterNode2 = new ClusterNode();
        clusterNode2.setAddress("10.2.0.2");
        clusterNode2.setDescription("test node");
        clusterNode2.setEnabled(true);
        clusterNode2.setGroup(clusterGroup);
        clusterGroup.getNodes().add(clusterNode2);

        control.reset();

        quartzManagementService.createJob(
View Full Code Here

Examples of org.qzerver.model.domain.entities.cluster.ClusterNode

        ClusterGroup clusterGroup = new ClusterGroup();
        clusterGroup.setName("Test cluster group");
        businessEntityDao.save(clusterGroup);

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.setAddress("10.2.0.1");
        clusterNode.setDescription("test node");
        clusterNode.setEnabled(true);
        clusterNode.setGroup(clusterGroup);
        clusterGroup.getNodes().add(clusterNode);

        Capture<Long> idCapture1 = new Capture<Long>(CaptureType.ALL);
        Capture<Long> idCapture2 = new Capture<Long>(CaptureType.ALL);
View Full Code Here

Examples of org.qzerver.model.domain.entities.cluster.ClusterNode

        ClusterGroup clusterGroup = new ClusterGroup();
        clusterGroup.setName("Test cluster group");
        businessEntityDao.save(clusterGroup);

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.setAddress("10.2.0.1");
        clusterNode.setDescription("test node");
        clusterNode.setEnabled(true);
        clusterNode.setGroup(clusterGroup);
        clusterGroup.getNodes().add(clusterNode);

        control.reset();

        quartzManagementService.createJob(
View Full Code Here

Examples of org.qzerver.model.domain.entities.cluster.ClusterNode

        ClusterGroup clusterGroup = new ClusterGroup();
        clusterGroup.setName("Test cluster group");
        businessEntityDao.save(clusterGroup);

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.setAddress("10.2.0.1");
        clusterNode.setDescription("test node");
        clusterNode.setEnabled(true);
        clusterNode.setGroup(clusterGroup);
        clusterGroup.getNodes().add(clusterNode);

        Capture<Long> idCapture1 = new Capture<Long>(CaptureType.ALL);
        Capture<Long> idCapture2 = new Capture<Long>(CaptureType.ALL);
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.