[jboss-cvs] JBoss Messaging SVN: r8161 - in branches/RIM_patch: src/main/org/jboss/jms/server/plugin and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 4 01:30:51 EST 2011


Author: gaohoward
Date: 2011-01-04 01:30:50 -0500 (Tue, 04 Jan 2011)
New Revision: 8161

Modified:
   branches/RIM_patch/integration/EAP4/etc/xmdesc/JDBCPersistenceManager-xmbean.xml
   branches/RIM_patch/integration/EAP4/etc/xmdesc/JMSUserManager-xmbean.xml
   branches/RIM_patch/integration/EAP4/etc/xmdesc/MessagingPostOffice-xmbean.xml
   branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
   branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java
   branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
   branches/RIM_patch/tests/src/org/jboss/test/messaging/core/PostOfficeTestBase.java
Log:
porting fix for JBMESSAGING-1838



Modified: branches/RIM_patch/integration/EAP4/etc/xmdesc/JDBCPersistenceManager-xmbean.xml
===================================================================
--- branches/RIM_patch/integration/EAP4/etc/xmdesc/JDBCPersistenceManager-xmbean.xml	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/integration/EAP4/etc/xmdesc/JDBCPersistenceManager-xmbean.xml	2011-01-04 06:30:50 UTC (rev 8161)
@@ -94,7 +94,25 @@
       <name>IDCacheSize</name>
       <type>int</type>
    </attribute>
+ 
+   <attribute access="read-write" getMethod="getMaxRetry" setMethod="setMaxRetry">
+      <description>Maximal retry times on DataSource failures, default 25</description>
+      <name>MaxRetry</name>
+      <type>int</type>
+   </attribute>
 
+   <attribute access="read-write" getMethod="getRetryInterval" setMethod="setRetryInterval">
+      <description>Retry interval (in milliseconds), default 1000 (1 sec)</description>
+      <name>RetryInterval</name>
+      <type>int</type>
+   </attribute>
+
+   <attribute access="read-write" getMethod="getRetryOnConnectionFailure" setMethod="setRetryOnConnectionFailure">
+      <description>If retry on connection failure, default false</description>
+      <name>RetryOnConnectionFailure</name>
+      <type>boolean</type>
+   </attribute>
+
    <!-- Managed operations -->
 
    <operation>

Modified: branches/RIM_patch/integration/EAP4/etc/xmdesc/JMSUserManager-xmbean.xml
===================================================================
--- branches/RIM_patch/integration/EAP4/etc/xmdesc/JMSUserManager-xmbean.xml	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/integration/EAP4/etc/xmdesc/JMSUserManager-xmbean.xml	2011-01-04 06:30:50 UTC (rev 8161)
@@ -40,7 +40,25 @@
       <name>CreateTablesOnStartup</name>
       <type>boolean</type>
    </attribute>
+ 
+   <attribute access="read-write" getMethod="getMaxRetry" setMethod="setMaxRetry">
+      <description>Maximal retry times on DataSource failures, default 25</description>
+      <name>MaxRetry</name>
+      <type>int</type>
+   </attribute>
 
+   <attribute access="read-write" getMethod="getRetryInterval" setMethod="setRetryInterval">
+      <description>Retry interval (in milliseconds), default 1000 (1 sec)</description>
+      <name>RetryInterval</name>
+      <type>int</type>
+   </attribute>
+
+   <attribute access="read-write" getMethod="getRetryOnConnectionFailure" setMethod="setRetryOnConnectionFailure">
+      <description>If retry on connection failure, default false</description>
+      <name>RetryOnConnectionFailure</name>
+      <type>boolean</type>
+   </attribute>
+
    <!-- Managed operations -->
 
    <operation>
@@ -63,4 +81,5 @@
       <name>destroy</name>
    </operation>   
 
-</mbean>
\ No newline at end of file
+</mbean>
+

