private String getImplicitContainerId(URI module, String refName, EJBRefInfo ejbRefInfo) throws DeploymentException {
Map references = (Map) ejbInterfaceIndex.get(ejbRefInfo);
// if we didn't find any ejbs that implement that interface... give up
if (references == null || references.isEmpty()) {
throw new UnresolvedEJBRefException(refName, ejbRefInfo.isLocal(), ejbRefInfo.isSession(), ejbRefInfo.getHomeIntf(), ejbRefInfo.getBeanIntf(), false);
}
// if there is only one matching ejb, use it
if (references.size() == 1) {
return (String) references.values().iterator().next();
}
// We got more then one matching ejb. Try to find an ejb in the current module
String ejbRef = (String) references.get(module);
if (ejbRef != null) {
return ejbRef;
}
// there is more then one ejb that implements that interface... give up
throw new UnresolvedEJBRefException(refName, ejbRefInfo.isLocal(), ejbRefInfo.isSession(), ejbRefInfo.getHomeIntf(), ejbRefInfo.getBeanIntf(), true);
}