Skip to content

Commit 0608f8f

Browse files
authored
Merge pull request wildfly#18578 from ropalka/WFLY-20174
[WFLY-20174] Use ModuleDependency.Builder instead of deprecated ModuleDependency ctor in EJB
2 parents b406362 + c03f3e3 commit 0608f8f

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

ejb3/src/main/java/org/jboss/as/ejb3/deployment/processors/EjbDependencyDeploymentUnitProcessor.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
6060
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
6161

6262
//always add EE API
63-
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_API, false, false, true, false));
63+
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_API).setImportServices(true).build());
6464
//we always give them the Jakarta Enterprise Beans client
65-
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_CLIENT, false, false, true, false));
66-
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_NAMING_CLIENT, false, false, true, false));
67-
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_IIOP_CLIENT, false, false, false, false));
65+
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_CLIENT).setImportServices(true).build());
66+
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_NAMING_CLIENT).setImportServices(true).build());
67+
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, EJB_IIOP_CLIENT).build());
6868

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

7878
if (IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) {
7979
//needed for dynamic IIOP stubs
80-
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IIOP_OPENJDK, false, false, false, false));
80+
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, IIOP_OPENJDK).build());
8181
}
8282

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

9696
}
9797
}

ejb3/src/main/java/org/jboss/as/ejb3/subsystem/StaticInterceptorsDependenciesDeploymentUnitProcessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentU
3838
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
3939
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
4040
final ModuleSpecification deploymentModuleSpec = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
41-
for(final String interceptorModule : interceptorModules) {
42-
deploymentModuleSpec.addSystemDependency(new ModuleDependency(moduleLoader, interceptorModule, false, false, true, false));
41+
42+
for (String interceptorModule : interceptorModules) {
43+
deploymentModuleSpec.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, interceptorModule).setImportServices(true).build());
4344
}
4445
}
4546
}

0 commit comments

Comments
 (0)