tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1296912 - in /openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config: ConfigurableClasspathArchive.java DeploymentLoader.java FinderFactory.java WebappAggregatedArchive.java
Date Mon, 05 Mar 2012 00:39:15 GMT
Author: rmannibucau
Date: Mon Mar  5 00:39:15 2012
New Revision: 1296912

URL: http://svn.apache.org/viewvc?rev=1296912&view=rev
Log:
fixing compile error

Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WebappAggregatedArchive.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java?rev=1296912&r1=1296911&r2=1296912&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurableClasspathArchive.java
Mon Mar  5 00:39:15 2012
@@ -15,7 +15,9 @@ import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 public class ConfigurableClasspathArchive extends CompositeArchive implements ScanConstants
{
@@ -122,14 +124,21 @@ public class ConfigurableClasspathArchiv
         return false;
     }
 
-    private static class FakeModule extends Module {
-        private FakeModule(final ClassLoader loader) {
+    protected static class FakeModule extends Module {
+        public FakeModule(final ClassLoader loader) {
+            this(loader, Collections.EMPTY_MAP);
+        }
+
+        public FakeModule(final ClassLoader loader, final Map<String, Object> altDD)
{
             super(false);
             setClassLoader(loader);
 
-            final URL scanXml = loader.getResource(SCAN_XML);
+            URL scanXml = (URL) altDD.get(SCAN_XML_NAME);
+            if (scanXml == null) {
+                scanXml = loader.getResource(SCAN_XML_NAME);
+            }
             if (scanXml != null) {
-                getAltDDs().put(SCAN_XML, scanXml);
+                getAltDDs().put(SCAN_XML_NAME, scanXml);
             }
         }
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java?rev=1296912&r1=1296911&r2=1296912&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
Mon Mar  5 00:39:15 2012
@@ -803,7 +803,7 @@ public class DeploymentLoader implements
 
         final EjbModule ejbModule = new EjbModule(appModule.getClassLoader(), "ear-scoped-cdi-beans",
new EjbJar(), new OpenejbJar());
         ejbModule.setBeans(complete);
-        ejbModule.setFinder(new FinderFactory.ModuleLimitedFinder(new org.apache.xbean.finder.AnnotationFinder(new
WebappAggregatedArchive(appModule.getClassLoader(), xmls))));
+        ejbModule.setFinder(new FinderFactory.ModuleLimitedFinder(new org.apache.xbean.finder.AnnotationFinder(new
WebappAggregatedArchive(appModule.getClassLoader(), appModule.getAltDDs(), xmls))));
 
         appModule.getEjbModules().add(ejbModule);
     }

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java?rev=1296912&r1=1296911&r2=1296912&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/FinderFactory.java
Mon Mar  5 00:39:15 2012
@@ -49,7 +49,7 @@ public class FinderFactory {
         if (module instanceof WebModule) {
             WebModule webModule = (WebModule) module;
             final ClassLoader webClassLoader = webModule.getClassLoader();
-            finder = new AnnotationFinder(new WebappAggregatedArchive(webModule, webClassLoader,
webModule.getScannableUrls())).link();
+            finder = new AnnotationFinder(new WebappAggregatedArchive(webModule, webModule.getScannableUrls())).link();
         } else if (module instanceof ConnectorModule) {
         	ConnectorModule connectorModule = (ConnectorModule) module;
         	final ClassLoader connectorClassLoader = connectorModule.getClassLoader();

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WebappAggregatedArchive.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WebappAggregatedArchive.java?rev=1296912&r1=1296911&r2=1296912&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WebappAggregatedArchive.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/WebappAggregatedArchive.java
Mon Mar  5 00:39:15 2012
@@ -21,7 +21,7 @@ public class WebappAggregatedArchive imp
     private boolean scanXmlExists = false; // faster than using an empty handler
     private Archive archive;
 
-    public WebappAggregatedArchive(final WebModule module, final ClassLoader loader, final
Iterable<URL> urls) {
+    public WebappAggregatedArchive(final Module module, final Iterable<URL> urls) {
         final List<Archive> archives = new ArrayList<Archive>();
 
         final URL scanXml = (URL) module.getAltDDs().get(ScanConstants.SCAN_XML_NAME);
@@ -36,7 +36,7 @@ public class WebappAggregatedArchive imp
 
         for (URL url : urls) {
             final List<String> classes = new ArrayList<String>();
-            final Archive archive = new FilteredArchive(new ConfigurableClasspathArchive(loader,
Arrays.asList(url)), new ScanXmlSaverFilter(scanXmlExists, handler, classes));
+            final Archive archive = new FilteredArchive(new ConfigurableClasspathArchive(module.getClassLoader(),
Arrays.asList(url)), new ScanXmlSaverFilter(scanXmlExists, handler, classes));
             map.put(url, classes);
             archives.add(archive);
         }
@@ -44,6 +44,10 @@ public class WebappAggregatedArchive imp
         archive = new CompositeArchive(archives);
     }
 
+    public WebappAggregatedArchive(final ClassLoader classLoader, final Map<String, Object>
altDDs, ArrayList<URL> xmls) {
+        this(new ConfigurableClasspathArchive.FakeModule(classLoader, altDDs), xmls);
+    }
+
     public Map<URL, List<String>> getClassesMap() {
         return map;
     }



Mime
View raw message