Skip to content

Commit

Permalink
Merge pull request wildfly#18695 from bstansberry/WFLY-20320
Browse files Browse the repository at this point in the history
[WFLY-20320] Change use of Attachments.ADDITIONAL_ANNOTATION_INDEXES…
  • Loading branch information
bstansberry authored Jan 25, 2025
2 parents 19ae775 + 44f5b3d commit 6ccd659
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.jboss.as.server.deployment.module.ModuleDependency;
import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.filter.PathFilters;

import static org.jboss.as.ee.subsystem.GlobalModulesDefinition.GlobalModule;
Expand Down Expand Up @@ -47,7 +46,7 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
}

if(module.isAnnotations()) {
deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, ModuleIdentifier.fromString(module.getModuleName()));
deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_INDEX_MODULES, module.getModuleName());
}

moduleSpecification.addSystemDependency(dependency);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,61 @@ public static List<GlobalModule> createModuleList(final OperationContext context
return ret;
}

/**
* Descriptive information for a module that should be added as a dependency to all deployment modules.
*/
public static final class GlobalModule {
private final String moduleName;
private final boolean annotations;
private final boolean services;
private final boolean metaInf;


/**
* Creates a new global module.
*
* @param moduleName {@link org.jboss.as.controller.ModuleIdentifierUtil#canonicalModuleIdentifier(String) canonicalized} name of the module
* @param annotations {@code true} if the module should be indexed for annotations
* @param services {@code true} if dependent modules should be able to import services from this module
* @param metaInf {@code true} if dependent modules should be able to import META-INF resources from this module
*/
GlobalModule(final String moduleName, final boolean annotations, final boolean services, final boolean metaInf) {
this.moduleName = moduleName;
this.annotations = annotations;
this.services = services;
this.metaInf = metaInf;
}

/**
* Gets the name of the module.
*
* @return the {@link org.jboss.as.controller.ModuleIdentifierUtil#canonicalModuleIdentifier(String) canonicalized} name of the module
* Will not return {@code null}
*/
public String getModuleName() {
return moduleName;
}

/**
* Gets whether the module should be indexed for annotations.
* @return {@code true} if the module should be indexed for annotations
*/
public boolean isAnnotations() {
return annotations;
}

/**
* Gets whether dependent modules should be able to import services from this module
* @return {@code true} if dependent modules should be able to import services from this module
*/
public boolean isServices() {
return services;
}

/**
* Gets whether dependent modules should be able to import META-INF resources from this module
* @return {@code true} if dependent modules should be able to import META-INF resources from this module
*/
public boolean isMetaInf() {
return metaInf;
}
Expand Down

0 comments on commit 6ccd659

Please sign in to comment.