tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r526320 - in /incubator/tuscany/java/sca/modules: core-spi/src/main/java/org/apache/tuscany/spi/deployer/ core/ core/src/main/java/org/apache/tuscany/core/bootstrap/ core/src/main/java/org/apache/tuscany/core/component/ core/src/main/java/o...
Date Fri, 06 Apr 2007 23:29:59 GMT
Author: rfeng
Date: Fri Apr  6 16:29:57 2007
New Revision: 526320

URL: http://svn.apache.org/viewvc?view=rev&rev=526320
Log:
[Work in progress] Integrate the core with Contribution Service

Added:
    incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java   (with props)
Removed:
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/resolver/
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/deployer/
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/integration/
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/launcher/
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/resolver/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
Modified:
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java
    incubator/tuscany/java/sca/modules/core/pom.xml
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/component/ComponentManagerImpl.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java
    incubator/tuscany/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java
    incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml
    incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/DefaultSCARuntime.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeInfoImpl.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java Fri Apr  6 16:29:57 2007
@@ -20,6 +20,7 @@
 
 import java.util.Collection;
 
+import org.apache.tuscany.assembly.Composite;
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ComponentException;
@@ -44,6 +45,6 @@
      *            assembly
      * @return the newly deployed component
      */
-    Collection<Component> deploy(Component parent, org.apache.tuscany.assembly.Component componentDefinition)
+    Collection<Component> deploy(Component parent, Composite composite)
         throws BuilderException, ComponentException, ResolutionException;
 }

Modified: incubator/tuscany/java/sca/modules/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/pom.xml?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/core/pom.xml Fri Apr  6 16:29:57 2007
@@ -34,12 +34,20 @@
             <artifactId>tuscany-core-spi</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-contribution</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-idl-java</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
+        
         <dependency>
             <groupId>org.codehaus.woodstox</groupId>
             <artifactId>wstx-asl</artifactId>

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java Fri Apr  6 16:29:57 2007
@@ -18,9 +18,8 @@
  */
 package org.apache.tuscany.core.bootstrap;
 
-import org.apache.tuscany.core.resolver.AutowireResolver;
 import org.apache.tuscany.host.MonitorFactory;
-import org.apache.tuscany.spi.builder.Connector;
+import org.apache.tuscany.services.spi.contribution.ContributionService;
 import org.apache.tuscany.spi.component.ComponentManager;
 import org.apache.tuscany.spi.component.ScopeRegistry;
 import org.apache.tuscany.spi.deployer.Deployer;
@@ -47,7 +46,7 @@
      *
      * @return a new primordial Deployer
      */
-    Deployer createDeployer();
+    Deployer createDeployer(ExtensionRegistry registry);
 
     /**
      * Create a ScopeRegistry that supports the Scopes supported for primordial components
@@ -56,21 +55,6 @@
      */
     ScopeRegistry getScopeRegistry();
 
-    /**
-     * Create a Connector that can wire together primordial components.
-     *
-     * @return a new primordial Connector
-     */
-    Connector getConnector();
-
-    /**
-     * Returns the AutowireResolver that resolves autowire targets
-     *
-     * @return the AutowireResolver that resolves autowire targets
-     */
-    AutowireResolver getAutowireResolver();
-    
     ComponentManager getComponentManager();
-    ExtensionRegistry getExtensionRegistry();
 
 }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java Fri Apr  6 16:29:57 2007
@@ -23,7 +23,6 @@
 import org.apache.tuscany.core.binding.local.LocalBindingBuilder;
 import org.apache.tuscany.core.binding.local.LocalBindingDefinition;
 import org.apache.tuscany.core.builder.BuilderRegistryImpl;
-import org.apache.tuscany.core.builder.ConnectorImpl;
 import org.apache.tuscany.core.component.ComponentManagerImpl;
 import org.apache.tuscany.core.component.scope.AbstractScopeContainer;
 import org.apache.tuscany.core.component.scope.CompositeScopeContainer;
@@ -32,12 +31,9 @@
 import org.apache.tuscany.core.component.scope.StatelessScopeContainer;
 import org.apache.tuscany.core.deployer.DeployerImpl;
 import org.apache.tuscany.core.implementation.composite.CompositeBuilder;
-import org.apache.tuscany.core.resolver.AutowireResolver;
-import org.apache.tuscany.core.resolver.DefaultAutowireResolver;
-import org.apache.tuscany.core.wire.IDLMappingService;
 import org.apache.tuscany.host.MonitorFactory;
+import org.apache.tuscany.services.spi.contribution.ContributionService;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.builder.Connector;
 import org.apache.tuscany.spi.component.ComponentManager;
 import org.apache.tuscany.spi.component.ScopeContainerMonitor;
 import org.apache.tuscany.spi.component.ScopeRegistry;
@@ -53,11 +49,7 @@
     private final MonitorFactory monitorFactory;
     private final XMLInputFactory xmlFactory;
     private final ComponentManager componentManager;
-    private final AutowireResolver resolver;
-    private final Connector connector;
     private final ScopeRegistry scopeRegistry;
