remm2003/07/22 11:51:22
Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java StandardContextValve.java
StandardWrapper.java StandardWrapperValve.java
Removed: catalina/src/share/org/apache/catalina/valves
RequestListenerValve.java
Log:
- Use the context logger for all webapp related error messages.
- Remove RequestListenerValve and merge into StandardContextValve.
This is a needed feature for servlet compliance, so this should be in the core.
- Note: maybe separate arrays should be introduced for the distinct listener
types, since some have a significant performance impact (such as
RequestAttributeListener). A lot of listener types were introduced in Servlet 2.4
and the original TC 4.0 design should probably be extended.
Revision ChangesPath
1.73 +15 -77
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
Index: StandardContext.java
===
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- StandardContext.java 21 Jul 2003 19:05:50 - 1.72
+++ StandardContext.java 22 Jul 2003 18:51:21 - 1.73
@@ -2845,13 +2845,6 @@
}
}
-// Create request listener valve
-if (ok) {
-if (!requestListenerConfig()) {
-
log.error(sm.getString(standardContext.requestListenerStartFailed));
-}
-}
-
// Restore the Welcome Files and Resources context attributes
postResources();
postWelcomeFiles();
@@ -3551,7 +3544,8 @@
(this, (FilterDef) filterDefs.get(name));
filterConfigs.put(name, filterConfig);
} catch (Throwable t) {
-log.error(sm.getString(standardContext.filterStart, name), t);
+getServletContext().log
+(sm.getString(standardContext.filterStart, name), t);
ok = false;
}
}
@@ -3626,8 +3620,9 @@
Class clazz = loader.loadClass(listeners[i]);
results[i] = clazz.newInstance();
} catch (Throwable t) {
-log.error(sm.getString(standardContext.applicationListener,
- listeners[i]), t);
+getServletContext().log
+(sm.getString(standardContext.applicationListener,
+ listeners[i]), t);
ok = false;
}
}
@@ -3660,8 +3655,9 @@
fireContainerEvent(afterContextInitialized, listener);
} catch (Throwable t) {
fireContainerEvent(afterContextInitialized, listener);
-log.error(sm.getString(standardContext.listenerStart,
- instances[i].getClass().getName()), t);
+getServletContext().log
+(sm.getString(standardContext.listenerStart,
+ instances[i].getClass().getName()), t);
ok = false;
}
}
@@ -3700,8 +3696,9 @@
fireContainerEvent(beforeContextDestroyed, listener);
} catch (Throwable t) {
fireContainerEvent(beforeContextDestroyed, listener);
-log.error(sm.getString(standardContext.listenerStop,
- listeners[j].getClass().getName()), t);
+getServletContext().log
+(sm.getString(standardContext.listenerStop,
+ listeners[j].getClass().getName()), t);
ok = false;
}
}
@@ -3828,8 +3825,9 @@
try {
wrapper.load();
} catch (ServletException e) {
-log.error(sm.getString(standardWrapper.loadException,
- getName()), e);
+getServletContext().log
+(sm.getString(standardWrapper.loadException,
+ getName()), e);
// NOTE: load errors (including a servlet that throws
// UnavailableException from tht init() method) are NOT
// fatal to application startup
@@ -4099,14 +4097,6 @@
}
}
-// Create request listener lifecycle valve
-if (ok) {
-if (!requestListenerConfig()) {
-log.error(sm.getString