tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r381493 - /incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java
Date Mon, 27 Feb 2006 23:46:17 GMT
Author: jboynes
Date: Mon Feb 27 15:46:14 2006
New Revision: 381493

URL: http://svn.apache.org/viewcvs?rev=381493&view=rev
Log:
workaround for TUSCANY-46 but we really should have consistency here between annotations and
sidefile

Modified:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java?rev=381493&r1=381492&r2=381493&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/system/assembly/impl/SystemImplementationImpl.java
Mon Feb 27 15:46:14 2006
@@ -67,23 +67,28 @@
      * Creates the component type
      */
     private ComponentType createComponentType(Class implClass) {
+        ComponentType componentType;
         String baseName = getBaseName(implClass);
         URL componentTypeFile = implClass.getResource(baseName + ".componentType");
         if (componentTypeFile != null) {
-            return modelContext.getAssemblyLoader().loadComponentType(componentTypeFile.toString());
+            componentType = modelContext.getAssemblyLoader().loadComponentType(componentTypeFile.toString());
+            // FIXME workaround for TUSCANY-46 where the scope is not read - default system
implementations to MODULE scope
+            for (Service service : componentType.getServices()) {
+                service.getServiceContract().setScope(Scope.MODULE);
+            }
         } else {
             //FIXME Return a made-up component type for now
             // We need to introspect the component implementation class, support a subset
of what
             // we support for java components.
             AssemblyFactory factory=modelContext.getAssemblyFactory();
-            ComponentType componentType=factory.createComponentType();
+            componentType=factory.createComponentType();
             Service service=factory.createService();
             ServiceContract serviceContract=factory.createJavaServiceContract();
             serviceContract.setScope(Scope.MODULE);
             service.setServiceContract(serviceContract);
             componentType.getServices().add(service);
-            return componentType;
         }
+        return componentType;
     }
 
     /**



Mime
View raw message