Author: toad
Date: 2008-06-13 13:00:34 +0000 (Fri, 13 Jun 2008)
New Revision: 20305

Modified:
   branches/db4o/freenet/src/freenet/client/async/ClientContext.java
   branches/db4o/freenet/src/freenet/node/updater/NodeUpdater.java
   branches/db4o/freenet/src/freenet/node/updater/RevocationChecker.java
   
branches/db4o/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
Log:
Start the node updater code properly too

Modified: branches/db4o/freenet/src/freenet/client/async/ClientContext.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientContext.java   
2008-06-13 12:54:08 UTC (rev 20304)
+++ branches/db4o/freenet/src/freenet/client/async/ClientContext.java   
2008-06-13 13:00:34 UTC (rev 20305)
@@ -6,6 +6,7 @@
 import com.db4o.ObjectContainer;
 
 import freenet.client.FECQueue;
+import freenet.client.FetchException;
 import freenet.client.InsertException;
 import freenet.node.NodeClientCore;
 import freenet.support.Executor;
@@ -57,5 +58,23 @@
                        inserter.start(param, param, null, this);
                }
        }
+
+       public void start(final ClientGetter getter) throws FetchException {
+               if(getter.persistent()) {
+                       jobRunner.queue(new DBJob() {
+                               
+                               public void run(ObjectContainer container, 
ClientContext context) {
+                                       try {
+                                               getter.start(container, 
context);
+                                       } catch (FetchException e) {
+                                               
getter.clientCallback.onFailure(e, getter);
+                                       }
+                               }
+                               
+                       }, NativeThread.NORM_PRIORITY, false);
+               } else {
+                       getter.start(null, this);
+               }
+       }
        
 }

Modified: branches/db4o/freenet/src/freenet/node/updater/NodeUpdater.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/updater/NodeUpdater.java     
2008-06-13 12:54:08 UTC (rev 20304)
+++ branches/db4o/freenet/src/freenet/node/updater/NodeUpdater.java     
2008-06-13 13:00:34 UTC (rev 20305)
@@ -140,7 +140,7 @@
                }
                if(toStart != null)
                        try {
-                               toStart.start();
+                               node.clientCore.clientContext.start(toStart);
                        } catch (FetchException e) {
                                Logger.error(this, "Error while starting the 
fetching: "+e, e);
                                synchronized(this) {

Modified: branches/db4o/freenet/src/freenet/node/updater/RevocationChecker.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/updater/RevocationChecker.java       
2008-06-13 12:54:08 UTC (rev 20304)
+++ branches/db4o/freenet/src/freenet/node/updater/RevocationChecker.java       
2008-06-13 13:00:34 UTC (rev 20305)
@@ -115,7 +115,7 @@
                        if(toCancel != null)
                                toCancel.cancel();
                        if(cg != null) {
-                               cg.start();
+                               core.clientContext.start(cg);
                                if(logMINOR) Logger.minor(this, "Started 
revocation fetcher");
                        }
                } catch (FetchException e) {

Modified: 
branches/db4o/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java  
    2008-06-13 12:54:08 UTC (rev 20304)
+++ 
branches/db4o/freenet/src/freenet/node/updater/UpdateOverMandatoryManager.java  
    2008-06-13 13:00:34 UTC (rev 20305)
@@ -780,7 +780,7 @@
                                updateManager.revocationURI, tempContext, 
(short)0, this, null, cleanedBlob); 
                
                try {
-                       cg.start();
+                       updateManager.node.clientCore.clientContext.start(cg);
                } catch (FetchException e1) {
                        System.err.println("Failed to decode UOM blob: "+e1);
                        e1.printStackTrace();
@@ -821,7 +821,7 @@
                                
updateManager.node.clientCore.requestStarters.sskPutScheduler,
                                RequestStarter.INTERACTIVE_PRIORITY_CLASS, 
false, false, this, null, null, true);
                try {
-                       putter.start(false);
+                       
updateManager.node.clientCore.clientContext.start(putter, false);
                } catch (InsertException e1) {
                        Logger.error(this, "Failed to start insert of 
revocation key binary blob: "+e1, e1);
                }
@@ -1159,7 +1159,7 @@
                                uri, tempContext, (short)0, this, null, 
cleanedBlob); 
                
                try {
-                       cg.start();
+                       updateManager.node.clientCore.clientContext.start(cg);
                } catch (FetchException e1) {
                        myCallback.onFailure(e1, cg);
                }

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to