deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-475 minor improvement
Date Fri, 20 Dec 2013 16:29:28 GMT
Updated Branches:
  refs/heads/master edbdaa8e6 -> db6eaefb4


DELTASPIKE-475 minor improvement


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

Branch: refs/heads/master
Commit: db6eaefb4de91697a8c67cf98b98364bf328766d
Parents: edbdaa8
Author: gpetracek <gpetracek@apache.org>
Authored: Fri Dec 20 17:21:28 2013 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Fri Dec 20 17:21:28 2013 +0100

----------------------------------------------------------------------
 .../deltaspike/scheduler/impl/QuartzScheduler.java | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/db6eaefb/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 8507d71..9eb1be8 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
@@ -248,20 +248,23 @@ public class QuartzScheduler implements Scheduler<Job>
         }
 
         @Override
-        public void jobToBeExecuted(JobExecutionContext context)
+        public void jobToBeExecuted(JobExecutionContext jobExecutionContext)
         {
-            Scheduled scheduled = context.getJobInstance().getClass().getAnnotation(Scheduled.class);
+            Scheduled scheduled = jobExecutionContext.getJobInstance().getClass().getAnnotation(Scheduled.class);
 
             Collections.addAll(this.scopes, scheduled.startScopes());
 
-            this.contextControl = BeanProvider.getContextualReference(ContextControl.class);
-
-            for (Class<? extends Annotation> scopeAnnotation : this.scopes)
+            if (!this.scopes.isEmpty())
             {
-                contextControl.startContext(scopeAnnotation);
+                this.contextControl = BeanProvider.getContextualReference(ContextControl.class);
+
+                for (Class<? extends Annotation> scopeAnnotation : this.scopes)
+                {
+                    contextControl.startContext(scopeAnnotation);
+                }
             }
 
-            BeanProvider.injectFields(context.getJobInstance());
+            BeanProvider.injectFields(jobExecutionContext.getJobInstance());
         }
 
         @Override


Mime
View raw message