-    private final ExtensionRegistry extensionRegistry;
-
     /**
      * Create a default bootstrapper.
      * 
@@ -71,26 +63,18 @@
      */
     public DefaultBootstrapper(MonitorFactory monitorFactory,
                                XMLInputFactory xmlFactory,
-                               ComponentManager componentManager,
-                               AutowireResolver resolver,
-                               Connector connector) {
+                               ComponentManager componentManager) {
         this.monitorFactory = monitorFactory;
         this.xmlFactory = xmlFactory;
         this.componentManager = componentManager;
-        this.resolver = resolver;
-        this.connector = connector;
         this.scopeRegistry = createScopeRegistry();
-        this.extensionRegistry = new ExtensionRegistryImpl();
     }
     
     public DefaultBootstrapper(MonitorFactory monitorFactory) {
         this.monitorFactory = monitorFactory;
         this.xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", getClass().getClassLoader());
-        this.resolver = new DefaultAutowireResolver(new IDLMappingService());
-        this.componentManager = new ComponentManagerImpl(null, this.resolver);
-        this.connector = new ConnectorImpl(componentManager);
+        this.componentManager = new ComponentManagerImpl(null);
         this.scopeRegistry = createScopeRegistry();
-        this.extensionRegistry = new ExtensionRegistryImpl();
     }    
 
     /**
@@ -108,11 +92,10 @@
      * 
      * @return the primordial deployer
      */
-    public Deployer createDeployer() {
+    public Deployer createDeployer(ExtensionRegistry extensionRegistry) {
         ScopeRegistry scopeRegistry = getScopeRegistry();
         BuilderRegistry builder = createBuilder(scopeRegistry);
-        DeployerImpl deployer = new DeployerImpl(xmlFactory, builder, componentManager, resolver, connector);
-        deployer.setMonitor(getMonitorFactory().getMonitor(ScopeContainerMonitor.class));
+        DeployerImpl deployer = new DeployerImpl(xmlFactory, builder, componentManager);
         deployer.setScopeRegistry(getScopeRegistry());
         extensionRegistry.addExtension(ScopeRegistry.class, scopeRegistry);
         extensionRegistry.addExtension(BuilderRegistry.class, builder);
@@ -146,21 +129,6 @@
     }
 
     /**
-     * Create a new Connector that can be used to wire primordial components
-     * together.
-     * 
-     * @return a new Connector
-     */
-    public Connector getConnector() {
-        return connector;
-    }
-
-    public AutowireResolver getAutowireResolver() {
-        return resolver;
-    }
-
-
-    /**
      * Create a Builder that can be used to build the components in the system
      * definition. The default implementation only supports implementations from
      * the system programming model.
@@ -193,13 +161,6 @@
      */
     public ScopeRegistry getScopeRegistry() {
         return scopeRegistry;
-    }
-
-    /**
-     * @return the extensionRegistry
-     */
-    public ExtensionRegistry getExtensionRegistry() {
-        return extensionRegistry;
     }
 
 }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/component/ComponentManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/component/ComponentManagerImpl.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/component/ComponentManagerImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/component/ComponentManagerImpl.java Fri Apr  6 16:29:57 2007
