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

svn commit: r558587 - in /incubator/tuscany/java/sca/modules: extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java

Author: lresende
Date: Sun Jul 22 19:36:00 2007
New Revision: 558587

URL: http://svn.apache.org/viewvc?view=rev&rev=558587
Log:
Integrating Model Resolver Extensibility into DefaultSCADomain

Modified:
    incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java

Modified: incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java?view=diff&rev=558587&r1=558586&r2=558587
==============================================================================
--- incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/extension-helper/src/main/java/org/apache/tuscany/sca/spi/impl/SCDLProcessor.java Sun Jul 22 19:36:00 2007
@@ -204,25 +204,24 @@
         }
     }
 
-    private ComponentType getComponentType(ModelResolver resolver, Implementation impl) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
-        for (Object o :((ModelResolverImpl)resolver).getModels()) {
-            if (o instanceof ComponentType) {
-                ComponentType ct = (ComponentType)o;
-                String uri = ct.getURI();
-                if (uri != null && uri.endsWith(".componentType")) {
-                    String name = uri.substring(0, uri.lastIndexOf('.'));
-                    for (Method m : getGetters()) {
-                        Object io;
-                        if (impl instanceof PojoImplementation) {
-                            io = ((PojoImplementation)impl).getUserImpl();
-                        } else {
-                            io = impl;
-                        }
-                        String value = (String) m.invoke(io, new Object[]{});
-                        if (value != null && name.endsWith(value.substring(0, value.lastIndexOf('.')))) {
-                            return ct;
-                        }
-                    }
+    ComponentType getComponentType(ModelResolver resolver, Implementation impl) throws IllegalArgumentException, IllegalAccessException,
+            InvocationTargetException {
+        for (Method m : getGetters()) {
+            Object io;
+            if (impl instanceof PojoImplementation) {
+                io = ((PojoImplementation) impl).getUserImpl();
+            } else {
+                io = impl;
+            }
+            String value = (String) m.invoke(io, new Object[] {});
+            if (value != null) {
+                value = value.substring(0, value.lastIndexOf('.'));
+                ComponentType componentType = assemblyFactory.createComponentType();
+                componentType.setUnresolved(true);
+                componentType.setURI(value + ".componentType");
+                componentType = resolver.resolveModel(ComponentType.class, componentType);
+                if (!componentType.isUnresolved()) {
+                    return componentType;
                 }
             }
         }

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java?view=diff&rev=558587&r1=558586&r2=558587
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java Sun Jul 22 19:36:00 2007
@@ -107,9 +107,9 @@
         }
 
         try {
-            ModelResolverImpl modelResolver = new ModelResolverImpl(applicationClassLoader);
+            //ModelResolverImpl modelResolver = new ModelResolverImpl(applicationClassLoader);
             String contributionURI = FileHelper.getName(contributionURL.getPath());
-            contribution = contributionService.contribute(contributionURI, contributionURL, modelResolver, false);
+            contribution = contributionService.contribute(contributionURI, contributionURL/*, modelResolver*/, false);
         } catch (ContributionException e) {
             throw new ServiceRuntimeException(e);
         } catch (IOException e) {



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