Changeset 2de36ee
- Timestamp:
- Oct 11, 2018 1:10:33 PM (2 years ago)
- Branches:
- master
- Children:
- 77e539a
- Parents:
- e68182a
- Location:
- apps/routerconsole/java/src/net/i2p/router/web
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java
re68182a r2de36ee 441 441 442 442 // start console webapps in console/webapps 443 ContextHandlerCollection server = WebAppStarter.getConsoleServer( );443 ContextHandlerCollection server = WebAppStarter.getConsoleServer(ctx); 444 444 if (server != null) { 445 445 File consoleDir = new File(pluginDir, "console"); … … 952 952 while(it.hasNext() && !isWarRunning) { 953 953 String warName = it.next(); 954 if(WebAppStarter.isWebAppRunning( warName)) {954 if(WebAppStarter.isWebAppRunning(ctx, warName)) { 955 955 isWarRunning = true; 956 956 } -
apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java
re68182a r2de36ee 25 25 26 26 import net.i2p.I2PAppContext; 27 import net.i2p.app.ClientApp; 27 28 import net.i2p.app.ClientAppManager; 28 29 import net.i2p.app.ClientAppState; … … 101 102 private final ClientAppManager _mgr; 102 103 private volatile ClientAppState _state = UNINITIALIZED; 103 private staticServer _server;104 private Server _server; 104 105 private static ScheduledExecutorScheduler _jettyTimer; 105 106 private String _listenPort; … … 117 118 authenticator.setMaxNonceAge(7*24*60*60*1000L); 118 119 } 120 private static final String NAME = "console"; 119 121 public static final String JETTY_REALM = "i2prouter"; 120 122 private static final String JETTY_ROLE = "routerAdmin"; … … 265 267 /** @since 0.9.4 */ 266 268 public String getName() { 267 return "console";269 return NAME; 268 270 } 269 271 … … 282 284 283 285 /** 284 * SInce _server is now static286 * To get to Jetty 285 287 * @return may be null or stopped perhaps 286 288 * @since Jetty 6 since it doesn't have Server.getServers() 287 289 */ 288 s taticServer getConsoleServer() {290 synchronized Server getConsoleServer() { 289 291 return _server; 290 292 } 293 294 /** 295 * To get to Jetty 296 * @return may be null or stopped perhaps 297 * @since 0.9.38 298 */ 299 static Server getConsoleServer(I2PAppContext ctx) { 300 ClientApp app = ctx.clientAppManager().getRegisteredApp(NAME); 301 return (app != null) ? ((RouterConsoleRunner)app).getConsoleServer() : null; 302 } 303 291 304 292 305 /** @since 0.8.13, moved from LogsHelper in 0.9.33 */ … … 1114 1127 if (ROUTERCONSOLE.equals(app)) 1115 1128 continue; 1116 if (WebAppStarter.isWebAppRunning( app)) {1129 if (WebAppStarter.isWebAppRunning(_context, app)) { 1117 1130 try { 1118 1131 WebAppStarter.stopWebApp(_context, app); -
apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java
re68182a r2de36ee 7 7 import java.util.concurrent.ConcurrentHashMap; 8 8 9 import net.i2p.I2PAppContext; 9 10 import net.i2p.router.RouterContext; 10 11 import net.i2p.util.FileUtil; … … 151 152 */ 152 153 public static void stopWebApp(RouterContext ctx, String appName) { 153 ContextHandler wac = getWebApp( appName);154 ContextHandler wac = getWebApp(ctx, appName); 154 155 if (wac == null) 155 156 return; … … 159 160 wac.stop(); 160 161 } catch (Exception ie) {} 161 ContextHandlerCollection server = getConsoleServer( );162 ContextHandlerCollection server = getConsoleServer(ctx); 162 163 if (server == null) 163 164 return; … … 174 175 * @since public since 0.9.33; was package private 175 176 */ 176 public static boolean isWebAppRunning( String appName) {177 ContextHandler wac = getWebApp( appName);177 public static boolean isWebAppRunning(I2PAppContext ctx, String appName) { 178 ContextHandler wac = getWebApp(ctx, appName); 178 179 if (wac == null) 179 180 return false; … … 182 183 183 184 /** @since Jetty 6 */ 184 static ContextHandler getWebApp( String appName) {185 ContextHandlerCollection server = getConsoleServer( );185 static ContextHandler getWebApp(I2PAppContext ctx, String appName) { 186 ContextHandlerCollection server = getConsoleServer(ctx); 186 187 if (server == null) 187 188 return null; … … 204 205 * @since public since 0.9.33, was package private 205 206 */ 206 public static ContextHandlerCollection getConsoleServer( ) {207 Server s = RouterConsoleRunner.getConsoleServer( );207 public static ContextHandlerCollection getConsoleServer(I2PAppContext ctx) { 208 Server s = RouterConsoleRunner.getConsoleServer(ctx); 208 209 if (s == null) 209 210 return null; -
apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java
re68182a r2de36ee 388 388 */ 389 389 private void startWebApp(String app) { 390 ContextHandlerCollection s = WebAppStarter.getConsoleServer( );390 ContextHandlerCollection s = WebAppStarter.getConsoleServer(_context); 391 391 if (s != null) { 392 392 try { -
apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHelper.java
re68182a r2de36ee 216 216 String app = name.substring(RouterConsoleRunner.PREFIX.length(), name.lastIndexOf(RouterConsoleRunner.ENABLED)); 217 217 String val = props.getProperty(name); 218 boolean isRunning = WebAppStarter.isWebAppRunning( app);218 boolean isRunning = WebAppStarter.isWebAppRunning(_context, app); 219 219 String desc; 220 220 // use descriptions already tagged elsewhere
Note: See TracChangeset
for help on using the changeset viewer.