Package org.jgroups

Examples of org.jgroups.Address


    }


    public static void testRemove() throws UnknownHostException {
        AckMcastSenderWindow mywin=new AckMcastSenderWindow(new MyCommand(), new StaticInterval(1000, 2000, 3000));
        Address sender1=new IpAddress("127.0.0.1", 10000);
        Address sender2=new IpAddress("127.0.0.1", 10001);
        Address sender3=new IpAddress("127.0.0.1", 10002);
        Vector senders=new Vector();
        Message msg=new Message();
        long seqno=322649;

        senders.addElement(sender1);
View Full Code Here


    private void updateStats(Message msg, short direction) {
        int     length;
        HashMap map;
        boolean mcast;
        Address dest, src;

        if(msg == null) return;
        length=msg.getLength();
        dest=msg.getDest();
        src=msg.getSrc();
        mcast=dest == null || dest.isMulticastAddress();

        if(direction == UP) { // received
            received_msgs++;
            received_bytes+=length;
            if(mcast) {
                received_mcasts++;
                received_mcast_bytes+=length;
            }
            else {
                received_ucasts++;
                received_ucast_bytes+=length;
            }
        }
        else {                // sent
            sent_msgs++;
            sent_bytes+=length;
            if(mcast) {
                sent_mcasts++;
                sent_mcast_bytes+=length;
            }
            else {
                sent_ucasts++;
                sent_ucast_bytes+=length;
            }
        }

        Address key=direction == UP? src : dest;
        map=direction == UP? received : sent;
        Entry entry=(Entry)map.get(key);
        if(entry == null) {
            entry=new Entry();
            map.put(key, entry);
View Full Code Here

      syncChannel.connect(groupName);
      asyncChannel.connect(groupName);

      super.start();

      Address syncAddress = syncChannel.getLocalAddress();
      Address asyncAddress = asyncChannel.getLocalAddress();
      PostOfficeAddressInfo info = new PostOfficeAddressInfo(syncAddress, asyncAddress);
      put(ADDRESS_INFO_KEY, info);

      statsSender.start();
View Full Code Here

         if (nodeIDView == null)
         {
            nodeIDView = new HashSet();
         }

         Address addr = (Address)i.next();

         for(Iterator j = addressInfo.entrySet().iterator(); j.hasNext(); )
         {
            Map.Entry entry = (Map.Entry)j.next();
View Full Code Here

      if (stopping)
      {
         return;
      }
     
      Address address = this.getAddressForNodeId(nodeId, false);

      if (address == null)
      {
         throw new IllegalArgumentException("Cannot find address for node " + nodeId);
      }
View Full Code Here

      {
         sb.append("UNINITIALIZED");
      }
      else
      {
         Address addr = syncChannel.getLocalAddress();
         if (addr == null)
         {
            sb.append("UNCONNECTED");
         }
         else
View Full Code Here

      out.println("<table border=1><tr><td>Members</td></tr>");


      for (Iterator iterMembers = currentView.getMembers().iterator(); iterMembers.hasNext();)
      {
         Address address = (Address) iterMembers.next();
         out.println("<tr><td>" + address + "</td></tr>");
      }

      out.println("</table>");
View Full Code Here

            if (oldView != null)
            {
               for (Iterator i = oldView.getMembers().iterator(); i.hasNext(); )
               {
                  Address address = (Address)i.next();
                  if (!newView.containsMember(address))
                  {
                     // this is where the failover happens, if necessary
                     nodeLeft(address);
                  }
               }
            }

            for (Iterator i = newView.getMembers().iterator(); i.hasNext(); )
            {
               Address address = (Address)i.next();
               if (oldView == null || !oldView.containsMember(address))
               {
                  nodeJoined(address);
               }
            }
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

    JChannel channel = new JChannel();
   
    channel.setReceiver(new ReceiverAdapter(){

      public void receive(Message msg) {
        Address sender = msg.getSrc();
        System.out.println(msg.getObject() + " [" + sender + "]");
      }

      public void viewAccepted(View view) {
        System.out.println("view: " + view);
View Full Code Here

TOP

Related Classes of org.jgroups.Address

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.