@@ -24,8 +24,6 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.tuscany.assembly.ComponentService;
-import org.apache.tuscany.assembly.Contract;
-import org.apache.tuscany.core.resolver.AutowireResolver;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ComponentManager;
@@ -41,17 +39,15 @@
  */
 public class ComponentManagerImpl implements ComponentManager {
     private TuscanyManagementService managementService;
-    private AutowireResolver resolver;
     private Map<URI, Component> components;
 
     public ComponentManagerImpl() {
         components = new ConcurrentHashMap<URI, Component>();
     }
 
-    public ComponentManagerImpl(TuscanyManagementService managementService, AutowireResolver resolver) {
+    public ComponentManagerImpl(TuscanyManagementService managementService) {
         this();
         this.managementService = managementService;
-        this.resolver = resolver;
     }
 
     public synchronized void register(Component component) throws RegistrationException {
@@ -73,19 +69,11 @@
     public <I> void registerJavaObject(URI uri, ComponentService service, I instance) throws RegistrationException {
         SingletonAtomicComponent<I> component = new SingletonAtomicComponent<I>(uri, service, instance);
         register(component);
-        if (resolver != null) {
-            resolver.addPrimordialService(service, uri);
-        }
     }
 
     public <I> void registerJavaObject(URI uri, List<ComponentService> services, I instance) throws RegistrationException {
         SingletonAtomicComponent<I> component = new SingletonAtomicComponent<I>(uri, services, instance);
         register(component);
-        if (resolver != null) {
-            for (ComponentService contract : services) {
-                resolver.addPrimordialService(contract, uri);
-            }
-        }
     }
 
     public synchronized void unregister(Component component) throws RegistrationException {

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java Fri Apr  6 16:29:57 2007
@@ -23,20 +23,18 @@
 
 import javax.xml.stream.XMLInputFactory;
 
-import org.apache.tuscany.core.resolver.AutowireResolver;
-import org.apache.tuscany.spi.Monitor;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.spi.Scope;
 import org.apache.tuscany.spi.builder.Builder;
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.builder.BuilderInstantiationException;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.builder.Connector;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ComponentManager;
 import org.apache.tuscany.spi.component.RegistrationException;
 import org.apache.tuscany.spi.component.SCAObject;
 import org.apache.tuscany.spi.component.ScopeContainer;
-import org.apache.tuscany.spi.component.ScopeContainerMonitor;
 import org.apache.tuscany.spi.component.ScopeRegistry;
 import org.apache.tuscany.spi.deployer.Deployer;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
@@ -51,22 +49,15 @@
 public class DeployerImpl implements Deployer {
     private XMLInputFactory xmlFactory;
     private Builder builder;
-    private ScopeContainerMonitor monitor;
-    private AutowireResolver resolver;
-    private Connector connector;
     private ComponentManager componentManager;
     private ScopeRegistry scopeRegistry;
 
     public DeployerImpl(XMLInputFactory xmlFactory,
                         Builder builder,
-                        ComponentManager componentManager,
-                        AutowireResolver resolver,
-                        Connector connector) {
+                        ComponentManager componentManager) {
         this.xmlFactory = xmlFactory;
         this.builder = builder;
         this.componentManager = componentManager;
-        this.resolver = resolver;
-        this.connector = connector;
     }
 
     public DeployerImpl() {
@@ -78,21 +69,6 @@
         this.builder = builder;
     }
 
-    @Monitor
-    public void setMonitor(ScopeContainerMonitor monitor) {
-        this.monitor = monitor;
-    }
-
-    @Reference
-    public void setResolver(AutowireResolver resolver) {
-        this.resolver = resolver;
-    }
-
-    @Reference
-    public void setConnector(Connector connector) {
-        this.connector = connector;
-    }
-
     @Reference
     public void setComponentManager(ComponentManager componentManager) {
         this.componentManager = componentManager;
@@ -103,26 +79,20 @@
         this.scopeRegistry = scopeRegistry;
     }
 
-    public Collection<Component> deploy(Component parent, org.apache.tuscany.assembly.Component componentDef)
+    public Collection<Component> deploy(Component parent, Composite composite)
         throws BuilderException, ResolutionException {
         @SuppressWarnings("unchecked")
         ScopeContainer<URI> scopeContainer = scopeRegistry.getScopeContainer(Scope.COMPOSITE);
         URI groupId = parent != null ? parent.getUri() : URI.create("/");
         DeploymentContext deploymentContext = new RootDeploymentContext(null, null, groupId, xmlFactory,
                                                                         scopeContainer, false);
-        // load the model
-        // load(parent, componentDefinition, deploymentContext);
-        // resolve autowires
-        resolver.resolve(null, componentDef);
+        
+        org.apache.tuscany.assembly.Component componentDef = new DefaultAssemblyFactory().createComponent();
+        componentDef.setName(composite.getName().getLocalPart());
+        componentDef.setImplementation(composite);
+        
         // build runtime artifacts
         build(parent, componentDef, deploymentContext);
-        /*
-         * // create a listener so the scope container is shutdown when the
-         * top-level composite stops RuntimeEventListener listener = new
-         * RuntimeEventListener() { public void onEvent(Event event) {
-         * scopeContainer.onEvent(event); if (event instanceof ComponentStop) {
-         * scopeContainer.stop(); } } }; component.addListener(listener);
-         */
 
         Collection<Component> components = deploymentContext.getComponents().values();
         for (Component toRegister : components) {
@@ -132,7 +102,6 @@
                 throw new BuilderInstantiationException("Error registering component", e);
             }
         }
-        connector.connect(groupId, componentDef);
         return components;
     }
 

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java Fri Apr  6 16:29:57 2007
@@ -39,21 +39,17 @@
 
 import org.apache.tuscany.assembly.AssemblyFactory;
 import org.apache.tuscany.assembly.ComponentService;
-import org.apache.tuscany.assembly.Contract;
 import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
 import org.apache.tuscany.core.bootstrap.Bootstrapper;
 import org.apache.tuscany.core.bootstrap.DefaultBootstrapper;
 import org.apache.tuscany.core.bootstrap.ExtensionActivator;
 import org.apache.tuscany.core.bootstrap.ExtensionRegistry;
-import org.apache.tuscany.core.builder.ConnectorImpl;
+import org.apache.tuscany.core.bootstrap.ExtensionRegistryImpl;
 import org.apache.tuscany.core.component.ComponentManagerImpl;
 import org.apache.tuscany.core.component.SimpleWorkContext;
 import org.apache.tuscany.core.monitor.NullMonitorFactory;
-import org.apache.tuscany.core.resolver.AutowireResolver;
-import org.apache.tuscany.core.resolver.DefaultAutowireResolver;
 import org.apache.tuscany.core.services.classloading.ClassLoaderRegistryImpl;
 import org.apache.tuscany.core.util.IOHelper;
-import org.apache.tuscany.core.wire.IDLMappingService;
 import org.apache.tuscany.host.MonitorFactory;
 import org.apache.tuscany.host.RuntimeInfo;
 import org.apache.tuscany.host.management.ManagementService;
@@ -62,7 +58,7 @@
 import org.apache.tuscany.host.runtime.TuscanyRuntime;
 import org.apache.tuscany.idl.java.JavaInterface;
 import org.apache.tuscany.idl.java.impl.DefaultJavaFactory;
-import org.apache.tuscany.spi.builder.Connector;
+import org.apache.tuscany.services.spi.contribution.ContributionService;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.ComponentManager;
@@ -83,8 +79,6 @@
 
     private static final URI COMPONENT_MGR_URI = TUSCANY_SYSTEM_ROOT.resolve("ComponentManager");
 
-    private static final URI AUTOWIRE_RESOLVER_URI = TUSCANY_SYSTEM_ROOT.resolve("AutowireResolver");
-
     private static final URI SCOPE_REGISTRY_URI = TUSCANY_SYSTEM_ROOT.resolve("ScopeRegistry");
 
     private static final URI WORK_CONTEXT_URI = TUSCANY_SYSTEM.resolve("WorkContext");
@@ -127,11 +121,11 @@
      */
     protected ClassLoaderRegistry classLoaderRegistry;
 
-    protected AutowireResolver resolver;
-
     protected Component systemComponent;
     protected Component tuscanySystem;
 
+    protected ContributionService contributionService;
+
     protected ScopeRegistry scopeRegistry;
     protected Collection<ExtensionActivator> activators;
 
@@ -203,21 +197,25 @@
         this.managementService = managementService;
     }
 
-    public void initialize() throws InitializationException {
-        // URI name = TUSCANY_SYSTEM_ROOT.resolve("main");
+    public void initialize(ExtensionRegistry extensionRegistry, ContributionService contributionService)
+        throws InitializationException {
+        this.contributionService = contributionService;
+        this.extensionRegistry = extensionRegistry;
+
         Bootstrapper bootstrapper = createBootstrapper();
-        Deployer deployer = bootstrapper.createDeployer();
-        this.extensionRegistry = bootstrapper.getExtensionRegistry();
-        
+
+        Deployer deployer = bootstrapper.createDeployer(extensionRegistry);
+
+        extensionRegistry.addExtension(ContributionService.class, contributionService);
+
         registerSystemComponent(TUSCANY_DEPLOYER, Deployer.class, deployer);
         registerSystemComponent(WORK_CONTEXT_URI, WorkContext.class, new SimpleWorkContext());
 
         this.scopeRegistry = bootstrapper.getScopeRegistry();
 
         activators = getInstances(getHostClassLoader(), ExtensionActivator.class);
-        ExtensionRegistry registry = bootstrapper.getExtensionRegistry();
         for (ExtensionActivator activator : activators) {
-            activator.start(registry);
+            activator.start(extensionRegistry);
         }
 
         registerBaselineSystemComponents();
@@ -244,10 +242,8 @@
 
     protected Bootstrapper createBootstrapper() {
         TuscanyManagementService tms = (TuscanyManagementService)getManagementService();
-        resolver = new DefaultAutowireResolver(new IDLMappingService());
-        componentManager = new ComponentManagerImpl(tms, resolver);
-        Connector connector = new ConnectorImpl(componentManager);
-        return new DefaultBootstrapper(getMonitorFactory(), xmlFactory, componentManager, resolver, connector);
+        componentManager = new ComponentManagerImpl(tms);
+        return new DefaultBootstrapper(getMonitorFactory(), xmlFactory, componentManager);
     }
 
     protected void registerBaselineSystemComponents() throws InitializationException {
@@ -266,9 +262,6 @@
         // register the ComponentManager to that the fabric can wire to it
         registerSystemComponent(COMPONENT_MGR_URI, ComponentManager.class, componentManager);
 
-        // register the AutowireResolver
-        registerSystemComponent(AUTOWIRE_RESOLVER_URI, AutowireResolver.class, resolver);
-
         // register the ScopeRegistry
         registerSystemComponent(SCOPE_REGISTRY_URI, ScopeRegistry.class, scopeRegistry);
     }
@@ -390,5 +383,12 @@
             throw new IllegalStateException(e);
         }
         return instances;
+    }
+
+    /**
+     * @return the contributionService
+     */
+    public ContributionService getContributionService() {
+        return contributionService;
     }
 }

Modified: incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java Fri Apr  6 16:29:57 2007
@@ -35,8 +35,6 @@
 import org.apache.tuscany.idl.impl.OperationImpl;
 import org.apache.tuscany.idl.java.JavaInterface;
 import org.apache.tuscany.idl.java.impl.JavaInterfaceImpl;
-import org.apache.tuscany.spi.QualifiedName;
-import org.apache.tuscany.spi.component.ReferenceBinding;
 import org.apache.tuscany.spi.wire.ChainHolder;
 import org.apache.tuscany.spi.wire.IncompatibleServiceContractException;
 import org.apache.tuscany.spi.wire.InvocationChain;
@@ -410,10 +408,6 @@
         }
 
         public Object createCallbackProxy(Class<?> interfaze) throws ProxyCreationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public void createWires(ReferenceBinding referenceBinding, Contract contract, QualifiedName targetName) {
             throw new UnsupportedOperationException();
         }
 

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java Fri Apr  6 16:29:57 2007
@@ -44,15 +44,15 @@
         super();
     }
 
