Author: ataylor
Date: 2011-10-13 13:29:08 -0400 (Thu, 13 Oct 2011)
New Revision: 11534
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
check for null on cc for backup server locator
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-13
14:07:24 UTC (rev 11533)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-13
17:29:08 UTC (rev 11534)
@@ -1522,9 +1522,9 @@
// cause reconnect loop
public void run()
{
- CLOSE_RUNNABLES.add(this);
try
{
+ CLOSE_RUNNABLES.add(this);
conn.fail(new HornetQException(HornetQException.DISCONNECTED,
"The connection was disconnected because of server
shutdown"));
} finally
@@ -1536,6 +1536,7 @@
public ClientSessionFactoryImpl stop()
{
+ CLOSE_RUNNABLES.remove(this);
causeExit();
return ClientSessionFactoryImpl.this;
}
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-13
14:07:24 UTC (rev 11533)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-13
17:29:08 UTC (rev 11534)
@@ -241,9 +241,12 @@
clusterConnector = new StaticClusterConnector(tcConfigs);
- backupServerLocator = clusterConnector.createServerLocator(false);
- backupServerLocator.setReconnectAttempts(-1);
- backupServerLocator.setInitialConnectAttempts(-1);
+ if (backupServerLocator != null)
+ {
+ backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator.setReconnectAttempts(-1);
+ backupServerLocator.setInitialConnectAttempts(-1);
+ }
if (tcConfigs != null && tcConfigs.length > 0)
{
@@ -344,9 +347,12 @@
clusterConnector = new DiscoveryClusterConnector(dg);
- backupServerLocator = clusterConnector.createServerLocator(false);
- backupServerLocator.setReconnectAttempts(-1);
- backupServerLocator.setInitialConnectAttempts(-1);
+ if (backupServerLocator != null)
+ {
+ backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator.setReconnectAttempts(-1);
+ backupServerLocator.setInitialConnectAttempts(-1);
+ }
this.manager = manager;
}