tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r828951 - in /tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web: WebImplementation.java impl/WebImplementationImpl.java xml/WebImplementationProcessor.java
Date Fri, 23 Oct 2009 07:41:38 GMT
Author: vamsic007
Date: Fri Oct 23 07:41:37 2009
New Revision: 828951

URL: http://svn.apache.org/viewvc?rev=828951&view=rev
Log:
Make the WebImplementationProcessor compute the injection points for properties, references
and resources like component context etc.

Modified:
    tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
    tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
    tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java

Modified: tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java?rev=828951&r1=828950&r2=828951&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
Fri Oct 23 07:41:37 2009
@@ -18,7 +18,11 @@
  */
 package org.apache.tuscany.sca.implementation.web;
 
+import java.util.Map;
+
 import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
 
 
 
@@ -39,4 +43,24 @@
      */
     void setWebURI(String webappURI);
 
+    /**
+     * Returns the injection points for SCA references
+     * 
+     * @return Map with injection points for SCA references
+     */
+    Map<String, JavaElementImpl> getReferenceInjectionPoints();
+    
+    /**
+     * Returns the injection points for SCA properties
+     * 
+     * @return Map with injection points for SCA properties
+     */
+    Map<String, JavaElementImpl> getPropertyInjectionPoints();
+
+    /**
+     * Returns the injection points for SCA resources like component context, component name,
etc.
+     * 
+     * @return Map with injection points for SCA resources
+     */
+    Map<String, JavaResourceImpl> getResourceInjectionPoints();
 }

Modified: tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java?rev=828951&r1=828950&r2=828951&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
Fri Oct 23 07:41:37 2009
@@ -19,7 +19,9 @@
 package org.apache.tuscany.sca.implementation.web.impl;
 
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.tuscany.sca.assembly.Component;
 import org.apache.tuscany.sca.assembly.ConstrainingType;
@@ -28,6 +30,8 @@
 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.implementation.java.impl.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
 import org.apache.tuscany.sca.implementation.web.WebImplementation;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 
@@ -39,6 +43,11 @@
 
     private String webURI;
 
+    private Map<String, JavaElementImpl> propertyInjectionPoints = new HashMap<String,
JavaElementImpl>();
+
+    private Map<String, JavaElementImpl> referenceInjectionPoints = new HashMap<String,
JavaElementImpl>();
+
+    private Map<String, JavaResourceImpl> resourceInjectionPoints = new HashMap<String,
JavaResourceImpl>();
     /**
      * Constructs a new Web implementation.
      */
@@ -132,4 +141,16 @@
         return newProperty;
     }
 
+    public Map<String, JavaElementImpl> getPropertyInjectionPoints() {
+        return propertyInjectionPoints;
+    }
+
+    public Map<String, JavaElementImpl> getReferenceInjectionPoints() {
+        return referenceInjectionPoints;
+    }
+
+    public Map<String, JavaResourceImpl> getResourceInjectionPoints() {
+        return resourceInjectionPoints;
+    }
+
 }

Modified: tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java?rev=828951&r1=828950&r2=828951&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
Fri Oct 23 07:41:37 2009
@@ -23,6 +23,7 @@
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -49,6 +50,10 @@
 import org.apache.tuscany.sca.implementation.java.IntrospectionException;
 import org.apache.tuscany.sca.implementation.java.JavaImplementation;
 import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
+import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor;
 import org.apache.tuscany.sca.implementation.web.WebImplementation;
 import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
 import org.apache.tuscany.sca.implementation.web.introspect.PropertyProcessor;
@@ -85,6 +90,8 @@
         this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
         javaImplementationFactory.addClassVisitor(new ReferenceProcessor(assemblyFactory,
javaInterfaceFactory));
         javaImplementationFactory.addClassVisitor(new PropertyProcessor(assemblyFactory));
+        javaImplementationFactory.addClassVisitor(new ComponentNameProcessor(assemblyFactory));
+        javaImplementationFactory.addClassVisitor(new ContextProcessor(assemblyFactory));
     }
 
     public QName getArtifactType() {
@@ -154,6 +161,15 @@
             }
             implementation.getReferences().addAll(ji.getReferences());
             implementation.getProperties().addAll(ji.getProperties());
+            for(Map.Entry<String, JavaElementImpl> entry : ji.getReferenceMembers().entrySet())
{ 
+                implementation.getReferenceInjectionPoints().put(entry.getKey(), entry.getValue());
+            }
+            for(Map.Entry<String, JavaElementImpl> entry : ji.getPropertyMembers().entrySet())
{ 
+                implementation.getPropertyInjectionPoints().put(entry.getKey(), entry.getValue());
+            }
+            for(Map.Entry<String, JavaResourceImpl> entry : ji.getResources().entrySet())
{ 
+                implementation.getResourceInjectionPoints().put(entry.getKey(), entry.getValue());
+            }
 
             // SCA References in JSP Tags
             for(JspReferenceTagInfo jspRefTag : webModuleInfo.getJspReferenceTags()) {



Mime
View raw message