ARTEMIS-151 more fixes because of the TransportConfiguration changes

This commit is contained in:
Clebert Suconic 2015-10-08 18:14:27 -04:00
parent 206acdac7d
commit a48046be5f
3 changed files with 12 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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 {