-    public void visitInterface(Class<?> clazz, Class<?> callbackClass, JavaServiceContract contract)
+    public void visitInterface(Class<?> clazz, Class<?> callbackClass, Contract contract)
         throws InvalidServiceContractException {
         if (!contract.isRemotable()) {
             return;
         }
-        Map<String, Operation<Type>> operations = contract.getOperations();
+        Map<String, Operation> operations = contract.getOperations();
         processInterface(clazz, contract, operations);
         if (callbackClass != null) {
-            Map<String, Operation<Type>> callbackOperations = contract.getCallbackOperations();
+            Map<String, Operation> callbackOperations = contract.getCallbackOperations();
             processInterface(callbackClass, contract, callbackOperations);
         }
     }
@@ -61,7 +61,7 @@
         return "".equals(value) ? defaultValue : value;
     }
 
-    private void processInterface(Class<?> clazz, JavaServiceContract contract, Map<String, Operation<Type>> operations) {
+    private void processInterface(Class<?> clazz, Contract contract, Map<String, Operation> operations) {
 
         for (Method method : clazz.getMethods()) {
             Operation<?> operation = operations.get(method.getName());

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml Fri Apr  6 16:29:57 2007
@@ -34,5 +34,10 @@
             <artifactId>tuscany-core</artifactId>
             <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-contribution-impl</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 </project>

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/DefaultSCARuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/DefaultSCARuntime.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/DefaultSCARuntime.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/DefaultSCARuntime.java Fri Apr  6 16:29:57 2007
@@ -24,7 +24,6 @@
 import java.util.List;
 
 import org.apache.tuscany.api.SCARuntime;
-import org.apache.tuscany.api.TuscanyException;
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.osoa.sca.ComponentContext;
 import org.osoa.sca.ServiceUnavailableException;
@@ -49,7 +48,7 @@
 
         try {
             runtime.start();
-        } catch (TuscanyException e) {
+        } catch (Exception e) {
             throw e;
         }
 

Added: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java?view=auto&rev=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java Fri Apr  6 16:29:57 2007
@@ -0,0 +1,63 @@
+/*
+ * 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.    
+ */
+package org.apache.tuscany.runtime.embedded;
+
+import org.apache.tuscany.spi.component.WorkContext;
+
+/**
+ * Class for tunneling a WorkContext through the invocation of a user class.
+ *
+ * @version $Rev$ $Date$
+ */
+public final class PojoWorkContextTunnel {
+    private static final ThreadLocal<WorkContext> CONTEXT = new ThreadLocal<WorkContext>();
+
+    private PojoWorkContextTunnel() {
+    }
+
+    /**
+     * Set the WorkContext for the current thread.
+     * The current work context is returned and must be restored after the invocation is complete.
+     * Typical usage would be:
+     * <pre>
+     *   WorkContext old = PojoWorkContextTunnel.setThreadWorkContext(newContext);
+     *   try {
+     *      ... invoke user code ...
+     *   } finally {
+     *     PojoWorkContextTunnel.setThreadWorkContext(old);
+     *   }
+     * </pre>
+     * @param context
+     * @return the current work context for the thread; this must be restored after the invocation is made
+     */
+    public static WorkContext setThreadWorkContext(WorkContext context) {
+        WorkContext old = CONTEXT.get();
+        CONTEXT.set(context);
+        return old;
+    }
+
+    /**
+     * Returns the WorkContext for the current thread.
+     *
+     * @return the WorkContext for the current thread
+     */
+    public static WorkContext getThreadWorkContext() {
+        return CONTEXT.get();
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/PojoWorkContextTunnel.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java Fri Apr  6 16:29:57 2007
@@ -20,13 +20,39 @@
 
 import static org.apache.tuscany.runtime.embedded.SimpleRuntimeInfo.DEFAULT_COMPOSITE;
 
+import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URL;
 import java.util.Collection;
 
-import org.apache.tuscany.api.annotation.LogLevel;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.xml.impl.ComponentTypeProcessor;
+import org.apache.tuscany.assembly.xml.impl.CompositeDocumentProcessor;
+import org.apache.tuscany.assembly.xml.impl.CompositeProcessor;
+import org.apache.tuscany.assembly.xml.impl.ConstrainingTypeProcessor;
+import org.apache.tuscany.core.bootstrap.ExtensionRegistry;
+import org.apache.tuscany.core.bootstrap.ExtensionRegistryImpl;
 import org.apache.tuscany.core.component.SimpleWorkContext;
-import org.apache.tuscany.core.implementation.PojoWorkContextTunnel;
 import org.apache.tuscany.core.runtime.AbstractRuntime;
+import org.apache.tuscany.host.runtime.InitializationException;
+import org.apache.tuscany.services.contribution.ContributionPackageProcessorRegistryImpl;
+import org.apache.tuscany.services.contribution.ContributionRepositoryImpl;
+import org.apache.tuscany.services.contribution.ContributionServiceImpl;
+import org.apache.tuscany.services.contribution.PackageTypeDescriberImpl;
+import org.apache.tuscany.services.contribution.model.Contribution;
+import org.apache.tuscany.services.contribution.model.DeployedArtifact;
+import org.apache.tuscany.services.contribution.processor.FolderContributionProcessor;
+import org.apache.tuscany.services.contribution.processor.JarContributionProcessor;
+import org.apache.tuscany.services.contribution.util.FileHelper;
+import org.apache.tuscany.services.spi.contribution.ArtifactResolverRegistry;
+import org.apache.tuscany.services.spi.contribution.ContributionPackageProcessorRegistry;
+import org.apache.tuscany.services.spi.contribution.ContributionRepository;
+import org.apache.tuscany.services.spi.contribution.ContributionService;
+import org.apache.tuscany.services.spi.contribution.DefaultStAXArtifactProcessorRegistry;
+import org.apache.tuscany.services.spi.contribution.DefaultURLArtifactProcessorRegistry;
+import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
+import org.apache.tuscany.services.spi.contribution.URLArtifactProcessorRegistry;
+import org.apache.tuscany.spi.Scope;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.Component;
 import org.apache.tuscany.spi.component.SCAObject;
@@ -34,9 +60,6 @@
 import org.apache.tuscany.spi.component.ScopeRegistry;
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.model.ComponentDefinition;
-import org.apache.tuscany.spi.model.CompositeImplementation;
-import org.apache.tuscany.spi.model.Scope;
 
 /**
  * @version $Rev$ $Date$
@@ -53,33 +76,78 @@
         setRuntimeInfo(runtimeInfo);
     }
 
-    public interface SimpleMonitor {
-        @LogLevel("SEVERE")
-        void runError(Exception e);
+    public void initialize() throws InitializationException {
+    }
+
+    private static URL getContributionLocation(URL applicationSCDL, String compositePath) {
+        URL root = null;
+        // "jar:file://....../something.jar!/a/b/c/app.composite"
+        try {
+            String scdlUrl = applicationSCDL.toExternalForm();
+            String protocol = applicationSCDL.getProtocol();
+            if ("file".equals(protocol)) {
+                // directory contribution
+                if (scdlUrl.endsWith(compositePath)) {
+                    String location = scdlUrl.substring(0, scdlUrl.lastIndexOf(compositePath));
+                    // workaround from evil url/uri form maven
+                    root = FileHelper.toFile(new URL(location)).toURI().toURL();
+                }
+
+            } else if ("jar".equals(protocol)) {
+                // jar contribution
+                String location = scdlUrl.substring(4, scdlUrl.lastIndexOf("!/"));
+                // workaround from evil url/uri form maven
+                root = FileHelper.toFile(new URL(location)).toURI().toURL();
+            }
+        } catch (MalformedURLException mfe) {
+            throw new IllegalArgumentException(mfe);
+        }
+
+        return root;
     }
 
     @SuppressWarnings("unchecked")
     public Component start() throws Exception {
-        
-        initialize();
+        ExtensionRegistry extensionRegistry = new ExtensionRegistryImpl();
+        ContributionRepository repository = new ContributionRepositoryImpl("target");
+        DefaultStAXArtifactProcessorRegistry registry = new DefaultStAXArtifactProcessorRegistry();
+        registry.addArtifactProcessor(new CompositeProcessor(registry));
+        registry.addArtifactProcessor(new ComponentTypeProcessor(registry));
+        registry.addArtifactProcessor(new ConstrainingTypeProcessor(registry));
+
+        extensionRegistry.addExtension(StAXArtifactProcessorRegistry.class, registry);
+
+        DefaultURLArtifactProcessorRegistry registry2 = new DefaultURLArtifactProcessorRegistry();
+        CompositeDocumentProcessor compositeProcessor = new CompositeDocumentProcessor(registry);
+
+        registry2.addArtifactProcessor(compositeProcessor);
+
+        PackageTypeDescriberImpl describer = new PackageTypeDescriberImpl();
+        ContributionPackageProcessorRegistry pkgRegistry = new ContributionPackageProcessorRegistryImpl(describer);
+        new JarContributionProcessor(pkgRegistry);
+        new FolderContributionProcessor(pkgRegistry);
+
+        ArtifactResolverRegistry resolverRegistry = null;
+
+        ContributionService contributionService = new ContributionServiceImpl(repository, pkgRegistry, registry2,
+                                                                              resolverRegistry);
+
+        extensionRegistry.addExtension(ContributionService.class, contributionService);
+        initialize(extensionRegistry, contributionService);
 
         ScopeRegistry scopeRegistry = getScopeRegistry();
         container = scopeRegistry.getScopeContainer(Scope.COMPOSITE);
 
-        // int i = 0;
-        // for (URL ext : runtimeInfo.getExtensionSCDLs()) {
-        // URI uri = URI.create("/extensions/extension" + (i++));
-        // deployExtension(null, uri, ext, runtimeInfo.getClassLoader());
-        // }
-
-        CompositeImplementation impl = new CompositeImplementation();
-        impl.setScdlLocation(getApplicationScdl());
-        impl.setClassLoader(runtimeInfo.getClassLoader());
-
-        ComponentDefinition<CompositeImplementation> definition = new ComponentDefinition<CompositeImplementation>(
-                                                                                                                   DEFAULT_COMPOSITE,
-                                                                                                                   impl);
-        Collection<Component> components = getDeployer().deploy(null, definition);
+        URI uri = URI.create("sca://default/");
+        URL root = getContributionLocation(getApplicationScdl(), runtimeInfo.getCompositePath());
+        contributionService.contribute(uri, root, false);
+        Contribution contribution = contributionService.getContribution(uri);
+
+        // FIXME: Need to getDeployables() as list of Composites
+        DeployedArtifact artifact = contribution.getArtifact(URI.create(uri + runtimeInfo.getCompositePath()));
+        Composite composite = (Composite)artifact.getModelObjects(Composite.class).get(0);
+
+        Collection<Component> components = getDeployer().deploy(null, composite);
         for (Component component : components) {
             component.start();
         }
@@ -88,7 +156,7 @@
         WorkContext workContext = new SimpleWorkContext();
         workContext.setIdentifier(Scope.COMPOSITE, DEFAULT_COMPOSITE);
         PojoWorkContextTunnel.setThreadWorkContext(workContext);
-        return getComponentManager().getComponent(definition.getUri());
+        return getComponentManager().getComponent(URI.create(composite.getName().getLocalPart()));
     }
 
     @SuppressWarnings("deprecation")

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeInfoImpl.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeInfoImpl.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeInfoImpl.java Fri Apr  6 16:29:57 2007
@@ -28,8 +28,8 @@
 import java.util.Enumeration;
 import java.util.List;
 
-import org.apache.tuscany.core.util.FileHelper;
 import org.apache.tuscany.host.AbstractRuntimeInfo;
+import org.apache.tuscany.services.contribution.util.FileHelper;
 
 /**
  * @version $Rev$ $Date$

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java Fri Apr  6 16:29:57 2007
@@ -26,13 +26,12 @@
 import org.apache.tuscany.core.component.ServiceReferenceImpl;
 import org.apache.tuscany.core.component.scope.InstanceWrapperBase;
 import org.apache.tuscany.core.injection.SingletonObjectFactory;
+import org.apache.tuscany.idl.Operation;
 import org.apache.tuscany.spi.ObjectCreationException;
 import org.apache.tuscany.spi.component.InstanceWrapper;
 import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.apache.tuscany.spi.extension.AtomicComponentExtension;
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.physical.PhysicalOperationDefinition;
 import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.apache.tuscany.spi.wire.Wire;
 import org.osoa.sca.CallableReference;
@@ -45,18 +44,18 @@
  * @version $Rev$ $Date$
  */
 public class CRUDAtomicComponent extends AtomicComponentExtension implements ComponentContextProvider {
-    private String directory;
+    private CRUDImplementation impl;
     private ComponentContext componentContext;
 
-    public CRUDAtomicComponent(URI uri, URI groupId, String directory) {
+    public CRUDAtomicComponent(URI uri, URI groupId, CRUDImplementation impl) {
         super(uri, null, null, groupId, 50);
-        this.directory = directory;
+        this.impl = impl;
         componentContext = new ComponentContextImpl(this);
 
     }
 
     public Object createInstance() throws ObjectCreationException {
-        return new CRUDImpl(directory);
+        return new CRUDImpl(impl.getDirectory());
     }
 
     public InstanceWrapper createInstanceWrapper() throws ObjectCreationException {
@@ -64,7 +63,7 @@
     }
 
     public Object getTargetInstance() throws TargetResolutionException {
-        return new CRUDImpl(directory);
+        return new CRUDImpl(impl.getDirectory());
     }
 
     public void attachCallbackWire(Wire arg0) {
@@ -80,15 +79,10 @@
         return null;
     }
 
-    public TargetInvoker createTargetInvoker(String targetName, final Operation operation)
+    public TargetInvoker createTargetInvoker(String targetName, final Operation operation, boolean callback)
         throws TargetInvokerCreationException {
-        return new CRUDTargetInvoker(operation, directory);
+        return new CRUDTargetInvoker(operation, impl.getDirectory());
 
-    }
-
-    public TargetInvoker createTargetInvoker(String targetName, PhysicalOperationDefinition arg1)
-        throws TargetInvokerCreationException {
-        return null;
     }
 
     @Override

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java Fri Apr  6 16:29:57 2007
@@ -18,11 +18,13 @@
  */
 package org.apache.tuscany.container.crud;
 
+import java.net.URI;
+
+import org.apache.tuscany.assembly.Component;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
-import org.apache.tuscany.spi.model.ComponentDefinition;
 
 /**
  * Builds a Java-based atomic context from a component definition
@@ -33,10 +35,9 @@
 public class CRUDComponentBuilder extends ComponentBuilderExtension<CRUDImplementation> {
 
     @SuppressWarnings("unchecked")
-    public AtomicComponent build(ComponentDefinition<CRUDImplementation> definition, DeploymentContext context)
-        throws BuilderConfigException {
-        CRUDAtomicComponent component = new CRUDAtomicComponent(definition.getUri(), context.getGroupId(), definition
-            .getImplementation().getDirectory());
+    public AtomicComponent build(Component definition, DeploymentContext context) throws BuilderConfigException {
+        CRUDAtomicComponent component = new CRUDAtomicComponent(URI.create(definition.getName()), context.getGroupId(),
+                                                                (CRUDImplementation)definition.getImplementation());
         return component;
     }
 

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java Fri Apr  6 16:29:57 2007
@@ -21,25 +21,22 @@
 
 import org.apache.tuscany.core.bootstrap.ExtensionActivator;
 import org.apache.tuscany.core.bootstrap.ExtensionRegistry;
+import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.loader.LoaderRegistry;
 
 /**
  * @version $Rev$ $Date$
  */
 public class CRUDExtensionActivator implements ExtensionActivator {
-    private CRUDComponentTypeLoader componentTypeLoader;
     private CRUDImplementationLoader implementationLoader;
     private CRUDComponentBuilder builder;
 
     public void start(ExtensionRegistry registry) {
-        LoaderRegistry loaderRegistry = registry.getExtension(LoaderRegistry.class);
+        StAXArtifactProcessorRegistry processors = registry.getExtension(StAXArtifactProcessorRegistry.class);
         BuilderRegistry builderRegistry = registry.getExtension(BuilderRegistry.class);
-        componentTypeLoader = new CRUDComponentTypeLoader(loaderRegistry);
-        componentTypeLoader.start();
 
-        implementationLoader = new CRUDImplementationLoader(loaderRegistry);
-        implementationLoader.start();
+        implementationLoader = new CRUDImplementationLoader();
+        processors.addArtifactProcessor(implementationLoader);
 
         builder = new CRUDComponentBuilder();
         builder.setBuilderRegistry(builderRegistry);
@@ -47,7 +44,5 @@
     }
 
     public void stop(ExtensionRegistry registry) {
-        componentTypeLoader.stop();
-        implementationLoader.stop();
     }
 }

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java Fri Apr  6 16:29:57 2007
@@ -18,17 +18,34 @@
  */
 package org.apache.tuscany.container.crud;
 
-import org.apache.tuscany.spi.model.AtomicImplementation;
-import org.apache.tuscany.spi.model.ComponentType;
+import org.apache.tuscany.assembly.ComponentService;
+import org.apache.tuscany.assembly.Implementation;
+import org.apache.tuscany.assembly.impl.ComponentTypeImpl;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.idl.java.JavaInterface;
+import org.apache.tuscany.idl.java.impl.DefaultJavaFactory;
+import org.apache.tuscany.idl.java.impl.JavaInterfaceImpl;
 
 /**
- * @version $$Rev$$ $$Date$$
+ * @version $$Rev$$ $$Date: 2007-04-03 11:08:56 -0700 (Tue, 03 Apr
+ *          2007) $$
  */
-public class CRUDImplementation extends AtomicImplementation<ComponentType> {
+public class CRUDImplementation extends ComponentTypeImpl implements Implementation {
     private String directory;
 
     public CRUDImplementation(String directory) {
         this.directory = directory;
+        ComponentService service = createService(CRUD.class);
+        getServices().add(service);
+    }
+
+    private ComponentService createService(Class<?> type) {
+        org.apache.tuscany.assembly.ComponentService service = new DefaultAssemblyFactory().createComponentService();
+        service.setName(type.getSimpleName());
+        JavaInterface i = new JavaInterfaceImpl();
+        i.setJavaClass(type);
+        service.setInterface(i);
+        return service;
     }
 
     /**

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java Fri Apr  6 16:29:57 2007
@@ -18,42 +18,60 @@
  */
 package org.apache.tuscany.container.crud;
 
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static org.osoa.sca.Constants.SCA_NS;
+
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
 
-import static org.osoa.sca.Constants.SCA_NS;
-import org.osoa.sca.annotations.Constructor;
-import org.osoa.sca.annotations.Reference;
-
-import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.extension.LoaderExtension;
-import org.apache.tuscany.spi.loader.LoaderException;
-import org.apache.tuscany.spi.loader.LoaderRegistry;
-import org.apache.tuscany.spi.loader.LoaderUtil;
-import org.apache.tuscany.spi.model.ModelObject;
+import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
+import org.apache.tuscany.services.spi.contribution.ContributionException;
+import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
+import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
 
-public class CRUDImplementationLoader extends LoaderExtension {
+public class CRUDImplementationLoader implements StAXArtifactProcessor<CRUDImplementation> {
     public static final QName IMPLEMENTATION_CRUD = new QName(SCA_NS, "implementation.crud");
 
-    @Constructor
-    public CRUDImplementationLoader(@Reference LoaderRegistry registry) {
-        super(registry);
+    public QName getArtifactType() {
+        return IMPLEMENTATION_CRUD;
     }
 
-    @Override
-    public QName getXMLType() {
-        return IMPLEMENTATION_CRUD;
+    public Class<CRUDImplementation> getModelType() {
+        return CRUDImplementation.class;
     }
 
-    public ModelObject load(ModelObject object, XMLStreamReader reader, DeploymentContext deploymentContext)
-        throws XMLStreamException, LoaderException {
+    public void optimize(CRUDImplementation impl) throws ContributionException {
+    }
+
+    public CRUDImplementation read(XMLStreamReader reader) throws ContributionReadException {
         assert IMPLEMENTATION_CRUD.equals(reader.getName());
-        String dir = reader.getAttributeValue(null, "directory");
+        try {
+            String dir = reader.getAttributeValue(null, "directory");
+
+            CRUDImplementation implementation = new CRUDImplementation(dir);
+            // Skip to end element
+            while (reader.hasNext()) {
+                if (reader.next() == END_ELEMENT && IMPLEMENTATION_CRUD.equals(reader.getName())) {
+                    break;
+                }
+            }
+            return implementation;
+        } catch (XMLStreamException e) {
+            throw new ContributionReadException(e);
+        }
+    }
 
-        CRUDImplementation implementation = new CRUDImplementation(dir);
-        LoaderUtil.skipToEndElement(reader);
-        return implementation;
+    public void resolve(CRUDImplementation impl, ArtifactResolver resolver) throws ContributionResolveException {
     }
 
+    public void wire(CRUDImplementation model) throws ContributionWireException {
+    }
+
+    public void write(CRUDImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException {
+    }
 }

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java?view=diff&rev=526320&r1=526319&r2=526320
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java Fri Apr  6 16:29:57 2007
@@ -24,9 +24,9 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.tuscany.idl.Operation;
 import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.extension.TargetInvokerExtension;
-import org.apache.tuscany.spi.model.Operation;
 
 /**
  * @version $Rev$ $Date$



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


Mime
View raw message