geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r496699 - /geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Date Tue, 16 Jan 2007 14:13:46 GMT
Author: sppatel
Date: Tue Jan 16 06:13:45 2007
New Revision: 496699

URL: http://svn.apache.org/viewvc?view=rev&rev=496699
Log:
add support for library-directory in application.xm - add alls jars in lib entry to classloader
of ear

Modified:
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&rev=496699&r1=496698&r2=496699
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Tue Jan 16 06:13:45 2007
@@ -498,6 +498,19 @@
             // Copy over all files that are _NOT_ modules (e.g. META-INF and APP-INF files)
             Set moduleLocations = applicationInfo.getModuleLocations();
             if (ConfigurationModuleType.EAR == applicationType && earFile != null)
{
+            	//get the value of the library-directory element in spec DD
+            	ApplicationType specDD = (ApplicationType) applicationInfo.getSpecDD();
+            	String libDir = null;
+            	//value 'lib' is used if element not set or ear does not contain a dd
+            	if(specDD == null || !specDD.isSetLibraryDirectory()) {
+            		libDir = "lib";
+            	} else {
+            		String value = specDD.getLibraryDirectory().getStringValue().trim();
+            		//only set if not empty value, empty value implies no library directory
+            		if(value.length() > 0) {
+            			libDir = value;
+            		}
+            	}
                 for (Enumeration e = earFile.entries(); e.hasMoreElements();) {
                     ZipEntry entry = (ZipEntry) e.nextElement();
                     String entryName = entry.getName();
@@ -509,8 +522,11 @@
                             break;
                         }
                     }
-                    if (addEntry) {
-                        earContext.addFile(URI.create(entry.getName()), earFile, entry);
+                    if(libDir != null && entry.getName().startsWith(libDir)) {
+            			NestedJarFile library = new NestedJarFile(earFile, entry.getName());
+                        earContext.addIncludeAsPackedJar(URI.create(entry.getName()), library);
+                    } else if(addEntry) {
+                    	earContext.addFile(URI.create(entry.getName()), earFile, entry);
                     }
                 }
             }



Mime
View raw message