// get hold of the deployment unit
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
//we always give them the EJB client
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_CLIENT, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_IIOP_CLIENT, false, false, false, false));
//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, false, false));
if (JacORBDeploymentMarker.isJacORBDeployment(deploymentUnit)) {
//needed for dynamic IIOP stubs
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACORB, false, false, false, false));
}
// fetch the EjbJarMetaData
//TODO: remove the app client bit after the next EJB release
if (!isEjbDeployment(deploymentUnit) && !DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) {
// nothing to do
return;
}
// 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, ModuleIdentifier.CLASSPATH, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAVAEE_MODULE_IDENTIFIER, false, false, false, false));
}