String link = ref.getLink();
String mappedName = ref.getMappedName();
// Use mapped name first
if(mappedName == null || mappedName.length() == 0)
{
ContainerDependencyMetaData target = null;
if(link != null)
{
EndpointInfo info = resolver.getEndpointInfo(link, EndpointType.EJB, vfsContext);
if(info != null)
{
target = endpointMap.get(info.getComponentKey());
}
else
{
/* A non-local link without a # jar target. This is allowed
for java ee clients so we have to search all ejb deployments.
First get the vfspaths of the ejb deploymens.
*/
List<String> ejbPaths = getEjbDeploymentPaths(unit);
for(String path : ejbPaths)
{
EndpointInfo altInfo = resolver.getEndpointInfo(link, EndpointType.EJB, path);
if(altInfo != null)
target = endpointMap.get(altInfo.getComponentKey());
if(target != null)
break;
}
}
if(target == null)
{
unresolvedRefs.add(cdmd.getComponentID()+":"+ref);
continue;
}
}
if(target == null && ref.getRemote() != null)
{
// Try the local interface type
target = resolveEjbInterface(ref.getRemote(), unit,
endpointMap, resolver);
}
if(target == null)
unresolvedRefs.add(cdmd.getComponentID()+":"+ref);
else
{
// Obtain remote interface name
String remoteInterface = ref.getRemote();
// Get Metadata
JBossEnterpriseBeanMetaData md = target.getBeanMetaData();
/*
* If for a Session bean we've got a reference to an EJB2.x
* Remote Component interface, stop processing because these
* are not bound in JNDI (only accessible via Home.create()