tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r525778 - /tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java
Date Thu, 05 Apr 2007 09:33:09 GMT
Author: pero
Date: Thu Apr  5 02:33:09 2007
New Revision: 525778

URL: http://svn.apache.org/viewvc?view=rev&rev=525778
Log:
convert hostnames to address at tcpListenAddress attribute

Modified:
    tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java

Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java?view=diff&rev=525778&r1=525777&r2=525778
==============================================================================
--- tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java
(original)
+++ tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/tcp/ClusterReceiverBase.java
Thu Apr  5 02:33:09 2007
@@ -117,10 +117,6 @@
     public java.net.InetAddress getBind() {
         if (bind == null) {
             try {
-                if ("auto".equals(tcpListenAddress)) {
-                    tcpListenAddress = java.net.InetAddress.getLocalHost()
-                            .getHostAddress();
-                }
                 if (log.isDebugEnabled())
                     log.debug("Starting replication listener on address:"
                             + tcpListenAddress);
@@ -196,13 +192,38 @@
         this.sendAck = sendAck;
     }
  
+    /**
+     * get tcp listen recevier ip address
+     * @return listen address
+     */
     public String getTcpListenAddress() {
         return tcpListenAddress;
     }
-    
+
+    /**
+     * Set TCP listen ip address. If arg auto use InetAddress.getLocalHost()
+     * otherwise arg converted with InetAddress.getByName().
+     * 
+     * @param tcpListenAddress 
+     */
     public void setTcpListenAddress(String tcpListenAddress) {
-        this.tcpListenAddress = tcpListenAddress;
+        try {
+            if ("auto".equals(tcpListenAddress)) {
+                this.tcpListenAddress = 
+                    java.net.InetAddress.getLocalHost().getHostAddress();
+            } else {
+                this.tcpListenAddress =
+                    java.net.InetAddress.getByName(tcpListenAddress).getHostAddress();
+            }
+            if (log.isDebugEnabled())
+                log.debug("Set replication listener on address:"
+                        + this.tcpListenAddress);
+        } catch (IOException ioe) {
+            log.error("Failed get Inet address at replication listener on address:"
+                    + tcpListenAddress, ioe);
+        }
     }
+
     
     public int getTcpListenPort() {
         return tcpListenPort;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message