private static void initJndiReferences(EnterpriseBean enterpriseBean, EjbDeployment ejbDeployment, EnterpriseBeanInfo beanInfo, JndiEncInfoBuilder jndiEncInfoBuilder, String moduleId) throws OpenEJBException {
// Link all the resource refs
for (ResourceRef res : enterpriseBean.getResourceRef()) {
ResourceLink resourceLink = ejbDeployment.getResourceLink(res.getResRefName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
res.setMappedName(resourceLink.getResId());
}
}
for (ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getResourceEnvRefName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
ref.setMappedName(resourceLink.getResId());
}
}
for (MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getMessageDestinationRefName());
if (resourceLink != null && resourceLink.getResId() != null /* don't overwrite with null */) {
ref.setMappedName(resourceLink.getResId());
}
}
// Link all the ejb refs
for (EjbRef ejbRef : enterpriseBean.getEjbRef()) {