openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1060902 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/ webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/ webbeans-spi/src/main/java/org/apache/webbeans/spi/ webbeans-web/src/main/java/o...
Date Wed, 19 Jan 2011 19:05:03 GMT
Author: gpetracek
Date: Wed Jan 19 19:05:03 2011
New Revision: 1060902

URL: http://svn.apache.org/viewvc?rev=1060902&view=rev
Log:
OWB-519 fix for r1036194

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/BeansXmlAnnotationDB.java
    openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/BDABeansXmlScanner.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/scanner/WebScannerService.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java?rev=1060902&r1=1060901&r2=1060902&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
Wed Jan 19 19:05:03 2011
@@ -34,6 +34,7 @@ import org.apache.webbeans.logger.WebBea
 import org.apache.webbeans.spi.BDABeansXmlScanner;
 import org.apache.webbeans.spi.ScannerService;
 import org.apache.webbeans.util.ClassUtil;
+import org.scannotation.AnnotationDB;
 
 public abstract class AbstractMetaDataDiscovery implements ScannerService
 {
@@ -45,7 +46,7 @@ public abstract class AbstractMetaDataDi
     //private Map<String, InputStream> EJB_XML_LOCATIONS = new HashMap<String, InputStream>();
 
     /** Annotation Database */
-    private final BeansXmlAnnotationDB annotationDB;
+    private AnnotationDB annotationDB;
 
     protected boolean isBDAScannerEnabled = false;
     protected BDABeansXmlScanner bdaBeansXmlScanner;
@@ -54,8 +55,7 @@ public abstract class AbstractMetaDataDi
     {
         try
         {
-            annotationDB = new BeansXmlAnnotationDB();
-            annotationDB.setBdaBeansXmlScanner(this);
+            annotationDB = new AnnotationDB();
             annotationDB.setScanClassAnnotations(true);
             annotationDB.crossReferenceMetaAnnotations();
             annotationDB.setScanFieldAnnotations(false);
@@ -98,6 +98,9 @@ public abstract class AbstractMetaDataDi
         this.isBDAScannerEnabled = Boolean.parseBoolean(usage);
         if (isBDAScannerEnabled)
         {
+            annotationDB = new BeansXmlAnnotationDB();
+            ((BeansXmlAnnotationDB)annotationDB).setBdaBeansXmlScanner(this);
+
             bdaBeansXmlScanner = new DefaultBDABeansXmlScanner();
         }
     }
@@ -105,7 +108,7 @@ public abstract class AbstractMetaDataDi
     /**
      * @return the aNNOTATION_DB
      */
-    protected BeansXmlAnnotationDB getAnnotationDB()
+    protected AnnotationDB getAnnotationDB()
     {
         return annotationDB;
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/BeansXmlAnnotationDB.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/BeansXmlAnnotationDB.java?rev=1060902&r1=1060901&r2=1060902&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/BeansXmlAnnotationDB.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/BeansXmlAnnotationDB.java
Wed Jan 19 19:05:03 2011
@@ -35,6 +35,7 @@ import org.scannotation.AnnotationDB;
  * Provides extensions to AnnotationDB that allow the beans.xml
  * of each BDA to be associated with a class.
  *
+ * due to a file-url issue it isn't compatible with wls (see OWB-519)
  */
 public class BeansXmlAnnotationDB extends AnnotationDB
 {

Modified: openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/BDABeansXmlScanner.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/BDABeansXmlScanner.java?rev=1060902&r1=1060901&r2=1060902&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/BDABeansXmlScanner.java
(original)
+++ openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/BDABeansXmlScanner.java
Wed Jan 19 19:05:03 2011
@@ -21,6 +21,9 @@ package org.apache.webbeans.spi;
 import java.lang.annotation.Annotation;
 import java.util.Set;
 
+/**
+ * due to a file-url issue it isn't compatible with wls (see OWB-519)
+ */
 public interface BDABeansXmlScanner
 {
 

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/scanner/WebScannerService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/scanner/WebScannerService.java?rev=1060902&r1=1060901&r2=1060902&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/scanner/WebScannerService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/scanner/WebScannerService.java
Wed Jan 19 19:05:03 2011
@@ -26,8 +26,10 @@ import javax.servlet.ServletContext;
 
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.corespi.scanner.AbstractMetaDataDiscovery;
+import org.apache.webbeans.corespi.se.BeansXmlAnnotationDB;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.WebBeansUtil;
+import org.scannotation.AnnotationDB;
 import org.scannotation.ClasspathUrlFinder;
 import org.scannotation.WarUrlFinder;
 
@@ -114,7 +116,7 @@ public class WebScannerService extends A
                     {
                         fileDir = "file:/" + fileDir;
                         //TODO switch to a more stable approach
-                        url = new URL("jar:" + fileDir);
+                        //url = new URL("jar:" + fileDir);
                     }
 
                     addPath = new URL("jar:" + fileDir);
@@ -154,7 +156,12 @@ public class WebScannerService extends A
             addWebBeansXmlLocation(url);
             URL resourceuUrl = WarUrlFinder.findWebInfClassesPath(this.servletContext);
             //set resource to beans.xml mapping
-            getAnnotationDB().setResourceBeansXml(resourceuUrl, url);
+            AnnotationDB annotationDB = getAnnotationDB();
+
+            if(annotationDB instanceof BeansXmlAnnotationDB)
+            {
+                ((BeansXmlAnnotationDB)annotationDB).setResourceBeansXml(resourceuUrl, url);
+            }
             return resourceuUrl;
         }
 



Mime
View raw message