tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r703066 - in /tuscany/branches/sca-equinox/modules: assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ core/src/main/java/org/apache/tuscany/sca/core/assembly/ core/src/main/java/org/apache/tuscany/sca/core/scope/ core/src...
Date Thu, 09 Oct 2008 06:11:27 GMT
Author: jsdelfino
Date: Wed Oct  8 23:11:26 2008
New Revision: 703066

URL: http://svn.apache.org/viewvc?rev=703066&view=rev
Log:
Work in progress. Continued to clean up cross bundle dependencies on implementation classes, like ScopeRegistry, CompositeActivator, ContributionService, some of the factories. Added declarations of some of these utilities to the relevant modules. That also simplified the bootstrap of the runtime used by NodeImpl, which doesn't invoke all their constructors anymore.

Added:
    tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java
      - copied, changed from r702000, tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
    tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator
    tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry
Removed:
    tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java
    tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/RuntimeBootStrapper.java
    tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/RuntimeBuilder.java
Modified:
    tuscany/branches/sca-equinox/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
    tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
    tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
    tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
    tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
    tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
    tuscany/branches/sca-equinox/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java

Modified: tuscany/branches/sca-equinox/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java (original)
+++ tuscany/branches/sca-equinox/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java Wed Oct  8 23:11:26 2008
@@ -91,7 +91,7 @@
      * @param monitor
      */
     protected void configureComponents(Composite composite, SCADefinitions definitions, Monitor monitor) throws CompositeBuilderException {
-        configureComponents(composite, null, monitor);
+        configureComponents(composite, null, definitions, monitor);
         configureSourcedProperties(composite, null);
     }
 

Modified: tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java (original)
+++ tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java Wed Oct  8 23:11:26 2008
@@ -38,12 +38,19 @@
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.context.ContextFactoryExtensionPoint;
 import org.apache.tuscany.sca.context.RequestContextFactory;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.core.context.ComponentContextHelper;
 import org.apache.tuscany.sca.core.context.ComponentContextImpl;
 import org.apache.tuscany.sca.core.conversation.ConversationManager;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ExtensibleWireProcessor;
 import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
 import org.apache.tuscany.sca.core.scope.ConversationalScopeContainer;
 import org.apache.tuscany.sca.core.scope.Scope;
 import org.apache.tuscany.sca.core.scope.ScopeContainer;
@@ -71,6 +78,7 @@
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 import org.apache.tuscany.sca.runtime.RuntimeWire;
 import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
