/** * Add POJO module if we have any bean factories. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) { if (kdxd.getBeanFactoriesCount() > 0) { final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false); PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName()); dependency.addImportFilter(filter, true); dependency.addImportFilter(PathFilters.rejectAll(), false); moduleSpecification.addSystemDependency(dependency); return; } } }
/** * Get a path filter which matches any path which is equal to, or a child of, the given path name. * * @param path the path name * @return a filter which returns {@code true} if the path name is equal to, or a child of, the given path */ public static PathFilter isOrIsChildOf(String path) { return any(is(path), isChildOf(path)); }
/** * Get a path filter which matches any path which is equal to, or a child of, the given path name. * * @param path the path name * @return a filter which returns {@code true} if the path name is equal to, or a child of, the given path */ public static PathFilter isOrIsChildOf(String path) { return any(is(path), isChildOf(path)); }
@Override protected void configure(ModuleLoader loader, Builder builder) { builder.addDependency(DependencySpec.createSystemDependencySpec( PathFilters.acceptAll(), PathFilters.any(Arrays.asList( PathFilters.isChildOf("javax"), PathFilters.is("org/jboss/weld"), PathFilters.isChildOf("org/jboss/weld"))), systemPaths)); }
@Override protected void configure(ModuleLoader loader, Builder builder) { builder.addDependency(DependencySpec.createSystemDependencySpec( PathFilters.acceptAll(), PathFilters.any(Arrays.asList( PathFilters.is("META-INF/services"), PathFilters.is("org/jboss/forge/container"), PathFilters.isChildOf("org/jboss/forge/container"), PathFilters.is("org/jboss/forge/proxy"), PathFilters.isChildOf("org/jboss/forge/proxy"), PathFilters.is("javassist"), PathFilters.isChildOf("javassist") )), systemPaths)); }
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
private static void parsePath(final XmlPullParser reader, final boolean include, final MultiplePathFilterBuilder builder) throws XmlPullParserException, IOException { String path = null; final Set<String> required = new HashSet<>(Arrays.asList(A_PATH)); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i ++) { final String attribute = reader.getAttributeName(i); required.remove(attribute); switch (attribute) { case A_PATH: path = reader.getAttributeValue(i); break; default: throw unknownAttribute(reader, attribute); } } if (! required.isEmpty()) { throw missingAttributes(reader, required); } final boolean literal = path.indexOf('*') == -1 && path.indexOf('?') == -1; if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include); } } else { builder.addFilter(PathFilters.match(path), include); } // consume remainder of element parseNoContent(reader); }
private static void parsePath(final XmlPullParser reader, final boolean include, final MultiplePathFilterBuilder builder) throws XmlPullParserException, IOException { String path = null; final Set<String> required = new HashSet<>(LIST_A_PATH); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i ++) { validateAttributeNamespace(reader, i); final String attribute = reader.getAttributeName(i); required.remove(attribute); switch (attribute) { case A_PATH: path = reader.getAttributeValue(i); break; default: throw unknownAttribute(reader, i); } } if (! required.isEmpty()) { throw missingAttributes(reader, required); } final boolean literal = path.indexOf('*') == -1 && path.indexOf('?') == -1; if (literal) { if (path.charAt(path.length() - 1) == '/') { builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include); } } else { builder.addFilter(PathFilters.match(path), include); } // consume remainder of element parseNoContent(reader); }
/** * Add POJO module if we have any bean factories. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) { if (kdxd.getBeanFactoriesCount() > 0) { final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false); PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName()); dependency.addImportFilter(filter, true); dependency.addImportFilter(PathFilters.rejectAll(), false); moduleSpecification.addSystemDependency(dependency); return; } } }
/** * Add POJO module if we have any bean factories. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) { if (kdxd.getBeanFactoriesCount() > 0) { final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false); PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName()); dependency.addImportFilter(filter, true); dependency.addImportFilter(PathFilters.rejectAll(), false); moduleSpecification.addSystemDependency(dependency); return; } } }