Author: remy.maucherat(a)jboss.com
Date: 2009-04-16 12:22:37 -0400 (Thu, 16 Apr 2009)
New Revision: 1010
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Move TLD processing to the right place (where it should handle scanning of the other
stuff).
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2009-04-16 16:11:07 UTC (rev
1009)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2009-04-16 16:22:37 UTC (rev
1010)
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.EventListener;
@@ -94,7 +93,6 @@
import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.session.StandardManager;
import org.apache.catalina.startup.ContextConfig;
-import org.apache.catalina.startup.TldConfig;
import org.apache.catalina.util.CharsetMapper;
import org.apache.catalina.util.ExtensionValidator;
import org.apache.catalina.util.RequestUtil;
@@ -4030,10 +4028,6 @@
((Lifecycle) pipeline).start();
}
- if(getProcessTlds()) {
- processTlds();
- }
-
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(START_EVENT, null);
@@ -4236,41 +4230,6 @@
}
/**
- * Processes TLDs.
- *
- * @throws LifecycleException If an error occurs
- */
- protected void processTlds() throws LifecycleException {
- TldConfig tldConfig = new TldConfig();
- tldConfig.setContext(this);
-
- // (1) check if the attribute has been defined
- // on the context element.
- tldConfig.setTldValidation(tldValidation);
- tldConfig.setTldNamespaceAware(tldNamespaceAware);
-
- // (2) if the attribute wasn't defined on the context
- // try the host.
- if (!tldValidation) {
- tldConfig.setTldValidation
- (((StandardHost) getParent()).getXmlValidation());
- }
-
- if (!tldNamespaceAware) {
- tldConfig.setTldNamespaceAware
- (((StandardHost) getParent()).getXmlNamespaceAware());
- }
-
- try {
- tldConfig.execute();
- } catch (Exception ex) {
- log.error("Error reading tld listeners "
- + ex.toString(), ex);
- }
- }
-
-
- /**
* Stop this Context component.
*
* @exception LifecycleException if a shutdown error occurs
@@ -5369,23 +5328,8 @@
return tldValidation;
}
- /**
- * Sets the process TLDs attribute.
- *
- * @param newProcessTlds The new value
- */
- public void setProcessTlds(boolean newProcessTlds) {
- processTlds = newProcessTlds;
- }
/**
- * Returns the processTlds attribute value.
- */
- public boolean getProcessTlds() {
- return processTlds;
- }
-
- /**
* Get the server.xml <host> attribute's xmlNamespaceAware.
* @return true if namespace awarenes is enabled.
*/
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-16 16:11:07 UTC (rev
1009)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-16 16:22:37 UTC (rev
1010)
@@ -485,7 +485,7 @@
* Set up an Authenticator automatically if required, and one has not
* already been configured.
*/
- protected synchronized void authenticatorConfig() {
+ protected void authenticatorConfig() {
// Does this Context require an Authenticator?
SecurityConstraint constraints[] = context.findConstraints();
@@ -795,7 +795,42 @@
}
}
+
+ /**
+ * Process additional descriptors: TLDs, web fragments, and map overlays.
+ */
+ // FIXME: Processing of web fragments
+ // FIXME: Map overlays
+ protected void applicationExtraDescriptorsConfig() {
+ TldConfig tldConfig = new TldConfig();
+ tldConfig.setContext(context);
+ // (1) check if the attribute has been defined
+ // on the context element.
+ tldConfig.setTldValidation(context.getTldValidation());
+ tldConfig.setTldNamespaceAware(context.getTldNamespaceAware());
+
+ // (2) if the attribute wasn't defined on the context
+ // try the host.
+ if (!context.getTldValidation()) {
+ tldConfig.setTldValidation
+ (((StandardHost) context.getParent()).getXmlValidation());
+ }
+
+ if (!context.getTldNamespaceAware()) {
+ tldConfig.setTldNamespaceAware
+ (((StandardHost) context.getParent()).getXmlNamespaceAware());
+ }
+
+ try {
+ tldConfig.execute();
+ } catch (Exception ex) {
+ log.error("Error reading tld listeners "
+ + ex.toString(), ex);
+ }
+ }
+
+
/**
* Process the default configuration file, if it exists.
*/
@@ -1102,7 +1137,7 @@
/**
* Process a "before start" event for this Context.
*/
- protected synchronized void beforeStart() {
+ protected void beforeStart() {
antiLocking();
}
@@ -1110,7 +1145,7 @@
/**
* Process a "start" event for this Context.
*/
- protected synchronized void start() {
+ protected void start() {
// Called from StandardContext.start()
if (log.isDebugEnabled())
@@ -1138,8 +1173,9 @@
}
// Process the default and application web.xml files
- // FIXME: Processing of web fragments
defaultWebConfig();
+ // FIXME: look where to place it according to the merging rules
+ applicationExtraDescriptorsConfig();
applicationWebConfig();
if (!context.getIgnoreAnnotations()) {
applicationAnnotationsConfig();
@@ -1181,7 +1217,7 @@
/**
* Process a "stop" event for this Context.
*/
- protected synchronized void stop() {
+ protected void stop() {
if (log.isDebugEnabled())
log.debug(sm.getString("contextConfig.stop"));
@@ -1347,7 +1383,7 @@
/**
* Process a "destroy" event for this Context.
*/
- protected synchronized void destroy() {
+ protected void destroy() {
// Called from StandardContext.destroy()
if (log.isDebugEnabled())
log.debug(sm.getString("contextConfig.destroy"));
Show replies by date