/** Updates a WebApp deploy */ public void updateWebAppDeploy(String name) throws Throwable { _appDeploy.update(); WebAppController controller = _appDeploy.update(name); clearCache(); if (controller != null) { Throwable configException = controller.getConfigException(); if (configException != null) throw configException; } }
/** Finds the web-app for the entry. */ private WebAppUriMap findByURIImpl(String subURI) { WebAppUriMap entry = _uriToAppCache.get(subURI); if (entry != null) { return entry; } int length = subURI.length(); int p = subURI.lastIndexOf('/'); if (p < 0 || p < length - 1) { // server/26cf WebAppController controller = _appDeploy.findController(subURI); if (controller != null) { entry = new WebAppUriMap(subURI, controller); _uriToAppCache.put(subURI, entry); return entry; } } if (p >= 0) { entry = findByURIImpl(subURI.substring(0, p)); if (entry != null) _uriToAppCache.put(subURI, entry); } return entry; }
/** Starts the container. */ public void start() { try { _appDeploy.start(); } catch (Exception e) { throw ConfigException.create(e); } }
public void addWebApp(WebAppSingleDeployGenerator deployGenerator) { deployGenerator.deploy(); _appDeploy.add(deployGenerator); clearCache(); }
/** Adds an webApp. */ public void addWebApp(WebAppConfig config) { if (config.getURLRegexp() != null) { DeployGenerator<WebAppController> deploy = new WebAppRegexpDeployGenerator(_appDeploySpi, this, config); _appDeploy.add(deploy); clearCache(); return; } // server/10f6 /* WebAppController oldEntry = _appDeploy.findController(config.getContextPath()); if (oldEntry != null && oldEntry.getSourceType().equals("single")) { throw new ConfigException(L.l("duplicate web-app '{0}' forbidden.", config.getId())); } */ WebAppSingleDeployGenerator deployGenerator = createDeployGenerator(config); addWebApp(deployGenerator); }
/** Sets the war-expansion */ public void addWarDeploy(WebAppExpandDeployGenerator webAppDeploy) throws ConfigException { assert webAppDeploy.getContainer() == this; if (!_hasWarGenerator) { _hasWarGenerator = true; _warGenerator = webAppDeploy; } _appDeploy.add(webAppDeploy); }
/** Adds the ear-expansion */ public void addEarDeploy(EarDeployGenerator earDeploy) throws Exception { _earDeploy.add(earDeploy); // server/26cc - _appDeploy must be added first, because the // _earDeploy addition will automaticall register itself _appDeploy.add(new WebAppEarDeployGenerator(_appDeploySpi, this, earDeploy)); /* _earDeploy.add(earDeploy); */ }
/** Closes the container. */ public void destroy() { _earDeploy.destroy(); _appDeploy.destroy(); AbstractAccessLog accessLog = _accessLog; _accessLog = null; if (accessLog != null) { try { accessLog.destroy(); } catch (Exception e) { log.log(Level.FINER, e.toString(), e); } } }
/** Finds the web-app matching the current entry. */ public WebAppUriMap findEntryByURI(String uri) { if (_appDeploy.isModified()) _uriToAppCache.clear(); WebAppUriMap entry = _uriToAppCache.get(uri); if (entry != null) return entry; String cleanUri = uri; if (CauchoSystem.isCaseInsensitive()) cleanUri = cleanUri.toLowerCase(Locale.ENGLISH); // server/105w try { cleanUri = getInvocationDecoder().normalizeUri(cleanUri); } catch (java.io.IOException e) { log.log(Level.FINER, e.toString(), e); } entry = findByURIImpl(cleanUri); _uriToAppCache.put(uri, entry); return entry; }
/** Closes the container. */ public boolean stop() { _earDeploy.stop(); _appDeploy.stop(); return true; }
/** Returns a list of the webApps. */ public WebAppController[] getWebAppList() { return _appDeploy.getControllers(); }
/** Finds the web-app for the entry, not checking for sub-apps. (used by LocalDeployServlet) */ public WebAppController findController(String subURI) { return _appDeploy.findController(subURI); }
/** Removes a web-app-generator. */ public void removeWebAppDeploy(DeployGenerator<WebAppController> deploy) { _appDeploy.remove(deploy); }
/** Sets the war-expansion */ public void addDeploy(DeployGenerator<WebAppController> deploy) throws ConfigException { if (deploy instanceof WebAppExpandDeployGenerator) addWebAppDeploy((WebAppExpandDeployGenerator) deploy); else _appDeploy.add(deploy); }
/** Removes an webApp. */ void removeWebApp(WebAppController entry) { _appDeploy.remove(entry.getContextPath()); clearCache(); }
public void removeWebApp(WebAppSingleDeployGenerator deployGenerator) { _appDeploy.remove(deployGenerator); deployGenerator.destroy(); }