activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject [1/3] git commit: Fix for https://issues.apache.org/jira/browse/AMQ-4719
Date Tue, 12 Nov 2013 08:10:34 GMT
Updated Branches:
  refs/heads/trunk bc9751ac2 -> d2ddd1dca


Fix for https://issues.apache.org/jira/browse/AMQ-4719


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/7e000d5a
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/7e000d5a
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/7e000d5a

Branch: refs/heads/trunk
Commit: 7e000d5a40f8bbb817dec42a8f9fd03de0f972d7
Parents: bc9751a
Author: Rob Davies <rajdavies@gmail.com>
Authored: Tue Nov 12 08:07:33 2013 +0000
Committer: Rob Davies <rajdavies@gmail.com>
Committed: Tue Nov 12 08:07:33 2013 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/transport/TransportServer.java |  7 +++++++
 .../activemq/transport/TransportServerFilter.java      |  4 ++++
 .../activemq/transport/tcp/TcpTransportServer.java     | 13 ++++++++++++-
 .../activemq/transport/udp/UdpTransportServer.java     | 10 ++++++++++
 4 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/7e000d5a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServer.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServer.java
b/activemq-client/src/main/java/org/apache/activemq/transport/TransportServer.java
index 27b8572..fb25f4f 100755
--- a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServer.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/TransportServer.java
@@ -65,4 +65,11 @@ public interface TransportServer extends Service {
      *          connections.
      */
     boolean isSslServer();
+
+    /**
+     * Some protocols allow link stealing by default (if 2 connections have the same clientID
- the youngest wins).
+     * This is the default for AMQP and MQTT. However, JMS 1.1 spec requires the opposite
+     * @return
+     */
+    boolean isAllowLinkStealing();
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/7e000d5a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServerFilter.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServerFilter.java
b/activemq-client/src/main/java/org/apache/activemq/transport/TransportServerFilter.java
index 2a06a57..e308774 100755
--- a/activemq-client/src/main/java/org/apache/activemq/transport/TransportServerFilter.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/TransportServerFilter.java
@@ -59,4 +59,8 @@ public class TransportServerFilter implements TransportServer {
     public boolean isSslServer() {
         return next.isSslServer();
     }
+
+    public boolean isAllowLinkStealing() {
+        return next.isAllowLinkStealing();
+    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/7e000d5a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
index 310e9eb..5e1426a 100755
--- a/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
@@ -72,6 +72,8 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
     protected long maxInactivityDurationInitalDelay = 10000;
     protected int minmumWireFormatVersion;
     protected boolean useQueueForAccept = true;
+    protected boolean allowLinkStealing;
+
 
     /**
      * trace=true -> the Transport stack where this TcpTransport object will be, will
have a TransportLogger layer
@@ -343,7 +345,7 @@ public class TcpTransportServer extends TransportServerThreadSupport implements
 
     /**
      * @param socket
-     * @param inetAddress
+     * @param bindAddress
      * @return real hostName
      * @throws UnknownHostException
      */
@@ -511,4 +513,13 @@ public class TcpTransportServer extends TransportServerThreadSupport
implements
     public boolean isSslServer() {
         return false;
     }
+
+    @Override
+    public boolean isAllowLinkStealing() {
+        return allowLinkStealing;
+    }
+
+    public void setAllowLinkStealing(boolean allowLinkStealing) {
+        this.allowLinkStealing = allowLinkStealing;
+    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/7e000d5a/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
b/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
index 79b140a..ccf7abe 100755
--- a/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
@@ -52,6 +52,7 @@ public class UdpTransportServer extends TransportServerSupport {
     private final Transport configuredTransport;
     private boolean usingWireFormatNegotiation;
     private final Map<DatagramEndpoint, Transport> transports = new HashMap<DatagramEndpoint,
Transport>();
+    private boolean allowLinkStealing;
 
     public UdpTransportServer(URI connectURI, UdpTransport serverTransport, Transport configuredTransport,
ReplayStrategy replayStrategy) {
         super(connectURI);
@@ -189,4 +190,13 @@ public class UdpTransportServer extends TransportServerSupport {
     public boolean isSslServer() {
         return false;
     }
+
+    @Override
+    public boolean isAllowLinkStealing() {
+        return allowLinkStealing;
+    }
+
+    public void setAllowLinkStealing(boolean allowLinkStealing) {
+        this.allowLinkStealing = allowLinkStealing;
+    }
 }


Mime
View raw message