From f76fee63ed9cb3a30d3c0c092d860b1cb93a481b Mon Sep 17 00:00:00 2001
From: Gerard Smyth <gerard.smyth@gmail.com>
Date: Thu, 08 May 2014 13:09:30 -0400
Subject: [PATCH] Updated the SyndicationServlet to provide an additional option to return details of the tags in the repository instead of the commits. This uses a new 'ot' request parameter to indicate the object type of the content to return, which can be ither TAG or COMMIT. If this is not provided, then COMMIT is assumed to maintain backwards compatability. If tags are returned, then the paging parameters, 'l' and 'pg' are still supported, but searching options are currently ignored.

---
 src/main/java/com/gitblit/utils/WorkQueue.java |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/gitblit/utils/WorkQueue.java b/src/main/java/com/gitblit/utils/WorkQueue.java
index 778e754..ba49a4c 100644
--- a/src/main/java/com/gitblit/utils/WorkQueue.java
+++ b/src/main/java/com/gitblit/utils/WorkQueue.java
@@ -14,11 +14,6 @@
 
 package com.gitblit.utils;
 
-import com.google.common.collect.Lists;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -38,7 +33,10 @@
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import javax.inject.Inject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
 
 /** Delayed execution of tasks using a background thread pool. */
 public class WorkQueue {
@@ -55,7 +53,6 @@
   private final IdGenerator idGenerator;
   private final CopyOnWriteArrayList<Executor> queues;
 
-  @Inject
   public WorkQueue(final IdGenerator idGenerator) {
     this.idGenerator = idGenerator;
     this.queues = new CopyOnWriteArrayList<Executor>();
@@ -268,7 +265,8 @@
       return startTime;
     }
 
-    public boolean cancel(boolean mayInterruptIfRunning) {
+    @Override
+	public boolean cancel(boolean mayInterruptIfRunning) {
       if (task.cancel(mayInterruptIfRunning)) {
         // Tiny abuse of running: if the task needs to know it was
         // canceled (to clean up resources) and it hasn't started
@@ -289,36 +287,44 @@
       }
     }
 
-    public int compareTo(Delayed o) {
+    @Override
+	public int compareTo(Delayed o) {
       return task.compareTo(o);
     }
 
-    public V get() throws InterruptedException, ExecutionException {
+    @Override
+	public V get() throws InterruptedException, ExecutionException {
       return task.get();
     }
 
-    public V get(long timeout, TimeUnit unit) throws InterruptedException,
+    @Override
+	public V get(long timeout, TimeUnit unit) throws InterruptedException,
         ExecutionException, TimeoutException {
       return task.get(timeout, unit);
     }
 
-    public long getDelay(TimeUnit unit) {
+    @Override
+	public long getDelay(TimeUnit unit) {
       return task.getDelay(unit);
     }
 
-    public boolean isCancelled() {
+    @Override
+	public boolean isCancelled() {
       return task.isCancelled();
     }
 
-    public boolean isDone() {
+    @Override
+	public boolean isDone() {
       return task.isDone();
     }
 
-    public boolean isPeriodic() {
+    @Override
+	public boolean isPeriodic() {
       return task.isPeriodic();
     }
 
-    public void run() {
+    @Override
+	public void run() {
       if (running.compareAndSet(false, true)) {
         try {
           task.run();

--
Gitblit v1.9.1