Modified: branches/RIM_patch/integration/EAP4/etc/xmdesc/MessagingPostOffice-xmbean.xml
===================================================================
--- branches/RIM_patch/integration/EAP4/etc/xmdesc/MessagingPostOffice-xmbean.xml	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/integration/EAP4/etc/xmdesc/MessagingPostOffice-xmbean.xml	2011-01-04 06:30:50 UTC (rev 8161)
@@ -136,7 +136,25 @@
       <name>NodeIDView</name>
       <type>java.util.Set</type>
    </attribute>
+ 
+   <attribute access="read-write" getMethod="getMaxRetry" setMethod="setMaxRetry">
+      <description>Maximal retry times on DataSource failures, default 25</description>
+      <name>MaxRetry</name>
+      <type>int</type>
+   </attribute>
 
+   <attribute access="read-write" getMethod="getRetryInterval" setMethod="setRetryInterval">
+      <description>Retry interval (in milliseconds), default 1000 (1 sec)</description>
+      <name>RetryInterval</name>
+      <type>int</type>
+   </attribute>
+
+   <attribute access="read-write" getMethod="getRetryOnConnectionFailure" setMethod="setRetryOnConnectionFailure">
+      <description>If retry on connection failure, default false</description>
+      <name>RetryOnConnectionFailure</name>
+      <type>boolean</type>
+   </attribute>
+
    <!-- Managed operations -->
 
    <operation>
@@ -159,4 +177,5 @@
       <name>destroy</name>
    </operation>
      
-</mbean>
\ No newline at end of file
+</mbean>
+

Modified: branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManager.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -64,6 +64,17 @@
       super(ds, tm, sqlProperties, createTablesOnStartup);
    }
       
+   public JDBCJMSUserManager(DataSource ds,
+                             TransactionManager tm,
+                             Properties sqlProperties,
+                             boolean createTablesOnStartup,
+                             int maxRetry,
+                             int retryInterval,
+                             boolean retryOnConnectionFailure)
+   {
+      super(ds, tm, sqlProperties, createTablesOnStartup, maxRetry, retryInterval, retryOnConnectionFailure);
+   }
+
    // JDBCSupport overrides ----------------------------
    
    protected Map getDefaultDMLStatements()
@@ -123,7 +134,7 @@
       
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          ps = conn.prepareStatement(getSQLStatement("SELECT_PRECONF_CLIENTID"));
          
@@ -194,7 +205,7 @@
                
                tx = new TransactionWrapper();
                
-               conn = ds.getConnection();
+               conn = getConnectionWithRetry();
                
                st = conn.createStatement();
                

Modified: branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/jms/server/plugin/JDBCJMSUserManagerService.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -73,7 +73,8 @@
       {  
          TransactionManager tm = getTransactionManagerReference();
          
-         userManager = new JDBCJMSUserManager(ds, tm, sqlProperties, createTablesOnStartup);
+         userManager = new JDBCJMSUserManager(ds, tm, sqlProperties, createTablesOnStartup, maxRetry,
+                                              retryInterval, retryOnConnectionFailure);
          
          userManager.start();
          

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCPersistenceManager.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -105,6 +105,12 @@
    
    private boolean supportsTxAge;
 
+   private int maxRetry = 25;
+
+   private int retryInterval = 1000;
+
+   private boolean retryOnConnectionFailure = false;
+
    // Constructors --------------------------------------------------
 
    public JDBCPersistenceManager(DataSource ds, TransactionManager tm,
@@ -143,6 +149,50 @@
             maxParams, supportsBlobSelect, supportsSetNullOnBlobs, false, false, 0);
    }
 
