use of org.apache.meecrowave.tomcat.ProvidedLoader in project meecrowave by apache.
the class Meecrowave method deployClasspath.
public Meecrowave deployClasspath(final DeploymentMeta meta) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
final ClassLoader parentLoader = tomcat.getServer().getParentClassLoader();
if (parentLoader.getParent() == classLoader) {
classLoader = parentLoader;
}
final ProvidedLoader loader = new ProvidedLoader(classLoader, configuration.isTomcatWrapLoader());
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);
}).orElse(builtInCustomizer)));
}
Aggregations