You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2019/02/12 08:52:12 UTC

svn commit: r1853423 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java

Author: rmannibucau
Date: Tue Feb 12 08:52:12 2019
New Revision: 1853423

URL: http://svn.apache.org/viewvc?rev=1853423&view=rev
Log:
MEECROWAVE-182 OWB-1280 ensure deployClasspath and deployWebapp respect both the same configuration (consumers, initializers)

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

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1853423&r1=1853422&r2=1853423&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java Tue Feb 12 08:52:12 2019
@@ -189,14 +189,7 @@ public class Meecrowave implements AutoC
         }
 
         final ProvidedLoader loader = new ProvidedLoader(classLoader, configuration.isTomcatWrapLoader());
-        final Consumer<Context> builtInCustomizer = c -> {
-            c.setLoader(loader);
-            if (configuration.antiResourceLocking && StandardContext.class.isInstance(c)) {
-                StandardContext.class.cast(c).setAntiResourceLocking(true);
-            }
-            configuration.getInitializers().forEach(i -> c.addServletContainerInitializer(i, emptySet()));
-            configuration.getGlobalContextConfigurers().forEach(it -> it.accept(c));
-        };
+        final Consumer<Context> builtInCustomizer = c -> c.setLoader(loader);
         return deployWebapp(new DeploymentMeta(meta.context, meta.docBase, ofNullable(meta.consumer).map(c -> (Consumer<Context>) ctx -> {
             builtInCustomizer.accept(ctx);
             c.accept(ctx);
@@ -404,6 +397,11 @@ public class Meecrowave implements AutoC
         }
 
         ofNullable(meta.consumer).ifPresent(c -> c.accept(ctx));
+        if (configuration.antiResourceLocking && StandardContext.class.isInstance(ctx)) {
+            StandardContext.class.cast(ctx).setAntiResourceLocking(true);
+        }
+        configuration.getInitializers().forEach(i -> ctx.addServletContainerInitializer(i, emptySet()));
+        configuration.getGlobalContextConfigurers().forEach(it -> it.accept(ctx));
 
         final Host host = tomcat.getHost();
         host.addChild(ctx);