summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-10-29 10:49:10 +0000
committervamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-10-29 10:49:10 +0000
commitae8df2107457670d0404931b8fa7fdf55535aa30 (patch)
tree8479bf2f1d5a1e29a559ed00f743dc2f412dfddd
parent4a473240fcfdecb8f7e0a03c3e252d87f1917632 (diff)
Injection info for SCA references from Java EE optional extension
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830888 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java6
-rw-r--r--branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/EjbReferenceInfo.java1
-rw-r--r--branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/InjectionTarget.java28
-rw-r--r--branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java3
-rw-r--r--branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java6
-rw-r--r--branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java6
6 files changed, 50 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java b/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java
index 89a09c84c5..c0830cbb2c 100644
--- a/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java
+++ b/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java
@@ -38,6 +38,7 @@ import org.apache.openejb.jee.EjbReference;
import org.apache.openejb.jee.EnterpriseBean;
import org.apache.openejb.jee.EnvEntry;
import org.apache.openejb.jee.Filter;
+import org.apache.openejb.jee.InjectionTarget;
import org.apache.openejb.jee.Listener;
import org.apache.openejb.jee.MessageDrivenBean;
import org.apache.openejb.jee.Servlet;
@@ -187,6 +188,11 @@ public class JavaEEIntrospectorImpl implements JavaEEIntrospector {
ejbReferenceInfo.ejbLink = ejbRef.getEjbLink();
ejbReferenceInfo.mappedName = ejbRef.getMappedName();
+ if(ejbRef.getInjectionTarget().size() > 0) {
+ InjectionTarget it = ejbRef.getInjectionTarget().iterator().next();
+ ejbReferenceInfo.injectionTarget.targetClass = it.getInjectionTargetClass();
+ ejbReferenceInfo.injectionTarget.targetName = it.getInjectionTargetName();
+ }
return ejbReferenceInfo;
}
diff --git a/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/EjbReferenceInfo.java b/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/EjbReferenceInfo.java
index 109a32d62c..70470f1133 100644
--- a/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/EjbReferenceInfo.java
+++ b/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/EjbReferenceInfo.java
@@ -30,4 +30,5 @@ public class EjbReferenceInfo {
public Class<?> businessInterface;
public String ejbLink;
public String mappedName;
+ public InjectionTarget injectionTarget = new InjectionTarget();
}
diff --git a/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/InjectionTarget.java b/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/InjectionTarget.java
new file mode 100644
index 0000000000..4ea2b6b072
--- /dev/null
+++ b/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/InjectionTarget.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.contribution.jee;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class InjectionTarget {
+ public String targetClass;
+ public String targetName;
+}
diff --git a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
index b8b8be1ffb..6b02c45208 100644
--- a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
+++ b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.implementation.web;
import java.util.Map;
import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.contribution.jee.InjectionTarget;
import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
@@ -63,4 +64,6 @@ public interface WebImplementation extends Implementation {
* @return Map with injection points for SCA resources
*/
Map<String, JavaResourceImpl> getResourceInjectionPoints();
+
+ Map<InjectionTarget, Class<?>> getOptExtensionReferenceInjectionPoints();
}
diff --git a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
index ec0627f0a8..4eeb4d24d1 100644
--- a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
+++ b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
@@ -30,6 +30,7 @@ import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
+import org.apache.tuscany.sca.contribution.jee.InjectionTarget;
import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
import org.apache.tuscany.sca.implementation.web.WebImplementation;
@@ -48,6 +49,8 @@ class WebImplementationImpl extends ImplementationImpl implements WebImplementat
private Map<String, JavaElementImpl> referenceInjectionPoints = new HashMap<String, JavaElementImpl>();
private Map<String, JavaResourceImpl> resourceInjectionPoints = new HashMap<String, JavaResourceImpl>();
+
+ private Map<InjectionTarget, Class<?>> optExtReferenceInjectionPoints = new HashMap<InjectionTarget, Class<?>>();
/**
* Constructs a new Web implementation.
*/
@@ -153,4 +156,7 @@ class WebImplementationImpl extends ImplementationImpl implements WebImplementat
return resourceInjectionPoints;
}
+ public Map<InjectionTarget, Class<?>> getOptExtensionReferenceInjectionPoints() {
+ return optExtReferenceInjectionPoints;
+ }
}
diff --git a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
index d1c611dc2f..ccab5cd3cd 100644
--- a/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
+++ b/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
@@ -35,6 +35,7 @@ import org.apache.tuscany.sca.assembly.ComponentReference;
import org.apache.tuscany.sca.assembly.ComponentType;
import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.jee.EjbReferenceInfo;
import org.apache.tuscany.sca.contribution.jee.JspReferenceTagInfo;
import org.apache.tuscany.sca.contribution.jee.WebModuleInfo;
import org.apache.tuscany.sca.contribution.jee.JavaEEExtension;
@@ -142,6 +143,11 @@ public class WebImplementationProcessor extends BaseStAXArtifactProcessor implem
ComponentType ct = jeeOptionalExtension.createImplementationWebComponentType(webModuleInfo);
implementation.getReferences().addAll(ct.getReferences());
implementation.getProperties().addAll(ct.getProperties());
+ // Injection points from optional extension
+ for(Map.Entry<String, EjbReferenceInfo> entry : webModuleInfo.getEjbReferences().entrySet()) {
+ EjbReferenceInfo ejbRef = entry.getValue();
+ implementation.getOptExtensionReferenceInjectionPoints().put(ejbRef.injectionTarget, ejbRef.businessInterface);
+ }
}
// Introspection of classes