From c6a697df573f3afa786c44f093c2fe687ce79a26 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sun, 1 Jun 2008 20:16:17 +0000 Subject: [PATCH] * Client Apps: Add new parameter for clients.config, clientApp.x.startOnLoad=false, to disable loading (for SAM for example). Defaults to true of course. --- .../src/net/i2p/router/startup/LoadClientAppsJob.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java index 664fd384e9..228ef274a8 100644 --- a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java +++ b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java @@ -41,10 +41,17 @@ class LoadClientAppsJob extends JobImpl { int i = 0; while (true) { String className = clientApps.getProperty("clientApp."+i+".main"); + if (className == null) + break; String clientName = clientApps.getProperty("clientApp."+i+".name"); String args = clientApps.getProperty("clientApp."+i+".args"); String delayStr = clientApps.getProperty("clientApp." + i + ".delay"); String onBoot = clientApps.getProperty("clientApp." + i + ".onBoot"); + String disabled = clientApps.getProperty("clientApp." + i + ".startOnLoad"); + i++; + if (disabled != null && "false".equals(disabled)) + continue; + boolean onStartup = false; if (onBoot != null) onStartup = "true".equals(onBoot) || "yes".equals(onBoot); @@ -53,9 +60,6 @@ class LoadClientAppsJob extends JobImpl { if (delayStr != null) try { delay = 1000*Integer.parseInt(delayStr); } catch (NumberFormatException nfe) {} - if (className == null) - break; - String argVal[] = parseArgs(args); if (onStartup) { // run this guy now @@ -64,7 +68,6 @@ class LoadClientAppsJob extends JobImpl { // wait before firing it up getContext().jobQueue().addJob(new DelayedRunClient(getContext(), className, clientName, argVal, delay)); } - i++; } } -- GitLab