r26864 - trunk/freenet/src/freenet/client/async

[email protected] Wed, 15 Apr 2009 22:59:18 +0000
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-15 22:59:18 +0000 (Wed, 15 Apr 2009)
New Revision: 26864

Modified:
   trunk/freenet/src/freenet/client/async/USKFetcher.java
Log:
Comments


Modified: trunk/freenet/src/freenet/client/async/USKFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/USKFetcher.java	2009-04-15 22:40:06 UTC (rev 26863)
+++ trunk/freenet/src/freenet/client/async/USKFetcher.java	2009-04-15 22:59:18 UTC (rev 26864)
@@ -107,6 +107,14 @@
 	private short lastCompressionCodec;
 	private boolean lastWasMetadata;
 	
+	/**
+	 * Callbacks are told when the USKFetcher finishes, and unless background poll is
+	 * enabled, they are only sent onFoundEdition *once*, on completion.
+	 * 
+	 * FIXME: Don't allow callbacks if backgroundPoll is enabled??
+	 * @param cb
+	 * @return
+	 */
 	public synchronized boolean addCallback(USKFetcherCallback cb) {
 		if(completed) return false; 
 		callbacks.add(cb);
@@ -550,6 +558,12 @@
 	 */
 	final HashSet<USKCallback> subscribers;
 	
+	/**
+	 * Add a subscriber. Subscribers are not directly sent onFoundEdition()'s by the
+	 * USKFetcher, we just use them to determine the priority of our requests and 
+	 * whether we should continue to request.
+	 * @param cb
+	 */
 	public void addSubscriber(USKCallback cb) {
 		synchronized(this) {
 			subscribers.add(cb);