Author: toad
Date: 2008-07-31 12:49:08 +0000 (Thu, 31 Jul 2008)
New Revision: 21532

Modified:
   branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
   
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
   branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
Log:
Activation.

Modified: branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-31 12:43:17 UTC (rev 21531)
+++ branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-31 12:49:08 UTC (rev 21532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.client.async;

+import com.db4o.ObjectContainer;
+
 import freenet.client.FetchContext;
 import freenet.keys.ClientKey;
 import freenet.keys.Key;
@@ -32,7 +34,7 @@
        public final boolean cacheLocalRequests;
        public final boolean ignoreStore;

-       ChosenRequest(SendableRequest req, Object tok, Key key, ClientKey ckey, 
short prio) {
+       ChosenRequest(SendableRequest req, Object tok, Key key, ClientKey ckey, 
short prio, ObjectContainer container) {
                request = req;
                token = tok;
                this.key = key;
@@ -41,6 +43,8 @@
                if(req instanceof SendableGet) {
                        SendableGet sg = (SendableGet) req;
                        FetchContext ctx = sg.getContext();
+                       if(container != null)
+                               container.activate(ctx, 1);
                        localRequestOnly = ctx.localRequestOnly;
                        cacheLocalRequests = ctx.cacheLocalRequests;
                        ignoreStore = ctx.ignoreStore;

Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java  
    2008-07-31 12:43:17 UTC (rev 21531)
+++ 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerCore.java  
    2008-07-31 12:49:08 UTC (rev 21532)
@@ -327,7 +327,7 @@
                                if(key != null && key.getRoutingKey() == null)
                                        throw new NullPointerException();
                                ret = new PersistentChosenRequest(this, req, 
token, key == null ? null : key.cloneKey(), 
-                                               ckey == null ? null : 
ckey.cloneKey(), req.getPriorityClass(container));
+                                               ckey == null ? null : 
ckey.cloneKey(), req.getPriorityClass(container), container);
                                container.set(ret);
                                if(logMINOR)
                                        Logger.minor(this, "Storing "+ret+" for 
"+req);
@@ -337,7 +337,7 @@
                        } else {
                                if(key != null && key.getRoutingKey() == null)
                                        throw new NullPointerException();
-                               ret = new ChosenRequest(req, token, key, ckey, 
req.getPriorityClass(container));
+                               ret = new ChosenRequest(req, token, key, ckey, 
req.getPriorityClass(container), null);
                        }
                        return ret;
                }

Modified: 
branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java 
2008-07-31 12:43:17 UTC (rev 21531)
+++ branches/db4o/freenet/src/freenet/client/async/PersistentChosenRequest.java 
2008-07-31 12:49:08 UTC (rev 21532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.client.async;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.ClientKey;
 import freenet.keys.Key;
 import freenet.node.SendableRequest;
@@ -26,8 +28,8 @@
        // A persistent hashCode is helpful for debugging and lets us put PCR's 
into hash-based maps and sets.
        private final int hashCode;

-       PersistentChosenRequest(ClientRequestSchedulerCore core, 
SendableRequest req, Object tok, Key key, ClientKey ckey, short prio) {
-               super(req, tok, key, ckey, prio);
+       PersistentChosenRequest(ClientRequestSchedulerCore core, 
SendableRequest req, Object tok, Key key, ClientKey ckey, short prio, 
ObjectContainer container) {
+               super(req, tok, key, ckey, prio, container);
                if(tok == null) throw new NullPointerException();
                int hash = core.hashCode() ^ req.hashCode();
                if(key != null)


Reply via email to