openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1799834 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java
Date Sun, 25 Jun 2017 19:27:41 GMT
Author: gpetracek
Date: Sun Jun 25 19:27:40 2017
New Revision: 1799834

URL: http://svn.apache.org/viewvc?rev=1799834&view=rev
Log:
MEECROWAVE-45 support for owb2

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java?rev=1799834&r1=1799833&r2=1799834&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/OWBTomcatWebScannerService.java
Sun Jun 25 19:27:40 2017
@@ -21,6 +21,7 @@ package org.apache.meecrowave.openwebbea
 import org.apache.meecrowave.Meecrowave;
 import org.apache.meecrowave.logging.tomcat.LogFacade;
 import org.apache.tomcat.JarScanFilter;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.scanner.xbean.CdiArchive;
 import org.apache.webbeans.spi.BeanArchiveService;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -168,7 +169,7 @@ public class OWBTomcatWebScannerService
         final String key = uri.toASCIIString();
         CdiArchive.FoundClasses foundClasses = archive.classesByUrl().get(key);
         if (foundClasses == null) {
-            final BeanArchiveService beanArchiveService = webBeansContext.getBeanArchiveService();
+            final BeanArchiveService beanArchiveService = webBeansContext().getBeanArchiveService();
             foundClasses = CdiArchive.FoundClasses.class.cast(
                     CdiArchive.FoundClasses.class.getConstructor(CdiArchive.class, URL.class,
Collection.class, BeanArchiveService.BeanArchiveInformation.class)
                             .newInstance(null, url, new HashSet<>(), beanArchiveService.getBeanArchiveInformation(url)));
@@ -244,7 +245,7 @@ public class OWBTomcatWebScannerService
             this.filter = new KnownJarsFilter(config);
         }
 
-        final Filter userFilter = this.webBeansContext.getService(Filter.class);
+        final Filter userFilter = webBeansContext().getService(Filter.class);
         if (KnowClassesFilter.class.isInstance(userFilter)) {
             KnowClassesFilter.class.cast(userFilter).init(config);
         }
@@ -276,4 +277,9 @@ public class OWBTomcatWebScannerService
     public void setFileVisitor(final Consumer<File> fileVisitor) {
         this.fileVisitor = fileVisitor;
     }
+
+    //don't rename this method - in case of owb2 it overrides the method defined in AbstractMetaDataDiscovery
+    protected WebBeansContext webBeansContext() {
+        return WebBeansContext.getInstance(); //only way to be compatible with owb 1.7.x
and 2.x (without reflection)
+    }
 }



Mime
View raw message