return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, deploymentContext, module, classLoader);
}
private String getContainerId(URI module, String ejbLink, Map references) throws AmbiguousEJBRefException, UnknownEJBRefException {
if (references == null || references.isEmpty()) {
throw new UnknownEJBRefException(ejbLink);
}
// is this an absolute reference ../relative/path/Module#EJBName
if (ejbLink.indexOf('#') >= 0) {
URI ejbURI = module.resolve(ejbLink).normalize();
String ejbRef = (String) references.get(ejbURI);
if (ejbRef == null) {
throw new UnknownEJBRefException(ejbLink);
}
return ejbRef;
}
//
// relative reference
//
// if there is only one ejb with that name, use it
if (references.size() == 1) {
String ejbRef = (String) references.values().iterator().next();
if (ejbRef == null) {
throw new UnknownEJBRefException(ejbLink);
}
return ejbRef;
}
// We got more then one ejb with that name. Try to find an ejb in the current module with that name