Package org.jgroups

Examples of org.jgroups.PhysicalAddress


    }


    protected void connect(String group, Address logical_addr) {
        String logical_name=org.jgroups.util.UUID.get(logical_addr);
        PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        List<PhysicalAddress> physical_addrs=physical_addr != null? new ArrayList<PhysicalAddress>() : null;
        if(physical_addr != null)
            physical_addrs.add(physical_addr);

        int num_faulty_conns=0;
View Full Code Here


                 local = local_addr;                
             } else {
                 ProtocolAdapter adapter = ProtocolAdapter.thread_local.get();
                 local = adapter.local_addr;
             }
             PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
             List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
             String logical_name=org.jgroups.util.UUID.get(local);
             tunnel_policy.connect(stubs, group, local, logical_name, physical_addrs);
            break;
View Full Code Here

                      if (log.isDebugEnabled()) {
                          log.debug("Reconnecting to router at " + stub.getGossipRouterAddress());
                      }

                      if(!isSingleton()){
                          PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
                          List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                          stub.connect(channel_name, local_addr, UUID.get(local_addr), physical_addrs);
                          if (log.isDebugEnabled()) {
                              log.debug("Reconnected to router at " + stub.getGossipRouterAddress());
                          }
                      }
                      else {
                          for(Protocol p: up_prots.values()) {
                              if(p instanceof ProtocolAdapter) {
                                  Address local=((ProtocolAdapter)p).local_addr;
                                  String cluster_name=((ProtocolAdapter)p).cluster_name;
                                  PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
                                  List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                                  stub.connect(cluster_name, local, UUID.get(local), physical_addrs);
                                  if (log.isDebugEnabled()) {
                                      log.debug("Reconnected to router at " + stub.getGossipRouterAddress());
                                  }
View Full Code Here

        super.start();
        initial_hosts = Util.parseCommaDelimitedHosts(hosts, port_range);      
    }
   
    public void sendGetMembersRequest(String cluster_name, Promise promise) throws Exception{
        PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        PingData data=new PingData(local_addr, null, false, UUID.get(local_addr), Arrays.asList(physical_addr));
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, data, cluster_name);

        Set<PhysicalAddress> combined_target_members=new HashSet<PhysicalAddress>(initial_hosts);
        combined_target_members.addAll(dynamic_hosts);
View Full Code Here

    public Object down(Event evt) {
        Object retval=super.down(evt);
        switch(evt.getType()) {
            case Event.VIEW_CHANGE:
                for(Address logical_addr: members) {
                    PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, logical_addr));
                    if(physical_addr != null && !initial_hosts.contains(physical_addr)) {
                        dynamic_hosts.addIfAbsent(physical_addr);
                    }
                }
                break;
View Full Code Here

      // Add mapping of local's address -> physical addr to the remote cache
      mapAddrWithPhysicalAddr(discovery, this);

      Address localAddr = discovery.getLocalAddr();
      PhysicalAddress physicalAddr = (PhysicalAddress) discovery.down(new Event(Event.GET_PHYSICAL_ADDRESS, localAddr));
      String logicalName = UUID.get(localAddr);
      PingData pingRsp = new PingData(localAddr, discovery.isServer(), logicalName, physicalAddr).coord(discovery.is_coord);

      if (log.isTraceEnabled())
         log.trace(String.format("Returning ping rsp: %s", pingRsp));
View Full Code Here

         rsps.addResponse(pingRsp, true);
      }
   }

   private void mapAddrWithPhysicalAddr(TEST_PING local, TEST_PING remote) {
      PhysicalAddress physical_addr = (PhysicalAddress)
         remote.down(new Event(Event.GET_PHYSICAL_ADDRESS, remote.getLocalAddr()));
      local.down(new Event(Event.SET_PHYSICAL_ADDRESS,
         new Tuple<Address, PhysicalAddress>(remote.getLocalAddr(), physical_addr)));

      if (log.isTraceEnabled())
View Full Code Here

    }


    protected void connect(String group, Address logical_addr) {
        String logical_name=org.jgroups.util.UUID.get(logical_addr);
        PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        List<PhysicalAddress> physical_addrs=physical_addr != null? new ArrayList<PhysicalAddress>() : null;
        if(physical_addr != null)
            physical_addrs.add(physical_addr);

        int num_faulty_conns=0;
View Full Code Here

                 local = local_addr;                
             } else {
                 ProtocolAdapter adapter = ProtocolAdapter.thread_local.get();
                 local = adapter.local_addr;
             }
             PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
             List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
             String logical_name=org.jgroups.util.UUID.get(local);
             tunnel_policy.connect(stubs, group, local, logical_name, physical_addrs);
            break;
View Full Code Here

                      if (log.isInfoEnabled()) {
                          log.info("Reconnecting " + stub);
                      }

                      if(!isSingleton()){
                          PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
                          List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                          stub.connect(channel_name, local_addr, UUID.get(local_addr), physical_addrs);
                          if (log.isInfoEnabled()) {
                              log.info("Reconnected " + stub);
                          }
                      }
                      else {
                          for(Protocol p: up_prots.values()) {
                              if(p instanceof ProtocolAdapter) {
                                  Address local=((ProtocolAdapter)p).local_addr;
                                  String cluster_name=((ProtocolAdapter)p).cluster_name;
                                  PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
                                  List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                                  stub.connect(cluster_name, local, UUID.get(local), physical_addrs);
                                  if (log.isInfoEnabled()) {
                                      log.info("Reconnected " + stub);
                                  }
View Full Code Here

TOP

Related Classes of org.jgroups.PhysicalAddress

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.