openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1822816 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
Date Wed, 31 Jan 2018 17:33:01 GMT
Author: rmannibucau
Date: Wed Jan 31 17:33:01 2018
New Revision: 1822816

URL: http://svn.apache.org/viewvc?rev=1822816&view=rev
Log:
simplifying MeecrowaveBus and enforcing the classloader to avoid to rely on resource in ServletController
when unneeded

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

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java?rev=1822816&r1=1822815&r2=1822816&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/cxf/MeecrowaveBus.java
Wed Jan 31 17:33:01 2018
@@ -14,9 +14,6 @@ import org.apache.johnzon.jaxrs.JsrMessa
 import org.apache.johnzon.jaxrs.JsrMessageBodyWriter;
 import org.apache.johnzon.jaxrs.jsonb.jaxrs.JsonbJaxrsProvider;
 import org.apache.meecrowave.Meecrowave;
-import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory;
-import org.apache.webbeans.proxy.NormalScopeProxyFactory;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
@@ -45,8 +42,6 @@ import static java.util.stream.Collector
 @ApplicationScoped
 public class MeecrowaveBus implements Bus {
     private final Bus delegate = new ExtensionManagerBus();
-    private NormalScopeProxyFactory normalScopeProxyFactory;
-    private InterceptorDecoratorProxyFactory interceptorDecoratorProxyFactory;
 
     protected MeecrowaveBus() {
         // no-op: for proxies
@@ -54,11 +49,9 @@ public class MeecrowaveBus implements Bu
 
     @Inject
     public MeecrowaveBus(final ServletContext context) {
-        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
-        normalScopeProxyFactory = webBeansContext.getNormalScopeProxyFactory();
-        interceptorDecoratorProxyFactory = webBeansContext.getInterceptorDecoratorProxyFactory();
-
+        final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
         setProperty(ClassUnwrapper.class.getName(), (ClassUnwrapper) this::getRealClass);
+        setExtension(contextClassLoader, ClassLoader.class); // ServletController locks on
the classloader otherwise
 
         final Meecrowave.Builder builder = Meecrowave.Builder.class.cast(context.getAttribute("meecrowave.configuration"));
         if (builder != null && builder.isJaxrsProviderSetup()) {
@@ -89,7 +82,6 @@ public class MeecrowaveBus implements Bu
 
             if (builder.isJaxrsAutoActivateBeanValidation()) {
                 try { // we don't need the jaxrsbeanvalidationfeature since bean validation
cdi extension handles it normally
-                    final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
                     contextClassLoader.loadClass("javax.validation.Validation");
                     final Object instance = contextClassLoader.loadClass("org.apache.cxf.jaxrs.validation.ValidationExceptionMapper")
                                                        .getConstructor().newInstance();



Mime
View raw message