+   public JDBCPersistenceManager(DataSource ds,
+                                 TransactionManager tm,
+                                 Properties sqlProperties,
+                                 boolean createTablesOnStartup,
+                                 boolean usingBatchUpdates,
+                                 boolean usingBinaryStream,
+                                 boolean usingTrailingByte,
+                                 int maxParams,
+                                 boolean supportsBlobSelect,
+                                 boolean supportsSetNullOnBlobs,
+                                 boolean detectDuplicates,
+                                 boolean useNDBFailoverStrategy,
+                                 int idCacheSize,
+                                 int maxRetry,
+                                 int retryInterval,
+                                 boolean retryOnConnectionFailure)
+   {
+      super(ds,
+            tm,
+            sqlProperties,
+            createTablesOnStartup,
+            useNDBFailoverStrategy,
+            maxRetry,
+            retryInterval,
+            retryOnConnectionFailure);
+
+      // usingBatchUpdates is currently ignored due to sketchy support from
+      // databases
+
+      this.usingBinaryStream = usingBinaryStream;
+
+      this.usingTrailingByte = usingTrailingByte;
+
+      this.maxParams = maxParams;
+
+      this.supportsBlobSelect = supportsBlobSelect;
+
+      this.supportsSetNullOnBlobs = supportsSetNullOnBlobs;
+
+      this.detectDuplicates = detectDuplicates;
+
+      this.idCacheSize = idCacheSize;
+   }
+
    // MessagingComponent overrides ---------------------------------
 
    public void start() throws Exception
@@ -157,7 +207,7 @@
 
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
          // JBossMessaging requires transaction isolation of READ_COMMITTED
          // Any looser isolation level and we cannot maintain consistency for
          // paging (HSQL)
