Diff of /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
Parent Directory
| Revision Log
| Patch
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java 2006/03/16 14:00:00 386330
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java 2006/03/16 14:03:12 386331
@@ -4059,18 +4059,19 @@ public class StandardContext
}
}
- // Binding thread
- ClassLoader oldCCL = bindThread();
-
// Standard container startup
if (log.isDebugEnabled())
log.debug("Processing standard container startup");
- if (ok) {
+ // Binding thread
+ ClassLoader oldCCL = bindThread();
- boolean mainOk = false;
- try {
+ boolean mainOk = false;
+ try {
+
+ if (ok) {
+
started = true;
// Start our subordinate components, if any
@@ -4141,17 +4142,18 @@ public class StandardContext
mainOk = true;
- } finally {
- // Unbinding thread
- unbindThread(oldCCL);
- if (!mainOk) {
- // An exception occurred
- // Register with JMX anyway, to allow management
- registerJMX();
- }
}
+ } finally {
+ // Unbinding thread
+ unbindThread(oldCCL);
+ if (!mainOk) {
+ // An exception occurred
+ // Register with JMX anyway, to allow management
+ registerJMX();
+ }
}
+
if (!getConfigured()) {
log.error( "Error getConfigured");
ok = false;
@@ -4168,38 +4170,42 @@ public class StandardContext
// Binding thread
oldCCL = bindThread();
- // Create context attributes that will be required
- if (ok) {
- postWelcomeFiles();
- }
-
- if (ok) {
- // Notify our interested LifecycleListeners
- lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
- }
-
- // Configure and call application event listeners and filters
- if (ok) {
- if (!listenerStart()) {
- log.error( "Error listenerStart");
- ok = false;
+ try {
+
+ // Create context attributes that will be required
+ if (ok) {
+ postWelcomeFiles();
}
- }
- if (ok) {
- if (!filterStart()) {
- log.error( "Error filterStart");
- ok = false;
+
+ if (ok) {
+ // Notify our interested LifecycleListeners
+ lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
}
+
+ // Configure and call application event listeners and filters
+ if (ok) {
+ if (!listenerStart()) {
+ log.error( "Error listenerStart");
+ ok = false;
+ }
+ }
+ if (ok) {
+ if (!filterStart()) {
+ log.error( "Error filterStart");
+ ok = false;
+ }
+ }
+
+ // Load and initialize all "load on startup" servlets
+ if (ok) {
+ loadOnStartup(findChildren());
+ }
+
+ } finally {
+ // Unbinding thread
+ unbindThread(oldCCL);
}
- // Load and initialize all "load on startup" servlets
- if (ok) {
- loadOnStartup(findChildren());
- }
-
- // Unbinding thread
- unbindThread(oldCCL);
-
// Set available status depending upon startup success
if (ok) {
if (log.isDebugEnabled())
@@ -4324,30 +4330,30 @@ public class StandardContext
// Binding thread
ClassLoader oldCCL = bindThread();
- // Stop our filters
- filterStop();
+ try {
- // Stop our application listeners
- listenerStop();
+ // Stop our filters
+ filterStop();
- // Stop ContainerBackgroundProcessor thread
- super.threadStop();
+ // Stop our application listeners
+ listenerStop();
- if ((manager != null) && (manager instanceof Lifecycle)) {
- ((Lifecycle) manager).stop();
- }
+ // Stop ContainerBackgroundProcessor thread
+ super.threadStop();
- // Finalize our character set mapper
- setCharsetMapper(null);
+ if ((manager != null) && (manager instanceof Lifecycle)) {
+ ((Lifecycle) manager).stop();
+ }
- // Normal container shutdown processing
- if (log.isDebugEnabled())
- log.debug("Processing standard container shutdown");
- // Notify our interested LifecycleListeners
- lifecycle.fireLifecycleEvent(STOP_EVENT, null);
- started = false;
+ // Finalize our character set mapper
+ setCharsetMapper(null);
- try {
+ // Normal container shutdown processing
+ if (log.isDebugEnabled())
+ log.debug("Processing standard container shutdown");
+ // Notify our interested LifecycleListeners
+ lifecycle.fireLifecycleEvent(STOP_EVENT, null);
+ started = false;
// Stop the Valves in our pipeline (including the basic), if any
if (pipeline instanceof Lifecycle) {