deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ch...@apache.org
Subject deltaspike git commit: DELTASPIKE-913 QuartzScheduler should use BeanProvider.getDependent()
Date Thu, 28 May 2015 15:06:13 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 1238dbaee -> e5b436922


DELTASPIKE-913 QuartzScheduler should use BeanProvider.getDependent()


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/e5b43692
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/e5b43692
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/e5b43692

Branch: refs/heads/master
Commit: e5b436922e61046ca33390e85f2f64c9171a8fc1
Parents: 1238dba
Author: Christian Kaltepoth <chkal@apache.org>
Authored: Thu May 28 10:09:11 2015 +0200
Committer: Christian Kaltepoth <chkal@apache.org>
Committed: Thu May 28 10:09:11 2015 +0200

----------------------------------------------------------------------
 .../apache/deltaspike/scheduler/impl/QuartzScheduler.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/e5b43692/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
index 587acf6..8ef3cc2 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/QuartzScheduler.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.scheduler.impl;
 
 import org.apache.deltaspike.cdise.api.ContextControl;
 import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.api.provider.DependentProvider;
 import org.apache.deltaspike.core.util.ClassUtils;
 import org.apache.deltaspike.core.util.ExceptionUtils;
 import org.apache.deltaspike.core.util.PropertyFileUtils;
@@ -419,7 +420,7 @@ public class QuartzScheduler implements Scheduler<Job>
     private class JobListenerContext
     {
         private Stack<Class<? extends Annotation>> scopes = new Stack<Class<?
extends Annotation>>();
-        private ContextControl contextControl;
+        private DependentProvider<ContextControl> contextControl;
 
         public void startContexts(Scheduled scheduled)
         {
@@ -427,11 +428,11 @@ public class QuartzScheduler implements Scheduler<Job>
 
             if (!this.scopes.isEmpty())
             {
-                this.contextControl = BeanProvider.getContextualReference(ContextControl.class);
+                this.contextControl = BeanProvider.getDependent(ContextControl.class);
 
                 for (Class<? extends Annotation> scopeAnnotation : this.scopes)
                 {
-                    contextControl.startContext(scopeAnnotation);
+                    contextControl.get().startContext(scopeAnnotation);
                 }
             }
         }
@@ -440,8 +441,9 @@ public class QuartzScheduler implements Scheduler<Job>
         {
             while (!this.scopes.empty())
             {
-                this.contextControl.stopContext(this.scopes.pop());
+                this.contextControl.get().stopContext(this.scopes.pop());
             }
+            this.contextControl.destroy();
         }
     }
 


Mime
View raw message