@@ -332,7 +382,7 @@
       {
          List<PreparedTxInfo> transactions = new ArrayList<PreparedTxInfo>();
 
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          if (supportsTxAge)
          {
@@ -906,7 +956,7 @@
 
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          ps = conn.prepareStatement(getSQLStatement("LOAD_PAGED_REFS"));
 
@@ -976,7 +1026,7 @@
 
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          // First we get the values for min() and max() page order
          ps = conn.prepareStatement(getSQLStatement("SELECT_MIN_MAX_PAGE_ORD"));
@@ -1869,7 +1919,7 @@
 
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          st = conn.prepareStatement(getSQLStatement("LOAD_ID_CACHE"));
 
@@ -3077,7 +3127,7 @@
 
       try
       {
-         conn = ds.getConnection();
+         conn = getConnectionWithRetry();
 
          ps = conn.prepareStatement(sqlQuery);
 

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCSupport.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCSupport.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/impl/JDBCSupport.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -63,6 +63,12 @@
        
    protected boolean createTablesOnStartup = true;
       
+   private int maxRetry = 25;
+
+   private int retryInterval = 1000;
+
+   private boolean retryOnConnectionFailure = false;
+
    public JDBCSupport()
    {
       defaultDMLStatements = new LinkedHashMap();
@@ -89,13 +95,54 @@
       this.createTablesOnStartup = createTablesOnStartup;
    }
 
-    public JDBCSupport(DataSource ds, TransactionManager tm, Properties sqlProperties,
+   public JDBCSupport(DataSource ds, TransactionManager tm, Properties sqlProperties,
                       boolean createTablesOnStartup, boolean useNDBFailoverStrategy)
    {
       this(ds, tm, sqlProperties, createTablesOnStartup);
       this.useNDBFailoverStrategy = useNDBFailoverStrategy;
    }
 
+   public JDBCSupport(DataSource ds,
+                      TransactionManager tm,
+                      Properties sqlProperties,
+                      boolean createTablesOnStartup,
+                      boolean useNDBFailoverStrategy,
+                      int maxRetry,
+                      int retryInterval,
+                      boolean retryOnConnectionFailure)
+   {
+      this(ds, tm, sqlProperties, createTablesOnStartup);
+      this.useNDBFailoverStrategy = useNDBFailoverStrategy;
+      this.maxRetry = maxRetry;
+      this.retryInterval = retryInterval;
+      this.retryOnConnectionFailure = retryOnConnectionFailure;
+   }
+
+   public JDBCSupport(DataSource ds,
+                      TransactionManager tm,
+                      Properties sqlProperties,
+                      boolean createTablesOnStartup,
+                      int maxRetry,
+                      int retryInterval,
+                      boolean retryOnConnectionFailure)
+   {
+      this();
+
+      this.ds = ds;
+
+      this.tm = tm;
+
+      if (sqlProperties != null)
+      {
+         this.sqlProperties = sqlProperties;
+      }
+
+      this.createTablesOnStartup = createTablesOnStartup;
+      this.maxRetry = maxRetry;
+      this.retryInterval = retryInterval;
+      this.retryOnConnectionFailure = retryOnConnectionFailure;
+   }
+
    // MessagingComponent overrides ---------------------------------
    
    public void start() throws Exception
@@ -284,8 +331,8 @@
                   
          try
          {                        
-            conn = ds.getConnection();
-                        
+            conn = getConnectionWithRetry();
+
             String statementName = (String)i.next();
              
             String statement = getSQLStatement(statementName);
@@ -325,6 +372,111 @@
    
    // Innner classes ---------------------------------------------------------
    
+   public void setMaxRetry(int maxRetry)
+   {
+      this.maxRetry = maxRetry;
+   }
+
+   public int getMaxRetry()
+   {
+      return maxRetry;
+   }
+
+   public void setRetryInterval(int retryInterval)
+   {
+      this.retryInterval = retryInterval;
+   }
+
+   public int getRetryInterval()
+   {
+      return retryInterval;
+   }
+
+   public void setRetryOnConnectionFailure(boolean retryOnConnectionFailure)
+   {
+      this.retryOnConnectionFailure = retryOnConnectionFailure;
+   }
+
+   public boolean getRetryOnConnectionFailure()
+   {
+      return retryOnConnectionFailure;
+   }
+
+   public Connection getConnectionWithRetry(boolean autoCommit) throws Exception
+   {
+      Connection connection = null;
+      int retries = 0;
+      while (connection == null)
+      {
+         try
+         {
+            connection = ds.getConnection();
+            connection.setAutoCommit(autoCommit);
+         }
+         catch (Exception e)
+         {
+            if (trace)
+            {
+               log.trace("Failure in getting connection", e);
+            }
+            if (retryOnConnectionFailure)
+            {
+               if ((maxRetry != -1) && (retries == maxRetry))
+               {
+                  log.error("Retried " + retries + " times reconnection, now giving up", e);
+                  throw new IllegalStateException("Failed to get connection");
+               }
+               retries++;
+               log.warn("Trying reconnection again after a pause of " + retryInterval + " ms.");
+
+               Thread.sleep(retryInterval);
+            }
+            else
+            {
+               throw e;
+            }
+         }
+      }
+      return connection;
+   }
+
+   public Connection getConnectionWithRetry() throws Exception
+   {
+      Connection connection = null;
+      int retries = 0;
+      while (connection == null)
+      {
+         try
+         {
+            connection = ds.getConnection();
+         }
+         catch (Exception e)
+         {
+            if (trace)
+            {
+               log.trace("Failure in getting connection", e);
+            }
+            if (retryOnConnectionFailure)
+            {
+               if ((maxRetry != -1) && (retries == maxRetry))
+               {
+                  log.error("Retried " + retries + " times reconnection, now giving up", e);
+                  throw new IllegalStateException("Failed to get connection");
+               }
+               retries++;
+               log.warn("Trying reconnection again after a pause of " + retryInterval + " ms.");
+
+               Thread.sleep(retryInterval);
+            }
+            else
+            {
+               throw e;
+            }
+         }
+      }
+      return connection;
+   }   
+
    protected class TransactionWrapper
    {
       private javax.transaction.Transaction oldTx;
@@ -377,8 +529,6 @@
 
    protected abstract class JDBCTxRunner<T>
    {
-   	private static final int MAX_TRIES = 25;
-
    	protected Connection conn;
 
       private TransactionWrapper wrap;
@@ -389,7 +539,7 @@
 
 	      try
 	      {
-	         conn = ds.getConnection();
+	         conn = getConnectionWithRetry();
 
 	         return doTransaction();
 	      }
@@ -425,15 +575,15 @@
 	         {
   	            log.warn("SQLException caught, SQLState " + e.getSQLState() + " code:" + e.getErrorCode() + "- assuming deadlock detected, try:" + (tries + 1), e);
 
-	            tries++;
-	            if (tries == MAX_TRIES)
+  	            if ((maxRetry != -1) && (tries == maxRetry))
 	            {
 	               log.error("Retried " + tries + " times, now giving up");
 	               throw new IllegalStateException("Failed to excecute transaction");
 	            }
-	            log.warn("Trying again after a pause");
-	            //Now we wait for a random amount of time to minimise risk of deadlock
-	            Thread.sleep((long)(Math.random() * 500));
+	            tries++;
+	            log.warn("Trying again after a pause of " + retryInterval + " ms.");
+	            
+	            Thread.sleep(retryInterval);
 	         }
 	      }
 		}
@@ -444,8 +594,6 @@
    
    protected abstract class JDBCTxRunner2<T>
    {
-      private static final int MAX_TRIES = 25;
-
       protected Connection conn;
       
       private boolean getConnectionFailed;
@@ -460,9 +608,7 @@
          {
             try
             {
-               conn = ds.getConnection();
-            
-               conn.setAutoCommit(false);
+               conn = getConnectionWithRetry(false);
             }
             catch (Exception e)
             {
@@ -537,15 +683,15 @@
                }
                log.warn("SQLException caught, SQLState " + e.getSQLState() + " code:" + e.getErrorCode() + "- assuming deadlock detected, try:" + (tries + 1), e);
 
-               tries++;
-               if (tries == MAX_TRIES)
+               if ((maxRetry != -1) && (tries == maxRetry))
                {
                   log.error("Retried " + tries + " times, now giving up");
                   throw new IllegalStateException("Failed to execute transaction");
                }
-               log.warn("Trying again after a pause");
-               //Now we wait for a random amount of time to minimise risk of deadlock
-               Thread.sleep((long)(Math.random() * 500));
+               tries++;
+               log.warn("Trying again after a pause of " + retryInterval + " ms.");
+
+               Thread.sleep((long)(retryInterval));
             }
          }
       }

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -268,10 +268,13 @@
                               FilterFactory filterFactory,
                               ConditionFactory conditionFactory,
                               IDManager channelIDManager,
-                              ClusterNotifier clusterNotifier)
+                              ClusterNotifier clusterNotifier,
+                              int maxRetry,
+                              int retryInterval,
+                              boolean retryOnConnectionFailure)
       throws Exception
    {
-   	super (ds, tm, sqlProperties, createTablesOnStartup);
+   	super (ds, tm, sqlProperties, createTablesOnStartup, maxRetry, retryInterval, retryOnConnectionFailure);
 
       this.thisNodeID = nodeId;
       
@@ -319,11 +322,14 @@
                               long stateTimeout, long castTimeout,
                               boolean supportsFailover,
                               int maxConcurrentReplications,
-                              boolean failoverOnNodeLeave)
+                              boolean failoverOnNodeLeave,
+                              int maxRetry,
+                              int retryInterval,
+                              boolean retryOnConnectionFailure)
       throws Exception
    {
    	this(ds, tm, sqlProperties, createTablesOnStartup, nodeId, officeName, ms, pm, tr,
-   		  filterFactory, conditionFactory, channelIDManager, clusterNotifier);
+   	     filterFactory, conditionFactory, channelIDManager, clusterNotifier, maxRetry, retryInterval, retryOnConnectionFailure);
      
       this.clustered = true;
       

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCPersistenceManagerService.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -95,7 +95,8 @@
             new JDBCPersistenceManager(ds, tm, sqlProperties,
                                        createTablesOnStartup, usingBatchUpdates,
                                        usingBinaryStream, usingTrailingByte, maxParams,
-                                       supportsBlobOnSelect, supportsSetNullOnBlobs, detectDuplicates, useNDBFailoverStrategy, idCacheSize);
+                                       supportsBlobOnSelect, supportsSetNullOnBlobs, detectDuplicates, useNDBFailoverStrategy, idCacheSize,
+                                       maxRetry, retryInterval, retryOnConnectionFailure);
 
          persistenceManager.start();
 

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/JDBCServiceSupport.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -61,6 +61,10 @@
    private ObjectName tmObjectName;
    private TransactionManager tm;
 
