Author: rajdavies
Date: Wed Feb 1 09:21:47 2006
New Revision: 374118
URL: http://svn.apache.org/viewcvs?rev=374118&view=rev
Log:
Don't attempt to reconnect if serverSessionPool is closing
Modified:
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java
Modified:
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
URL:
http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java?rev=374118&r1=374117&r2=374118&view=diff
==============================================================================
---
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
(original)
+++
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java
Wed Feb 1 09:21:47 2006
@@ -232,24 +232,23 @@
connection=null;
}
- synchronized private void reconnect(JMSException error) {
- log.debug("Reconnect cause: ", error);
- // Only log errors if the server is really down.. And not a temp
failure.
- if( reconnectDelay == MAX_RECONNECT_DELAY ) {
- log.info("Endpoint connection to JMS broker failed:
"+error.getMessage());
- log.info("Endpoint will try to reconnect to the JMS broker in
"+(MAX_RECONNECT_DELAY/1000)+" seconds");
- }
- try {
- disconnect();
- Thread.sleep(reconnectDelay);
-
- // Use exponential rollback.
- reconnectDelay*=2;
- if( reconnectDelay > MAX_RECONNECT_DELAY )
- reconnectDelay = MAX_RECONNECT_DELAY;
-
- connect();
- } catch (InterruptedException e) {
+ synchronized private void reconnect(JMSException error){
+ if(!serverSessionPool.isClosing()){
+ log.debug("Reconnect cause: ",error);
+ // Only log errors if the server is really down.. And not a temp
failure.
+ if(reconnectDelay==MAX_RECONNECT_DELAY){
+ log.info("Endpoint connection to JMS broker failed:
"+error.getMessage());
+ log.info("Endpoint will try to reconnect to the JMS broker in
"+(MAX_RECONNECT_DELAY/1000)+" seconds");
+ }
+ try{
+ disconnect();
+ Thread.sleep(reconnectDelay);
+ // Use exponential rollback.
+ reconnectDelay*=2;
+ if(reconnectDelay>MAX_RECONNECT_DELAY)
+ reconnectDelay=MAX_RECONNECT_DELAY;
+ connect();
+ }catch(InterruptedException e){}
}
}
Modified:
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java?rev=374118&r1=374117&r2=374118&view=diff
==============================================================================
---
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java
(original)
+++
incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java
Wed Feb 1 09:21:47 2006
@@ -199,4 +199,18 @@
}
}
+ /**
+ * @return Returns the closing.
+ */
+ public boolean isClosing(){
+ return closing;
+ }
+
+ /**
+ * @param closing The closing to set.
+ */
+ public void setClosing(boolean closing){
+ this.closing=closing;
+ }
+
}