activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [5/6] activemq-artemis git commit: ARTEMIS-151 more fixes because of the TransportConfiguration changes
Date Fri, 09 Oct 2015 02:55:56 GMT
ARTEMIS-151 more fixes because of the TransportConfiguration changes


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

Branch: refs/heads/master
Commit: a48046be5fbb163bc12e626353fdf11781e2abbf
Parents: 206acda
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Oct 8 18:14:27 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Oct 8 20:32:44 2015 -0400

----------------------------------------------------------------------
 .../artemis/api/core/TransportConfiguration.java         | 11 ++++++++++-
 .../core/client/impl/ClientSessionFactoryImpl.java       |  2 +-
 .../artemis/core/client/impl/TopologyMemberImpl.java     |  2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a48046be/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
index bdb49bb..666c5c8 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/TransportConfiguration.java
@@ -174,10 +174,19 @@ public class TransportConfiguration implements Serializable {
 
       TransportConfiguration that = (TransportConfiguration) o;
 
-      if (!factoryClassName.equals(that.factoryClassName))
+      if (!isSameHost(that)) {
          return false;
+      }
+
       if (name != null ? !name.equals(that.name) : that.name != null)
          return false;
+
+      return true;
+   }
+
+   public boolean isSameHost(TransportConfiguration that) {
+      if (!factoryClassName.equals(that.factoryClassName))
+         return false;
       if (params != null ? !params.equals(that.params) : that.params != null)
          return false;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a48046be/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index acdf1e8..ed588ef 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -1269,7 +1269,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal,
C
                                Pair<TransportConfiguration, TransportConfiguration>
connectorPair,
                                boolean isLast) {
          // if it is our connector then set the live id used for failover
-         if (connectorPair.getA() != null && connectorPair.getA().equals(connectorConfig))
{
+         if (connectorPair.getA() != null && connectorPair.getA().isSameHost(connectorConfig))
{
             liveNodeID = nodeID;
          }
          serverLocator.notifyNodeUp(uniqueEventID, nodeID, backupGroupName, scaleDownGroupName,
connectorPair, isLast);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a48046be/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java
index f220457..7c11cd0 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/TopologyMemberImpl.java
@@ -107,7 +107,7 @@ public final class TopologyMemberImpl implements TopologyMember {
    }
 
    public boolean isMember(TransportConfiguration configuration) {
-      if (getConnector().getA() != null && getConnector().getA().equals(configuration)
|| getConnector().getB() != null && getConnector().getB().equals(configuration)) {
+      if (getConnector().getA() != null && getConnector().getA().isSameHost(configuration)
|| getConnector().getB() != null && getConnector().getB().isSameHost(configuration))
{
          return true;
       }
       else {


Mime
View raw message