forked from I2P_Developers/i2p.i2p
* Naming service, addressbook, susidns:
- Replace img hack for susidns requesting addressbook update with registration and request through the NamingService
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user