super.merge(jbossEnv, specEnv, overridenFile, overrideFile, mustOverride);
EJBLocalReferencesMetaData ejbLocalRefs = null;
EJBLocalReferencesMetaData jbossEjbLocalRefs = null;
PersistenceContextReferencesMetaData specPersistenceContextRefs = null;
PersistenceContextReferencesMetaData jbossPersistenceContextRefs = null;
if (specEnv != null)
{
ejbLocalRefs = specEnv.getEjbLocalReferences();
specPersistenceContextRefs = specEnv.getPersistenceContextRefs();
}
if (jbossEnv != null)
{
jbossEjbLocalRefs = jbossEnv.getEjbLocalReferences();
jbossPersistenceContextRefs = jbossEnv.getPersistenceContextRefs();
}
else
{
// Use the merge target for the static merge methods
jbossEjbLocalRefs = this.getEjbLocalReferences();
jbossPersistenceContextRefs = getPersistenceContextRefs();
}
EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(jbossEjbLocalRefs, ejbLocalRefs, overridenFile, overrideFile);
if (mergedEjbLocalRefs != null)
this.setEjbLocalReferences(mergedEjbLocalRefs);
// Need to set the jndi name from resource mgr if referenced
ResourceReferencesMetaData jbossResRefs = getResourceReferences();
if(resourceMgrs != null && jbossResRefs != null)
{
for(ResourceReferenceMetaData ref : jbossResRefs)
{
ResourceManagerMetaData mgr = resourceMgrs.get(ref.getResourceName());
if(mgr != null)
{
if(mgr.getResJndiName() != null)
ref.setJndiName(mgr.getResJndiName());
else if(mgr.getResUrl() != null)
ref.setResUrl(mgr.getResUrl());
}
}
}
PersistenceContextReferencesMetaData mergedPcRefs = PersistenceContextReferencesMetaData.merge(jbossPersistenceContextRefs,
specPersistenceContextRefs, overridenFile, overrideFile);
if (mergedPcRefs != null)
this.setPersistenceContextRefs(mergedPcRefs);
}