+import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
 import org.apache.tuscany.sca.work.WorkScheduler;
 
 /**
@@ -96,15 +104,28 @@
     private final ComponentContextHelper componentContextHelper;
 
     private Composite domainComposite;
+    
+    public CompositeActivatorImpl(ExtensionPointRegistry extensionPoints) {
+        FactoryExtensionPoint factories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+        this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+        this.messageFactory = factories.getFactory(MessageFactory.class);
+        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+        this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
+        this.scopeRegistry = utilities.getUtility(ScopeRegistry.class);
+        this.workScheduler = utilities.getUtility(WorkScheduler.class);
+        this.wireProcessor = new ExtensibleWireProcessor(extensionPoints.getExtensionPoint(RuntimeWireProcessorExtensionPoint.class));
+        this.providerFactories = extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
+        this.endpointResolverFactories = extensionPoints.getExtensionPoint(EndpointResolverFactoryExtensionPoint.class);
+        this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
+        ContextFactoryExtensionPoint contextFactories = extensionPoints.getExtensionPoint(ContextFactoryExtensionPoint.class);
+        this.requestContextFactory = contextFactories.getFactory(RequestContextFactory.class);
+        ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
+        proxyFactory = new ExtensibleProxyFactory(proxyFactories);
+        this.conversationManager = utilities.getUtility(ConversationManager.class);
+        StAXArtifactProcessorExtensionPoint processors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+        this.componentContextHelper = new ComponentContextHelper(assemblyFactory, javaInterfaceFactory, processors);
+    }
 
-    /**
-     * @param assemblyFactory
-     * @param interfaceContractMapper
-     * @param workScheduler
-     * @param conversationManager TODO
-     * @param workContext
-     * @param wirePostProcessorRegistry
-     */
     public CompositeActivatorImpl(AssemblyFactory assemblyFactory,
                                   MessageFactory messageFactory,
                                   JavaInterfaceFactory javaInterfaceFactory,

Copied: tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java (from r702000, tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java)
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java?p2=tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java&p1=tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java&r1=702000&r2=703066&rev=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANode2.java (original)
+++ tuscany/branches/sca-equinox/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/DefaultScopeRegistry.java Wed Oct  8 23:11:26 2008
@@ -17,17 +17,24 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.node;
-
-
+package org.apache.tuscany.sca.core.scope;
 
 /**
- * Represents an SCA processing node.
- * A node is loaded with an SCA composites. It can start and stop that composite.
+ * A default scope registry implementation.
  *
- * @version $Rev$ $Date$
- * @deprecated Use SCANode instead
+ * @version $Rev: $ $Date: $
  */
-@Deprecated
-public interface SCANode2 extends SCANode {
+public class DefaultScopeRegistry extends ScopeRegistryImpl implements ScopeRegistry {
+
+    public DefaultScopeRegistry() {
+        ScopeContainerFactory[] factories =
+            new ScopeContainerFactory[] {new CompositeScopeContainerFactory(), new StatelessScopeContainerFactory(),
+                                         new RequestScopeContainerFactory(),
+                                         new ConversationalScopeContainerFactory(null),
+                                         // new HttpSessionScopeContainer(monitor)
+            };
+        for (ScopeContainerFactory f : factories) {
+            register(f);
+        }
+    }
 }

Added: tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator?rev=703066&view=auto
==============================================================================
--- tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator (added)
+++ tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.assembly.CompositeActivator Wed Oct  8 23:11:26 2008
@@ -0,0 +1,18 @@
+# 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.
+
+org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl

Added: tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry?rev=703066&view=auto
==============================================================================
--- tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry (added)
+++ tuscany/branches/sca-equinox/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.scope.ScopeRegistry Wed Oct  8 23:11:26 2008
@@ -0,0 +1,18 @@
+# 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.
+
+org.apache.tuscany.sca.core.scope.DefaultScopeRegistry

Modified: tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java (original)
+++ tuscany/branches/sca-equinox/modules/node-api/src/main/java/org/apache/tuscany/sca/node/SCANodeFactory.java Wed Oct  8 23:11:26 2008
@@ -148,21 +148,6 @@
     }
 
     /**
-     * Create a SCA node based on the discovery of the contribution on the classpath for the 
-     * given classloader. This method should be treated a convinient shortcut with the following
-     * assumptions:
-     * <ul>
-     * <li>This is a standalone application and there is a deployable composite file on the classpath.
-     * <li>There is only one contribution which contains the deployable composite file physically in its packaging hierarchy.
-     * </ul> 
-     * @param compositeURI The URI of the composite file relative to the root of the enclosing contribution
-     * @param classLoader The ClassLoader used to load the composite file as a resource. If the value is null,
-     * then thread context classloader will be used
-     * @return A newly created SCA node
-     */
-    public abstract SCANode createSCANodeFromClassLoader(String compositeURI, ClassLoader classLoader);
-
-    /**
      * Creates a new SCA node from the configuration URL
      * 
      * @param configurationURL the URL of the node configuration which is the ATOM feed

Modified: tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java (original)
+++ tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java Wed Oct  8 23:11:26 2008
@@ -33,11 +33,6 @@
     }
     
     @Override
-    public SCANode createSCANodeFromClassLoader(String compositeURI, ClassLoader classLoader) {
-        return new NodeImpl(classLoader, compositeURI);
-    }
-
-    @Override
     public SCANode createSCANodeFromURL(String configurationURI) {
         return new NodeImpl(configurationURI);
     }

Modified: tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java (original)
+++ tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java Wed Oct  8 23:11:26 2008
@@ -19,32 +19,27 @@
 
 package org.apache.tuscany.sca.node.impl;
 
-import static org.apache.tuscany.sca.node.impl.NodeUtil.collectJARs;
-import static org.apache.tuscany.sca.node.impl.NodeUtil.createContribution;
+import static java.lang.System.currentTimeMillis;
+import static org.apache.tuscany.sca.node.impl.NodeUtil.contribution;
 import static org.apache.tuscany.sca.node.impl.NodeUtil.createURI;
-import static org.apache.tuscany.sca.node.impl.NodeUtil.getContributionURL;
-import static org.apache.tuscany.sca.node.impl.NodeUtil.getResource;
+import static org.apache.tuscany.sca.node.impl.NodeUtil.loadModules;
+import static org.apache.tuscany.sca.node.impl.NodeUtil.startModules;
+import static org.apache.tuscany.sca.node.impl.NodeUtil.stopModules;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.TransformerFactory;
 
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.Component;
@@ -53,11 +48,9 @@
 import org.apache.tuscany.sca.assembly.CompositeService;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor;
 import org.apache.tuscany.sca.contribution.Artifact;
 import org.apache.tuscany.sca.contribution.Contribution;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
@@ -73,6 +66,11 @@
 import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.core.assembly.ActivationException;
 import org.apache.tuscany.sca.core.assembly.CompositeActivator;
+import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
+import org.apache.tuscany.sca.definitions.SCADefinitions;
 import org.apache.tuscany.sca.implementation.node.ConfiguredNodeImplementation;
 import org.apache.tuscany.sca.implementation.node.NodeImplementationFactory;
 import org.apache.tuscany.sca.monitor.Monitor;
@@ -84,6 +82,7 @@
 import org.apache.tuscany.sca.node.SCANode;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
+import org.apache.tuscany.sca.work.WorkScheduler;
 import org.apache.tuscany.sca.workspace.Workspace;
 import org.apache.tuscany.sca.workspace.WorkspaceFactory;
 import org.apache.tuscany.sca.workspace.builder.ContributionBuilder;
@@ -107,6 +106,7 @@
     // The composite loaded into this node
     private Composite composite;
 
+    private ExtensionPointRegistry extensionPoints;
     private Monitor monitor;
     private URLArtifactProcessor<Contribution> contributionProcessor;
     private ModelResolverExtensionPoint modelResolvers;
@@ -115,16 +115,14 @@
     private ContributionFactory contributionFactory;
     private AssemblyFactory assemblyFactory;
     private XMLInputFactory inputFactory;
-    private XMLOutputFactory outputFactory;
-    private DocumentBuilderFactory documentBuilderFactory;
-    private TransformerFactory transformerFactory;
-    private StAXArtifactProcessor<Object> xmlProcessor; 
     private ContributionBuilder contributionDependencyBuilder;
-    private CompositeBuilder domainCompositeBuilder;
+    private CompositeBuilder compositeBuilder;
     private StAXArtifactProcessorExtensionPoint xmlProcessors;
-    private URLArtifactProcessorExtensionPoint documentProcessors;
-    private RuntimeBootStrapper runtime;
+    private StAXArtifactProcessor<Composite> compositeProcessor; 
+    private ProxyFactory proxyFactory;
+    private List<ModuleActivator> modules;
     private CompositeActivator compositeActivator;
+    private WorkScheduler workScheduler;
 
     /** 
      * Constructs a new SCA node.
@@ -166,94 +164,6 @@
         }
     }
 
-    /**
-     * Construct a node by discovering the node configuration (composite+contrbutions) on the classpath
-     * @param classLoader
-     * @param compositeURI
-     */
-    NodeImpl(ClassLoader classLoader, String compositeURI) {
-        configurationName = compositeURI;
-        logger.log(Level.INFO, "Creating node: " + configurationName);
-
-        if (compositeURI != null) {
-            URI uri = URI.create(compositeURI);
-            if (uri.isAbsolute()) {
-                throw new IllegalArgumentException("Composite URI must be a resource name: " + compositeURI);
-            }
-        }
-        try {
-            // Initialize the runtime
-            init();
-
-            ConfiguredNodeImplementation config = findNodeConfiguration(compositeURI, classLoader);
-            configureNode(config);
-        } catch (Throwable e) {
-            throw new ServiceRuntimeException(e);
-        }
-    }
-
-    /**
-     * Discover the contribution on the classpath
-     * @param compositeURI
-     * @param classLoader
-     * @return A configured node implementation
-     * @throws Exception
-     */
-    private ConfiguredNodeImplementation findNodeConfiguration(final String compositeURI, ClassLoader classLoader)
-        throws Exception {
-        NodeImplementationFactory nodeImplementationFactory =
-            modelFactories.getFactory(NodeImplementationFactory.class);
-        ConfiguredNodeImplementation config = nodeImplementationFactory.createConfiguredNodeImplementation();
-
-        // Default to thread context classloader
-        if (classLoader == null) {
-            classLoader = Thread.currentThread().getContextClassLoader();
-        }
-        String contributionArtifactPath = compositeURI;
-        URL contributionArtifactURL = null;
-        if (compositeURI != null) {
-            contributionArtifactURL = getResource(classLoader, compositeURI);
-            if (contributionArtifactURL == null) {
-                throw new IllegalArgumentException("Composite not found: " + contributionArtifactPath);
-            }
-            // Set to relative URI to avoid duplicate loading
-            Composite composite = createComposite(compositeURI);
-            config.setComposite(composite);
-        } else {
-            // No composite is specified, tring to search the SCA metadata files
-            contributionArtifactPath = Contribution.SCA_CONTRIBUTION_META;
-            contributionArtifactURL = getResource(classLoader, Contribution.SCA_CONTRIBUTION_META);
-
-            if (contributionArtifactURL == null) {
-                contributionArtifactPath = Contribution.SCA_CONTRIBUTION_GENERATED_META;
-                contributionArtifactURL = getResource(classLoader, Contribution.SCA_CONTRIBUTION_GENERATED_META);
-            }
-            if (contributionArtifactURL == null) {
-                contributionArtifactPath = Contribution.SCA_CONTRIBUTION_DEPLOYABLES;
-                contributionArtifactURL = getResource(classLoader, Contribution.SCA_CONTRIBUTION_DEPLOYABLES);
-            }
-            
-            // No contribution can be discovered
-            if (contributionArtifactURL == null) {
-                throw new IllegalArgumentException("No default contribution can be discovered on the classpath");
-            }
-            
-            // No composite will be created, all deployable composites will be used later
-        }
-
-        Contribution c = getContribution(contributionArtifactURL, contributionArtifactPath);
-        config.getContributions().add(c);
-
-        return config;
-    }
-
-    private Contribution getContribution(URL contributionArtifactURL, String contributionArtifactPath) {
-        URL contributionURL = getContributionURL(contributionArtifactURL, contributionArtifactPath);
-        SCAContribution contribution = new SCAContribution(contributionURL.toString(), contributionURL.toString());
-        Contribution c = createContribution(contributionFactory, contribution);
-        return c;
-    }
-
     /** 
      * Constructs a new SCA node.
      *  
@@ -268,28 +178,21 @@
             // Initialize the runtime
             init();
 
-            URI uri = compositeURI == null ? null : URI.create(compositeURI);
-            ConfiguredNodeImplementation configuration = null;
-            if (contributions == null || contributions.length == 0) {
-                if (uri != null && uri.getScheme() != null) {
-                    throw new IllegalArgumentException("No SCA contributions are provided");
-                }
-                configuration = findNodeConfiguration(compositeURI, null);
-            } else {
-
-                // Create a node configuration
-                NodeImplementationFactory nodeImplementationFactory =
-                    modelFactories.getFactory(NodeImplementationFactory.class);
-                configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
-
-                Composite composite = compositeURI == null ? null : createComposite(compositeURI);
+            // Create a node configuration
+            NodeImplementationFactory nodeImplementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
+            ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
+
+            if (compositeURI != null) {
+                Composite composite = assemblyFactory.createComposite();
+                composite.setURI(compositeURI);
+                composite.setUnresolved(true);
                 configuration.setComposite(composite);
+            }
   
                 // Create contribution models
-                for (SCAContribution c : contributions) {
-                    Contribution contribution = createContribution(contributionFactory, c);
-                    configuration.getContributions().add(contribution);
-                }
+            for (SCAContribution c : contributions) {
+                Contribution contribution = contribution(contributionFactory, c);
+                configuration.getContributions().add(contribution);
             }
 
             // Configure the node
@@ -300,14 +203,6 @@
         }
     }
 
-    private Composite createComposite(String compositeURI) {
-        // Create composite model
-        Composite composite = assemblyFactory.createComposite();
-        composite.setURI(compositeURI);
-        composite.setUnresolved(true);
-        return composite;
-    }
-
     /** 
      * Constructs a new SCA node.
      *  
@@ -323,32 +218,29 @@
             // Initialize the runtime
             init();
 
-            ConfiguredNodeImplementation configuration = null;
-            if (contributions == null || contributions.length == 0) {
-                configuration = findNodeConfiguration(compositeURI, null);
-            } else {
-                // Create a node configuration
-                NodeImplementationFactory nodeImplementationFactory =
-                    modelFactories.getFactory(NodeImplementationFactory.class);
-                configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
-
-                // Read the composite model
-                StAXArtifactProcessor<Composite> compositeProcessor = xmlProcessors.getProcessor(Composite.class);
-                // URL compositeURL = new URL(compositeURI);
-                logger.log(Level.INFO, "Loading composite: " + compositeURI);
+            // Create a node configuration
+            NodeImplementationFactory nodeImplementationFactory = modelFactories.getFactory(NodeImplementationFactory.class);
+            ConfiguredNodeImplementation configuration = nodeImplementationFactory.createConfiguredNodeImplementation();
 
-                CompositeDocumentProcessor compositeDocProcessor = (CompositeDocumentProcessor)documentProcessors.getProcessor(Composite.class);
-                composite = compositeDocProcessor.read(URI.create(compositeURI), new ByteArrayInputStream(compositeContent.getBytes("UTF-8")));
+            // Read the composite model
+            logger.log(Level.INFO, "Loading composite: " + compositeURI);
 
-                analyzeProblems();
+            XMLStreamReader reader = inputFactory.createXMLStreamReader(new ByteArrayInputStream(compositeContent.getBytes("UTF-8")));
+            reader.nextTag();
+            
+            // Read the composite model
+            composite = (Composite)compositeProcessor.read(reader);
+            if (composite != null) {
+                composite.setURI(compositeURI);
+            }
+            analyzeProblems();
 
-                configuration.setComposite(composite);
+            configuration.setComposite(composite);
 
-                // Create contribution models
-                for (SCAContribution c : contributions) {
-                    Contribution contribution = createContribution(contributionFactory, c);
-                    configuration.getContributions().add(contribution);
-                }
+            // Create contribution models
+            for (SCAContribution c : contributions) {
+                Contribution contribution = contribution(contributionFactory, c);
+                configuration.getContributions().add(contribution);
             }
 
             // Configure the node
@@ -360,9 +252,10 @@
     }
 
     private void init() {
+        long start = currentTimeMillis();
         
         // Create extension point registry 
-        ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+        extensionPoints = new DefaultExtensionPointRegistry();
         
         // Create a monitor
         UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
@@ -378,17 +271,19 @@
         // Get XML input/output factories
         modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
         inputFactory = modelFactories.getFactory(XMLInputFactory.class);
-        outputFactory = modelFactories.getFactory(XMLOutputFactory.class);
         
         // Get contribution workspace and assembly model factories
         contributionFactory = modelFactories.getFactory(ContributionFactory.class);
         workspaceFactory = modelFactories.getFactory(WorkspaceFactory.class); 
         assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+
+        // Use the runtime-enabled assembly factory 
+        assemblyFactory = new RuntimeAssemblyFactory();
+        modelFactories.addFactory(assemblyFactory);
         
         // Create XML artifact processors
         xmlProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-        documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
-        xmlProcessor = new ExtensibleStAXArtifactProcessor(xmlProcessors, inputFactory, outputFactory, monitor);
+        compositeProcessor = xmlProcessors.getProcessor(Composite.class);
         
         // Create contribution content processor
         URLArtifactProcessorExtensionPoint docProcessorExtensions = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
@@ -403,25 +298,39 @@
         
         // Get composite builders
         CompositeBuilderExtensionPoint compositeBuilders = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class);
-        domainCompositeBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
-    }
-    
-    /**
-     * Initialize the Tuscany runtime.
-     * 
-     * @throws Exception
-     */
-    private void initRuntime() throws Exception {
+        compositeBuilder = compositeBuilders.getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
+        
+        // Initialize runtime
 
-        // Create a node runtime
-        runtime = new RuntimeBootStrapper(Thread.currentThread().getContextClassLoader());
-        runtime.start();
+        // Load the runtime modules
+        try {
+            modules = loadModules(extensionPoints);
+
+            // Start the runtime modules
+            startModules(extensionPoints, modules);
+            
+        } catch (ActivationException e) {
+            throw new IllegalStateException(e);
+        }
 
-        // Save the composite activator
-        compositeActivator = runtime.getCompositeActivator();
+        // Get proxy factory
+        ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
+        proxyFactory = new ExtensibleProxyFactory(proxyFactories);
 
-    }
+        // Get the composite activator
+        compositeActivator = utilities.getUtility(CompositeActivator.class);
 
+        workScheduler = utilities.getUtility(WorkScheduler.class);
+        
+        // Load the definitions.xml
+        //loadSCADefinitions();
+
+        if (logger.isLoggable(Level.FINE)) {
+            long end = currentTimeMillis();
+            logger.fine("The tuscany runtime started in " + (end - start) + " ms.");
+        }
+    }
+    
     private void configureNode(ConfiguredNodeImplementation configuration) throws Exception {
 
         // Create workspace model
@@ -460,20 +369,46 @@
         }
         
         composite = configuration.getComposite();
