You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/07/03 10:04:16 UTC

svn commit: r552703 - in /incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml: OSGiImplementation.java OSGiImplementationProcessor.java

Author: antelder
Date: Tue Jul  3 01:04:16 2007
New Revision: 552703

URL: http://svn.apache.org/viewvc?view=rev&rev=552703
Log:
TUSCANY-1406, apply patch from Rajini Sivaram to get impl-osgi working with the latest trunk code

Modified:
    incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java
    incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java

Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java?view=diff&rev=552703&r1=552702&r2=552703
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementation.java Tue Jul  3 01:04:16 2007
@@ -24,6 +24,8 @@
 import java.util.List;
 
 import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Implementation;
 import org.apache.tuscany.sca.assembly.impl.ComponentTypeImpl;
 import org.apache.tuscany.sca.implementation.osgi.OSGiImplementationInterface;
 import org.apache.tuscany.sca.scope.Scope;
@@ -42,8 +44,9 @@
     private Scope scope;
     private String[] allowsPassByRef;
     private boolean needsPropertyInjection;
-    Hashtable<String, List<ComponentProperty>> referenceProperties;
-    Hashtable<String, List<ComponentProperty>> serviceProperties;
+    private Hashtable<String, List<ComponentProperty>> referenceProperties;
+    private Hashtable<String, List<ComponentProperty>> serviceProperties;
+    
 
     public OSGiImplementation(String bundleName, 
             String bundleLocation,
@@ -126,6 +129,5 @@
     public long getMaxIdleTime() {
         return Long.MAX_VALUE;
     }
-    
     
 }

Modified: incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java?view=diff&rev=552703&r1=552702&r2=552703
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiImplementationProcessor.java Tue Jul  3 01:04:16 2007
@@ -186,9 +186,6 @@
                     serviceProperties,
                     injectProperties);
             
-            
-            processComponentType(bundleName, implementation);
-            
             implementation.setUnresolved(true);
             
             return implementation;
@@ -204,17 +201,9 @@
             
             impl.setUnresolved(false);
             
-            // FIXME: Tuscany will only process the component type file if it is visible
-            //        to its classloader. So it can't really be located anywhere in the
-            //        directory structure like the bundle. So even though the bundle name
-            //        is used to find the relative pathname of the component type file,
-            //        its absolute location is obtained from the classloader. This doesn't
-            //        seem right, since the bundle could potentially be located anywhere.
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            String bundleName = impl.getBundleName();
-            String ctName = bundleName.replaceAll("\\.", "/") + ".componentType";
-            String ctURI = cl.getResource(ctName).toString();
             
+            String bundleName = impl.getBundleName();
+            String ctURI = bundleName.replaceAll("\\.", "/") + ".componentType";
             impl.setURI(ctURI);
             ComponentType componentType = resolver.resolveModel(ComponentType.class, impl);
             if (componentType.isUnresolved()) {
@@ -302,17 +291,7 @@
     public void write(OSGiImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException {
     }
     
-    private void processComponentType(String bundleName, OSGiImplementation implementation) {
-        
-        // Form the URI of the expected .componentType file;
-        String ctName = bundleName.replaceAll("\\.", "/") + ".componentType";
-        String uri = ctName;
-
-        
-        implementation.setURI(uri);
-        implementation.setUnresolved(true);
-    }
-
+    
     private QName getQNameValue(XMLStreamReader reader, String value) {
         if (value != null) {
             int index = value.indexOf(':');



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org