]> source.dussan.org Git - sonarqube.git/commitdiff
Add TaskComponent to SemaphoreUpdater and Semaphores
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 15 Mar 2013 19:23:45 +0000 (20:23 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 15 Mar 2013 19:23:45 +0000 (20:23 +0100)
sonar-core/src/main/java/org/sonar/core/persistence/SemaphoreUpdater.java
sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java

index 6231460bb2f3c9bdc71584d9571e0bea91054a69..5a610af7de96ff53e4ccc76732dd4126d983bb0f 100644 (file)
@@ -22,6 +22,8 @@ package org.sonar.core.persistence;
 import com.google.common.collect.Maps;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.sonar.api.ServerComponent;
+import org.sonar.api.task.TaskComponent;
 import org.sonar.api.utils.Semaphores;
 
 import java.util.Map;
@@ -32,7 +34,7 @@ import java.util.concurrent.TimeUnit;
 /**
  * @since 3.5
  */
-public class SemaphoreUpdater {
+public class SemaphoreUpdater implements TaskComponent, ServerComponent {
 
   private static final Logger LOG = LoggerFactory.getLogger(SemaphoreUpdater.class);
 
index ac47230abfc844f21c813061d6701d16ffd88865..8e208210270cfa4f6bc778029ca4281e475d4da8 100644 (file)
@@ -19,8 +19,8 @@
  */
 package org.sonar.api.utils;
 
-import org.sonar.api.BatchComponent;
 import org.sonar.api.ServerComponent;
+import org.sonar.api.task.TaskComponent;
 
 import java.util.Date;
 
@@ -30,7 +30,7 @@ import java.util.Date;
  *
  * @since 3.4
  */
-public interface Semaphores extends BatchComponent, ServerComponent {
+public interface Semaphores extends TaskComponent, ServerComponent {
 
   /**
    * Try to acquire a semaphore for a given duration.
@@ -39,9 +39,9 @@ public interface Semaphores extends BatchComponent, ServerComponent {
    * server to update the semaphore and avoid it to be considered as
    * outdated.
    *
-   * @param name                 the key of the semaphore
-   * @param maxAgeInSeconds the max duration in seconds the semaphore will be considered unlocked if
-   *                        it was not updated. The value zero forces the semaphore to be acquired, whatever its status.
+   * @param name                  the key of the semaphore
+   * @param maxAgeInSeconds       the max duration in seconds the semaphore will be considered unlocked if
+   *                              it was not updated. The value zero forces the semaphore to be acquired, whatever its status.
    * @param updatePeriodInSeconds the period in seconds the semaphore will be updated.
    * @return the semaphore, whatever its status (locked or unlocked). Can't be null.
    */