geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r718353 - in /geronimo/server/trunk/plugins: activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/ activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ activemq5/geronimo-activemq5/src/test/java/org/apache...
Date Mon, 17 Nov 2008 19:57:35 GMT
Author: dwoods
Date: Mon Nov 17 11:57:34 2008
New Revision: 718353

URL: http://svn.apache.org/viewvc?rev=718353&view=rev
Log:
GERONIMO-4404 ActiveMQ v4.1 connectors default to 0.0.0.0 when ServerHostname is set to localhost.
 Including in trunk until AMQ5 integration is complete.  Thanks Shawn for the patch.

Modified:
    geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
    geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
    geronimo/server/trunk/plugins/activemq5/geronimo-activemq5/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java

Modified: geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java?rev=718353&r1=718352&r2=718353&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
(original)
+++ geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/TransportConnectorGBeanImpl.java
Mon Nov 17 11:57:34 2008
@@ -53,7 +53,12 @@
     public TransportConnectorGBeanImpl(BrokerServiceGBean brokerServiceGBean, String protocol,
String host, int port) {
         this.brokerServiceGBean = brokerServiceGBean;
         this.protocol = protocol;
-        this.host = host;
+        //force localhost to 127.0.0.1 to avoid activemq amplify localhost to 0.0.0.0
+        if (host.equalsIgnoreCase("localhost")) {
+            this.host = "127.0.0.1";
+        } else {
+            this.host = host;
+        }
         this.port = port;
     }
 

Modified: geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java?rev=718353&r1=718352&r2=718353&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
(original)
+++ geronimo/server/trunk/plugins/activemq/geronimo-activemq/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
Mon Nov 17 11:57:34 2008
@@ -32,9 +32,9 @@
 
     public void testURLManipulation() {
         test = new TransportConnectorGBeanImpl(null, "foo", "localhost", 1234);
-        assertEquals("foo://localhost:1234", test.getUrl());
+        assertEquals("foo://127.0.0.1:1234", test.getUrl());
         assertEquals("foo", test.getProtocol());
-        assertEquals("localhost", test.getHost());
+        assertEquals("127.0.0.1", test.getHost());
         assertEquals(1234, test.getPort());
         test.setHost("0.0.0.0");
         assertEquals("foo://0.0.0.0:1234", test.getUrl());
@@ -52,9 +52,9 @@
         assertEquals("0.0.0.0", test.getHost());
         assertEquals(8765, test.getPort());
         test = new TransportConnectorGBeanImpl(null, "vm", "localhost", -1);
-        assertEquals("vm://localhost", test.getUrl());
+        assertEquals("vm://127.0.0.1", test.getUrl());
         assertEquals("vm", test.getProtocol());
-        assertEquals("localhost", test.getHost());
+        assertEquals("127.0.0.1", test.getHost());
         assertEquals(-1, test.getPort());
     }
 }

Modified: geronimo/server/trunk/plugins/activemq5/geronimo-activemq5/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq5/geronimo-activemq5/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java?rev=718353&r1=718352&r2=718353&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq5/geronimo-activemq5/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
(original)
+++ geronimo/server/trunk/plugins/activemq5/geronimo-activemq5/src/test/java/org/apache/geronimo/activemq/ConnectorTest.java
Mon Nov 17 11:57:34 2008
@@ -35,9 +35,9 @@
 //
 //    public void testURLManipulation() {
 //        test = new TransportConnectorGBeanImpl(null, "foo", "localhost", 1234);
-//        assertEquals("foo://localhost:1234", test.getUrl());
+//        assertEquals("foo://127.0.0.1:1234", test.getUrl());
 //        assertEquals("foo", test.getProtocol());
-//        assertEquals("localhost", test.getHost());
+//        assertEquals("127.0.0.1", test.getHost());
 //        assertEquals(1234, test.getPort());
 //        test.setHost("0.0.0.0");
 //        assertEquals("foo://0.0.0.0:1234", test.getUrl());
@@ -55,9 +55,9 @@
 //        assertEquals("0.0.0.0", test.getHost());
 //        assertEquals(8765, test.getPort());
 //        test = new TransportConnectorGBeanImpl(null, "vm", "localhost", -1);
-//        assertEquals("vm://localhost", test.getUrl());
+//        assertEquals("vm://127.0.0.1", test.getUrl());
 //        assertEquals("vm", test.getProtocol());
-//        assertEquals("localhost", test.getHost());
+//        assertEquals("127.0.0.1", test.getHost());
 //        assertEquals(-1, test.getPort());
 //    }
 }



Mime
View raw message