Author: nfilotto
Date: 2010-09-23 06:16:10 -0400 (Thu, 23 Sep 2010)
New Revision: 3184
Modified:
kernel/branches/2.2.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/QuartzSheduler.java
kernel/branches/2.2.x/exo.kernel.component.common/src/test/java/org/exoplatform/services/scheduler/test/TestSchedulerService.java
Log:
KER-160: patch applied
Modified:
kernel/branches/2.2.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/QuartzSheduler.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/QuartzSheduler.java 2010-09-23
09:57:03 UTC (rev 3183)
+++
kernel/branches/2.2.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl/QuartzSheduler.java 2010-09-23
10:16:10 UTC (rev 3184)
@@ -44,6 +44,9 @@
{
SchedulerFactory sf = new StdSchedulerFactory();
scheduler_ = sf.getScheduler();
+ // If the scheduler has already been started, it is necessary to put the scheduler
+ // in standby mode to ensure that the jobs of the ExoContainer won't launched
too early
+ scheduler_.standby();
// This will launch the scheduler when all the components will be started
ctx.getContainer().addContainerLifecylePlugin(new BaseContainerLifecyclePlugin()
{
Modified:
kernel/branches/2.2.x/exo.kernel.component.common/src/test/java/org/exoplatform/services/scheduler/test/TestSchedulerService.java
===================================================================
---
kernel/branches/2.2.x/exo.kernel.component.common/src/test/java/org/exoplatform/services/scheduler/test/TestSchedulerService.java 2010-09-23
09:57:03 UTC (rev 3183)
+++
kernel/branches/2.2.x/exo.kernel.component.common/src/test/java/org/exoplatform/services/scheduler/test/TestSchedulerService.java 2010-09-23
10:16:10 UTC (rev 3184)
@@ -279,6 +279,7 @@
public void startContainer(ExoContainer container) throws Exception
{
MyComponent component =
(MyComponent)container.getComponentInstanceOfType(MyComponent.class);
+ component.doneSignal.await(2, TimeUnit.SECONDS);
component.started = true;
}
}
@@ -286,7 +287,7 @@
public static class MyComponent
{
public boolean started;
- private final CountDownLatch doneSignal = new CountDownLatch(1);
+ public final CountDownLatch doneSignal = new CountDownLatch(1);
public Boolean result;
public void doSomething()
Show replies by date