Package org.jgroups.stack

Examples of org.jgroups.stack.IpAddress


*/
public class TestClusterNodeFactory implements ClusterNodeFactory
{
 
  public ClusterNode getClusterNode(Address address){
    IpAddress ip = (IpAddress) address;
    return new MockClusterNode(ip.getIpAddress(), ip.getPort());
  }  
View Full Code Here


{
   private final ClusterNodeFactory factory = new TestClusterNodeFactory();
   public void testFilterLogic()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      ClusterNode sender = factory.getClusterNode(new IpAddress(12345));
      exerciseFilterLogic(filter, sender);
   }
View Full Code Here

   }

   public void testFilterLogicViaAdapter()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      Address sender = new IpAddress(12345);
      RspFilterAdapter adapter = new RspFilterAdapter(filter,factory);
      exerciseFilterLogic(adapter, sender);
  }
View Full Code Here

    * doesn't result in an incorrect answer.
    */
   public void testConcurrentResponses()
   {
      ResponseFilter filter = new LookupSucceededFilter();
      ClusterNode sender1 = factory.getClusterNode(new IpAddress(12345));
      ClusterNode sender2 = factory.getClusterNode(new IpAddress(67890));
     
      filter.isAcceptable("A", sender1);
      filter.isAcceptable(null, sender2);
      assertFalse("Concurrency problem (JBAS-7945)",filter.needMoreResponses());
   }
View Full Code Here

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

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

     
      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);
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] = factory.getClusterNode(new IpAddress("localhost", 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] = factory.getClusterNode(new IpAddress("localhost", 12340 + i));
            allNodes.add(nodes[i]);
//            names[i] = nodes[i].getName();
            replicants[i] = new Integer(i);
         }
        
View Full Code Here

TOP

Related Classes of org.jgroups.stack.IpAddress

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.