[hornetq-commits] JBoss hornetq SVN: r9932 - in branches/2_2_0_HA_Improvements_preMerge: src/main/org/hornetq/core/client/impl and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 26 07:38:11 EST 2010
Author: ataylor
Date: 2010-11-26 07:38:11 -0500 (Fri, 26 Nov 2010)
New Revision: 9932
Modified:
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/api/core/client/ServerLocator.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
Log:
added initialconnectattempts to connection factory and fixed manual failover test
Modified: branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/api/core/client/ServerLocator.java
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/api/core/client/ServerLocator.java 2010-11-26 11:28:20 UTC (rev 9931)
+++ branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/api/core/client/ServerLocator.java 2010-11-26 12:38:11 UTC (rev 9932)
@@ -563,7 +563,10 @@
* @param reconnectAttempts maximum number of attempts to retry connection in case of failure
*/
void setReconnectAttempts(int reconnectAttempts);
-
+
+ void setInitialConnectAttempts(int reconnectAttempts);
+
+ int getInitialConnectAttempts();
/**
* Returns true if the client will automatically attempt to connect to the backup server if the initial
* connection to the live server fails
Modified: branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-11-26 11:28:20 UTC (rev 9931)
+++ branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2010-11-26 12:38:11 UTC (rev 9932)
@@ -871,6 +871,11 @@
this.initialConnectAttempts = initialConnectAttempts;
}
+ public int getInitialConnectAttempts()
+ {
+ return initialConnectAttempts;
+ }
+
public synchronized boolean isFailoverOnInitialConnection()
{
return this.failoverOnInitialConnection;
Modified: branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-11-26 11:28:20 UTC (rev 9931)
+++ branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/core/client/impl/ServerLocatorInternal.java 2010-11-26 12:38:11 UTC (rev 9932)
@@ -54,7 +54,5 @@
void setBackup(boolean backup);
- void setInitialConnectAttempts(int reconnectAttempts);
-
Topology getTopology();
}
Modified: branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2010-11-26 11:28:20 UTC (rev 9931)
+++ branches/2_2_0_HA_Improvements_preMerge/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2010-11-26 12:38:11 UTC (rev 9932)
@@ -486,6 +486,18 @@
checkWrite();
serverLocator.setReconnectAttempts(reconnectAttempts);
}
+
+ public synchronized void setInitialConnectAttempts(final int reconnectAttempts)
+ {
+ checkWrite();
+ serverLocator.setInitialConnectAttempts(reconnectAttempts);
+ }
+
+ public synchronized int getInitialConnectAttempts()
+ {
+ checkWrite();
+ return serverLocator.getInitialConnectAttempts();
+ }
public synchronized boolean isFailoverOnInitialConnection()
{
Modified: branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-11-26 11:28:20 UTC (rev 9931)
+++ branches/2_2_0_HA_Improvements_preMerge/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-11-26 12:38:11 UTC (rev 9932)
@@ -240,6 +240,7 @@
backupParams));
jbcfBackup.setBlockOnNonDurableSend(true);
jbcfBackup.setBlockOnDurableSend(true);
+ jbcfBackup.setInitialConnectAttempts(-1);
jbcfBackup.setReconnectAttempts(-1);
Connection connLive = jbcfLive.createConnection();
More information about the hornetq-commits
mailing list