@Override protected void processClasses(final WebXml webXml, final Set<WebXml> orderedFragments) { final ClassLoader loader = context.getLoader().getClassLoader(); orderedFragments.forEach(fragment -> { final WebXml annotations = new WebXml(); annotations.setDistributable(true); final URL url = fragment.getURL(); final Collection<Class<?>> classes = webClasses.get(url.toExternalForm()); if (classes == null) { return; } classes.forEach(clazz -> { try (final InputStream stream = loader.getResourceAsStream(clazz.getName().replace('.', '/') + ".class")) { processClass(annotations, new ClassParser(stream).parse()); } catch (final IOException e) { new LogFacade(MeecrowaveContextConfig.class.getName()).error("Can't parse " + clazz); } }); fragment.merge(singleton(annotations)); }); }
@Override protected void processClasses(final WebXml webXml, final Set<WebXml> orderedFragments) { final ClassLoader loader = context.getLoader().getClassLoader(); orderedFragments.forEach(fragment -> { final WebXml annotations = new WebXml(); annotations.setDistributable(true); final URL url = fragment.getURL(); final Collection<Class<?>> classes = webClasses.get(url.toExternalForm()); if (classes == null) { return; } classes.forEach(clazz -> { try (final InputStream stream = loader.getResourceAsStream(clazz.getName().replace('.', '/') + ".class")) { processClass(annotations, new ClassParser(stream).parse()); } catch (final IOException e) { new LogFacade(MeecrowaveContextConfig.class.getName()).error("Can't parse " + clazz); } }); fragment.merge(singleton(annotations)); }); }
protected void processAnnotations(Set<WebXml> fragments, boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) { for(WebXml fragment : fragments) { // Only need to scan for @HandlesTypes matches if any of the // following are true: // - it has already been determined only @HandlesTypes is required // (e.g. main web.xml has metadata-complete="true" // - this fragment is for a container JAR (Servlet 3.1 section 8.1) // - this fragment has metadata-complete="true" boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() || fragment.isMetadataComplete(); WebXml annotations = new WebXml(); // no impact on distributable annotations.setDistributable(true); URL url = fragment.getURL(); processAnnotationsUrl(url, annotations, htOnly, javaClassCache); Set<WebXml> set = new HashSet<>(); set.add(annotations); // Merge annotations into fragment - fragment takes priority fragment.merge(set); } }
protected void processAnnotations(Set<WebXml> fragments, boolean handlesTypesOnly, Map<String,JavaClassCacheEntry> javaClassCache) { for(WebXml fragment : fragments) { // Only need to scan for @HandlesTypes matches if any of the // following are true: // - it has already been determined only @HandlesTypes is required // (e.g. main web.xml has metadata-complete="true" // - this fragment is for a container JAR (Servlet 3.1 section 8.1) // - this fragment has metadata-complete="true" boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() || fragment.isMetadataComplete(); WebXml annotations = new WebXml(); // no impact on distributable annotations.setDistributable(true); URL url = fragment.getURL(); processAnnotationsUrl(url, annotations, htOnly, javaClassCache); Set<WebXml> set = new HashSet<>(); set.add(annotations); // Merge annotations into fragment - fragment takes priority fragment.merge(set); } }
protected void processAnnotations(Set<WebXml> fragments, boolean handlesTypesOnly) { for(WebXml fragment : fragments) { // Only need to scan for @HandlesTypes matches if any of the // following are true: // - it has already been determined only @HandlesTypes is required // (e.g. main web.xml has metadata-complete="true" // - this fragment is for a container JAR (Servlet 3.1 section 8.1) // - this fragment has metadata-complete="true" boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() || fragment.isMetadataComplete(); WebXml annotations = new WebXml(); // no impact on distributable annotations.setDistributable(true); URL url = fragment.getURL(); processAnnotationsUrl(url, annotations, htOnly); Set<WebXml> set = new HashSet<>(); set.add(annotations); // Merge annotations into fragment - fragment takes priority fragment.merge(set); } }
webXml.merge(orderedFragments); return webXml;
webXml.merge(orderedFragments); return webXml;