bob finals, synch

This commit is contained in:
zzz
2014-07-23 13:12:32 +00:00
parent 328d7d0008
commit 89764c12e7

View File

@ -119,15 +119,16 @@ public class BOB implements Runnable, ClientApp {
public final static String PROP_BOB_HOST = "BOB.host"; public final static String PROP_BOB_HOST = "BOB.host";
public final static String PROP_CFG_VER = "BOB.CFG.VER"; public final static String PROP_CFG_VER = "BOB.CFG.VER";
/** unused when started via the ClientApp interface */
private static BOB _bob; private static BOB _bob;
private NamedDB database; private final NamedDB database;
private Properties props = new Properties(); private final Properties props = new Properties();
private AtomicBoolean spin = new AtomicBoolean(true); private final AtomicBoolean spin = new AtomicBoolean(true);
private static final String P_RUNNING = "RUNNING"; private static final String P_RUNNING = "RUNNING";
private static final String P_STARTING = "STARTING"; private static final String P_STARTING = "STARTING";
private static final String P_STOPPING = "STOPPING"; private static final String P_STOPPING = "STOPPING";
private AtomicBoolean lock = new AtomicBoolean(false); private final AtomicBoolean lock = new AtomicBoolean(false);
// no longer used. // no longer used.
// private static int maxConnections = 0; // private static int maxConnections = 0;
@ -143,7 +144,8 @@ public class BOB implements Runnable, ClientApp {
* Stop BOB gracefully * Stop BOB gracefully
* @deprecated unused * @deprecated unused
*/ */
public static void stop() { public synchronized static void stop() {
if (_bob != null)
_bob.shutdown(null); _bob.shutdown(null);
} }
@ -189,7 +191,7 @@ public class BOB implements Runnable, ClientApp {
* *
* @param args * @param args
*/ */
public static void main(String[] args) { public synchronized static void main(String[] args) {
try { try {
_bob = new BOB(I2PAppContext.getGlobalContext(), null, args); _bob = new BOB(I2PAppContext.getGlobalContext(), null, args);
_bob.startup(); _bob.startup();