-        if (composite.isUnresolved()) {
-            
-            // Find the composite in the given contributions
-            for (Contribution contribution: workspace.getContributions()) {
-                composite = contribution.getModelResolver().resolveModel(Composite.class, composite);
+        
+        // Find the composite in the given contributions
+        boolean found = false;
+        Artifact compositeFile = contributionFactory.createArtifact();
+        compositeFile.setUnresolved(true);
+        compositeFile.setURI(composite.getURI());
+        for (Contribution contribution: workspace.getContributions()) {
+            ModelResolver resolver = contribution.getModelResolver();
+            Artifact resolvedArtifact = resolver.resolveModel(Artifact.class, compositeFile);
+            if (!resolvedArtifact.isUnresolved() && resolvedArtifact.getModel() instanceof Composite) {
+                
                 if (!composite.isUnresolved()) {
-                    break;
+                    
+                    // The composite content was passed into the node and read into a composite model,
+                    // don't use the composite found in the contribution, use that composite, but just resolve
+                    // it within the context of the contribution
+                    compositeProcessor.resolve(composite, resolver);
+                    
+                } else {
+                    
+                    // Use the resolved composite we've found in the contribution
+                    composite = (Composite)resolvedArtifact.getModel();
                 }
+                found = true;
+                break;
             }
         }
+        if (!found) {
+            throw new IllegalArgumentException("Composite not found: " + composite.getURI());
+        }
 
+        // Build an aggregated SCA definitions model
+        SCADefinitions definitions = null;
+        //definitions = new SCADefinitionsImpl();
+        //for (SCADefinitions definition : ((List<SCADefinitions>)policyDefinitions)) {
+        //    SCADefinitionsUtil.aggregateSCADefinitions(definition, aggregatedDefinitions);
+        //}
+        
         // Build the composite and wire the components included in it
-        domainCompositeBuilder.build(composite);
-
+        compositeBuilder.build(composite, definitions, monitor);
         analyzeProblems();
         
         // Create a top level composite to host our composite
@@ -489,44 +424,49 @@
         // logic in callable reference resolution relies on this being 
         // available
         compositeActivator.setDomainComposite(tempComposite);
-
     }
 
     public void start() {
         logger.log(Level.INFO, "Starting node: " + configurationName);
 
         try {
-
+            
             // Activate the composite
             compositeActivator.activate(composite);
 
             // Start the composite
             compositeActivator.start(composite);
-
+            
         } catch (ActivationException e) {
-            throw new ServiceRuntimeException(e);
+            throw new IllegalStateException(e);
         }
+
     }
 
     public void stop() {
         logger.log(Level.INFO, "Stopping node: " + configurationName);
 
         try {
-
+            
             // Stop the composite
             compositeActivator.stop(composite);
-
+    
             // Deactivate the composite
             compositeActivator.deactivate(composite);
 
-            runtime.stop();
         } catch (ActivationException e) {
-            throw new ServiceRuntimeException(e);
+            throw new IllegalStateException(e);
         }
+
+        // Stop the runtime modules
+        stopModules(extensionPoints, modules);
+
+        // Stop and destroy the work manager
+        workScheduler.destroy();
     }
 
     public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
-        return (R)runtime.getProxyFactory().cast(target);
+        return (R)proxyFactory.cast(target);
     }
 
     public <B> B getService(Class<B> businessInterface, String serviceName) {

Modified: tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java (original)
+++ tuscany/branches/sca-equinox/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java Wed Oct  8 23:11:26 2008
@@ -20,19 +20,28 @@
 package org.apache.tuscany.sca.node.impl;
 
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Map;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.tuscany.sca.contribution.Contribution;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.service.util.FileHelper;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ModuleActivator;
+import org.apache.tuscany.sca.core.assembly.ActivationException;
+import org.apache.tuscany.sca.core.scope.CompositeScopeContainerFactory;
+import org.apache.tuscany.sca.core.scope.ConversationalScopeContainerFactory;
+import org.apache.tuscany.sca.core.scope.RequestScopeContainerFactory;
+import org.apache.tuscany.sca.core.scope.ScopeContainerFactory;
+import org.apache.tuscany.sca.core.scope.ScopeRegistry;
+import org.apache.tuscany.sca.core.scope.ScopeRegistryImpl;
+import org.apache.tuscany.sca.core.scope.StatelessScopeContainerFactory;
+import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
 import org.apache.tuscany.sca.node.SCAContribution;
 
 /**
@@ -41,16 +50,9 @@
  * @version $Rev: $ $Date: $
  */
 public class NodeUtil {
+    private static final Logger logger = Logger.getLogger(NodeImpl.class.getName());
 
-    static URL getResource(final ClassLoader classLoader, final String compositeURI) {
-        return AccessController.doPrivileged(new PrivilegedAction<URL>() {
-            public URL run() {
-                return classLoader.getResource(compositeURI);
-            }
-        });
-    }
-
-    static Contribution createContribution(ContributionFactory contributionFactory, SCAContribution c) {
+    static Contribution contribution(ContributionFactory contributionFactory, SCAContribution c) {
         Contribution contribution = contributionFactory.createContribution();
         contribution.setURI(c.getURI());
         contribution.setLocation(c.getLocation());
@@ -70,88 +72,118 @@
         return URI.create(uri);
     }
 
-    /**
-     * Collect JARs on the classpath of a URLClassLoader
-     * @param urls
-     * @param cl
-     */
-    static void collectJARs(Map<String, URL> urls, ClassLoader cl) {
-        if (cl == null) {
-            return;
-        }
-    
-        // Collect JARs from the URLClassLoader's classpath
-        if (cl instanceof URLClassLoader) {
-            URL[] jarURLs = ((URLClassLoader)cl).getURLs();
-            if (jarURLs != null) {
-                for (URL jarURL : jarURLs) {
-                    String file = jarURL.getPath();
-                    int i = file.lastIndexOf('/');
-                    if (i != -1 && i < file.length() - 1) {
-                        file = file.substring(i + 1);
-                        urls.put(file, jarURL);
-                    }
+    static List<ModuleActivator> loadModules(ExtensionPointRegistry registry) throws ActivationException {
+
+        // Load and instantiate the modules found on the classpath (or any registered ClassLoaders)
+        List<ModuleActivator> modules = new ArrayList<ModuleActivator>();
+        try {
+            Set<ServiceDeclaration> moduleActivators = ServiceDiscovery.getInstance().getServiceDeclarations(ModuleActivator.class.getName());
+            Set<String> moduleClasses = new HashSet<String>();
+            for (ServiceDeclaration moduleDeclarator : moduleActivators) {
+                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
+                    continue;
                 }
+                moduleClasses.add(moduleDeclarator.getClassName());
+                Class<?> moduleClass = moduleDeclarator.loadClass();
+                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
+                modules.add(module);
             }
+        } catch (IOException e) {
+            throw new ActivationException(e);
+        } catch (ClassNotFoundException e) {
+            throw new ActivationException(e);
+        } catch (InstantiationException e) {
+            throw new ActivationException(e);
+        } catch (IllegalAccessException e) {
+            throw new ActivationException(e);
         }
-    
-        // Collect JARs from the parent ClassLoader
-        collectJARs(urls, cl.getParent());
+
+        return modules;
     }
 
-    static URL getContributionURL(URL contributionArtifactURL, String contributionArtifactPath) {
-        URL contributionURL = null;
-        // "jar:file://....../something.jar!/a/b/c/app.composite"
-        try {
-            String url = contributionArtifactURL.toExternalForm();
-            String protocol = contributionArtifactURL.getProtocol();
-            if ("file".equals(protocol)) {
-                // directory contribution
-                if (url.endsWith(contributionArtifactPath)) {
-                    final String location = url.substring(0, url.lastIndexOf(contributionArtifactPath));
-                    // workaround from evil URL/URI form Maven
-                    // contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
-                    // Allow privileged access to open URL stream. Add FilePermission to added to
-                    // security policy file.
-                    try {
-                        contributionURL = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
-                            public URL run() throws IOException {
-                                return FileHelper.toFile(new URL(location)).toURI().toURL();
-                            }
-                        });
-                    } catch (PrivilegedActionException e) {
-                        throw (MalformedURLException)e.getException();
-                    }
+    static void startModules(ExtensionPointRegistry registry, List<ModuleActivator> modules) throws ActivationException {
+        boolean debug = logger.isLoggable(Level.FINE);
+        
+        // Start all the extension modules
+        for (ModuleActivator module : modules) {
+            long start = 0L;
+            if (debug) {
+                logger.fine(module.getClass().getName() + " is starting.");
+                start = System.currentTimeMillis();
+            }
+            try {
+                module.start(registry);
+                if (debug) {
+                    long end = System.currentTimeMillis();
+                    logger.fine(module.getClass().getName() + " is started in " + (end - start) + " ms.");
                 }
-    
-            } else if ("jar".equals(protocol)) {
-                // jar contribution
-                String location = url.substring(4, url.lastIndexOf("!/"));
-                // workaround for evil URL/URI from Maven
-                contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
-    
-            } else if ("wsjar".equals(protocol)) {
-                // See https://issues.apache.org/jira/browse/TUSCANY-2219
-                // wsjar contribution 
-                String location = url.substring(6, url.lastIndexOf("!/"));
-                // workaround for evil url/uri from maven 
-                contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
-    
-            } else if ("zip".equals(protocol)) {
-                // See https://issues.apache.org/jira/browse/TUSCANY-2598
-                // zip contribution, remove the zip prefix and pad with file:
-                String location = "file:"+url.substring(4, url.lastIndexOf("!/"));
-                contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL();
-                
-            } else if (protocol != null && (protocol.equals("bundle") || protocol.equals("bundleresource"))) {
-                contributionURL =
-                    new URL(contributionArtifactURL.getProtocol(), contributionArtifactURL.getHost(),
-                            contributionArtifactURL.getPort(), "/");
+            } catch (Throwable e) {
+                logger.log(Level.WARNING, "Exception starting module " + module.getClass().getName()
+                    + " :"
+                    + e.getMessage());
+                logger.log(Level.FINE, "Exception starting module " + module.getClass().getName(), e);
+            }
+        }
+    }
+
+    static void stopModules(final ExtensionPointRegistry registry, List<ModuleActivator> modules) {
+        boolean debug = logger.isLoggable(Level.FINE);
+        for (ModuleActivator module : modules) {
+            long start = 0L;
+            if (debug) {
+                logger.fine(module.getClass().getName() + " is stopping.");
+                start = System.currentTimeMillis();
+            }
+            module.stop(registry);
+            if (debug) {
+                long end = System.currentTimeMillis();
+                logger.fine(module.getClass().getName() + " is stopped in " + (end - start) + " ms.");
             }
-        } catch (MalformedURLException mfe) {
-            throw new IllegalArgumentException(mfe);
         }
-        return contributionURL;
     }
 
+//    private void loadSCADefinitions() throws ActivationException {
+//        try {
+//            URLArtifactProcessorExtensionPoint documentProcessors =
+//                registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+//            URLArtifactProcessor<SCADefinitions> definitionsProcessor =
+//                documentProcessors.getProcessor(SCADefinitions.class);
+//            SCADefinitionsProviderExtensionPoint scaDefnProviders =
+//                registry.getExtensionPoint(SCADefinitionsProviderExtensionPoint.class);
+//
+//            SCADefinitions systemSCADefinitions = new SCADefinitionsImpl();
+//            SCADefinitions aSCADefn = null;
+//            for (SCADefinitionsProvider aProvider : scaDefnProviders.getSCADefinitionsProviders()) {
+//                aSCADefn = aProvider.getSCADefinition();
+//                SCADefinitionsUtil.aggregateSCADefinitions(aSCADefn, systemSCADefinitions);
+//            }
+//
+//            policyDefinitions.add(systemSCADefinitions);
+//
+//            //we cannot expect that providers will add the intents and policysets into the resolver
+//            //so we do this here explicitly
+//            for (Intent intent : systemSCADefinitions.getPolicyIntents()) {
+//                policyDefinitionsResolver.addModel(intent);
+//            }
+//
+//            for (PolicySet policySet : systemSCADefinitions.getPolicySets()) {
+//                policyDefinitionsResolver.addModel(policySet);
+//            }
+//
+//            for (IntentAttachPointType attachPoinType : systemSCADefinitions.getBindingTypes()) {
+//                policyDefinitionsResolver.addModel(attachPoinType);
+//            }
+//
+//            for (IntentAttachPointType attachPoinType : systemSCADefinitions.getImplementationTypes()) {
+//                policyDefinitionsResolver.addModel(attachPoinType);
+//            }
+//
+//            //now that all system sca definitions have been read, lets resolve them right away
+//            definitionsProcessor.resolve(systemSCADefinitions, policyDefinitionsResolver);
+//            
+//        } catch (Exception e) {
+//            throw new ActivationException(e);
+//        }
+//    }
+
 }

Modified: tuscany/branches/sca-equinox/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java?rev=703066&r1=703065&r2=703066&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java (original)
+++ tuscany/branches/sca-equinox/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java Wed Oct  8 23:11:26 2008
@@ -49,35 +49,12 @@
     public void testNodeWithCompositeContent() {
         SCANodeFactory factory = new NodeFactoryImpl();
         SCAContribution contribution = new SCAContribution("c1", new File("target/test-classes").toURI().toString());
-        SCANode node = factory.createSCANode("HelloWorld.composite", composite, contribution);
-        testNode(node);
-    }
-    
-    @Test
-    public void testNodeWithCompositeContentAndNoContribution() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        SCANode node = factory.createSCANode("HelloWorld.composite", composite);
-        testNode(node);
-    }    
-
-    @Test
-    public void testNodeWithoutCompositeURI() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        SCAContribution contribution = new SCAContribution("c1", new File("target/test-classes").toURI().toString());
-        SCANode node = factory.createSCANode(null, contribution);
+        String compositeURI = "HelloWorld.composite";
+        SCANode node = factory.createSCANode(compositeURI, composite, contribution);
         testNode(node);
     }
     
     @Test
-    public void testNodeWithCompositeURI() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        SCAContribution contribution = new SCAContribution("c1", new File("target/test-classes").toURI().toString());
-        String compositeURI = new File("target/test-classes/HelloWorld.composite").toURI().toString();
-        SCANode node = factory.createSCANode(compositeURI, contribution);
-        testNode(node);
-    }
-
-    @Test
     public void testNodeWithRelativeCompositeURI() {
         SCANodeFactory factory = new NodeFactoryImpl();
         SCAContribution contribution = new SCAContribution("c1", new File("target/test-classes").toURI().toString());
@@ -86,29 +63,6 @@
         testNode(node);
     }
 
-    @Test
-    public void testNodeWithRelativeCompositeURIAndNoContribution() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        String compositeURI = "HelloWorld.composite";
-        SCANode node = factory.createSCANode(compositeURI, new SCAContribution[0]);
-        testNode(node);
-    }
-
-    @Test
-    public void testNodeWithClassLoader() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        String compositeURI = "HelloWorld.composite";
-        SCANode node = factory.createSCANodeFromClassLoader(compositeURI, HelloWorld.class.getClassLoader());
-        testNode(node);
-    }
-
-    @Test
-    public void testNodeWithClassLoaderAndNullComposite() {
-        SCANodeFactory factory = new NodeFactoryImpl();
-        SCANode node = factory.createSCANodeFromClassLoader(null, HelloWorld.class.getClassLoader());
-        testNode(node);
-    }
-    
     private void testNode(SCANode node) {
         node.start();
         HelloWorld hw = ((SCAClient)node).getService(HelloWorld.class, "HelloWorld");



Mime
View raw message