JBossWeb SVN: r1039 - in trunk: java/org/apache/catalina/startup and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-30 13:50:00 -0400 (Thu, 30 Apr 2009)
New Revision: 1039
Modified:
trunk/PATCHES.txt
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/catalina/startup/LocalStrings.properties
trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
Log:
- Small cleanups.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2009-04-30 01:54:09 UTC (rev 1038)
+++ trunk/PATCHES.txt 2009-04-30 17:50:00 UTC (rev 1039)
@@ -64,3 +64,6 @@
765727
ETag should be identical regardless of how the entity is encoded, this patch "fixes" apparently broken proxies
+
+769979
+Does not hurt to unregister properly, but a JMX cleanup is redundant, so will see about it later
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-30 01:54:09 UTC (rev 1038)
+++ trunk/ROADMAP.txt 2009-04-30 17:50:00 UTC (rev 1039)
@@ -6,7 +6,7 @@
- Jasper plugin for TLD metadata
- Access control annotations
- Update digester XML parsing rules for web.xml updates (session tracking-mode, cookie-config, servlet enabled,
- servlets and filters async-supported)
+ servlets and filters async-supported, http-method-omission)
- Enforce web.xml fragments merging rules
- Lazy webapp startup valve
- Abstract JMX in custom modeler better
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-30 01:54:09 UTC (rev 1038)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-30 17:50:00 UTC (rev 1039)
@@ -442,6 +442,8 @@
}
}
+ // FIXME: It is likely this should be moved to after running all listeners,
+ // as they can add servlets or filters
WebAnnotationSet.loadApplicationAnnotations(context);
long t2=System.currentTimeMillis();
@@ -457,9 +459,6 @@
*/
protected void applicationWebConfig() {
- // FIXME: Parse web fragments here
- // FIXME: Parse according to the configured order
-
String altDDName = null;
// Open the application web.xml file, if it exists
@@ -1007,8 +1006,7 @@
}
}
} catch (Exception e) {
- // FIXME: error message
- log.error(sm.getString("contextConfig.applicationParse", jar), e);
+ log.error(sm.getString("contextConfig.fragmentOrderingParse", jar), e);
ok = false;
} finally {
try {
@@ -1024,16 +1022,14 @@
// Generate web fragments parsing order
LinkedList<String> order = new LinkedList<String>();
if (absoluteOrdering != null) {
- // Absolute ordering has been declared in web.xml,
- // any ordering from the fragments is ignored
+ // Absolute ordering from web.xml, any fragment ordering is ignored
List<String> fragmentNames = absoluteOrdering.getOrder();
int otherPos = -1;
for (int i = 0; i < fragmentNames.size(); i++) {
String fragmentName = fragmentNames.get(i);
if (fragmentName.equals("*")) {
if (otherPos >= 0) {
- // FIXME: error message
- log.error(sm.getString("contextConfig.applicationParse"));
+ log.error(sm.getString("contextConfig.invalidAbsoluteOrder"));
ok = false;
}
otherPos = i;
@@ -1053,8 +1049,11 @@
order.addAll(otherPos, jarsSet);
}
} else if (orderings.size() > 0) {
- // FIXME: Will use the ordering specified by the fragments, if any
+ // FIXME: Use the ordering specified by the fragments
+ } else {
+ // No order specified
+ order.addAll(jarsSet);
}
// Parse fragments according to order
@@ -1087,7 +1086,6 @@
}
}
} catch (Exception e) {
- // FIXME: error message
log.error(sm.getString("contextConfig.applicationParse", jar), e);
ok = false;
} finally {
@@ -1450,22 +1448,26 @@
try {
scanner.scan(context);
} catch (Throwable t) {
- // FIXME: error message
log.error(sm.getString("contextConfig.scan"), t);
ok = false;
}
- // FIXME: look where to place it according to the merging rules
+ // Scan the main descriptors
applicationWebConfig();
- // FIXME: Add overlays
- scanner.getOverlays();
+ // Parse fragments
if (!context.getIgnoreAnnotations()) {
applicationExtraDescriptorsConfig();
+ }
+ // Scan all Servlet API related annotations
+ if (!context.getIgnoreAnnotations()) {
applicationAnnotationsConfig();
}
if (ok) {
validateSecurityRoles();
}
+ // FIXME: Add overlays, and see about order
+ scanner.getOverlays();
+
// Invoke Servlet container initializer: instantiate and call onStartup
if (ok) {
Iterator<ServletContainerInitializerInfo> initializers =
Modified: trunk/java/org/apache/catalina/startup/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/catalina/startup/LocalStrings.properties 2009-04-30 01:54:09 UTC (rev 1038)
+++ trunk/java/org/apache/catalina/startup/LocalStrings.properties 2009-04-30 17:50:00 UTC (rev 1039)
@@ -20,11 +20,14 @@
contextConfig.defaultParse=Parse error in default web.xml
contextConfig.defaultPosition=Occurred at line {0} column {1}
contextConfig.fixDocBase=Exception fixing docBase: {0}
+contextConfig.fragmentOrderingParse=Failed to parse web fragment ordering for {0}
contextConfig.init=ContextConfig: Initializing
+contextConfig.invalidAbsoluteOrder=Invalid absolute order
contextConfig.missingRealm=No Realm has been configured to authenticate against
contextConfig.role.auth=WARNING: Security role name {0} used in an <auth-constraint> without being defined in a <security-role>
contextConfig.role.link=WARNING: Security role name {0} used in a <role-link> without being defined in a <security-role>
contextConfig.role.runas=WARNING: Security role name {0} used in a <run-as> without being defined in a <security-role>
+contextConfig.scan=Error scanning context resources
contextConfig.start=ContextConfig: Processing START
contextConfig.stop=ContextConfig: Processing STOP
contextConfig.tldEntryException=Exception processing TLD {0} in JAR at resource path {1} in context {2}
Modified: trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebAnnotationSet.java 2009-04-30 01:54:09 UTC (rev 1038)
+++ trunk/java/org/apache/catalina/startup/WebAnnotationSet.java 2009-04-30 17:50:00 UTC (rev 1039)
@@ -117,6 +117,8 @@
}
loadClassAnnotation(context, wrapper.getServletClass());
+
+ // FIXME: Parse the other access control annotations
/* Process RunAs annotation which can be only on servlets.
* Ref JSR 250, equivalent to the run-as element in
* the deployment descriptor
15 years, 10 months
JBossWeb SVN: r1038 - trunk/java/javax/servlet/annotation.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-29 21:54:09 -0400 (Wed, 29 Apr 2009)
New Revision: 1038
Modified:
trunk/java/javax/servlet/annotation/MultipartConfig.java
Log:
- Spec update.
Modified: trunk/java/javax/servlet/annotation/MultipartConfig.java
===================================================================
--- trunk/java/javax/servlet/annotation/MultipartConfig.java 2009-04-30 01:46:25 UTC (rev 1037)
+++ trunk/java/javax/servlet/annotation/MultipartConfig.java 2009-04-30 01:54:09 UTC (rev 1038)
@@ -41,10 +41,10 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MultipartConfig {
+
/**
* The directory location where files will be stored
*
@@ -55,13 +55,13 @@
* the maximum size allowed for files uploaded
*
*/
- int maxFileSize() default 0;
+ long maxFileSize() default 0L;
/**
* The maximum size of a multi-part/form-data request allowed
*
*/
- int maxRequestSize() default 0;
+ long maxRequestSize() default 0L;
/**
* The size threshold after which the file will be written to disk
15 years, 10 months
JBossWeb SVN: r1037 - in trunk: java/org/apache/catalina/startup and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-29 21:46:25 -0400 (Wed, 29 Apr 2009)
New Revision: 1037
Modified:
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/startup/BaseContextScanner.java
trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/tomcat/WarComponents.java
Log:
- Call onStartup.
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-29 17:23:16 UTC (rev 1036)
+++ trunk/ROADMAP.txt 2009-04-30 01:46:25 UTC (rev 1037)
@@ -1,24 +1,25 @@
Roadmap for JBoss Web 3.0
-Main development:
-- Update digester XML parsing rules for web.xml updates
-- web.xml fragments merging rules
-- web.xml fragments ordering
-- Resources overlay
-- Session tracking configuration
+Standalone:
+- Web fragments ordering
+- Resources overlay implementation
+- Jasper plugin for TLD metadata
- Access control annotations
-- Jasper plugin for TLD metadata
+- Update digester XML parsing rules for web.xml updates (session tracking-mode, cookie-config, servlet enabled,
+ servlets and filters async-supported)
+- Enforce web.xml fragments merging rules
- Lazy webapp startup valve
+- Abstract JMX in custom modeler better
- JSP 2.2 changes
- EL 1.1 changes
-- Setup standalone TCK environment for testing compliance with the new features
-- Javassist annotation scanning impl for JBoss Web standalone
-- Abstract JMX in custom modeler better
+
+JBoss AS:
+- JBoss Metadata parsing of .tld files (out of tree)
- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
-- JBoss Metadata parsing of .tld files (out of tree)
- Coordinate with AS 6 for annotation updates (out of tree)
Other:
+- Setup standalone TCK environment for testing compliance with the new features
- Diagnostic and monitoring features (provided by the jopr/JON agent, as JBoss Web standalone seems too
lightweight for embedded jopr/JON to make sense)
- .net support like the php support (looks ok, but PHP is hard to use, how would this be different ?)
Modified: trunk/java/org/apache/catalina/startup/BaseContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 17:23:16 UTC (rev 1036)
+++ trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-30 01:46:25 UTC (rev 1037)
@@ -112,15 +112,15 @@
protected ArrayList<String> overlays = new ArrayList<String>();
protected ArrayList<String> webFragments = new ArrayList<String>();
protected Map<String, Set<String>> TLDs = new HashMap<String, Set<String>>();
- protected Map<String, JarServletContainerInitializerService> jarServletContainerInitializerServices =
- new HashMap<String, JarServletContainerInitializerService>();
+ protected Map<String, ServletContainerInitializerInfo> servletContainerInitializerInfos =
+ new HashMap<String, ServletContainerInitializerInfo>();
/**
* Used to speed up scanning for the services interest classes.
*/
protected Class<?>[] handlesTypesArray = null;
- protected Map<Class<?>, JarServletContainerInitializerServiceImpl> handlesTypes =
- new HashMap<Class<?>, JarServletContainerInitializerServiceImpl>();
+ protected Map<Class<?>, ServletContainerInitializerInfoImpl> handlesTypes =
+ new HashMap<Class<?>, ServletContainerInitializerInfoImpl>();
public Iterator<Class<?>> getAnnotatedClasses() {
@@ -143,8 +143,8 @@
}
- public Map<String, JarServletContainerInitializerService> getJarServletContainerInitializerServices() {
- return jarServletContainerInitializerServices;
+ public Map<String, ServletContainerInitializerInfo> getServletContainerInitializerInfo() {
+ return servletContainerInitializerInfos;
}
@@ -298,9 +298,9 @@
}
}
// Add in jarService map, and add in the local map used to speed up lookups
- JarServletContainerInitializerServiceImpl jarServletContainerInitializerService =
- new JarServletContainerInitializerServiceImpl(servletContainerInitializerClass, handlesTypesArray);
- jarServletContainerInitializerServices.put(file.getName(), jarServletContainerInitializerService);
+ ServletContainerInitializerInfoImpl jarServletContainerInitializerService =
+ new ServletContainerInitializerInfoImpl(servletContainerInitializerClass, handlesTypesArray);
+ servletContainerInitializerInfos.put(file.getName(), jarServletContainerInitializerService);
if (typesArray != null) {
ArrayList<Class<?>> handlesTypesList = new ArrayList<Class<?>>();
if (handlesTypesArray != null) {
@@ -374,11 +374,11 @@
public abstract Class<?> scanClass(Context context, String className, File file, JarEntry entry);
- protected class JarServletContainerInitializerServiceImpl implements JarServletContainerInitializerService {
+ protected class ServletContainerInitializerInfoImpl implements ServletContainerInitializerInfo {
protected Class<?> servletContainerInitializer = null;
protected Class<?>[] interestClasses = null;
- protected HashSet<Class<?>> startupNotifySetSet = new HashSet<Class<?>>();
- protected JarServletContainerInitializerServiceImpl(Class<?> servletContainerInitializer, Class<?>[] interestClasses) {
+ protected HashSet<Class<?>> startupNotifySet = new HashSet<Class<?>>();
+ protected ServletContainerInitializerInfoImpl(Class<?> servletContainerInitializer, Class<?>[] interestClasses) {
this.servletContainerInitializer = servletContainerInitializer;
this.interestClasses = interestClasses;
}
@@ -389,10 +389,10 @@
return interestClasses;
}
protected void addStartupNotifySetSet(Class<?> clazz) {
- startupNotifySetSet.add(clazz);
+ startupNotifySet.add(clazz);
}
public Set<Class<?>> getStartupNotifySet() {
- return startupNotifySetSet;
+ return startupNotifySet;
}
}
Modified: trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-29 17:23:16 UTC (rev 1036)
+++ trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-30 01:46:25 UTC (rev 1037)
@@ -42,7 +42,7 @@
if (handlesTypesArray != null) {
for (int i = 0; i < handlesTypesArray.length; i++) {
if (handlesTypesArray[i].isAssignableFrom(clazz)) {
- JarServletContainerInitializerServiceImpl jarServletContainerInitializerService =
+ ServletContainerInitializerInfoImpl jarServletContainerInitializerService =
handlesTypes.get(handlesTypesArray[i]);
jarServletContainerInitializerService.addStartupNotifySetSet(clazz);
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-29 17:23:16 UTC (rev 1036)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-30 01:46:25 UTC (rev 1037)
@@ -65,8 +65,8 @@
import java.util.zip.ZipEntry;
import javax.servlet.DispatcherType;
+import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
-import javax.servlet.annotation.HandlesTypes;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
@@ -100,6 +100,7 @@
import org.apache.catalina.deploy.WebAbsoluteOrdering;
import org.apache.catalina.deploy.WebOrdering;
import org.apache.catalina.util.StringManager;
+import org.apache.tomcat.WarComponents.ServletContainerInitializerInfo;
import org.apache.tomcat.util.digester.Digester;
import org.apache.tomcat.util.digester.RuleSet;
import org.xml.sax.ErrorHandler;
@@ -1446,7 +1447,13 @@
// Process the default and application web.xml files
defaultWebConfig();
- scanner.scan(context);
+ try {
+ scanner.scan(context);
+ } catch (Throwable t) {
+ // FIXME: error message
+ log.error(sm.getString("contextConfig.scan"), t);
+ ok = false;
+ }
// FIXME: look where to place it according to the merging rules
applicationWebConfig();
// FIXME: Add overlays
@@ -1459,7 +1466,24 @@
validateSecurityRoles();
}
- // FIXME: Invoke Servlet container initializer: instantiate and call onStartup
+ // Invoke Servlet container initializer: instantiate and call onStartup
+ if (ok) {
+ Iterator<ServletContainerInitializerInfo> initializers =
+ scanner.getServletContainerInitializerInfo().values().iterator();
+ while (initializers.hasNext()) {
+ ServletContainerInitializerInfo service = initializers.next();
+ try {
+ ServletContainerInitializer servletContainerInitializer =
+ (ServletContainerInitializer) service.getServletContainerInitializer().newInstance();
+ servletContainerInitializer.onStartup(service.getStartupNotifySet(), context.getServletContext());
+ } catch (Throwable t) {
+ // FIXME: error message
+ log.error(sm.getString("contextConfig.servletContainerInitializer",
+ service.getServletContainerInitializer()), t);
+ ok = false;
+ }
+ }
+ }
// Configure an authenticator if we need one
if (ok)
Modified: trunk/java/org/apache/tomcat/WarComponents.java
===================================================================
--- trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 17:23:16 UTC (rev 1036)
+++ trunk/java/org/apache/tomcat/WarComponents.java 2009-04-30 01:46:25 UTC (rev 1037)
@@ -29,7 +29,7 @@
public interface WarComponents {
- public interface JarServletContainerInitializerService {
+ public interface ServletContainerInitializerInfo {
public Set<Class<?>> getStartupNotifySet();
public Class<?>[] getInterestClasses();
public Class<?> getServletContainerInitializer();
@@ -58,6 +58,6 @@
/**
* Find Jar services.
*/
- public Map<String, JarServletContainerInitializerService> getJarServletContainerInitializerServices();
+ public Map<String, ServletContainerInitializerInfo> getServletContainerInitializerInfo();
}
15 years, 10 months
JBossWeb SVN: r1036 - in trunk: java/org/apache/catalina/startup and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-29 13:23:16 -0400 (Wed, 29 Apr 2009)
New Revision: 1036
Modified:
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/startup/BaseContextScanner.java
trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/tomcat/WarComponents.java
Log:
- Fix types after looking at onStartup.
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-29 16:18:25 UTC (rev 1035)
+++ trunk/ROADMAP.txt 2009-04-29 17:23:16 UTC (rev 1036)
@@ -7,7 +7,6 @@
- Resources overlay
- Session tracking configuration
- Access control annotations
-- ServletContainerInitializer support
- Jasper plugin for TLD metadata
- Lazy webapp startup valve
- JSP 2.2 changes
Modified: trunk/java/org/apache/catalina/startup/BaseContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 16:18:25 UTC (rev 1035)
+++ trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 17:23:16 UTC (rev 1036)
@@ -170,59 +170,15 @@
if (jarRepository != null) {
JarFile[] jars = jarRepository.findJars();
for (int i = 0; i < jars.length; i++) {
- scanJar(context, jars[i]);
+ // FIXME: maybe add an option to do the full scan
+ scanSharedJar(context, jars[i]);
}
File[] explodedJars = jarRepository.findExplodedJars();
for (int i = 0; i < explodedJars.length; i++) {
- scanClasses(context, explodedJars[i], "");
+ // FIXME: maybe add an option to do the full scan
+ // scanClasses(context, explodedJars[i], "");
}
}
- /*
- ClassLoader loader = context.getLoader().getClassLoader().getParent();
- while (loader != null) {
- if (loader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader) loader).getURLs();
- for (int i=0; i<urls.length; i++) {
- // Expect file URLs, these are %xx encoded or not depending on
- // the class loader
- // This is definitely not as clean as using JAR URLs either
- // over file or the custom jndi handler, but a lot less
- // buggy overall
- File file = null;
- try {
- file = new File(urls[i].toURI());
- } catch (Exception e) {
- // Ignore, probably an unencoded char or non file URL,
- // attempt direct access
- file = new File(urls[i].getFile());
- }
- try {
- file = file.getCanonicalFile();
- } catch (IOException e) {
- // Ignore
- }
- if (!file.exists()) {
- continue;
- }
- String path = file.getAbsolutePath();
- if (!path.endsWith(".jar")) {
- continue;
- }
- // Scan all JARs from WEB-INF/lib, plus any shared JARs
- // that are not known not to contain any TLDs
- if (skipJars == null
- || !skipJars.contains(file.getName())) {
- try {
- scanJar(context, new JarFile(path));
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- }
- loader = loader.getParent();
- }
- */
HashSet<String> warTLDs = new HashSet<String>();
@@ -233,29 +189,6 @@
}
TLDs.put("", warTLDs);
- /*
- DirContext resources = context.getResources();
- DirContext webInfClasses = null;
- DirContext webInfLib = null;
-
- try {
- webInfClasses = (DirContext) resources.lookup("/WEB-INF/classes");
- } catch (Exception e) {
- // Ignore, /WEB-INF/classes not found, or not a folder
- }
- if (webInfClasses != null) {
- scanClasses(context, webInfClasses, "");
- }
-
- try {
- webInfLib = (DirContext) resources.lookup("/WEB-INF/lib");
- } catch (Exception e) {
- // Ignore, /WEB-INF/classes not found, or not a folder
- }
- if (webInfLib != null) {
- scanJars(context, webInfLib);
- }*/
-
}
@@ -319,88 +252,10 @@
/**
- * Scan folder containing class files.
+ * Scan all class files in the given shared JAR (shared JARs are not scanned for annotations, overlays,
+ * etc, as this would be a serious security risk).
*/
- /*
- public static void scanClasses(Context context, DirContext folder, String path) {
- try {
- NamingEnumeration<Binding> enumeration = folder.listBindings(path);
- while (enumeration.hasMore()) {
- Binding binding = enumeration.next();
- Object object = binding.getObject();
-
- if (object instanceof Resource) {
- // This is a class, so we should load it
- String className = getClassName(path + "/" + binding.getName());
- scanClass(context, className, (Resource) object, null, null);
- } else if (object instanceof DirContext) {
- scanClasses(context, folder, path + "/" + binding.getName());
- }
-
- }
- } catch (NamingException e) {
- // Ignore for now
- e.printStackTrace();
- }
- }*/
-
-
- /**
- * Scan folder containing JAR files.
- */
- //public void scanJars(Context context, DirContext folder) {
- /*if (context.getLoader().findLoaderRepositories() != null) {
- String[] repositories = context.getLoader().findLoaderRepositories();
- for (int i = 0; i < repositories.length; i++) {
- if (repositories[i].endsWith(".jar")) {
- try {
- scanJar(context, new JarFile(repositories[i]));
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- }*/
- /*else {
- try {
- NamingEnumeration<Binding> enumeration = folder.listBindings("");
- while (enumeration.hasMore()) {
- Binding binding = enumeration.next();
- Object object = binding.getObject();
-
- if (object instanceof Resource && binding.getName().endsWith(".jar")) {
- // This is normally a JAR, put it in the work folder
- File destDir = null;
- File workDir =
- (File) context.getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
- destDir = new File(workDir, "WEB-INF/lib");
- destDir.mkdirs();
- File destFile = new File(destDir, binding.getName());
-
- scanJar(context, (Resource) object);
- }
-
- }
- } catch (NamingException e) {
- // Ignore for now
- e.printStackTrace();
- }
- }*/
- //}
-
-
- /**
- * Scan all class files in the given JAR.
- */
- public void scanJar(Context context, JarFile file) {
- // Find webapp descriptor fragments
- if (file.getEntry(Globals.WEB_FRAGMENT_PATH) != null) {
- webFragments.add(file.getName());
- }
- // Find webapp overlays
- if (file.getEntry(Globals.OVERLAY_PATH) != null) {
- overlays.add(file.getName());
- }
+ public void scanSharedJar(Context context, JarFile file) {
// Find ServletContainerInitializer services
JarEntry servletContainerInitializerEntry = file.getJarEntry(Globals.SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH);
String servletContainerInitializerClassName = null;
@@ -460,6 +315,23 @@
handlesTypesArray = handlesTypesList.toArray(handlesTypesArray);
}
}
+ }
+
+
+ /**
+ * Scan all class files in the given JAR.
+ */
+ public void scanJar(Context context, JarFile file) {
+ // Find webapp descriptor fragments
+ if (file.getEntry(Globals.WEB_FRAGMENT_PATH) != null) {
+ webFragments.add(file.getName());
+ }
+ // Find webapp overlays
+ if (file.getEntry(Globals.OVERLAY_PATH) != null) {
+ overlays.add(file.getName());
+ }
+ // Find ServletContainerInitializer services
+ scanSharedJar(context, file);
// Find tag library descriptors
HashSet<String> jarTLDs = new HashSet<String>();
Enumeration<JarEntry> entries = file.entries();
@@ -505,7 +377,7 @@
protected class JarServletContainerInitializerServiceImpl implements JarServletContainerInitializerService {
protected Class<?> servletContainerInitializer = null;
protected Class<?>[] interestClasses = null;
- protected HashSet<String> interestClassNames = new HashSet<String>();
+ protected HashSet<Class<?>> startupNotifySetSet = new HashSet<Class<?>>();
protected JarServletContainerInitializerServiceImpl(Class<?> servletContainerInitializer, Class<?>[] interestClasses) {
this.servletContainerInitializer = servletContainerInitializer;
this.interestClasses = interestClasses;
@@ -516,11 +388,11 @@
public Class<?>[] getInterestClasses() {
return interestClasses;
}
- protected void addInterestClassName(String className) {
- interestClassNames.add(className);
+ protected void addStartupNotifySetSet(Class<?> clazz) {
+ startupNotifySetSet.add(clazz);
}
- public String[] getInterestClassesArray() {
- return interestClassNames.toArray(new String[0]);
+ public Set<Class<?>> getStartupNotifySet() {
+ return startupNotifySetSet;
}
}
Modified: trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-29 16:18:25 UTC (rev 1035)
+++ trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-29 17:23:16 UTC (rev 1036)
@@ -44,7 +44,7 @@
if (handlesTypesArray[i].isAssignableFrom(clazz)) {
JarServletContainerInitializerServiceImpl jarServletContainerInitializerService =
handlesTypes.get(handlesTypesArray[i]);
- jarServletContainerInitializerService.addInterestClassName(clazz.getName());
+ jarServletContainerInitializerService.addStartupNotifySetSet(clazz);
}
}
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-29 16:18:25 UTC (rev 1035)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-29 17:23:16 UTC (rev 1036)
@@ -1459,7 +1459,7 @@
validateSecurityRoles();
}
- // FIXME: Invoke Servlet container initializer
+ // FIXME: Invoke Servlet container initializer: instantiate and call onStartup
// Configure an authenticator if we need one
if (ok)
Modified: trunk/java/org/apache/tomcat/WarComponents.java
===================================================================
--- trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 16:18:25 UTC (rev 1035)
+++ trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 17:23:16 UTC (rev 1036)
@@ -30,7 +30,7 @@
public interface WarComponents {
public interface JarServletContainerInitializerService {
- public String[] getInterestClassesArray();
+ public Set<Class<?>> getStartupNotifySet();
public Class<?>[] getInterestClasses();
public Class<?> getServletContainerInitializer();
}
15 years, 10 months
JBossWeb SVN: r1035 - in trunk/java/org/apache: tomcat and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-29 12:18:25 -0400 (Wed, 29 Apr 2009)
New Revision: 1035
Modified:
trunk/java/org/apache/catalina/startup/BaseContextScanner.java
trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/tomcat/WarComponents.java
Log:
- Do the scanning code for ServletContainerInitializer.
Modified: trunk/java/org/apache/catalina/startup/BaseContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 02:01:44 UTC (rev 1034)
+++ trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 16:18:25 UTC (rev 1035)
@@ -23,7 +23,11 @@
package org.apache.catalina.startup;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -38,12 +42,12 @@
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
+import javax.servlet.annotation.HandlesTypes;
import org.apache.catalina.Context;
import org.apache.catalina.ContextScanner;
import org.apache.catalina.Globals;
import org.apache.catalina.JarRepository;
-import org.apache.tomcat.WarComponents.JarServletContainerInitializerService;
public abstract class BaseContextScanner
implements ContextScanner {
@@ -108,15 +112,15 @@
protected ArrayList<String> overlays = new ArrayList<String>();
protected ArrayList<String> webFragments = new ArrayList<String>();
protected Map<String, Set<String>> TLDs = new HashMap<String, Set<String>>();
- protected Map<String, JarServletContainerInitializerService> jarServletContainerInitializerService =
+ protected Map<String, JarServletContainerInitializerService> jarServletContainerInitializerServices =
new HashMap<String, JarServletContainerInitializerService>();
/**
* Used to speed up scanning for the services interest classes.
*/
protected Class<?>[] handlesTypesArray = null;
- protected Map<Class<?>, JarServletContainerInitializerService> handlesTypes =
- new HashMap<Class<?>, JarServletContainerInitializerService>();
+ protected Map<Class<?>, JarServletContainerInitializerServiceImpl> handlesTypes =
+ new HashMap<Class<?>, JarServletContainerInitializerServiceImpl>();
public Iterator<Class<?>> getAnnotatedClasses() {
@@ -140,7 +144,7 @@
public Map<String, JarServletContainerInitializerService> getJarServletContainerInitializerServices() {
- return jarServletContainerInitializerService;
+ return jarServletContainerInitializerServices;
}
@@ -389,20 +393,74 @@
* Scan all class files in the given JAR.
*/
public void scanJar(Context context, JarFile file) {
+ // Find webapp descriptor fragments
if (file.getEntry(Globals.WEB_FRAGMENT_PATH) != null) {
webFragments.add(file.getName());
}
+ // Find webapp overlays
if (file.getEntry(Globals.OVERLAY_PATH) != null) {
overlays.add(file.getName());
}
- if (file.getEntry(Globals.SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH) != null) {
- // FIXME: Read Servlet container initializer service file
-
- // FIXME: Load Servlet container initializer class and read HandlesTypes annotation
-
- // FIXME: Add in jarService map, and add in the local map used to speed up lookups
-
+ // Find ServletContainerInitializer services
+ JarEntry servletContainerInitializerEntry = file.getJarEntry(Globals.SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH);
+ String servletContainerInitializerClassName = null;
+ if (servletContainerInitializerEntry != null) {
+ // Read Servlet container initializer service file
+ InputStream is = null;
+ try {
+ is = file.getInputStream(servletContainerInitializerEntry);
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+ servletContainerInitializerClassName = reader.readLine();
+ int pos = servletContainerInitializerClassName.indexOf('#');
+ if (pos > 0) {
+ servletContainerInitializerClassName = servletContainerInitializerClassName.substring(0, pos);
+ }
+ servletContainerInitializerClassName = servletContainerInitializerClassName.trim();
+ } catch (Exception e) {
+ // FIXME: error message or exception
+ } finally {
+ try {
+ if (is != null) {
+ is.close();
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ // Load Servlet container initializer class and read HandlesTypes annotation
+ Class<?> servletContainerInitializerClass = null;
+ Class<?>[] typesArray = null;
+ if (servletContainerInitializerClassName != null) {
+ try {
+ servletContainerInitializerClass = context.getLoader().getClassLoader()
+ .loadClass(servletContainerInitializerClassName);
+ if (servletContainerInitializerClass.isAnnotationPresent(HandlesTypes.class)) {
+ HandlesTypes handlesTypes = servletContainerInitializerClass.getAnnotation(HandlesTypes.class);
+ typesArray = handlesTypes.value();
+ }
+ } catch (Throwable t) {
+ // FIXME: error message or exception
+ }
+ }
+ // Add in jarService map, and add in the local map used to speed up lookups
+ JarServletContainerInitializerServiceImpl jarServletContainerInitializerService =
+ new JarServletContainerInitializerServiceImpl(servletContainerInitializerClass, handlesTypesArray);
+ jarServletContainerInitializerServices.put(file.getName(), jarServletContainerInitializerService);
+ if (typesArray != null) {
+ ArrayList<Class<?>> handlesTypesList = new ArrayList<Class<?>>();
+ if (handlesTypesArray != null) {
+ for (int i = 0; i < handlesTypesArray.length; i++) {
+ handlesTypesList.add(handlesTypesArray[i]);
+ }
+ }
+ for (int i = 0; i < typesArray.length; i++) {
+ handlesTypesList.add(typesArray[i]);
+ handlesTypes.put(typesArray[i], jarServletContainerInitializerService);
+ }
+ handlesTypesArray = handlesTypesList.toArray(handlesTypesArray);
+ }
}
+ // Find tag library descriptors
HashSet<String> jarTLDs = new HashSet<String>();
Enumeration<JarEntry> entries = file.entries();
while (entries.hasMoreElements()) {
@@ -444,4 +502,27 @@
public abstract Class<?> scanClass(Context context, String className, File file, JarEntry entry);
+ protected class JarServletContainerInitializerServiceImpl implements JarServletContainerInitializerService {
+ protected Class<?> servletContainerInitializer = null;
+ protected Class<?>[] interestClasses = null;
+ protected HashSet<String> interestClassNames = new HashSet<String>();
+ protected JarServletContainerInitializerServiceImpl(Class<?> servletContainerInitializer, Class<?>[] interestClasses) {
+ this.servletContainerInitializer = servletContainerInitializer;
+ this.interestClasses = interestClasses;
+ }
+ public Class<?> getServletContainerInitializer() {
+ return servletContainerInitializer;
+ }
+ public Class<?>[] getInterestClasses() {
+ return interestClasses;
+ }
+ protected void addInterestClassName(String className) {
+ interestClassNames.add(className);
+ }
+ public String[] getInterestClassesArray() {
+ return interestClassNames.toArray(new String[0]);
+ }
+ }
+
+
}
Modified: trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-29 02:01:44 UTC (rev 1034)
+++ trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-29 16:18:25 UTC (rev 1035)
@@ -39,6 +39,15 @@
// Load the class using the classloader, and see if it implements one of the web annotations
try {
Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
+ if (handlesTypesArray != null) {
+ for (int i = 0; i < handlesTypesArray.length; i++) {
+ if (handlesTypesArray[i].isAssignableFrom(clazz)) {
+ JarServletContainerInitializerServiceImpl jarServletContainerInitializerService =
+ handlesTypes.get(handlesTypesArray[i]);
+ jarServletContainerInitializerService.addInterestClassName(clazz.getName());
+ }
+ }
+ }
if (clazz.isAnnotationPresent(MultipartConfig.class)
|| clazz.isAnnotationPresent(WebFilter.class)
|| clazz.isAnnotationPresent(WebInitParam.class)
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-29 02:01:44 UTC (rev 1034)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-29 16:18:25 UTC (rev 1035)
@@ -1459,6 +1459,8 @@
validateSecurityRoles();
}
+ // FIXME: Invoke Servlet container initializer
+
// Configure an authenticator if we need one
if (ok)
authenticatorConfig();
Modified: trunk/java/org/apache/tomcat/WarComponents.java
===================================================================
--- trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 02:01:44 UTC (rev 1034)
+++ trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 16:18:25 UTC (rev 1035)
@@ -30,7 +30,7 @@
public interface WarComponents {
public interface JarServletContainerInitializerService {
- public String[] getInterestClasseNames();
+ public String[] getInterestClassesArray();
public Class<?>[] getInterestClasses();
public Class<?> getServletContainerInitializer();
}
15 years, 10 months
JBossWeb SVN: r1034 - in trunk: java/org/apache/catalina and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-28 22:01:44 -0400 (Tue, 28 Apr 2009)
New Revision: 1034
Modified:
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/Globals.java
trunk/java/org/apache/catalina/startup/BaseContextScanner.java
trunk/java/org/apache/tomcat/WarComponents.java
Log:
- Add the layout for the shared lib support.
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-28 15:44:44 UTC (rev 1033)
+++ trunk/ROADMAP.txt 2009-04-29 02:01:44 UTC (rev 1034)
@@ -14,6 +14,7 @@
- EL 1.1 changes
- Setup standalone TCK environment for testing compliance with the new features
- Javassist annotation scanning impl for JBoss Web standalone
+- Abstract JMX in custom modeler better
- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
- JBoss Metadata parsing of .tld files (out of tree)
- Coordinate with AS 6 for annotation updates (out of tree)
Modified: trunk/java/org/apache/catalina/Globals.java
===================================================================
--- trunk/java/org/apache/catalina/Globals.java 2009-04-28 15:44:44 UTC (rev 1033)
+++ trunk/java/org/apache/catalina/Globals.java 2009-04-29 02:01:44 UTC (rev 1034)
@@ -354,6 +354,14 @@
/**
+ * The path used for the ServletContainerInitializer service.
+ */
+ public static final String SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH =
+ System.getProperty("org.apache.catalina.SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH",
+ "/META-INF/services/javax.servlet.ServletContainerInitializer");
+
+
+ /**
* The master flag which controls XML validation.
*/
public static final boolean XML_VALIDATION =
Modified: trunk/java/org/apache/catalina/startup/BaseContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-28 15:44:44 UTC (rev 1033)
+++ trunk/java/org/apache/catalina/startup/BaseContextScanner.java 2009-04-29 02:01:44 UTC (rev 1034)
@@ -43,6 +43,7 @@
import org.apache.catalina.ContextScanner;
import org.apache.catalina.Globals;
import org.apache.catalina.JarRepository;
+import org.apache.tomcat.WarComponents.JarServletContainerInitializerService;
public abstract class BaseContextScanner
implements ContextScanner {
@@ -107,8 +108,17 @@
protected ArrayList<String> overlays = new ArrayList<String>();
protected ArrayList<String> webFragments = new ArrayList<String>();
protected Map<String, Set<String>> TLDs = new HashMap<String, Set<String>>();
+ protected Map<String, JarServletContainerInitializerService> jarServletContainerInitializerService =
+ new HashMap<String, JarServletContainerInitializerService>();
+ /**
+ * Used to speed up scanning for the services interest classes.
+ */
+ protected Class<?>[] handlesTypesArray = null;
+ protected Map<Class<?>, JarServletContainerInitializerService> handlesTypes =
+ new HashMap<Class<?>, JarServletContainerInitializerService>();
+
public Iterator<Class<?>> getAnnotatedClasses() {
return annotatedClasses.iterator();
}
@@ -129,6 +139,11 @@
}
+ public Map<String, JarServletContainerInitializerService> getJarServletContainerInitializerServices() {
+ return jarServletContainerInitializerService;
+ }
+
+
/**
* Scan the given context's default locations for annotations.
*
@@ -380,6 +395,14 @@
if (file.getEntry(Globals.OVERLAY_PATH) != null) {
overlays.add(file.getName());
}
+ if (file.getEntry(Globals.SERVLET_CONTAINER_INITIALIZER_SERVICE_PATH) != null) {
+ // FIXME: Read Servlet container initializer service file
+
+ // FIXME: Load Servlet container initializer class and read HandlesTypes annotation
+
+ // FIXME: Add in jarService map, and add in the local map used to speed up lookups
+
+ }
HashSet<String> jarTLDs = new HashSet<String>();
Enumeration<JarEntry> entries = file.entries();
while (entries.hasMoreElements()) {
Modified: trunk/java/org/apache/tomcat/WarComponents.java
===================================================================
--- trunk/java/org/apache/tomcat/WarComponents.java 2009-04-28 15:44:44 UTC (rev 1033)
+++ trunk/java/org/apache/tomcat/WarComponents.java 2009-04-29 02:01:44 UTC (rev 1034)
@@ -29,27 +29,35 @@
public interface WarComponents {
+ public interface JarServletContainerInitializerService {
+ public String[] getInterestClasseNames();
+ public Class<?>[] getInterestClasses();
+ public Class<?> getServletContainerInitializer();
+ }
+
/**
* Find annotated classes for this context.
*/
public Iterator<Class<?>> getAnnotatedClasses();
-
/**
* Find JAR files containing an overlay.
*/
public Iterator<String> getOverlays();
-
/**
* Find JAR files containing a web fragment.
*/
public Iterator<String> getWebFragments();
-
/**
* Find TLDs.
*/
public Map<String, Set<String>> getTLDs();
+ /**
+ * Find Jar services.
+ */
+ public Map<String, JarServletContainerInitializerService> getJarServletContainerInitializerServices();
+
}
15 years, 10 months
JBossWeb SVN: r1033 - trunk/java/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-28 11:44:44 -0400 (Tue, 28 Apr 2009)
New Revision: 1033
Modified:
trunk/java/org/apache/catalina/startup/WebRuleSet.java
Log:
- Fix oops.
Modified: trunk/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-26 03:30:07 UTC (rev 1032)
+++ trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-28 15:44:44 UTC (rev 1033)
@@ -272,7 +272,7 @@
digester.addRule(prefix + elementName + "/servlet",
new WrapperCreateRule());
- digester.addSetNext(prefix + "/servlet",
+ digester.addSetNext(prefix + elementName + "/servlet",
"addChild",
"org.apache.catalina.Container");
15 years, 10 months
JBossWeb SVN: r1032 - in trunk: java/org/apache/catalina/startup and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-25 23:30:07 -0400 (Sat, 25 Apr 2009)
New Revision: 1032
Modified:
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/catalina/startup/WebOrderingRuleSet.java
trunk/java/org/apache/catalina/startup/WebRuleSet.java
Log:
- Basic fragment parsing.
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-25 16:43:39 UTC (rev 1031)
+++ trunk/ROADMAP.txt 2009-04-26 03:30:07 UTC (rev 1032)
@@ -2,7 +2,7 @@
Main development:
- Update digester XML parsing rules for web.xml updates
-- web.xml fragments scanning and merging rules
+- web.xml fragments merging rules
- web.xml fragments ordering
- Resources overlay
- Session tracking configuration
Modified: trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-25 16:43:39 UTC (rev 1031)
+++ trunk/java/org/apache/catalina/startup/ClassLoadingContextScanner.java 2009-04-26 03:30:07 UTC (rev 1032)
@@ -21,7 +21,6 @@
import java.io.File;
import java.util.jar.JarEntry;
-import javax.servlet.annotation.HandlesTypes;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
@@ -40,8 +39,7 @@
// Load the class using the classloader, and see if it implements one of the web annotations
try {
Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
- if (clazz.isAnnotationPresent(HandlesTypes.class)
- || clazz.isAnnotationPresent(MultipartConfig.class)
+ if (clazz.isAnnotationPresent(MultipartConfig.class)
|| clazz.isAnnotationPresent(WebFilter.class)
|| clazz.isAnnotationPresent(WebInitParam.class)
|| clazz.isAnnotationPresent(WebListener.class)
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-25 16:43:39 UTC (rev 1031)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-26 03:30:07 UTC (rev 1032)
@@ -54,7 +54,9 @@
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -375,10 +377,6 @@
// Add init param
context.addParameter(annotation.name(), annotation.value());
}
- if (clazz.isAnnotationPresent(HandlesTypes.class)) {
- HandlesTypes annotation = clazz.getAnnotation(HandlesTypes.class);
- // FIXME: Ok, this is complex ....
- }
if (clazz.isAnnotationPresent(MultipartConfig.class)) {
MultipartConfig annotation = clazz.getAnnotation(MultipartConfig.class);
// FIXME: Do something ....
@@ -979,10 +977,12 @@
WebAbsoluteOrdering absoluteOrdering = context.getWebAbsoluteOrdering();
List<WebOrdering> orderings = new ArrayList<WebOrdering>();
Iterator<String> jarsWithWebFragments = scanner.getWebFragments();
+ HashSet<String> jarsSet = new HashSet<String>();
// Parse the ordering defined in web fragments
- while ((absoluteOrdering == null) && jarsWithWebFragments.hasNext()) {
+ while (jarsWithWebFragments.hasNext()) {
String jar = jarsWithWebFragments.next();
+ jarsSet.add(jar);
JarFile jarFile = null;
InputStream is = null;
try {
@@ -1020,18 +1020,86 @@
}
}
- // FIXME: Generate web fragments parsing order
+ // Generate web fragments parsing order
+ LinkedList<String> order = new LinkedList<String>();
if (absoluteOrdering != null) {
-
+ // Absolute ordering has been declared in web.xml,
+ // any ordering from the fragments is ignored
+ List<String> fragmentNames = absoluteOrdering.getOrder();
+ int otherPos = -1;
+ for (int i = 0; i < fragmentNames.size(); i++) {
+ String fragmentName = fragmentNames.get(i);
+ if (fragmentName.equals("*")) {
+ if (otherPos >= 0) {
+ // FIXME: error message
+ log.error(sm.getString("contextConfig.applicationParse"));
+ ok = false;
+ }
+ otherPos = i;
+ } else {
+ Iterator<WebOrdering> orderingsIterator = orderings.iterator();
+ while (orderingsIterator.hasNext()) {
+ WebOrdering ordering = orderingsIterator.next();
+ if (fragmentName.equals(ordering.getName())) {
+ order.add(ordering.getJar());
+ jarsSet.remove(ordering.getJar());
+ break;
+ }
+ }
+ }
+ }
+ if (otherPos >= 0) {
+ order.addAll(otherPos, jarsSet);
+ }
} else if (orderings.size() > 0) {
+ // FIXME: Will use the ordering specified by the fragments, if any
}
- // FIXME: Parse fragments according to order
+ // Parse fragments according to order
+ // FIXME: Merging rules
+ Iterator<String> orderIterator = order.iterator();
+ while (orderIterator.hasNext()) {
+ String jar = orderIterator.next();
+ JarFile jarFile = null;
+ InputStream is = null;
+ try {
+ jarFile = jarRepository.findJar(jar);
+ ZipEntry entry = jarFile.getEntry(Globals.WEB_FRAGMENT_PATH);
+ if (entry != null) {
+ is = jarFile.getInputStream(entry);
+ InputSource input = new InputSource((new File(jar)).toURI().toURL().toExternalForm());
+ input.setByteStream(is);
+ synchronized (webFragmentDigester) {
+ try {
+ webFragmentDigester.push(context);
+ webFragmentDigester.setErrorHandler(new ContextErrorHandler());
+ webFragmentDigester.parse(input);
+ if (parseException != null) {
+ ok = false;
+ }
+ } finally {
+ webFragmentDigester.reset();
+ webFragmentRuleSet.recycle();
+ parseException = null;
+ }
+ }
+ }
+ } catch (Exception e) {
+ // FIXME: error message
+ log.error(sm.getString("contextConfig.applicationParse", jar), e);
+ ok = false;
+ } finally {
+ try {
+ if (is != null) {
+ is.close();
+ }
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
-
- // FIXME: Add overlays
- scanner.getOverlays();
}
@@ -1381,8 +1449,10 @@
scanner.scan(context);
// FIXME: look where to place it according to the merging rules
applicationWebConfig();
- applicationExtraDescriptorsConfig();
+ // FIXME: Add overlays
+ scanner.getOverlays();
if (!context.getIgnoreAnnotations()) {
+ applicationExtraDescriptorsConfig();
applicationAnnotationsConfig();
}
if (ok) {
Modified: trunk/java/org/apache/catalina/startup/WebOrderingRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebOrderingRuleSet.java 2009-04-25 16:43:39 UTC (rev 1031)
+++ trunk/java/org/apache/catalina/startup/WebOrderingRuleSet.java 2009-04-26 03:30:07 UTC (rev 1032)
@@ -100,7 +100,7 @@
"addBefore", 0);
digester.addRule(prefix + "web-app/ordering/after/others",
new AddOthersAfterRule());
- digester.addRule(prefix + "web-app/ordering/before/name",
+ digester.addRule(prefix + "web-app/ordering/before/others",
new AddOthersBeforeRule());
}
@@ -109,14 +109,14 @@
public void begin(String namespace, String name, Attributes attributes)
throws Exception {
WebOrdering ordering = (WebOrdering) digester.peek();
- ordering.addAfter("");
+ ordering.addAfter("*");
}
}
final class AddOthersBeforeRule extends Rule {
public void begin(String namespace, String name, Attributes attributes)
throws Exception {
WebOrdering ordering = (WebOrdering) digester.peek();
- ordering.addBefore("");
+ ordering.addBefore("*");
}
}
}
Modified: trunk/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-25 16:43:39 UTC (rev 1031)
+++ trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-26 03:30:07 UTC (rev 1032)
@@ -940,7 +940,7 @@
public void begin(String namespace, String name, Attributes attributes)
throws Exception {
WebAbsoluteOrdering ordering = (WebAbsoluteOrdering) digester.peek();
- ordering.addName("");
+ ordering.addName("*");
}
}
15 years, 10 months
JBossWeb SVN: r1031 - in trunk: java/org/apache/catalina and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-25 12:43:39 -0400 (Sat, 25 Apr 2009)
New Revision: 1031
Removed:
trunk/java/org/apache/catalina/startup/WebAbsoluteOrderingRuleSet.java
Modified:
trunk/ROADMAP.txt
trunk/java/org/apache/catalina/Context.java
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/catalina/startup/WebRuleSet.java
trunk/webapps/docs/changelog.xml
Log:
- Determine that only one scan pass was needed for web.xml (very good).
- Add fragment support to the rule set (in theory).
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/ROADMAP.txt 2009-04-25 16:43:39 UTC (rev 1031)
@@ -8,9 +8,10 @@
- Session tracking configuration
- Access control annotations
- ServletContainerInitializer support
+- Jasper plugin for TLD metadata
+- Lazy webapp startup valve
- JSP 2.2 changes
- EL 1.1 changes
-- Jasper plugin for TLD metadata
- Setup standalone TCK environment for testing compliance with the new features
- Javassist annotation scanning impl for JBoss Web standalone
- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
Modified: trunk/java/org/apache/catalina/Context.java
===================================================================
--- trunk/java/org/apache/catalina/Context.java 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/java/org/apache/catalina/Context.java 2009-04-25 16:43:39 UTC (rev 1031)
@@ -29,6 +29,7 @@
import org.apache.catalina.deploy.NamingResources;
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.deploy.SessionCookie;
+import org.apache.catalina.deploy.WebAbsoluteOrdering;
import org.apache.catalina.util.CharsetMapper;
import org.apache.tomcat.util.http.mapper.Mapper;
@@ -69,17 +70,21 @@
/**
- * Return the set of initialized application event listener objects,
- * in the order they were specified in the web application deployment
- * descriptor, for this application.
- *
- * @exception IllegalStateException if this method is called before
- * this application has started, or after it has been stopped
+ * Return the absolute ordering that is configured for this context, or
+ * null if no absolute ordering has been defined.
*/
- public Object[] getApplicationEventListeners();
+ public WebAbsoluteOrdering getWebAbsoluteOrdering();
/**
+ * Set the absolute ordering for this context.
+ *
+ * @param webAbsoluteOrdering the new absolute ordering for this context
+ */
+ public void setWebAbsoluteOrdering(WebAbsoluteOrdering webAbsoluteOrdering);
+
+
+ /**
* Return the authenticator that is configured for this context, or
* null if no authenticator has been configured.
*/
@@ -95,6 +100,17 @@
/**
+ * Return the set of initialized application event listener objects,
+ * in the order they were specified in the web application deployment
+ * descriptor, for this application.
+ *
+ * @exception IllegalStateException if this method is called before
+ * this application has started, or after it has been stopped
+ */
+ public Object[] getApplicationEventListeners();
+
+
+ /**
* Store the set of initialized application event listener objects,
* in the order they were specified in the web application deployment
* descriptor, for this application.
@@ -304,6 +320,20 @@
/**
+ * Return the logical name for this web application.
+ */
+ public String getLogicalName();
+
+
+ /**
+ * Set the logical name for this web application.
+ *
+ * @param logicalName The new logical name
+ */
+ public void setLogicalName(String logicalName);
+
+
+ /**
* Return the login configuration descriptor for this web application.
*/
public LoginConfig getLoginConfig();
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2009-04-25 16:43:39 UTC (rev 1031)
@@ -90,6 +90,7 @@
import org.apache.catalina.deploy.SecurityCollection;
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.deploy.SessionCookie;
+import org.apache.catalina.deploy.WebAbsoluteOrdering;
import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.session.StandardManager;
import org.apache.catalina.startup.ContextConfig;
@@ -237,6 +238,11 @@
protected Authenticator authenticator = null;
/**
+ * The absolute ordering used for this Context.
+ */
+ protected WebAbsoluteOrdering webAbsoluteOrdering = null;
+
+ /**
* The application available flag for this Context.
*/
protected boolean available = false;
@@ -415,6 +421,12 @@
/**
+ * The logical name of the webapp, if any which may be used in other descriptors.
+ */
+ protected String logicalName = null;
+
+
+ /**
* The login configuration descriptor for this web application.
*/
protected LoginConfig loginConfig = null;
@@ -958,6 +970,28 @@
/**
+ * Return the absolute ordering that is configured for this context, or
+ * null if no absolute ordering has been defined.
+ */
+ public WebAbsoluteOrdering getWebAbsoluteOrdering() {
+ return webAbsoluteOrdering;
+ }
+
+
+ /**
+ * Set the absolute ordering for this context.
+ *
+ * @param webAbsoluteOrdering the new absolute ordering for this context
+ */
+ public void setWebAbsoluteOrdering(WebAbsoluteOrdering webAbsoluteOrdering) {
+ WebAbsoluteOrdering oldWebAbsoluteOrdering = this.webAbsoluteOrdering;
+ this.webAbsoluteOrdering = webAbsoluteOrdering;
+ support.firePropertyChange("webAbsoluteOrdering", oldWebAbsoluteOrdering,
+ this.webAbsoluteOrdering);
+ }
+
+
+ /**
* Return the application authenticator for this Context.
*/
public Authenticator getAuthenticator() {
@@ -1382,6 +1416,26 @@
/**
+ * Return the logical name for this web application.
+ */
+ public String getLogicalName() {
+ return logicalName;
+ }
+
+
+ /**
+ * Set the logical name for this web application.
+ *
+ * @param logicalName The new logical name
+ */
+ public void setLogicalName(String logicalName) {
+ String oldLogicalName = this.logicalName;
+ this.logicalName = logicalName;
+ support.firePropertyChange("logicalName", oldLogicalName, logicalName);
+ }
+
+
+ /**
* Return the login configuration descriptor for this web application.
*/
public LoginConfig getLoginConfig() {
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-04-25 16:43:39 UTC (rev 1031)
@@ -78,6 +78,7 @@
import org.apache.catalina.Engine;
import org.apache.catalina.Globals;
import org.apache.catalina.Host;
+import org.apache.catalina.JarRepository;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
@@ -193,6 +194,13 @@
/**
+ * The <code>Digester</code> we will use to process web application
+ * fragment descriptor files.
+ */
+ protected static Digester webFragmentDigester = null;
+
+
+ /**
* The <code>Digester</code> we will use to process tag library
* descriptor files.
*/
@@ -212,12 +220,18 @@
/**
- * The <code>Rule</code> used to parse the web.xml
+ * The <code>Rule</code> used to parse the web.xml.
*/
protected static WebRuleSet webRuleSet = new WebRuleSet();
/**
+ * The <code>Rule</code> used to parse web-fragment.xml files.
+ */
+ protected static WebRuleSet webFragmentRuleSet = new WebRuleSet("", true);
+
+
+ /**
* Scanner for annotations, etc.
*/
protected ContextScanner scanner = null;
@@ -755,6 +769,15 @@
/**
+ * Create (if necessary) and return a Digester configured to process the
+ * web application fragment descriptors (web-fragment.xml).
+ */
+ protected static Digester createWebFragmentDigester() {
+ return DigesterFactory.newDigester(Globals.XML_NAMESPACE_AWARE, Globals.XML_VALIDATION, webFragmentRuleSet);
+ }
+
+
+ /**
* Create (if necessary) and return a Digester configured to process tag
* library descriptors.
*/
@@ -773,16 +796,6 @@
/**
- * Create (if necessary) and return a Digester configured to process web.xml
- * absolute ordering.
- */
- protected static Digester createOrderingDigester() {
- return DigesterFactory.newDigester(Globals.XML_NAMESPACE_AWARE,
- Globals.XML_VALIDATION, new WebAbsoluteOrderingRuleSet());
- }
-
-
- /**
* Create (if necessary) and return a Digester configured to process the
* context configuration descriptor for an application.
*/
@@ -960,86 +973,20 @@
* Process additional descriptors: TLDs, web fragments, and map overlays.
*/
protected void applicationExtraDescriptorsConfig() {
+ JarRepository jarRepository = context.getJarRepository();
+
// Read order from web.xml and fragments (note: if no fragments, skip)
- WebAbsoluteOrdering absoluteOrdering = null;
+ WebAbsoluteOrdering absoluteOrdering = context.getWebAbsoluteOrdering();
List<WebOrdering> orderings = new ArrayList<WebOrdering>();
Iterator<String> jarsWithWebFragments = scanner.getWebFragments();
- /*
- String altDDName = null;
-
- // Open the application web.xml file, if it exists
- InputStream stream = null;
- ServletContext servletContext = context.getServletContext();
- if (servletContext != null) {
- altDDName = (String)servletContext.getAttribute(
- Globals.ALT_DD_ATTR);
- if (altDDName != null) {
- try {
- stream = new FileInputStream(altDDName);
- } catch (FileNotFoundException e) {
- log.error(sm.getString("contextConfig.altDDNotFound",
- altDDName));
- }
- }
- else {
- stream = servletContext.getResourceAsStream
- (Constants.ApplicationWebXml);
- }
- }
- if (stream == null) {
- if (log.isDebugEnabled()) {
- log.debug(sm.getString("contextConfig.applicationMissing") + " " + context);
- }
- return;
- }
-
- URL url = null;
-
- // Process the application web.xml file
- synchronized (orderingDigester) {
- try {
- if (altDDName != null) {
- url = new File(altDDName).toURI().toURL();
- } else {
- url = servletContext.getResource(Constants.ApplicationWebXml);
- }
- if (url != null) {
- InputSource is = new InputSource(url.toExternalForm());
- is.setByteStream(stream);
- orderingDigester.parse(is);
- absoluteOrdering = (WebAbsoluteOrdering) orderingDigester.peek();
- }
- } catch (SAXParseException e) {
- log.error(sm.getString("contextConfig.applicationParse", url.toExternalForm()), e);
- log.error(sm.getString("contextConfig.applicationPosition",
- "" + e.getLineNumber(),
- "" + e.getColumnNumber()));
- ok = false;
- } catch (Exception e) {
- log.error(sm.getString("contextConfig.applicationParse", url.toExternalForm()), e);
- ok = false;
- } finally {
- orderingDigester.reset();
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException e) {
- log.error(sm.getString("contextConfig.applicationClose"), e);
- }
- }
- }
- */
-
- // Process the web fragments
- // FIXME: Do only if no absolute ordering
- while (jarsWithWebFragments.hasNext()) {
+ // Parse the ordering defined in web fragments
+ while ((absoluteOrdering == null) && jarsWithWebFragments.hasNext()) {
String jar = jarsWithWebFragments.next();
JarFile jarFile = null;
InputStream is = null;
try {
- jarFile = new JarFile(jar);
+ jarFile = jarRepository.findJar(jar);
ZipEntry entry = jarFile.getEntry(Globals.WEB_FRAGMENT_PATH);
if (entry != null) {
is = jarFile.getInputStream(entry);
@@ -1070,21 +1017,19 @@
} catch (IOException e) {
// Ignore
}
- try {
- if (jarFile != null) {
- jarFile.close();
- }
- } catch (IOException e) {
- // Ignore
- }
}
}
- // FIXME: Generate final web fragments order
- if (absoluteOrdering != null || (orderings.size() > 0)) {
+ // FIXME: Generate web fragments parsing order
+ if (absoluteOrdering != null) {
+ } else if (orderings.size() > 0) {
+
}
+ // FIXME: Parse fragments according to order
+
+
// FIXME: Add overlays
scanner.getOverlays();
}
@@ -1376,6 +1321,11 @@
webDigester.getParser();
}
+ if (webFragmentDigester == null){
+ webFragmentDigester = createWebFragmentDigester();
+ webFragmentDigester.getParser();
+ }
+
if (tldDigester == null){
tldDigester = createTldDigester();
tldDigester.getParser();
@@ -1386,11 +1336,6 @@
fragmentOrderingDigester.getParser();
}
- if (orderingDigester == null){
- orderingDigester = createOrderingDigester();
- orderingDigester.getParser();
- }
-
if (contextDigester == null){
contextDigester = createContextDigester();
contextDigester.getParser();
Deleted: trunk/java/org/apache/catalina/startup/WebAbsoluteOrderingRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebAbsoluteOrderingRuleSet.java 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/java/org/apache/catalina/startup/WebAbsoluteOrderingRuleSet.java 2009-04-25 16:43:39 UTC (rev 1031)
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.startup;
-
-
-import org.apache.catalina.deploy.WebAbsoluteOrdering;
-import org.apache.tomcat.util.digester.Digester;
-import org.apache.tomcat.util.digester.Rule;
-import org.apache.tomcat.util.digester.RuleSetBase;
-import org.xml.sax.Attributes;
-
-
-/**
- * <p><strong>RuleSet</strong> for processing the absolute-ordering element
- * of web.xml.</p>
- *
- * @author Craig R. McClanahan
- * @version $Revision: 515 $ $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
- */
-
-public class WebAbsoluteOrderingRuleSet extends RuleSetBase {
-
-
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * The matching pattern prefix to use for recognizing our elements.
- */
- protected String prefix = null;
-
-
- // ------------------------------------------------------------ Constructor
-
-
- /**
- * Construct an instance of this <code>RuleSet</code> with the default
- * matching pattern prefix.
- */
- public WebAbsoluteOrderingRuleSet() {
-
- this("");
-
- }
-
-
- /**
- * Construct an instance of this <code>RuleSet</code> with the specified
- * matching pattern prefix.
- *
- * @param prefix Prefix for matching pattern rules (including the
- * trailing slash character)
- */
- public WebAbsoluteOrderingRuleSet(String prefix) {
-
- super();
- this.namespaceURI = null;
- this.prefix = prefix;
-
- }
-
-
- // --------------------------------------------------------- Public Methods
-
-
- /**
- * <p>Add the set of Rule instances defined in this RuleSet to the
- * specified <code>Digester</code> instance, associating them with
- * our namespace URI (if any). This method should only be called
- * by a Digester instance.</p>
- *
- * @param digester Digester instance to which the new Rule instances
- * should be added.
- */
- public void addRuleInstances(Digester digester) {
-
- digester.addObjectCreate(prefix + "web-app",
- "org.apache.catalina.deploy.WebAbsoluteOrdering");
- digester.addCallMethod(prefix + "web-app/name",
- "setName", 0);
- digester.addCallMethod(prefix + "web-app/absolute-ordering/name",
- "addName", 0);
- digester.addRule(prefix + "web-app/absolute-ordering/others",
- new AddOthersRule());
-
- }
-
-
- final class AddOthersRule extends Rule {
- public AddOthersRule() {
- }
-
- public void begin(String namespace, String name, Attributes attributes)
- throws Exception {
- WebAbsoluteOrdering ordering = (WebAbsoluteOrdering) digester.peek();
- ordering.addName("");
- }
-
- }
-}
Modified: trunk/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-04-25 16:43:39 UTC (rev 1031)
@@ -27,6 +27,7 @@
import org.apache.catalina.deploy.ContextHandler;
import org.apache.catalina.deploy.ContextService;
import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.catalina.deploy.WebAbsoluteOrdering;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.digester.CallMethodRule;
import org.apache.tomcat.util.digester.CallParamRule;
@@ -52,6 +53,12 @@
/**
+ * The fragment flag
+ */
+ protected boolean fragment;
+
+
+ /**
* The matching pattern prefix to use for recognizing our elements.
*/
protected String prefix = null;
@@ -84,7 +91,7 @@
*/
public WebRuleSet() {
- this("");
+ this("", false);
}
@@ -96,9 +103,10 @@
* @param prefix Prefix for matching pattern rules (including the
* trailing slash character)
*/
- public WebRuleSet(String prefix) {
+ public WebRuleSet(String prefix, boolean fragment) {
super();
+ this.fragment = fragment;
this.namespaceURI = null;
this.prefix = prefix;
@@ -118,390 +126,413 @@
* should be added.
*/
public void addRuleInstances(Digester digester) {
+ String elementName = "web-app";
+ if (fragment) {
+ elementName = "web-fragment";
+ }
sessionConfig = new SetSessionConfig();
jspConfig = new SetJspConfig();
loginConfig = new SetLoginConfig();
- digester.addRule(prefix + "web-app",
+ digester.addRule(prefix + elementName,
new SetPublicIdRule("setPublicId"));
- digester.addRule(prefix + "web-app",
+ digester.addRule(prefix + elementName,
new IgnoreAnnotationsRule());
- digester.addCallMethod(prefix + "web-app/context-param",
+ digester.addCallMethod(prefix + elementName + "/context-param",
"addParameter", 2);
- digester.addCallParam(prefix + "web-app/context-param/param-name", 0);
- digester.addCallParam(prefix + "web-app/context-param/param-value", 1);
+ digester.addCallParam(prefix + elementName + "/context-param/param-name", 0);
+ digester.addCallParam(prefix + elementName + "/context-param/param-value", 1);
- digester.addCallMethod(prefix + "web-app/display-name",
+ digester.addCallMethod(prefix + elementName + "/display-name",
"setDisplayName", 0);
- digester.addRule(prefix + "web-app/distributable",
+ digester.addRule(prefix + elementName + "/distributable",
new SetDistributableRule());
configureNamingRules(digester);
- digester.addObjectCreate(prefix + "web-app/error-page",
+ digester.addObjectCreate(prefix + elementName + "/error-page",
"org.apache.catalina.deploy.ErrorPage");
- digester.addSetNext(prefix + "web-app/error-page",
+ digester.addSetNext(prefix + elementName + "/error-page",
"addErrorPage",
"org.apache.catalina.deploy.ErrorPage");
- digester.addCallMethod(prefix + "web-app/error-page/error-code",
+ digester.addCallMethod(prefix + elementName + "/error-page/error-code",
"setErrorCode", 0);
- digester.addCallMethod(prefix + "web-app/error-page/exception-type",
+ digester.addCallMethod(prefix + elementName + "/error-page/exception-type",
"setExceptionType", 0);
- digester.addCallMethod(prefix + "web-app/error-page/location",
+ digester.addCallMethod(prefix + elementName + "/error-page/location",
"setLocation", 0);
- digester.addObjectCreate(prefix + "web-app/filter",
+ digester.addObjectCreate(prefix + elementName + "/filter",
"org.apache.catalina.deploy.FilterDef");
- digester.addSetNext(prefix + "web-app/filter",
+ digester.addSetNext(prefix + elementName + "/filter",
"addFilterDef",
"org.apache.catalina.deploy.FilterDef");
- digester.addCallMethod(prefix + "web-app/filter/description",
+ digester.addCallMethod(prefix + elementName + "/filter/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/filter/display-name",
+ digester.addCallMethod(prefix + elementName + "/filter/display-name",
"setDisplayName", 0);
- digester.addCallMethod(prefix + "web-app/filter/filter-class",
+ digester.addCallMethod(prefix + elementName + "/filter/filter-class",
"setFilterClass", 0);
- digester.addCallMethod(prefix + "web-app/filter/filter-name",
+ digester.addCallMethod(prefix + elementName + "/filter/filter-name",
"setFilterName", 0);
- digester.addCallMethod(prefix + "web-app/filter/large-icon",
+ digester.addCallMethod(prefix + elementName + "/filter/large-icon",
"setLargeIcon", 0);
- digester.addCallMethod(prefix + "web-app/filter/small-icon",
+ digester.addCallMethod(prefix + elementName + "/filter/small-icon",
"setSmallIcon", 0);
- digester.addCallMethod(prefix + "web-app/filter/init-param",
+ digester.addCallMethod(prefix + elementName + "/filter/init-param",
"addInitParameter", 2);
- digester.addCallParam(prefix + "web-app/filter/init-param/param-name",
+ digester.addCallParam(prefix + elementName + "/filter/init-param/param-name",
0);
- digester.addCallParam(prefix + "web-app/filter/init-param/param-value",
+ digester.addCallParam(prefix + elementName + "/filter/init-param/param-value",
1);
- digester.addObjectCreate(prefix + "web-app/filter-mapping",
+ digester.addObjectCreate(prefix + elementName + "/filter-mapping",
"org.apache.catalina.deploy.FilterMap");
- digester.addSetNext(prefix + "web-app/filter-mapping",
+ digester.addSetNext(prefix + elementName + "/filter-mapping",
"addFilterMap",
"org.apache.catalina.deploy.FilterMap");
- digester.addCallMethod(prefix + "web-app/filter-mapping/filter-name",
+ digester.addCallMethod(prefix + elementName + "/filter-mapping/filter-name",
"setFilterName", 0);
- digester.addCallMethod(prefix + "web-app/filter-mapping/servlet-name",
+ digester.addCallMethod(prefix + elementName + "/filter-mapping/servlet-name",
"addServletName", 0);
- digester.addCallMethod(prefix + "web-app/filter-mapping/url-pattern",
+ digester.addCallMethod(prefix + elementName + "/filter-mapping/url-pattern",
"addURLPattern", 0);
- digester.addCallMethod(prefix + "web-app/filter-mapping/dispatcher",
+ digester.addCallMethod(prefix + elementName + "/filter-mapping/dispatcher",
"setDispatcher", 0);
- digester.addRule(prefix + "web-app/jsp-config",
+ digester.addRule(prefix + elementName + "/jsp-config",
jspConfig);
- digester.addCallMethod(prefix + "web-app/jsp-config/jsp-property-group/url-pattern",
+ digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/url-pattern",
"addJspMapping", 0);
- digester.addCallMethod(prefix + "web-app/listener/listener-class",
+ digester.addCallMethod(prefix + elementName + "/listener/listener-class",
"addApplicationListener", 0);
- digester.addRule(prefix + "web-app/login-config",
+ digester.addRule(prefix + elementName + "/login-config",
loginConfig);
- digester.addObjectCreate(prefix + "web-app/login-config",
+ digester.addObjectCreate(prefix + elementName + "/login-config",
"org.apache.catalina.deploy.LoginConfig");
- digester.addSetNext(prefix + "web-app/login-config",
+ digester.addSetNext(prefix + elementName + "/login-config",
"setLoginConfig",
"org.apache.catalina.deploy.LoginConfig");
- digester.addCallMethod(prefix + "web-app/login-config/auth-method",
+ digester.addCallMethod(prefix + elementName + "/login-config/auth-method",
"setAuthMethod", 0);
- digester.addCallMethod(prefix + "web-app/login-config/realm-name",
+ digester.addCallMethod(prefix + elementName + "/login-config/realm-name",
"setRealmName", 0);
- digester.addCallMethod(prefix + "web-app/login-config/form-login-config/form-error-page",
+ digester.addCallMethod(prefix + elementName + "/login-config/form-login-config/form-error-page",
"setErrorPage", 0);
- digester.addCallMethod(prefix + "web-app/login-config/form-login-config/form-login-page",
+ digester.addCallMethod(prefix + elementName + "/login-config/form-login-config/form-login-page",
"setLoginPage", 0);
- digester.addCallMethod(prefix + "web-app/mime-mapping",
+ digester.addCallMethod(prefix + elementName + "/mime-mapping",
"addMimeMapping", 2);
- digester.addCallParam(prefix + "web-app/mime-mapping/extension", 0);
- digester.addCallParam(prefix + "web-app/mime-mapping/mime-type", 1);
+ digester.addCallParam(prefix + elementName + "/mime-mapping/extension", 0);
+ digester.addCallParam(prefix + elementName + "/mime-mapping/mime-type", 1);
- digester.addObjectCreate(prefix + "web-app/security-constraint",
+ digester.addObjectCreate(prefix + elementName + "/security-constraint",
"org.apache.catalina.deploy.SecurityConstraint");
- digester.addSetNext(prefix + "web-app/security-constraint",
+ digester.addSetNext(prefix + elementName + "/security-constraint",
"addConstraint",
"org.apache.catalina.deploy.SecurityConstraint");
- digester.addRule(prefix + "web-app/security-constraint/auth-constraint",
+ digester.addRule(prefix + elementName + "/security-constraint/auth-constraint",
new SetAuthConstraintRule());
- digester.addCallMethod(prefix + "web-app/security-constraint/auth-constraint/role-name",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/auth-constraint/role-name",
"addAuthRole", 0);
- digester.addCallMethod(prefix + "web-app/security-constraint/display-name",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/display-name",
"setDisplayName", 0);
- digester.addCallMethod(prefix + "web-app/security-constraint/user-data-constraint/transport-guarantee",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/user-data-constraint/transport-guarantee",
"setUserConstraint", 0);
- digester.addObjectCreate(prefix + "web-app/security-constraint/web-resource-collection",
+ digester.addObjectCreate(prefix + elementName + "/security-constraint/web-resource-collection",
"org.apache.catalina.deploy.SecurityCollection");
- digester.addSetNext(prefix + "web-app/security-constraint/web-resource-collection",
+ digester.addSetNext(prefix + elementName + "/security-constraint/web-resource-collection",
"addCollection",
"org.apache.catalina.deploy.SecurityCollection");
- digester.addCallMethod(prefix + "web-app/security-constraint/web-resource-collection/http-method",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/web-resource-collection/http-method",
"addMethod", 0);
- digester.addCallMethod(prefix + "web-app/security-constraint/web-resource-collection/url-pattern",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/web-resource-collection/url-pattern",
"addPattern", 0);
- digester.addCallMethod(prefix + "web-app/security-constraint/web-resource-collection/web-resource-name",
+ digester.addCallMethod(prefix + elementName + "/security-constraint/web-resource-collection/web-resource-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/security-role/role-name",
+ digester.addCallMethod(prefix + elementName + "/security-role/role-name",
"addSecurityRole", 0);
- digester.addRule(prefix + "web-app/servlet",
+ digester.addRule(prefix + elementName + "/servlet",
new WrapperCreateRule());
- digester.addSetNext(prefix + "web-app/servlet",
+ digester.addSetNext(prefix + "/servlet",
"addChild",
"org.apache.catalina.Container");
- digester.addCallMethod(prefix + "web-app/servlet/description",
+ digester.addCallMethod(prefix + elementName + "/servlet/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/servlet/init-param",
+ digester.addCallMethod(prefix + elementName + "/servlet/init-param",
"addInitParameter", 2);
- digester.addCallParam(prefix + "web-app/servlet/init-param/param-name",
+ digester.addCallParam(prefix + elementName + "/servlet/init-param/param-name",
0);
- digester.addCallParam(prefix + "web-app/servlet/init-param/param-value",
+ digester.addCallParam(prefix + elementName + "/servlet/init-param/param-value",
1);
- digester.addCallMethod(prefix + "web-app/servlet/jsp-file",
+ digester.addCallMethod(prefix + elementName + "/servlet/jsp-file",
"setJspFile", 0);
- digester.addCallMethod(prefix + "web-app/servlet/load-on-startup",
+ digester.addCallMethod(prefix + elementName + "/servlet/load-on-startup",
"setLoadOnStartupString", 0);
- digester.addCallMethod(prefix + "web-app/servlet/run-as/role-name",
+ digester.addCallMethod(prefix + elementName + "/servlet/run-as/role-name",
"setRunAs", 0);
- digester.addCallMethod(prefix + "web-app/servlet/security-role-ref",
+ digester.addCallMethod(prefix + elementName + "/servlet/security-role-ref",
"addSecurityReference", 2);
- digester.addCallParam(prefix + "web-app/servlet/security-role-ref/role-link", 1);
- digester.addCallParam(prefix + "web-app/servlet/security-role-ref/role-name", 0);
+ digester.addCallParam(prefix + elementName + "/servlet/security-role-ref/role-link", 1);
+ digester.addCallParam(prefix + elementName + "/servlet/security-role-ref/role-name", 0);
- digester.addCallMethod(prefix + "web-app/servlet/servlet-class",
+ digester.addCallMethod(prefix + elementName + "/servlet/servlet-class",
"setServletClass", 0);
- digester.addCallMethod(prefix + "web-app/servlet/servlet-name",
+ digester.addCallMethod(prefix + elementName + "/servlet/servlet-name",
"setName", 0);
- digester.addRule(prefix + "web-app/servlet-mapping",
+ digester.addRule(prefix + elementName + "/servlet-mapping",
new CallMethodMultiRule("addServletMapping", 2, 0));
- digester.addCallParam(prefix + "web-app/servlet-mapping/servlet-name", 1);
- digester.addRule(prefix + "web-app/servlet-mapping/url-pattern", new CallParamMultiRule(0));
+ digester.addCallParam(prefix + elementName + "/servlet-mapping/servlet-name", 1);
+ digester.addRule(prefix + elementName + "/servlet-mapping/url-pattern", new CallParamMultiRule(0));
- digester.addRule(prefix + "web-app/session-config",
+ digester.addRule(prefix + elementName + "/session-config",
sessionConfig);
- digester.addCallMethod(prefix + "web-app/session-config/session-timeout",
+ digester.addCallMethod(prefix + elementName + "/session-config/session-timeout",
"setSessionTimeout", 1,
new Class[] { Integer.TYPE });
- digester.addCallParam(prefix + "web-app/session-config/session-timeout", 0);
+ digester.addCallParam(prefix + elementName + "/session-config/session-timeout", 0);
- digester.addCallMethod(prefix + "web-app/taglib",
+ digester.addCallMethod(prefix + elementName + "/taglib",
"addTaglib", 2);
- digester.addCallParam(prefix + "web-app/taglib/taglib-location", 1);
- digester.addCallParam(prefix + "web-app/taglib/taglib-uri", 0);
+ digester.addCallParam(prefix + elementName + "/taglib/taglib-location", 1);
+ digester.addCallParam(prefix + elementName + "/taglib/taglib-uri", 0);
- digester.addCallMethod(prefix + "web-app/welcome-file-list/welcome-file",
+ digester.addCallMethod(prefix + elementName + "/welcome-file-list/welcome-file",
"addWelcomeFile", 0);
- digester.addCallMethod(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping",
+ digester.addCallMethod(prefix + elementName + "/locale-encoding-mapping-list/locale-encoding-mapping",
"addLocaleEncodingMappingParameter", 2);
- digester.addCallParam(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping/locale", 0);
- digester.addCallParam(prefix + "web-app/locale-encoding-mapping-list/locale-encoding-mapping/encoding", 1);
+ digester.addCallParam(prefix + elementName + "/locale-encoding-mapping-list/locale-encoding-mapping/locale", 0);
+ digester.addCallParam(prefix + elementName + "/locale-encoding-mapping-list/locale-encoding-mapping/encoding", 1);
+ // absolute-ordering rules
+ if (!fragment) {
+ digester.addCallMethod(prefix + elementName + "/name", "setLogicalName", 0);
+ digester.addObjectCreate(prefix + elementName + "/absolute-ordering",
+ "org.apache.catalina.deploy.WebAbsoluteOrdering");
+ digester.addSetNext(prefix + elementName + "/absolute-ordering",
+ "setWebAbsoluteOrdering",
+ "org.apache.catalina.deploy.WebAbsoluteOrdering");
+ digester.addCallMethod(prefix + elementName + "/absolute-ordering/name",
+ "addName", 0);
+ digester.addRule(prefix + elementName + "/absolute-ordering/others",
+ new AddOthersRule());
+ }
+
}
protected void configureNamingRules(Digester digester) {
+ String elementName = "web-app";
+ if (fragment) {
+ elementName = "web-fragment";
+ }
//ejb-local-ref
- digester.addObjectCreate(prefix + "web-app/ejb-local-ref",
+ digester.addObjectCreate(prefix + elementName + "/ejb-local-ref",
"org.apache.catalina.deploy.ContextLocalEjb");
- digester.addRule(prefix + "web-app/ejb-local-ref",
+ digester.addRule(prefix + elementName + "/ejb-local-ref",
new SetNextNamingRule("addLocalEjb",
"org.apache.catalina.deploy.ContextLocalEjb"));
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/description",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/ejb-link",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/ejb-link",
"setLink", 0);
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/ejb-ref-name",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/ejb-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/ejb-ref-type",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/ejb-ref-type",
"setType", 0);
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/local",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/local",
"setLocal", 0);
- digester.addCallMethod(prefix + "web-app/ejb-local-ref/local-home",
+ digester.addCallMethod(prefix + elementName + "/ejb-local-ref/local-home",
"setHome", 0);
- configureInjectionRules(digester, "web-app/ejb-local-ref/");
+ configureInjectionRules(digester, elementName + "/ejb-local-ref/");
//ejb-ref
- digester.addObjectCreate(prefix + "web-app/ejb-ref",
+ digester.addObjectCreate(prefix + elementName + "/ejb-ref",
"org.apache.catalina.deploy.ContextEjb");
- digester.addRule(prefix + "web-app/ejb-ref",
+ digester.addRule(prefix + elementName + "/ejb-ref",
new SetNextNamingRule("addEjb",
"org.apache.catalina.deploy.ContextEjb"));
- digester.addCallMethod(prefix + "web-app/ejb-ref/description",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/ejb-ref/ejb-link",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/ejb-link",
"setLink", 0);
- digester.addCallMethod(prefix + "web-app/ejb-ref/ejb-ref-name",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/ejb-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/ejb-ref/ejb-ref-type",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/ejb-ref-type",
"setType", 0);
- digester.addCallMethod(prefix + "web-app/ejb-ref/home",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/home",
"setHome", 0);
- digester.addCallMethod(prefix + "web-app/ejb-ref/remote",
+ digester.addCallMethod(prefix + elementName + "/ejb-ref/remote",
"setRemote", 0);
- configureInjectionRules(digester, "web-app/ejb-ref/");
+ configureInjectionRules(digester, elementName + "/ejb-ref/");
//env-entry
- digester.addObjectCreate(prefix + "web-app/env-entry",
+ digester.addObjectCreate(prefix + elementName + "/env-entry",
"org.apache.catalina.deploy.ContextEnvironment");
- digester.addRule(prefix + "web-app/env-entry",
+ digester.addRule(prefix + elementName + "/env-entry",
new SetNextNamingRule("addEnvironment",
"org.apache.catalina.deploy.ContextEnvironment"));
- digester.addCallMethod(prefix + "web-app/env-entry/description",
+ digester.addCallMethod(prefix + elementName + "/env-entry/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/env-entry/env-entry-name",
+ digester.addCallMethod(prefix + elementName + "/env-entry/env-entry-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/env-entry/env-entry-type",
+ digester.addCallMethod(prefix + elementName + "/env-entry/env-entry-type",
"setType", 0);
- digester.addCallMethod(prefix + "web-app/env-entry/env-entry-value",
+ digester.addCallMethod(prefix + elementName + "/env-entry/env-entry-value",
"setValue", 0);
- configureInjectionRules(digester, "web-app/env-entry/");
+ configureInjectionRules(digester, elementName + "/env-entry/");
//resource-env-ref
- digester.addObjectCreate(prefix + "web-app/resource-env-ref",
+ digester.addObjectCreate(prefix + elementName + "/resource-env-ref",
"org.apache.catalina.deploy.ContextResourceEnvRef");
- digester.addRule(prefix + "web-app/resource-env-ref",
+ digester.addRule(prefix + elementName + "/resource-env-ref",
new SetNextNamingRule("addResourceEnvRef",
"org.apache.catalina.deploy.ContextResourceEnvRef"));
- digester.addCallMethod(prefix + "web-app/resource-env-ref/resource-env-ref-name",
+ digester.addCallMethod(prefix + elementName + "/resource-env-ref/resource-env-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/resource-env-ref/resource-env-ref-type",
+ digester.addCallMethod(prefix + elementName + "/resource-env-ref/resource-env-ref-type",
"setType", 0);
- configureInjectionRules(digester, "web-app/ejb-local-ref/");
+ configureInjectionRules(digester, elementName + "/ejb-local-ref/");
//message-destination
- digester.addObjectCreate(prefix + "web-app/message-destination",
+ digester.addObjectCreate(prefix + elementName + "/message-destination",
"org.apache.catalina.deploy.MessageDestination");
- digester.addSetNext(prefix + "web-app/message-destination",
+ digester.addSetNext(prefix + elementName + "/message-destination",
"addMessageDestination",
"org.apache.catalina.deploy.MessageDestination");
- digester.addCallMethod(prefix + "web-app/message-destination/description",
+ digester.addCallMethod(prefix + elementName + "/message-destination/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/message-destination/display-name",
+ digester.addCallMethod(prefix + elementName + "/message-destination/display-name",
"setDisplayName", 0);
- digester.addCallMethod(prefix + "web-app/message-destination/icon/large-icon",
+ digester.addCallMethod(prefix + elementName + "/message-destination/icon/large-icon",
"setLargeIcon", 0);
- digester.addCallMethod(prefix + "web-app/message-destination/icon/small-icon",
+ digester.addCallMethod(prefix + elementName + "/message-destination/icon/small-icon",
"setSmallIcon", 0);
- digester.addCallMethod(prefix + "web-app/message-destination/message-destination-name",
+ digester.addCallMethod(prefix + elementName + "/message-destination/message-destination-name",
"setName", 0);
//message-destination-ref
- digester.addObjectCreate(prefix + "web-app/message-destination-ref",
+ digester.addObjectCreate(prefix + elementName + "/message-destination-ref",
"org.apache.catalina.deploy.MessageDestinationRef");
- digester.addSetNext(prefix + "web-app/message-destination-ref",
+ digester.addSetNext(prefix + elementName + "/message-destination-ref",
"addMessageDestinationRef",
"org.apache.catalina.deploy.MessageDestinationRef");
- digester.addCallMethod(prefix + "web-app/message-destination-ref/description",
+ digester.addCallMethod(prefix + elementName + "/message-destination-ref/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/message-destination-ref/message-destination-link",
+ digester.addCallMethod(prefix + elementName + "/message-destination-ref/message-destination-link",
"setLink", 0);
- digester.addCallMethod(prefix + "web-app/message-destination-ref/message-destination-ref-name",
+ digester.addCallMethod(prefix + elementName + "/message-destination-ref/message-destination-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/message-destination-ref/message-destination-type",
+ digester.addCallMethod(prefix + elementName + "/message-destination-ref/message-destination-type",
"setType", 0);
- digester.addCallMethod(prefix + "web-app/message-destination-ref/message-destination-usage",
+ digester.addCallMethod(prefix + elementName + "/message-destination-ref/message-destination-usage",
"setUsage", 0);
- configureInjectionRules(digester, "web-app/message-destination-ref/");
+ configureInjectionRules(digester, elementName + "/message-destination-ref/");
//resource-ref
- digester.addObjectCreate(prefix + "web-app/resource-ref",
+ digester.addObjectCreate(prefix + elementName + "/resource-ref",
"org.apache.catalina.deploy.ContextResource");
- digester.addRule(prefix + "web-app/resource-ref",
+ digester.addRule(prefix + elementName + "/resource-ref",
new SetNextNamingRule("addResource",
"org.apache.catalina.deploy.ContextResource"));
- digester.addCallMethod(prefix + "web-app/resource-ref/description",
+ digester.addCallMethod(prefix + elementName + "/resource-ref/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/resource-ref/res-auth",
+ digester.addCallMethod(prefix + elementName + "/resource-ref/res-auth",
"setAuth", 0);
- digester.addCallMethod(prefix + "web-app/resource-ref/res-ref-name",
+ digester.addCallMethod(prefix + elementName + "/resource-ref/res-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/resource-ref/res-sharing-scope",
+ digester.addCallMethod(prefix + elementName + "/resource-ref/res-sharing-scope",
"setScope", 0);
- digester.addCallMethod(prefix + "web-app/resource-ref/res-type",
+ digester.addCallMethod(prefix + elementName + "/resource-ref/res-type",
"setType", 0);
- configureInjectionRules(digester, "web-app/resource-ref/");
+ configureInjectionRules(digester, elementName + "/resource-ref/");
//service-ref
- digester.addObjectCreate(prefix + "web-app/service-ref",
+ digester.addObjectCreate(prefix + elementName + "/service-ref",
"org.apache.catalina.deploy.ContextService");
- digester.addRule(prefix + "web-app/service-ref",
+ digester.addRule(prefix + elementName + "/service-ref",
new SetNextNamingRule("addService",
"org.apache.catalina.deploy.ContextService"));
- digester.addCallMethod(prefix + "web-app/service-ref/description",
+ digester.addCallMethod(prefix + elementName + "/service-ref/description",
"setDescription", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/display-name",
+ digester.addCallMethod(prefix + elementName + "/service-ref/display-name",
"setDisplayname", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/icon",
+ digester.addCallMethod(prefix + elementName + "/service-ref/icon",
"setIcon", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/service-ref-name",
+ digester.addCallMethod(prefix + elementName + "/service-ref/service-ref-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/service-interface",
+ digester.addCallMethod(prefix + elementName + "/service-ref/service-interface",
"setType", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/wsdl-file",
+ digester.addCallMethod(prefix + elementName + "/service-ref/wsdl-file",
"setWsdlfile", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/jaxrpc-mapping-file",
+ digester.addCallMethod(prefix + elementName + "/service-ref/jaxrpc-mapping-file",
"setJaxrpcmappingfile", 0);
- digester.addRule(prefix + "web-app/service-ref/service-qname", new ServiceQnameRule());
+ digester.addRule(prefix + elementName + "/service-ref/service-qname", new ServiceQnameRule());
- digester.addRule(prefix + "web-app/service-ref/port-component-ref",
+ digester.addRule(prefix + elementName + "/service-ref/port-component-ref",
new CallMethodMultiRule("addPortcomponent", 2, 1));
- digester.addCallParam(prefix + "web-app/service-ref/port-component-ref/service-endpoint-interface", 0);
- digester.addRule(prefix + "web-app/service-ref/port-component-ref/port-component-link", new CallParamMultiRule(1));
+ digester.addCallParam(prefix + elementName + "/service-ref/port-component-ref/service-endpoint-interface", 0);
+ digester.addRule(prefix + elementName + "/service-ref/port-component-ref/port-component-link",
+ new CallParamMultiRule(1));
- digester.addObjectCreate(prefix + "web-app/service-ref/handler",
+ digester.addObjectCreate(prefix + elementName + "/service-ref/handler",
"org.apache.catalina.deploy.ContextHandler");
- digester.addRule(prefix + "web-app/service-ref/handler",
+ digester.addRule(prefix + elementName + "/service-ref/handler",
new SetNextRule("addHandler",
"org.apache.catalina.deploy.ContextHandler"));
- digester.addCallMethod(prefix + "web-app/service-ref/handler/handler-name",
+ digester.addCallMethod(prefix + elementName + "/service-ref/handler/handler-name",
"setName", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/handler/handler-class",
+ digester.addCallMethod(prefix + elementName + "/service-ref/handler/handler-class",
"setHandlerclass", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/handler/init-param",
+ digester.addCallMethod(prefix + elementName + "/service-ref/handler/init-param",
"setProperty", 2);
- digester.addCallParam(prefix + "web-app/service-ref/handler/init-param/param-name",
+ digester.addCallParam(prefix + elementName + "/service-ref/handler/init-param/param-name",
0);
- digester.addCallParam(prefix + "web-app/service-ref/handler/init-param/param-value",
+ digester.addCallParam(prefix + elementName + "/service-ref/handler/init-param/param-value",
1);
- digester.addRule(prefix + "web-app/service-ref/handler/soap-header", new SoapHeaderRule());
+ digester.addRule(prefix + elementName + "/service-ref/handler/soap-header", new SoapHeaderRule());
- digester.addCallMethod(prefix + "web-app/service-ref/handler/soap-role",
+ digester.addCallMethod(prefix + elementName + "/service-ref/handler/soap-role",
"addSoapRole", 0);
- digester.addCallMethod(prefix + "web-app/service-ref/handler/port-name",
+ digester.addCallMethod(prefix + elementName + "/service-ref/handler/port-name",
"addPortName", 0);
- configureInjectionRules(digester, "web-app/service-ref/");
+ configureInjectionRules(digester, elementName + "/service-ref/");
}
@@ -902,3 +933,14 @@
}
}
+final class AddOthersRule extends Rule {
+ public AddOthersRule() {
+ }
+
+ public void begin(String namespace, String name, Attributes attributes)
+ throws Exception {
+ WebAbsoluteOrdering ordering = (WebAbsoluteOrdering) digester.peek();
+ ordering.addName("");
+ }
+
+}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-04-25 12:05:33 UTC (rev 1030)
+++ trunk/webapps/docs/changelog.xml 2009-04-25 16:43:39 UTC (rev 1031)
@@ -74,6 +74,9 @@
<add>
Multipart implementation. (remm)
</add>
+ <add>
+ New JarRepository component to handle better management of JarFiles following the Servlet 3.0 update. (remm)
+ </add>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months
JBossWeb SVN: r1030 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-04-25 08:05:33 -0400 (Sat, 25 Apr 2009)
New Revision: 1030
Added:
tags/JBOSSWEB_2_1_3_GA/
Log:
- JBoss Web 2.1.3 GA.
Copied: tags/JBOSSWEB_2_1_3_GA (from rev 1029, branches/2.1.x)
15 years, 10 months