+   protected int maxRetry = 25;
+   protected int retryInterval = 1000;
+   protected boolean retryOnConnectionFailure = false;
+
    // Constructors ---------------------------------------------------------------------------------
 
    // ServiceMBeanSupport overrides ----------------------------------------------------------------
@@ -161,6 +165,36 @@
       createTablesOnStartup = b;
    }
 
+   public void setMaxRetry(int maxRetry)
+   {
+      this.maxRetry = maxRetry;
+   }
+
+   public int getMaxRetry()
+   {
+      return maxRetry;
+   }
+
+   public void setRetryInterval(int retryInterval)
+   {
+      this.retryInterval = retryInterval;
+   }
+
+   public int getRetryInterval()
+   {
+      return retryInterval;
+   }
+
+   public void setRetryOnConnectionFailure(boolean retryOnConnectionFailure)
+   {
+      this.retryOnConnectionFailure = retryOnConnectionFailure;
+   }
+
+   public boolean getRetryOnConnectionFailure()
+   {
+      return retryOnConnectionFailure;
+   }
+
    // Public ---------------------------------------------------------------------------------------
 
    // Package protected ----------------------------------------------------------------------------

Modified: branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
===================================================================
--- branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -447,7 +447,10 @@
 	                                               stateTimeout, castTimeout,
                                                   serverPeer.isSupportsFailover(),
                                                   maxConcurrentReplications,
