activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1389776 - in /activemq/trunk: activemq-core/ activemq-core/src/main/java/org/apache/activemq/broker/ activemq-optional/src/main/java/org/apache/activemq/transport/ activemq-optional/src/main/java/org/apache/activemq/transport/http/ activem...
Date Tue, 25 Sep 2012 09:44:20 GMT
Author: dejanb
Date: Tue Sep 25 09:44:20 2012
New Revision: 1389776

URL: http://svn.apache.org/viewvc?rev=1389776&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3918 - don't bind http based transports to local
host name and do better url registering

Modified:
    activemq/trunk/activemq-core/pom.xml
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java

Modified: activemq/trunk/activemq-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/pom.xml?rev=1389776&r1=1389775&r2=1389776&view=diff
==============================================================================
--- activemq/trunk/activemq-core/pom.xml (original)
+++ activemq/trunk/activemq-core/pom.xml Tue Sep 25 09:44:20 2012
@@ -955,7 +955,7 @@
             <exclude>org/apache/activemq/store/jdbc/JDBCStoreBrokerTest.*</exclude>
             <exclude>org/apache/activemq/broker/ft/MasterSlaveSlaveDieTest.*</exclude>
             <exclude>org/apache/activemq/security/XBeanSecurityWithGuestNoCredentialsOnlyTest.*</exclude>
-
+            <exclude>org/apache/activemq/store/kahadb/plist/PListTest.*</exclude>
           </excludes>
         </configuration>
       </plugin>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?rev=1389776&r1=1389775&r2=1389776&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Tue Sep 25 09:44:20 2012
@@ -62,7 +62,6 @@ public class TransportConnector implemen
     private DiscoveryAgent discoveryAgent;
     private final ConnectorStatistics statistics = new ConnectorStatistics();
     private URI discoveryUri;
-    private URI connectUri;
     private String name;
     private boolean disableAsyncDispatch;
     private boolean enableStatusMonitor = false;
@@ -105,7 +104,6 @@ public class TransportConnector implemen
     public ManagedTransportConnector asManagedConnector(ManagementContext context, ObjectName
connectorName) throws IOException, URISyntaxException {
         ManagedTransportConnector rc = new ManagedTransportConnector(context, connectorName,
getServer());
         rc.setBrokerInfo(getBrokerInfo());
-        rc.setConnectUri(getConnectUri());
         rc.setDisableAsyncDispatch(isDisableAsyncDispatch());
         rc.setDiscoveryAgent(getDiscoveryAgent());
         rc.setDiscoveryUri(getDiscoveryUri());
@@ -345,16 +343,11 @@ public class TransportConnector implemen
     }
 
     public URI getConnectUri() throws IOException, URISyntaxException {
-        if (connectUri == null) {
-            if (server != null) {
-                connectUri = server.getConnectURI();
-            }
+        if (server != null) {
+            return server.getConnectURI();
+        } else {
+            return uri;
         }
-        return connectUri;
-    }
-
-    public void setConnectUri(URI transportUri) {
-        this.connectUri = transportUri;
     }
 
     public void onStarted(TransportConnection connection) {

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java?rev=1389776&r1=1389775&r2=1389776&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
Tue Sep 25 09:44:20 2012
@@ -43,14 +43,14 @@ abstract public class WebTransportServer
         bindHost = (bindHost == null || bindHost.length() == 0) ? "localhost" : bindHost;
         InetAddress addr = InetAddress.getByName(bindHost);
         host = addr.getCanonicalHostName();
-        if (addr.isAnyLocalAddress()) {
-            host = InetAddressUtil.getLocalHostName();
-        }
 
         connector.setHost(host);
         connector.setPort(bindAddress.getPort());
         connector.setServer(server);
         server.addConnector(connector);
-
+        if (addr.isAnyLocalAddress()) {
+            host = InetAddressUtil.getLocalHostName();
+        }
+        setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, bindAddress.getPort(),
bind.getPath(), bind.getQuery(), bind.getFragment()));
     }
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java?rev=1389776&r1=1389775&r2=1389776&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
Tue Sep 25 09:44:20 2012
@@ -95,7 +95,6 @@ public class HttpTransportServer extends
         contextHandler.setHandler(gzipHandler);
 
         server.start();
-        setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, connector.getLocalPort(),
bind.getPath(), bind.getQuery(), bind.getFragment()));
     }
 
     protected void doStop(ServiceStopper stopper) throws Exception {

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java?rev=1389776&r1=1389775&r2=1389776&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
Tue Sep 25 09:44:20 2012
@@ -72,7 +72,6 @@ public class WSTransportServer extends W
         contextHandler.setAttribute("acceptListener", getAcceptListener());
 
         server.start();
-        setConnectURI(new URI(bind.getScheme(), bind.getUserInfo(), host, connector.getLocalPort(),
bind.getPath(), bind.getQuery(), bind.getFragment()));
     }
 
     protected void doStop(ServiceStopper stopper) throws Exception {



Mime
View raw message