Search in sources :

Example 11 with Configuration

use of org.apache.meecrowave.configuration.Configuration in project meecrowave by apache.

the class MeecrowaveTest method classpathUsingConfigurationAndNotBuilder.

@Test
public void classpathUsingConfigurationAndNotBuilder() {
    final Meecrowave.Builder randomPortHolder = new Meecrowave.Builder().randomHttpPort();
    final Configuration configuration = new Configuration();
    configuration.setHttpPort(randomPortHolder.getHttpPort());
    configuration.setScanningPackageIncludes("org.superbiz.app");
    try (final Meecrowave meecrowave = new Meecrowave(new Configuration()).bake()) {
        assertClasspath(meecrowave);
    } catch (final IOException e) {
        fail(e.getMessage());
    }
}
Also used : Configuration(org.apache.meecrowave.configuration.Configuration) IOException(java.io.IOException) Test(org.junit.Test)

Example 12 with Configuration

use of org.apache.meecrowave.configuration.Configuration in project meecrowave by apache.

the class OWBTomcatWebScannerService method setFilter.

// replace init
public void setFilter(final JarScanFilter filter, final ServletContext ctx) {
    this.filter = filter;
    super.init(ctx);
    final Configuration config = Configuration.class.cast(ServletContext.class.cast(ctx).getAttribute("meecrowave.configuration"));
    if (this.filter == null) {
        this.filter = new KnownJarsFilter(config);
    }
    final Filter userFilter = webBeansContext().getService(Filter.class);
    if (KnownClassesFilter.class.isInstance(userFilter)) {
        KnownClassesFilter.class.cast(userFilter).init(config);
    }
}
Also used : Configuration(org.apache.meecrowave.configuration.Configuration) Filter(org.apache.xbean.finder.filter.Filter) JarScanFilter(org.apache.tomcat.JarScanFilter)

Aggregations

Configuration (org.apache.meecrowave.configuration.Configuration)12 IOException (java.io.IOException)8 Field (java.lang.reflect.Field)5 Collection (java.util.Collection)5 Map (java.util.Map)5 Optional.ofNullable (java.util.Optional.ofNullable)5 Collectors.toList (java.util.stream.Collectors.toList)5 Stream (java.util.stream.Stream)5 File (java.io.File)4 InputStream (java.io.InputStream)4 MalformedURLException (java.net.MalformedURLException)4 URL (java.net.URL)4 StandardCharsets (java.nio.charset.StandardCharsets)4 HashMap (java.util.HashMap)4 List (java.util.List)4 OutputStream (java.io.OutputStream)3 StringReader (java.io.StringReader)3 Writer (java.io.Writer)3 URLClassLoader (java.net.URLClassLoader)3 ArrayList (java.util.ArrayList)3