-                                                  failoverOnNodeLeave);
+	                                               failoverOnNodeLeave,
+	                                               maxRetry,
+	                                               retryInterval,
+	                                               retryOnConnectionFailure);
          }
          else
          {
@@ -456,7 +459,10 @@
 											                 nodeId, officeName, ms,
 											                 pm,
 											                 tr, ff, cf, idManager,
-											                 clusterNotifier);
+         	                                      clusterNotifier,
+         	                                      maxRetry,
+         	                                      retryInterval,
+         	                                      retryOnConnectionFailure);
          }
 
          postOffice.start();

Modified: branches/RIM_patch/tests/src/org/jboss/test/messaging/core/PostOfficeTestBase.java
===================================================================
--- branches/RIM_patch/tests/src/org/jboss/test/messaging/core/PostOfficeTestBase.java	2011-01-04 04:00:34 UTC (rev 8160)
+++ branches/RIM_patch/tests/src/org/jboss/test/messaging/core/PostOfficeTestBase.java	2011-01-04 06:30:50 UTC (rev 8161)
@@ -95,7 +95,7 @@
                                  sc.getPostOfficeSQLProperties(), true, nodeID,
                                  "Clustered", ms, pm, tr, ff, cf, idm, cn,
                                  groupName, jChannelFactory,
-                                 stateTimeout, castTimeout, true, 100, false);
+                                 stateTimeout, castTimeout, true, 100, false, 25, 1000, false);
 
       postOffice.start();
 
@@ -114,7 +114,7 @@
       MessagingPostOffice postOffice =
          new MessagingPostOffice(sc.getDataSource(), sc.getTransactionManager(),
                                  sc.getPostOfficeSQLProperties(),
-                                 true, 1, "NonClustered", ms, pm, tr, ff, cf, idm, cn);
+                                 true, 1, "NonClustered", ms, pm, tr, ff, cf, idm, cn, 25, 1000, false);
 
       postOffice.start();
 



More information about the jboss-cvs-commits mailing list