Author: toad
Date: 2008-07-23 20:20:43 +0000 (Wed, 23 Jul 2008)
New Revision: 21352

Modified:
   branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java
   branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
Log:
Activation depth should be 1 not Integer.MAX_VALUE !

Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java   2008-07-23 
20:09:00 UTC (rev 21351)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java   2008-07-23 
20:20:43 UTC (rev 21352)
@@ -38,11 +38,11 @@
                final boolean forever = (persistenceType == 
ClientRequest.PERSIST_FOREVER);
                if(forever) {
                        runningPersistentRequests = 
container.ext().collections().newLinkedList();
-                       
((Db4oList)runningPersistentRequests).activationDepth(Integer.MAX_VALUE);
+                       
((Db4oList)runningPersistentRequests).activationDepth(1);
                        completedUnackedRequests = 
container.ext().collections().newLinkedList();
-                       
((Db4oList)completedUnackedRequests).activationDepth(Integer.MAX_VALUE);
+                       ((Db4oList)completedUnackedRequests).activationDepth(1);
                        clientRequestsByIdentifier = 
container.ext().collections().newHashMap(10);
-                       
((Db4oMap)clientRequestsByIdentifier).activationDepth(Integer.MAX_VALUE);
+                       
((Db4oMap)clientRequestsByIdentifier).activationDepth(1);
                } else {
                        runningPersistentRequests = new Vector();
                        completedUnackedRequests = new Vector();
@@ -421,4 +421,10 @@
                }
                return null;
        }
+
+       public void init() {
+               ((Db4oList)runningPersistentRequests).activationDepth(1);
+               ((Db4oList)completedUnackedRequests).activationDepth(1);
+               ((Db4oMap)clientRequestsByIdentifier).activationDepth(1);
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java   
2008-07-23 20:09:00 UTC (rev 21351)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPPersistentRoot.java   
2008-07-23 20:20:43 UTC (rev 21352)
@@ -37,6 +37,7 @@
                        System.err.println("Loaded FCP persistent root.");
                        FCPPersistentRoot root = (FCPPersistentRoot) set.next();
                        container.activate(root, 2);
+                       root.globalForeverClient.init();
                        return root;
                }
                FCPPersistentRoot root = new FCPPersistentRoot(nodeDBHandle, 
container);
@@ -72,6 +73,7 @@
                        if(!(name.equals(client.name)))
                                Logger.error(this, "Returning "+client+" for 
"+name);
                        if(Logger.shouldLog(Logger.MINOR, this)) 
Logger.minor(this, "Returning "+client+" for "+name);
+                       client.init();
                        return client;
                }
                FCPClient client = new FCPClient(name, handler, false, null, 
ClientRequest.PERSIST_FOREVER, this, container);


Reply via email to