* Naming service, addressbook, susidns:

- Replace img hack for susidns requesting addressbook update
      with registration and request through the NamingService
This commit is contained in:
zzz
2011-03-15 23:16:44 +00:00
parent 12c5b9c21c
commit 0352ca3ef6
5 changed files with 66 additions and 8 deletions

View File

@@ -21,13 +21,18 @@
package net.i2p.addressbook;
import java.util.Properties;
import net.i2p.I2PAppContext;
import net.i2p.client.naming.NamingServiceUpdater;
/**
* A thread that waits five minutes, then runs the addressbook daemon.
*
* @author Ragnarok
*
*/
class DaemonThread extends Thread {
class DaemonThread extends Thread implements NamingServiceUpdater {
private String[] args;
@@ -49,11 +54,21 @@ class DaemonThread extends Thread {
// Thread.sleep(5 * 60 * 1000);
//} catch (InterruptedException exp) {
//}
I2PAppContext.getGlobalContext().namingService().registerUpdater(this);
Daemon.main(this.args);
I2PAppContext.getGlobalContext().namingService().unregisterUpdater(this);
}
public void halt() {
Daemon.stop();
interrupt();
}
/**
* The NamingServiceUpdater interface
* @since 0.8.6
*/
public void update(Properties options) {
interrupt();
}
}