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;
/**
* @since 3.5
*/
-public class SemaphoreUpdater {
+public class SemaphoreUpdater implements TaskComponent, ServerComponent {
private static final Logger LOG = LoggerFactory.getLogger(SemaphoreUpdater.class);
*/
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;
*
* @since 3.4
*/
-public interface Semaphores extends BatchComponent, ServerComponent {
+public interface Semaphores extends TaskComponent, ServerComponent {
/**
* Try to acquire a semaphore for a given duration.
* 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.
*/