Author: xor
Date: 2008-11-10 03:22:01 +0000 (Mon, 10 Nov 2008)
New Revision: 23464

Modified:
   trunk/plugins/WoT/IdentityInserter.java
   trunk/plugins/WoT/WoT.java
Log:
Wake up the inserter thread if a new identity is created.

Modified: trunk/plugins/WoT/IdentityInserter.java
===================================================================
--- trunk/plugins/WoT/IdentityInserter.java     2008-11-10 03:16:31 UTC (rev 
23463)
+++ trunk/plugins/WoT/IdentityInserter.java     2008-11-10 03:22:01 UTC (rev 
23464)
@@ -125,6 +125,11 @@
                }
                Logger.debug(this, "Stopped IdentityInserter thread.");
        }
+       
+       public void wakeUp() {
+               if(mThread != null)
+                       mThread.interrupt(); /* FIXME: toad: i hope this will 
not break any of the code which is NOT the sleep() function??? */
+       }

        /**
         * Inserts an OwnIdentity.
@@ -140,7 +145,7 @@
         * @throws InvalidParameterException
         * @throws InsertException
         */
-       public void insert(OwnIdentity identity) throws 
TransformerConfigurationException, FileNotFoundException, 
ParserConfigurationException, TransformerException, IOException, 
Db4oIOException, DatabaseClosedException, InvalidParameterException, 
InsertException {
+       private void insert(OwnIdentity identity) throws 
TransformerConfigurationException, FileNotFoundException, 
ParserConfigurationException, TransformerException, IOException, 
Db4oIOException, DatabaseClosedException, InvalidParameterException, 
InsertException {
                /* FIXME: Where is the synchronization? */
                /* TODO: after the WoT has become large enough, calculate the 
average size of identity.xml and either modify the constant or even calculate 
dynamically */
                Bucket tempB = tBF.makeBucket(8 * 1024);  

Modified: trunk/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/WoT.java  2008-11-10 03:16:31 UTC (rev 23463)
+++ trunk/plugins/WoT/WoT.java  2008-11-10 03:22:01 UTC (rev 23464)
@@ -361,6 +361,8 @@
                // This identity trusts the seed identity
                identity.setTrust(db, seed, (byte)100, "I trust the WoT 
plugin");

+               inserter.wakeUp();
+               
                Logger.debug(this, "Successfully created a new OwnIdentity (" + 
identity.getNickName() + ")");

                db.commit();    


Reply via email to