MCPcopy Index your code
hub / github.com/apache/tomcat / manageApp

Method manageApp

java/org/apache/catalina/startup/HostConfig.java:1751–1788  ·  view source on GitHub ↗

Add a new Context to be managed by us. Entry point for the admin webapp, and other JMX Context controllers. @param context The context instance

(Context context)

Source from the content-addressed store, hash-verified

1749 * @param context The context instance
1750 */
1751 public void manageApp(Context context) {
1752
1753 String contextName = context.getName();
1754
1755 if (deployed.containsKey(contextName)) {
1756 return;
1757 }
1758
1759 DeployedApplication deployedApp = new DeployedApplication(contextName, false);
1760
1761 // Add the associated docBase to the redeployed list if it's a WAR
1762 boolean isWar = false;
1763 if (context.getDocBase() != null) {
1764 File docBase = new File(context.getDocBase());
1765 if (!docBase.isAbsolute()) {
1766 docBase = new File(host.getAppBaseFile(), context.getDocBase());
1767 }
1768 deployedApp.redeployResources.put(docBase.getAbsolutePath(), Long.valueOf(docBase.lastModified()));
1769 if (docBase.getAbsolutePath().toLowerCase(Locale.ENGLISH).endsWith(".war")) {
1770 isWar = true;
1771 }
1772 }
1773 host.addChild(context);
1774 // Add the eventual unpacked WAR and all the resources which will be
1775 // watched inside it
1776 boolean unpackWAR = unpackWARs;
1777 if (unpackWAR && context instanceof StandardContext) {
1778 unpackWAR = ((StandardContext) context).getUnpackWAR();
1779 }
1780 if (isWar && unpackWAR) {
1781 File docBase = new File(host.getAppBaseFile(), context.getBaseName());
1782 deployedApp.redeployResources.put(docBase.getAbsolutePath(), Long.valueOf(docBase.lastModified()));
1783 addWatchedResources(deployedApp, docBase.getAbsolutePath(), context);
1784 } else {
1785 addWatchedResources(deployedApp, null, context);
1786 }
1787 deployed.put(contextName, deployedApp);
1788 }
1789
1790 /**
1791 * Remove a webapp from our control. Entry point for the admin webapp, and other JMX Context controllers.

Callers

nothing calls this directly

Calls 12

addWatchedResourcesMethod · 0.95
endsWithMethod · 0.80
getUnpackWARMethod · 0.80
getNameMethod · 0.65
getDocBaseMethod · 0.65
getAppBaseFileMethod · 0.65
putMethod · 0.65
addChildMethod · 0.65
getBaseNameMethod · 0.65
containsKeyMethod · 0.45
getAbsolutePathMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected