TUSCANY-3052 - add EJBModuleInfo to generate EJB implementation to sit alongside the EJBInfo.

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@779891 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
slaws 2009-05-29 08:22:48 +00:00
parent 5f70131cb4
commit 171b522071
4 changed files with 31 additions and 6 deletions

View file

@ -40,4 +40,17 @@ public interface EJBImplementationGenerated extends Implementation {
*/ */
void setEJBInfo(EjbInfo ejbInfo); void setEJBInfo(EjbInfo ejbInfo);
/**
* return the EjbModuleInfo which contains the EJB Info used to generate this object
*
* @return
*/
EjbModuleInfo getEjbModuleInfo();
/**
* Set the EjbModuleInfo which contains the EJB Info used to generate this object
*
* @param ejbModuleInfo
*/
void setEjbModuleInfo(EjbModuleInfo ejbModuleInfo);
} }

View file

@ -22,6 +22,7 @@ import org.apache.tuscany.sca.assembly.ConstrainingType;
import org.apache.tuscany.sca.assembly.impl.ImplementationImpl; import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
import org.apache.tuscany.sca.contribution.jee.EJBImplementationGenerated; import org.apache.tuscany.sca.contribution.jee.EJBImplementationGenerated;
import org.apache.tuscany.sca.contribution.jee.EjbInfo; import org.apache.tuscany.sca.contribution.jee.EjbInfo;
import org.apache.tuscany.sca.contribution.jee.EjbModuleInfo;
/** /**
* The model representing an EJB implementation in an SCA assembly model when the * The model representing an EJB implementation in an SCA assembly model when the
@ -30,6 +31,7 @@ import org.apache.tuscany.sca.contribution.jee.EjbInfo;
class EJBImplementationGeneratedImpl extends ImplementationImpl implements EJBImplementationGenerated { class EJBImplementationGeneratedImpl extends ImplementationImpl implements EJBImplementationGenerated {
private EjbInfo ejbInfo; private EjbInfo ejbInfo;
private EjbModuleInfo ejbModuleInfo;
/** /**
* Constructs a new EJB implementation. * Constructs a new EJB implementation.
@ -56,5 +58,13 @@ class EJBImplementationGeneratedImpl extends ImplementationImpl implements EJBIm
public void setEJBInfo(EjbInfo ejbInfo) { public void setEJBInfo(EjbInfo ejbInfo) {
this.ejbInfo = ejbInfo; this.ejbInfo = ejbInfo;
} }
public EjbModuleInfo getEjbModuleInfo() {
return ejbModuleInfo;
}
public void setEjbModuleInfo(EjbModuleInfo ejbModuleInfo) {
this.ejbModuleInfo = ejbModuleInfo;
}
} }

View file

@ -109,7 +109,7 @@ public class JavaEEExtensionImpl implements JavaEEExtension {
for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) { for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) {
EjbInfo ejbInfo = entry.getValue(); EjbInfo ejbInfo = entry.getValue();
Component component = findComponent(composite, ejbInfo); Component component = findComponent(composite, ejbInfo, ejbModule);
if(ejbInfo.ejbType.compareTo(EjbType.MESSAGE_DRIVEN) != 0) { if(ejbInfo.ejbType.compareTo(EjbType.MESSAGE_DRIVEN) != 0) {
for(Class<?> intf : ejbInfo.businessRemote) { for(Class<?> intf : ejbInfo.businessRemote) {
@ -161,7 +161,7 @@ public class JavaEEExtensionImpl implements JavaEEExtension {
for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) { for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) {
EjbInfo ejbInfo = entry.getValue(); EjbInfo ejbInfo = entry.getValue();
Component component = findComponent(composite, ejbInfo); Component component = findComponent(composite, ejbInfo, ejbModule);
if(ejbInfo.ejbType.compareTo(EjbType.MESSAGE_DRIVEN) != 0) { if(ejbInfo.ejbType.compareTo(EjbType.MESSAGE_DRIVEN) != 0) {
for(Class<?> intf : ejbInfo.businessRemote) { for(Class<?> intf : ejbInfo.businessRemote) {
@ -215,7 +215,7 @@ public class JavaEEExtensionImpl implements JavaEEExtension {
* @param componentName * @param componentName
* @return * @return
*/ */
private Component findComponent(Composite composite, EjbInfo ejbInfo){ private Component findComponent(Composite composite, EjbInfo ejbInfo, EjbModuleInfo ejbmoduleInfo){
String componentName = ejbInfo.beanName; String componentName = ejbInfo.beanName;
Component component = null; Component component = null;
@ -235,6 +235,7 @@ public class JavaEEExtensionImpl implements JavaEEExtension {
EJBImplementationGenerated implementation = new EJBImplementationGeneratedImpl(); EJBImplementationGenerated implementation = new EJBImplementationGeneratedImpl();
implementation.setUnresolved(true); implementation.setUnresolved(true);
implementation.setEJBInfo(ejbInfo); implementation.setEJBInfo(ejbInfo);
implementation.setEjbModuleInfo(ejbmoduleInfo);
component.setImplementation(implementation); component.setImplementation(implementation);
} }

View file

@ -206,7 +206,7 @@ public class JavaEEOptionalExtensionImpl implements JavaEEOptionalExtension {
for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) { for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) {
EjbInfo ejbInfo = entry.getValue(); EjbInfo ejbInfo = entry.getValue();
Component component = findComponent(composite, ejbInfo); Component component = findComponent(composite, ejbInfo, ejbModule);
// Process Remote EJB References // Process Remote EJB References
for(Map.Entry<String, EjbReferenceInfo> entry1 : ejbInfo.ejbReferences.entrySet()) { for(Map.Entry<String, EjbReferenceInfo> entry1 : ejbInfo.ejbReferences.entrySet()) {
@ -241,7 +241,7 @@ public class JavaEEOptionalExtensionImpl implements JavaEEOptionalExtension {
for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) { for(Map.Entry<String, EjbInfo> entry : ejbModule.getEjbInfos().entrySet()) {
EjbInfo ejbInfo = entry.getValue(); EjbInfo ejbInfo = entry.getValue();
Component component = findComponent(composite, ejbInfo); Component component = findComponent(composite, ejbInfo, ejbModule);
// Process Remote EJB References // Process Remote EJB References
for(Map.Entry<String, EjbReferenceInfo> entry1 : ejbInfo.ejbReferences.entrySet()) { for(Map.Entry<String, EjbReferenceInfo> entry1 : ejbInfo.ejbReferences.entrySet()) {
@ -277,7 +277,7 @@ public class JavaEEOptionalExtensionImpl implements JavaEEOptionalExtension {
* @param ejbInfo * @param ejbInfo
* @return * @return
*/ */
private Component findComponent(Composite composite, EjbInfo ejbInfo){ private Component findComponent(Composite composite, EjbInfo ejbInfo, EjbModuleInfo ejbmoduleInfo){
String componentName = ejbInfo.beanName; String componentName = ejbInfo.beanName;
Component component = null; Component component = null;
@ -297,6 +297,7 @@ public class JavaEEOptionalExtensionImpl implements JavaEEOptionalExtension {
EJBImplementationGenerated implementation = new EJBImplementationGeneratedImpl(); EJBImplementationGenerated implementation = new EJBImplementationGeneratedImpl();
implementation.setUnresolved(true); implementation.setUnresolved(true);
implementation.setEJBInfo(ejbInfo); implementation.setEJBInfo(ejbInfo);
implementation.setEjbModuleInfo(ejbmoduleInfo);
component.setImplementation(implementation); component.setImplementation(implementation);
} }