[infinispan-commits] Infinispan SVN: r1295 - in trunk/core/src/main/java/org/infinispan/remoting: transport and 1 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Fri Dec 11 12:09:29 EST 2009


Author: galder.zamarreno at jboss.com
Date: 2009-12-11 12:09:28 -0500 (Fri, 11 Dec 2009)
New Revision: 1295

Modified:
   trunk/core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java
   trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java
   trunk/core/src/main/java/org/infinispan/remoting/transport/jgroups/JGroupsTransport.java
Log:
[ISPN-297] (Transport API change to that collection of physical addresses are returned) Done.

Modified: trunk/core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java	2009-12-11 16:47:35 UTC (rev 1294)
+++ trunk/core/src/main/java/org/infinispan/remoting/rpc/RpcManagerImpl.java	2009-12-11 17:09:28 UTC (rev 1295)
@@ -327,11 +327,11 @@
       return address == null ? "N/A" : address.toString();
    }
 
-   @ManagedAttribute(description = "The physical network address associated with this instance")
-   @Metric(displayName = "Physical network address", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
-   public String getPhysicalAddress() {
+   @ManagedAttribute(description = "The physical network addresses associated with this instance")
+   @Metric(displayName = "Physical network addresses", dataType = DataType.TRAIT, displayType = DisplayType.SUMMARY)
+   public String getPhysicalAddresses() {
       if (t == null || !isStatisticsEnabled()) return "N/A";
-      Address address = t.getPhysicalAddress();
+      List<Address> address = t.getPhysicalAddresses();
       return address == null ? "N/A" : address.toString();
    }
 

Modified: trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java	2009-12-11 16:47:35 UTC (rev 1294)
+++ trunk/core/src/main/java/org/infinispan/remoting/transport/Transport.java	2009-12-11 17:09:28 UTC (rev 1295)
@@ -84,14 +84,14 @@
    Address getAddress();
 
    /**
-    * Retrieves the current cache instance's phyical network address. Some implementations might differentiate 
-    * between logical and physical addresses in which case, this method allows clients to query the physical one. 
-    * Implementations where logical and physical address are the same will simply return the same Address 
-    * as {@link #getAddress()}.
+    * Retrieves the current cache instance's phyical network addresses. Some implementations might differentiate 
+    * between logical and physical addresses in which case, this method allows clients to query the physical ones 
+    * associated with the logical address. Implementations where logical and physical address are the same will simply 
+    * return a single entry List that contains the same Address as {@link #getAddress()}.
     *
-    * @return an Address
-    */   
-   Address getPhysicalAddress();
+    * @return an List of Address
+    */
+   List<Address> getPhysicalAddresses();
 
    /**
     * Returns a list of  members in the current cluster view.

Modified: trunk/core/src/main/java/org/infinispan/remoting/transport/jgroups/JGroupsTransport.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/transport/jgroups/JGroupsTransport.java	2009-12-11 16:47:35 UTC (rev 1294)
+++ trunk/core/src/main/java/org/infinispan/remoting/transport/jgroups/JGroupsTransport.java	2009-12-11 17:09:28 UTC (rev 1295)
@@ -159,7 +159,7 @@
             throw new CacheException("Unable to start JGroups Channel", e);
          }
       }
-      log.info("Cache local address is {0}, physical address is {1}", getAddress(), getPhysicalAddress());
+      log.info("Cache local address is {0}, physical addresses are {1}", getAddress(), getPhysicalAddresses());
 
       // ensure that the channel has FLUSH enabled.
       // see ISPN-83 for details.
@@ -357,12 +357,12 @@
       return address;
    }
 
-   public Address getPhysicalAddress() {
+   public List<Address> getPhysicalAddresses() {
       if (physicalAddress == null && channel != null) {
          org.jgroups.Address addr = (org.jgroups.Address) channel.downcall(new Event(Event.GET_PHYSICAL_ADDRESS, channel.getAddress()));
          physicalAddress = new JGroupsAddress(addr);
       }
-      return physicalAddress;
+      return Collections.singletonList(physicalAddress);
    }
 
    // ------------------------------------------------------------------------------------------------------------------



More information about the infinispan-commits mailing list