private void addJSFInjection(String jsfVersion, ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) throws DeploymentUnitProcessingException { if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL)) return; ModuleIdentifier jsfInjectionModule = moduleIdFactory.getInjectionModId(jsfVersion); ModuleDependency jsfInjectionDependency = new ModuleDependency(moduleLoader, jsfInjectionModule, false, true, true, false); try { if (isJSF12(jsfInjectionDependency, jsfInjectionModule.toString())) { JSFLogger.ROOT_LOGGER.loadingJsf12(); jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/faces-config.xml"), false); jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/1.2/faces-config.xml"), true); } else { JSFLogger.ROOT_LOGGER.loadingJsf2x(); jsfInjectionDependency.addImportFilter(PathFilters.getMetaInfFilter(), true); // Exclude JSF 1.2 faces-config.xml to make extra sure it won't interfere with JSF 2.0 deployments jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/1.2/faces-config.xml"), false); } } catch (ModuleLoadException e) { throw JSFLogger.ROOT_LOGGER.jsfInjectionFailed(jsfVersion); } moduleSpecification.addSystemDependency(jsfInjectionDependency); }
/** * 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)); }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, false)); }
@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)); }
/** * Add the EE APIs as a dependency to all deployments * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); //add jboss-invocation classes needed by the proxies ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false); invocation.addImportFilter(PathFilters.is("org/jboss/invocation/proxy/classloading"), true); invocation.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(invocation); ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/component/serialization"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent/handle"), true); ee.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(ee); // add dep for naming permission moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.wildfly.naming"), false, false, false, false)); //we always add all Java EE API modules, as the platform spec requires them to always be available //we do not just add the javaee.api module, as this breaks excludes for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) { moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false)); } }
@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)); }
/** * Add dependencies for modules required for weld deployments, if managed weld configurations are attached to the deployment * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); addDependency(moduleSpecification, moduleLoader, JAVAX_ENTERPRISE_API); addDependency(moduleSpecification, moduleLoader, JAVAX_INJECT_API); if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) { return; // Skip if there are no beans.xml files in the deployment } addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID); addDependency(moduleSpecification, moduleLoader, WELD_CORE_ID); addDependency(moduleSpecification, moduleLoader, WELD_PROBE_ID, true); addDependency(moduleSpecification, moduleLoader, WELD_API_ID); addDependency(moduleSpecification, moduleLoader, WELD_SPI_ID); ModuleDependency weldSubsystemDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_ID, false, false, false, false); weldSubsystemDependency.addImportFilter(PathFilters.getMetaInfFilter(), true); weldSubsystemDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/injection"), true); weldSubsystemDependency.addImportFilter(PathFilters.acceptAll(), false); weldSubsystemDependency.addExportFilter(PathFilters.getMetaInfFilter(), true); moduleSpecification.addSystemDependency(weldSubsystemDependency); // Due to serialization of EJBs ModuleDependency weldEjbDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_EJB_ID, true, false, false, false); weldEjbDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/ejb"), true); weldEjbDependency.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(weldEjbDependency); }
filters.add(new FilterSpecification(PathFilters.isChildOf(path), include)); } else { filters.add(new FilterSpecification(PathFilters.is(path), include));
private void addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, boolean optional, boolean deploymentBundelesClientBuilder) { ModuleDependency dependency = new ModuleDependency(moduleLoader, moduleIdentifier, optional, false, true, false); if(deploymentBundelesClientBuilder) { dependency.addImportFilter(PathFilters.is(CLIENT_BUILDER), false); } moduleSpecification.addSystemDependency(dependency); }
builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
private void addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, boolean optional, boolean deploymentBundelesClientBuilder) { ModuleDependency dependency = new ModuleDependency(moduleLoader, moduleIdentifier, optional, false, true, false); if(deploymentBundelesClientBuilder) { dependency.addImportFilter(PathFilters.is(CLIENT_BUILDER), false); } moduleSpecification.addSystemDependency(dependency); }
builder.addFilter(PathFilters.isChildOf(path), include); } else { builder.addFilter(PathFilters.is(path), include);
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); }
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); }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); }
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); }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, false)); }
/** * Add the EE APIs as a dependency to all deployments * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); //add jboss-invocation classes needed by the proxies ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false); invocation.addImportFilter(PathFilters.is("org/jboss/invocation/proxy/classloading"), true); invocation.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(invocation); ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/component/serialization"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent/handle"), true); ee.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(ee); // add dep for naming permission moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.wildfly.naming"), false, false, false, false)); //we always add all Java EE API modules, as the platform spec requires them to always be available //we do not just add the javaee.api module, as this breaks excludes for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) { moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false)); } }
/** * Add the EE APIs as a dependency to all deployments * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAVAEE_API_ID, false, false, true, false)); // TODO: Post 7.0, we have to rethink this whole hibernate dependencies that we add to user deployments moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HIBERNATE_VALIDATOR_ID, false, false, true, false)); //add jboss-invocation classes needed by the proxies ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false); invocation.addImportFilter(PathFilters.is("org.jboss.invocation.proxy.classloading"), true); moduleSpecification.addSystemDependency(invocation); ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false); ee.addImportFilter(PathFilters.is("org.jboss.as.ee.component.serialization"), true); moduleSpecification.addSystemDependency(ee); }