summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorvamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 22:31:53 +0000
committervamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 22:31:53 +0000
commitf7e48d3ddaa6ce6c79ccb25224889949311c40f1 (patch)
treeb7fa5637ebe33da5b9ede56c9d13dafad3d4a785 /branches
parentddce254f04ea895e4fc3e2f1101f1fe05449e0f8 (diff)
Use the JavaEE extensions to compute SCA services, SCA references and SCA properties from EJB3 business interfaces, Remote EJB3 references and EnvEntries.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755761 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/modules/implementation-ejb/pom.xml6
-rw-r--r--branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java29
2 files changed, 35 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-ejb/pom.xml b/branches/sca-java-1.x/modules/implementation-ejb/pom.xml
index e60ac9f521..7bf2d0f561 100644
--- a/branches/sca-java-1.x/modules/implementation-ejb/pom.xml
+++ b/branches/sca-java-1.x/modules/implementation-ejb/pom.xml
@@ -45,6 +45,12 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-jee</artifactId>
+ <version>1.5-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-embedded</artifactId>
<version>1.5-SNAPSHOT</version>
<scope>test</scope>
diff --git a/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java b/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
index b3e5e3394c..0a4bb8b2db 100644
--- a/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
+++ b/branches/sca-java-1.x/modules/implementation-ejb/src/main/java/org/apache/tuscany/sca/implementation/ejb/xml/EJBImplementationProcessor.java
@@ -20,6 +20,8 @@ package org.apache.tuscany.sca.implementation.ejb.xml;
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import java.net.URI;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -30,6 +32,10 @@ import org.apache.tuscany.sca.assembly.ComponentType;
import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.jee.EjbModuleInfo;
+import org.apache.tuscany.sca.contribution.jee.JavaEEExtension;
+import org.apache.tuscany.sca.contribution.jee.JavaEEOptionalExtension;
+import org.apache.tuscany.sca.contribution.jee.impl.EjbModuleInfoImpl;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -54,10 +60,14 @@ public class EJBImplementationProcessor extends BaseStAXArtifactProcessor implem
private AssemblyFactory assemblyFactory;
private EJBImplementationFactory implementationFactory;
private Monitor monitor;
+ private JavaEEExtension jeeExtension;
+ private JavaEEOptionalExtension jeeOptionalExtension;
public EJBImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
this.implementationFactory = modelFactories.getFactory(EJBImplementationFactory.class);
+ this.jeeExtension = modelFactories.getFactory(JavaEEExtension.class);
+ this.jeeOptionalExtension = modelFactories.getFactory(JavaEEOptionalExtension.class);
this.monitor = monitor;
}
@@ -122,7 +132,26 @@ public class EJBImplementationProcessor extends BaseStAXArtifactProcessor implem
// Resolve the component type
String uri = implementation.getURI();
+ String ejbLink = implementation.getEJBLink();
if (uri != null) {
+ EjbModuleInfo ejbModuleInfo = new EjbModuleInfoImpl();
+ ejbModuleInfo.setUri(URI.create(uri));
+ ejbModuleInfo = resolver.resolveModel(EjbModuleInfo.class, ejbModuleInfo);
+
+ if(jeeExtension != null) {
+ ComponentType ct = jeeExtension.createImplementationEjbComponentType(ejbModuleInfo, ejbLink);
+ implementation.getServices().addAll(ct.getServices());
+ }
+
+ if(jeeOptionalExtension != null) {
+ ComponentType ct = jeeOptionalExtension.createImplementationEjbComponentType(ejbModuleInfo, ejbLink);
+ implementation.getReferences().addAll(ct.getReferences());
+ implementation.getProperties().addAll(ct.getProperties());
+ }
+
+ // TODO: Introspection of bean class
+
+ // Process componentType side file
ComponentType componentType = assemblyFactory.createComponentType();
componentType.setURI(uri + ".componentType");
componentType = resolver.resolveModel(ComponentType.class, componentType);