Package org.jboss.ha.framework.server

Examples of org.jboss.ha.framework.server.ClusterNodeImpl


      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();
        
         // Create a fake view for the MockHAPartition
        
         Vector<ClusterNode> remoteAddresses = new Vector<ClusterNode>();
         for (int i = 1; i < 5; i++)
            remoteAddresses.add(new ClusterNodeImpl(new IpAddress("127.0.0.1", 12340 + i)));
        
         Vector<ClusterNode> allNodes = new Vector<ClusterNode>(remoteAddresses);
         allNodes.add(localAddress);
         partition.setCurrentViewClusterNodes(allNodes);
        
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();
        
         // Create a fake view for the MockHAPartition
        
         Vector<ClusterNode> remoteAddresses = new Vector<ClusterNode>();
         for (int i = 1; i < 5; i++)
            remoteAddresses.add(new ClusterNodeImpl(new IpAddress("127.0.0.1", 12340 + i)));
        
         Vector<ClusterNode> allNodes = new Vector<ClusterNode>(remoteAddresses);
         allNodes.add(localAddress);
         partition.setCurrentViewClusterNodes(allNodes);
        
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

         String[] names = new String[nodes.length];
         Integer[] replicants = new Integer[nodes.length];
         Vector<ClusterNode> allNodes = new Vector<ClusterNode>();
         for (int i = 0; i < nodes.length; i++)
         {
            nodes[i] = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12340 + i));
            allNodes.add(nodes[i]);
            names[i] = nodes[i].getName();
            replicants[i] = new Integer(i);
         }
        
View Full Code Here

//         String[] names = new String[nodes.length];
         Integer[] replicants = new Integer[nodes.length];
         Vector<ClusterNode> allNodes = new Vector<ClusterNode>();
         for (int i = 0; i < nodes.length; i++)
         {
            nodes[i] = new ClusterNodeImpl(new IpAddress("127.0.0.1", 12340 + i));
            allNodes.add(nodes[i]);
//            names[i] = nodes[i].getName();
            replicants[i] = new Integer(i);
         }
        
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

   @Override
   protected void setUp() throws UnknownHostException
   {
      InetAddress localAddress = InetAddress.getByName("localhost");
     
      this.candidates.add(new ClusterNodeImpl(new IpAddress(localAddress, 10000)));
      this.candidates.add(new ClusterNodeImpl(new IpAddress(localAddress, 10001)));
      this.candidates.add(new ClusterNodeImpl(new IpAddress(localAddress, 10002)));
     
      this.policy = new PreferredMasterElectionPolicy();
   }
View Full Code Here

   }

   protected void setUp() throws Exception
   {
      super.setUp();
      node1 = new ClusterNodeImpl(new IpAddress("localhost", 1));
      node2 = new ClusterNodeImpl(new IpAddress("localhost", 2));
      node3 = new ClusterNodeImpl(new IpAddress("localhost", 3));
   }
View Full Code Here

TOP

Related Classes of org.jboss.ha.framework.server.ClusterNodeImpl

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.