use of org.apache.openejb.jee.oejb2.Jndi in project tomee by apache.
the class MappedNameBuilder method deploy.
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
for (final EjbModule ejbModule : appModule.getEjbModules()) {
final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
if (openejbJar == null) {
return appModule;
}
final Map<String, EjbDeployment> ejbDeployments = openejbJar.getDeploymentsByEjbName();
for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
final EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
if (ejbDeployment == null) {
continue;
}
final String mappedName = enterpriseBean.getMappedName();
if (mappedName != null && mappedName.length() > 0) {
ejbDeployment.getJndi().add(new Jndi(mappedName, "Remote"));
}
}
}
return appModule;
}
Aggregations