Author: rmannibucau
Date: Thu Nov 8 22:19:31 2012
New Revision: 1407294
URL: http://svn.apache.org/viewvc?rev=1407294&view=rev
Log:
delaying a bit the scheduler creation in ejbtimerserviceimpl to avoid to start
before the ejb is deployed
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=1407294&r1=1407293&r2=1407294&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
Thu Nov 8 22:19:31 2012
@@ -79,20 +79,19 @@ public class EjbTimerServiceImpl impleme
private transient TransactionManager transactionManager;
private transient BeanContext deployment;
private transient TimerStore timerStore;
- private transient Scheduler scheduler;
+ private transient Scheduler scheduler = null;
public EjbTimerServiceImpl(BeanContext deployment) {
- this(deployment, getDefaultTransactionManager(),
getDefaultScheduler(deployment), new
MemoryTimerStore(getDefaultTransactionManager()), -1);
+ this(deployment, getDefaultTransactionManager(), new
MemoryTimerStore(getDefaultTransactionManager()), -1);
}
public static TransactionManager getDefaultTransactionManager() {
return SystemInstance.get().getComponent(TransactionManager.class);
}
- public EjbTimerServiceImpl(BeanContext deployment, TransactionManager
transactionManager, Scheduler scheduler, TimerStore timerStore, int
retryAttempts) {
+ public EjbTimerServiceImpl(BeanContext deployment, TransactionManager
transactionManager, TimerStore timerStore, int retryAttempts) {
this.deployment = deployment;
this.transactionManager = transactionManager;
- this.scheduler = scheduler;
this.timerStore = timerStore;
TransactionType transactionType =
deployment.getTransactionType(deployment.getEjbTimeout());
this.transacted = transactionType == TransactionType.Required ||
transactionType == TransactionType.RequiresNew;
@@ -297,6 +296,8 @@ public class EjbTimerServiceImpl impleme
@Override
public void start() throws TimerStoreException {
+ scheduler = getDefaultScheduler(deployment);
+
// load saved timers
Collection<TimerData> timerDatas = timerStore.loadTimers(this,
(String) deployment.getDeploymentID());
// schedule the saved timers