Author: rmannibucau
Date: Mon Aug 20 20:25:32 2012
New Revision: 1375204

URL: http://svn.apache.org/viewvc?rev=1375204&view=rev
Log:
TOMEE-391 timeout method retry attemps conf

Modified:
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java?rev=1375204&r1=1375203&r2=1375204&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/core/timer/EjbTimerServiceImpl.java
 Mon Aug 20 20:25:32 2012
@@ -69,6 +69,8 @@ public class EjbTimerServiceImpl impleme
     public static final String OPENEJB_TIMEOUT_JOB_NAME = 
"OPENEJB_TIMEOUT_JOB";
     public static final String OPENEJB_TIMEOUT_JOB_GROUP_NAME = 
"OPENEJB_TIMEOUT_GROUP";
 
+    public static final String EJB_TIMER_RETRY_ATTEMPTS = 
"EjbTimer.RetryAttempts";
+
     private boolean transacted;
     private int retryAttempts;
 
@@ -78,7 +80,7 @@ public class EjbTimerServiceImpl impleme
     private transient Scheduler scheduler;
 
     public EjbTimerServiceImpl(BeanContext deployment) {
-        this(deployment, getDefaultTransactionManager(), 
getDefaultScheduler(deployment), new 
MemoryTimerStore(getDefaultTransactionManager()), 1);
+        this(deployment, getDefaultTransactionManager(), 
getDefaultScheduler(deployment), new 
MemoryTimerStore(getDefaultTransactionManager()), -1);
     }
 
     public static TransactionManager getDefaultTransactionManager() {
@@ -93,6 +95,9 @@ public class EjbTimerServiceImpl impleme
         TransactionType transactionType = 
deployment.getTransactionType(deployment.getEjbTimeout());
         this.transacted = transactionType == TransactionType.Required || 
transactionType == TransactionType.RequiresNew;
         this.retryAttempts = retryAttempts;
+        if (retryAttempts < 0) {
+            this.retryAttempts = 
deployment.getOptions().get(EJB_TIMER_RETRY_ATTEMPTS, 1);
+        }
     }
 
     private void writeObject(final ObjectOutputStream out) throws IOException {


Reply via email to