String uri = implementation.getURI();
String ejbLink = implementation.getEJBLink();
if (ejbLink != null) {
String module = ejbLink.indexOf('#') != -1 ? ejbLink.substring(0, ejbLink.indexOf('#')) : "";
String beanName = ejbLink.indexOf('#') != -1 ? ejbLink.substring(ejbLink.indexOf('#')+1) : ejbLink;
EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl();
ejbModuleInfo.setUri(URI.create(module));
ejbModuleInfo = resolver.resolveModel(EjbModuleInfo.class, ejbModuleInfo);
if(jeeExtension != null) {
ComponentType ct = jeeExtension.createImplementationEjbComponentType(ejbModuleInfo, beanName);
// TODO - SL - TUSCANY-2944 - these new JEE processors are causing problems with existing contributions
// ct is null if there is no EJBInfo
if (ct != null){
implementation.getServices().addAll(ct.getServices());
}
}
if(jeeOptionalExtension != null) {
ComponentType ct = jeeOptionalExtension.createImplementationEjbComponentType(ejbModuleInfo, beanName);
// TODO - SL - TUSCANY-2944 - these new JEE processors are causing problems with existing contributions
// ct is null if there is no EJBInfo
if (ct != null){
implementation.getReferences().addAll(ct.getReferences());
implementation.getProperties().addAll(ct.getProperties());
// Injection points
List<String> propertyNames = new ArrayList<String>();
for(Property prop : ct.getProperties()) {
propertyNames.add(prop.getName());
}
EjbInfo ejbInfo = ejbModuleInfo.getEjbInfo(uri);
for(Map.Entry<String, EjbReferenceInfo> entry : ejbInfo.ejbReferences.entrySet()) {
EjbReferenceInfo ejbRef = entry.getValue();
implementation.getOptExtensionReferenceInjectionPoints().put(ejbRef.injectionTarget, ejbRef.businessInterface);
}
for(Map.Entry<String, EnvEntryInfo> entry : ejbInfo.envEntries.entrySet()) {
EnvEntryInfo envEntry = entry.getValue();
if(propertyNames.contains(envEntry.name.replace("/", "_"))) {
implementation.getOptExtensionPropertyInjectionPoints().put(envEntry.name, envEntry.type);
}
}
}
}
EjbInfo ejbInfo = ejbModuleInfo.getEjbInfo(uri);
if (ejbInfo == null) {
// FIXME:
logger.severe("EJB " + uri + " is not found in the module");
// throw new ContributionResolveException("EJB " + uri + " is not found in the module");
} else {