MCPcopy Create free account
hub / github.com/apache/tomcat / destroy

Method destroy

java/org/apache/catalina/startup/ContextConfig.java:1187–1206  ·  view source on GitHub ↗

Process a "destroy" event for this Context.

()

Source from the content-addressed store, hash-verified

1185 * Process a "destroy" event for this Context.
1186 */
1187 protected synchronized void destroy() {
1188 // Called from StandardContext.destroy()
1189 if (log.isTraceEnabled()) {
1190 log.trace(sm.getString("contextConfig.destroy"));
1191 }
1192
1193 // Skip clearing the work directory if Tomcat is being shutdown
1194 Server s = getServer();
1195 if (s != null && !s.getState().isAvailable()) {
1196 return;
1197 }
1198
1199 // Changed to getWorkPath per Bugzilla 35819.
1200 if (context instanceof StandardContext) {
1201 String workDir = ((StandardContext) context).getWorkPath();
1202 if (workDir != null) {
1203 ExpandWar.delete(new File(workDir));
1204 }
1205 }
1206 }
1207
1208
1209 private Server getServer() {

Callers 1

lifecycleEventMethod · 0.95

Calls 8

getServerMethod · 0.95
deleteMethod · 0.95
getWorkPathMethod · 0.80
isTraceEnabledMethod · 0.65
traceMethod · 0.65
getStringMethod · 0.65
isAvailableMethod · 0.65
getStateMethod · 0.65

Tested by

no test coverage detected