Repository: zest-java
Updated Branches:
  refs/heads/develop b3403cebf -> 63b0aad04


Adding License headers that Kent forgot.


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/63b0aad0
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/63b0aad0
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/63b0aad0

Branch: refs/heads/develop
Commit: 63b0aad040681a81430a48c00fed2160697d42d4
Parents: b3403ce
Author: Niclas Hedhman <[email protected]>
Authored: Sun Nov 8 09:07:28 2015 +0800
Committer: Niclas Hedhman <[email protected]>
Committed: Sun Nov 8 09:07:28 2015 +0800

----------------------------------------------------------------------
 .../ElasticSearchQueryMultimoduleTest.java      | 25 ++++++++++++++++----
 .../index/rdf/RdfNamedQueryMultimoduleTest.java | 25 ++++++++++++++++----
 .../zest/index/rdf/RdfQueryMultimoduleTest.java | 25 ++++++++++++++++----
 .../zest/library/scheduler/SchedulerMixin.java  | 18 +++++++-------
 4 files changed, 70 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/63b0aad0/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryMultimoduleTest.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryMultimoduleTest.java
 
b/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryMultimoduleTest.java
index 9f41a60..6e50400 100755
--- 
a/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryMultimoduleTest.java
+++ 
b/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryMultimoduleTest.java
@@ -1,3 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.zest.index.elasticsearch;
 
 import java.io.File;
@@ -12,11 +32,6 @@ import org.apache.zest.test.EntityTestAssembler;
 import org.apache.zest.test.util.DelTreeAfter;
 import org.junit.Rule;
 
-/**
- * User: ksr
- * Date: 28-09-2015
- * Time: 23:40
- */
 public class ElasticSearchQueryMultimoduleTest extends ElasticSearchQueryTest
 {
     @Rule

http://git-wip-us.apache.org/repos/asf/zest-java/blob/63b0aad0/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfNamedQueryMultimoduleTest.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfNamedQueryMultimoduleTest.java
 
b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfNamedQueryMultimoduleTest.java
index b16eed9..d0b1d19 100755
--- 
a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfNamedQueryMultimoduleTest.java
+++ 
b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfNamedQueryMultimoduleTest.java
@@ -1,3 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.zest.index.rdf;
 
 import org.apache.zest.api.common.Visibility;
@@ -7,11 +27,6 @@ import org.apache.zest.bootstrap.ModuleAssembly;
 import org.apache.zest.index.rdf.assembly.RdfMemoryStoreAssembler;
 import org.apache.zest.test.EntityTestAssembler;
 
-/**
- * User: ksr
- * Date: 28-09-2015
- * Time: 10:28
- */
 public class RdfNamedQueryMultimoduleTest
     extends RdfNamedQueryTest
 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/63b0aad0/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryMultimoduleTest.java
----------------------------------------------------------------------
diff --git 
a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryMultimoduleTest.java
 
b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryMultimoduleTest.java
index d37c770..d25f79a 100755
--- 
a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryMultimoduleTest.java
+++ 
b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryMultimoduleTest.java
@@ -1,3 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
 package org.apache.zest.index.rdf;
 
 import java.io.File;
@@ -11,11 +31,6 @@ import org.apache.zest.test.EntityTestAssembler;
 import org.apache.zest.test.util.DelTreeAfter;
 import org.junit.Rule;
 
-/**
- * User: ksr
- * Date: 27-09-2015
- * Time: 23:32
- */
 public class RdfQueryMultimoduleTest
     extends RdfQueryTest
 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/63b0aad0/libraries/scheduler/src/main/java/org/apache/zest/library/scheduler/SchedulerMixin.java
----------------------------------------------------------------------
diff --git 
a/libraries/scheduler/src/main/java/org/apache/zest/library/scheduler/SchedulerMixin.java
 
b/libraries/scheduler/src/main/java/org/apache/zest/library/scheduler/SchedulerMixin.java
index 1ad2271..69329dc 100644
--- 
a/libraries/scheduler/src/main/java/org/apache/zest/library/scheduler/SchedulerMixin.java
+++ 
b/libraries/scheduler/src/main/java/org/apache/zest/library/scheduler/SchedulerMixin.java
@@ -28,7 +28,6 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
-import org.joda.time.DateTime;
 import org.apache.zest.api.configuration.Configuration;
 import org.apache.zest.api.injection.scope.Service;
 import org.apache.zest.api.injection.scope.Structure;
@@ -45,6 +44,7 @@ import 
org.apache.zest.library.scheduler.schedule.ScheduleFactory;
 import org.apache.zest.library.scheduler.schedule.ScheduleTime;
 import org.apache.zest.library.scheduler.schedule.Schedules;
 import org.apache.zest.library.scheduler.schedule.cron.CronExpression;
+import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -225,9 +225,9 @@ public class SchedulerMixin
         // or if workersCount less than or equal to zero,
         // or if corePoolSize greater than workersCount.
         taskExecutor = new ThreadPoolExecutor( corePoolSize, workersCount,
-            0, TimeUnit.MILLISECONDS,
-            new LinkedBlockingQueue<Runnable>( workQueueSize ),
-            threadFactory, rejectionHandler );
+                                               0, TimeUnit.MILLISECONDS,
+                                               new 
LinkedBlockingQueue<Runnable>( workQueueSize ),
+                                               threadFactory, rejectionHandler 
);
         taskExecutor.prestartAllCoreThreads();
         managementExecutor = new ScheduledThreadPoolExecutor( 2, 
threadFactory, rejectionHandler );
         loadSchedules();
@@ -336,11 +336,11 @@ public class SchedulerMixin
         {
             Usecase usecase = UsecaseBuilder.newUsecase( "ScheduleRunner" );
             UnitOfWork uow = module.newUnitOfWork( usecase );
+            Schedule schedule = null;
             try
             {
-                Schedule schedule = uow.get( Schedule.class, 
this.schedule.scheduleIdentity );
-                Task task = schedule.task().get();
                 schedule = uow.get( Schedule.class, 
this.schedule.scheduleIdentity );
+                Task task = schedule.task().get();
                 try
                 {
                     schedule.taskStarting();
@@ -351,7 +351,6 @@ public class SchedulerMixin
                 {
                     schedule.taskCompletedWithException( ex );
                 }
-                schedulerMixin.dispatchForExecution( schedule );
                 uow.complete();
             }
             catch( UnitOfWorkCompletionException ex )
@@ -359,6 +358,10 @@ public class SchedulerMixin
             }
             finally
             {
+                if( schedule != null )
+                {
+                    schedulerMixin.dispatchForExecution( schedule );
+                }
                 // What should we do if we can't manage the Running flag??
                 if( uow.isOpen() )
                 {
@@ -367,5 +370,4 @@ public class SchedulerMixin
             }
         }
     }
-
 }

Reply via email to