Skip to content

Commit

Permalink
Merge pull request wildfly#18578 from ropalka/WFLY-20174
Browse files Browse the repository at this point in the history
[WFLY-20174] Use ModuleDependency.Builder instead of deprecated ModuleDependency ctor in EJB
  • Loading branch information
bstansberry authored Jan 8, 2025
2 parents b406362 + c03f3e3 commit 0608f8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);

//always add EE API
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_API, false, false, true, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_API).setImportServices(true).build());
//we always give them the Jakarta Enterprise Beans client
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_CLIENT, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_NAMING_CLIENT, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_IIOP_CLIENT, false, false, false, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_CLIENT).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_NAMING_CLIENT).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_IIOP_CLIENT).build());

//we always have to add this, as even non-ejb deployments may still lookup IIOP ejb's
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_SUBSYSTEM, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_EJB, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_NAMING, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_TRANSACTION, false, false, true, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_SUBSYSTEM).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, HTTP_EJB).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, HTTP_NAMING).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, HTTP_TRANSACTION).setImportServices(true).build());
// Marshalling support for EJB SessionIDs
// TODO Move this to distributable-ejb subsystem
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, CLUSTERING_EJB_CLIENT, false, false, true, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, CLUSTERING_EJB_CLIENT).setImportServices(true).build());

if (IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) {
//needed for dynamic IIOP stubs
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IIOP_OPENJDK, false, false, false, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, IIOP_OPENJDK).build());
}

// fetch the EjbJarMetaData
Expand All @@ -91,7 +91,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
// FIXME: still not the best way to do it
//this must be the first dep listed in the module
if (Boolean.getBoolean("org.jboss.as.ejb3.EMBEDDED"))
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "Classpath", false, false, false, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, "Classpath").build());

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification deploymentModuleSpec = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
for(final String interceptorModule : interceptorModules) {
deploymentModuleSpec.addSystemDependency(new ModuleDependency(moduleLoader, interceptorModule, false, false, true, false));

for (String interceptorModule : interceptorModules) {
deploymentModuleSpec.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, interceptorModule).setImportServices(true).build());
}
}
}

0 comments on commit 0608f8f

Please sign in to comment.