*/
public List<EZBJNDIBeanData> getEJBJNDINames(final String interfaceName, final String beanName, final URL ejbLinkURL) {
// Get the container for the given URL if present
if (ejbLinkURL != null) {
EZBContainerJNDIResolver containerJNDIResolver = this.containersMap.get(ejbLinkURL);
// found one ?
if (containerJNDIResolver != null) {
return containerJNDIResolver.getEJBJNDINames(interfaceName, beanName, false);
}
// No container for this URL
return Collections.emptyList();
}
// Need to ask all containers as we don't know the right URL
Collection<EZBContainerJNDIResolver> containerJNDIResolvers = this.containersMap.values();
// No containers, do nothing
if (containerJNDIResolvers == null) {
return Collections.emptyList();
}
// Build list that will be returned
List<EZBJNDIBeanData> beanDataList = new ArrayList<EZBJNDIBeanData>();
// Ask all containers and add the return value
for (EZBContainerJNDIResolver containerJNDIResolver : containerJNDIResolvers) {
// Ask without asking ourself again else it ends it recursive loop
beanDataList.addAll(containerJNDIResolver.getEJBJNDINames(interfaceName, beanName, false));
}
// Return value
return beanDataList;
}