Search in sources :

Example 1 with ProvidedLoader

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)));
}
Also used : WebBeansContext(org.apache.webbeans.config.WebBeansContext) CreationalContext(javax.enterprise.context.spi.CreationalContext) StandardContext(org.apache.catalina.core.StandardContext) Context(org.apache.catalina.Context) MeecrowaveClientLifecycleListener(org.apache.meecrowave.cxf.MeecrowaveClientLifecycleListener) ProvidedLoader(org.apache.meecrowave.tomcat.ProvidedLoader) SecurityCollection(org.apache.tomcat.util.descriptor.web.SecurityCollection) SecretKeySpec(javax.crypto.spec.SecretKeySpec) ServerSocket(java.net.ServerSocket) URLClassLoader(java.net.URLClassLoader) Host(org.apache.catalina.Host) StopListening(org.apache.meecrowave.api.StopListening) Map(java.util.Map) SAXParser(javax.xml.parsers.SAXParser) Path(java.nio.file.Path) Log4j2Log(org.apache.meecrowave.logging.tomcat.Log4j2Log) LifecycleException(org.apache.catalina.LifecycleException) Set(java.util.Set) CDI(javax.enterprise.inject.spi.CDI) CDIInstanceManager(org.apache.meecrowave.tomcat.CDIInstanceManager) StandardCharsets(java.nio.charset.StandardCharsets) WebBeansContext(org.apache.webbeans.config.WebBeansContext) BufferStrategy(org.apache.johnzon.core.BufferStrategy) ResourceFinder(org.apache.xbean.finder.ResourceFinder) Stream(java.util.stream.Stream) ConfigurableBus(org.apache.meecrowave.cxf.ConfigurableBus) JarScanFilter(org.apache.tomcat.JarScanFilter) TomcatAutoInitializer(org.apache.meecrowave.tomcat.TomcatAutoInitializer) Log4j2Logger(org.apache.meecrowave.logging.jul.Log4j2Logger) Connector(org.apache.catalina.connector.Connector) StandardHost(org.apache.catalina.core.StandardHost) AnnotatedType(javax.enterprise.inject.spi.AnnotatedType) StandardCopyOption(java.nio.file.StandardCopyOption) ArrayList(java.util.ArrayList) CreationalContext(javax.enterprise.context.spi.CreationalContext) StrLookup(org.apache.commons.text.StrLookup) SecurityConstraint(org.apache.tomcat.util.descriptor.web.SecurityConstraint) StreamSupport(java.util.stream.StreamSupport) SSLHostConfig(org.apache.tomcat.util.net.SSLHostConfig) ManagementFactory(java.lang.management.ManagementFactory) Service(org.apache.catalina.Service) Properties(java.util.Properties) LogFacade(org.apache.meecrowave.logging.tomcat.LogFacade) Files(java.nio.file.Files) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) ValueTransformer(org.apache.meecrowave.service.ValueTransformer) Field(java.lang.reflect.Field) File(java.io.File) ObjectRecipe(org.apache.xbean.recipe.ObjectRecipe) DefaultHandler(org.xml.sax.helpers.DefaultHandler) TreeMap(java.util.TreeMap) Paths(java.nio.file.Paths) CliOption(org.apache.meecrowave.runner.cli.CliOption) BeanManager(javax.enterprise.inject.spi.BeanManager) MeecrowaveContextConfig(org.apache.catalina.startup.MeecrowaveContextConfig) URL(java.net.URL) Lifecycle(org.apache.catalina.Lifecycle) Catalina(org.apache.catalina.startup.Catalina) OWBJarScanner(org.apache.meecrowave.tomcat.OWBJarScanner) Http2Protocol(org.apache.coyote.http2.Http2Protocol) IO(org.apache.meecrowave.io.IO) LifecycleState(org.apache.catalina.LifecycleState) Collectors.toSet(java.util.stream.Collectors.toSet) Server(org.apache.catalina.Server) StartListening(org.apache.meecrowave.api.StartListening) Collections.emptyList(java.util.Collections.emptyList) Collection(java.util.Collection) ServiceLoader(java.util.ServiceLoader) FileNotFoundException(java.io.FileNotFoundException) Objects(java.util.Objects) Base64(java.util.Base64) List(java.util.List) Realm(org.apache.catalina.Realm) SAXException(org.xml.sax.SAXException) Writer(java.io.Writer) StandardContext(org.apache.catalina.core.StandardContext) NoDescriptorRegistry(org.apache.meecrowave.tomcat.NoDescriptorRegistry) OWBAutoSetup(org.apache.meecrowave.openwebbeans.OWBAutoSetup) LoginConfig(org.apache.tomcat.util.descriptor.web.LoginConfig) SAXParserFactory(javax.xml.parsers.SAXParserFactory) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Cipher(javax.crypto.Cipher) BiPredicate(java.util.function.BiPredicate) ServletContainerInitializer(javax.servlet.ServletContainerInitializer) Log4j2Shutdown(org.apache.meecrowave.logging.log4j2.Log4j2Shutdown) Attributes(org.xml.sax.Attributes) ROOT(java.util.Locale.ROOT) InjectionTarget(javax.enterprise.inject.spi.InjectionTarget) Manager(org.apache.catalina.Manager) CxfCdiAutoSetup(org.apache.meecrowave.cxf.CxfCdiAutoSetup) LinkedList(java.util.LinkedList) OutputStream(java.io.OutputStream) Collections.emptySet(java.util.Collections.emptySet) MalformedURLException(java.net.MalformedURLException) ManagerBase(org.apache.catalina.session.ManagerBase) Log4j2LoggerFactory(org.apache.meecrowave.logging.openwebbeans.Log4j2LoggerFactory) Optional.ofNullable(java.util.Optional.ofNullable) LoggingAccessLogPattern(org.apache.meecrowave.tomcat.LoggingAccessLogPattern) FileWriter(java.io.FileWriter) Globals(org.apache.catalina.Globals) StandardManager(org.apache.catalina.session.StandardManager) FileInputStream(java.io.FileInputStream) Context(org.apache.catalina.Context) StrSubstitutor(org.apache.commons.text.StrSubstitutor) Registry(org.apache.tomcat.util.modeler.Registry) Consumer(java.util.function.Consumer) Tomcat(org.apache.catalina.startup.Tomcat) Collectors.toList(java.util.stream.Collectors.toList) BusFactory(org.apache.cxf.BusFactory) InputStream(java.io.InputStream) Consumer(java.util.function.Consumer) ProvidedLoader(org.apache.meecrowave.tomcat.ProvidedLoader) URLClassLoader(java.net.URLClassLoader)

Aggregations

File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Writer (java.io.Writer)1 ManagementFactory (java.lang.management.ManagementFactory)1 Field (java.lang.reflect.Field)1 MalformedURLException (java.net.MalformedURLException)1 ServerSocket (java.net.ServerSocket)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 Paths (java.nio.file.Paths)1 StandardCopyOption (java.nio.file.StandardCopyOption)1