You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/06/24 16:50:06 UTC
svn commit: r1496071 - in
/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system:
ManifoldCF.java RequestQueue.java
Author: kwright
Date: Mon Jun 24 14:50:05 2013
New Revision: 1496071
URL: http://svn.apache.org/r1496071
Log:
Make RequestQueue generic, since I intend to use it for mappings as well
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java
Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java?rev=1496071&r1=1496070&r2=1496071&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java Mon Jun 24 14:50:05 2013
@@ -38,7 +38,7 @@ public class ManifoldCF extends org.apac
protected static final String authCheckThreadCountProperty = "org.apache.manifoldcf.authorityservice.threads";
// Request queue
- protected static RequestQueue requestQueue = null;
+ protected static RequestQueue<AuthRequest> requestQueue = null;
/** Initialize environment.
*/
@@ -174,7 +174,7 @@ public class ManifoldCF extends org.apac
idleCleanupThread = new IdleCleanupThread();
idleCleanupThread.start();
- requestQueue = new RequestQueue();
+ requestQueue = new RequestQueue<AuthRequest>();
authCheckThreads = new AuthCheckThread[numAuthCheckThreads];
int i = 0;
Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java?rev=1496071&r1=1496070&r2=1496071&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java Mon Jun 24 14:50:05 2013
@@ -28,12 +28,12 @@ import java.util.*;
* (b) the "reader" threads block if queue is empty.
* The objects being queued are all AuthRequest objects.
*/
-public class RequestQueue
+public class RequestQueue<T>
{
public static final String _rcsid = "@(#)$Id: RequestQueue.java 988245 2010-08-23 18:39:35Z kwright $";
// Since the queue has a maximum size, an ArrayList is a fine way to keep it
- protected ArrayList queue = new ArrayList();
+ protected List<T> queue = new ArrayList<T>();
/** Constructor.
*/
@@ -44,7 +44,7 @@ public class RequestQueue
/** Add a request to the queue.
*@param dd is the request.
*/
- public void addRequest(AuthRequest dd)
+ public void addRequest(T dd)
{
synchronized (queue)
{
@@ -57,7 +57,7 @@ public class RequestQueue
* nothing there.
*@return the request to be processed.
*/
- public AuthRequest getRequest()
+ public T getRequest()
throws InterruptedException
{
synchronized (queue)
@@ -66,7 +66,7 @@ public class RequestQueue
while (queue.size() == 0)
queue.wait();
- return (AuthRequest)queue.remove(queue.size()-1);
+ return queue.remove(queue.size()-1);
}
}