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

svn commit: r525225 - in /incubator/tuscany/java/sca/modules/runtime-embedded: ./ src/main/java/org/apache/tuscany/runtime/embedded/ src/test/java/calculator/ src/test/java/org/apache/tuscany/api/ src/test/java/org/apache/tuscany/container/ src/test/ja...

Author: rfeng
Date: Tue Apr  3 11:08:56 2007
New Revision: 525225

URL: http://svn.apache.org/viewvc?view=rev&rev=525225
Log:
Add the embedded runtime that works with the mini-core

Added:
    incubator/tuscany/java/sca/modules/runtime-embedded/
      - copied from r523826, incubator/tuscany/java/sca/runtime/embedded/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
      - copied, changed from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java   (with props)
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
      - copied, changed from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite
      - copied, changed from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite
Removed:
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/calculator/
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/application.composite
    incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/system.composite
Modified:
    incubator/tuscany/java/sca/modules/runtime-embedded/.pmd
    incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml
    incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java

Modified: incubator/tuscany/java/sca/modules/runtime-embedded/.pmd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/.pmd?view=diff&rev=525225&r1=523826&r2=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/.pmd (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/.pmd Tue Apr  3 11:08:56 2007
@@ -1,20 +1,2 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-    * 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.    
--->
 <pmd><useProjectRuleSet>true</useProjectRuleSet><rules/><includeDerivedFiles>false</includeDerivedFiles></pmd>

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=525225&r1=523826&r2=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml Tue Apr  3 11:08:56 2007
@@ -25,7 +25,7 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.tuscany.sca.runtime.embedded</groupId>
-    <artifactId>embedded-host</artifactId>
+    <artifactId>tuscany-runtime-embedded</artifactId>
     <packaging>jar</packaging>
     <name>Apache Tuscany Embedded Runtime Host</name>
     <description>Host code to support an embedded runtime</description>
@@ -33,7 +33,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca.kernel</groupId>
-            <artifactId>tuscany-core</artifactId>
+            <artifactId>tuscany-minicore</artifactId>
             <version>2.0-alpha2-incubating-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>

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=525225&r1=523826&r2=525225
==============================================================================
--- 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 Tue Apr  3 11:08:56 2007
@@ -20,38 +20,23 @@
 
 import static org.apache.tuscany.runtime.embedded.SimpleRuntimeInfo.DEFAULT_COMPOSITE;
 
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 
 import org.apache.tuscany.api.annotation.LogLevel;
 import org.apache.tuscany.core.component.SimpleWorkContext;
 import org.apache.tuscany.core.implementation.PojoWorkContextTunnel;
-import org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
 import org.apache.tuscany.core.runtime.AbstractRuntime;
-import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.Component;
-import org.apache.tuscany.spi.component.ComponentException;
 import org.apache.tuscany.spi.component.SCAObject;
 import org.apache.tuscany.spi.component.ScopeContainer;
 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.loader.LoaderException;
 import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.CompositeImplementation;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.resolver.ResolutionException;
 
 /**
  * @version $Rev$ $Date$
@@ -61,7 +46,7 @@
 
     public SimpleRuntimeImpl(SimpleRuntimeInfo runtimeInfo) {
         super(SimpleRuntimeInfo.class);
-        ClassLoader hostClassLoader = ClassLoader.getSystemClassLoader();
+        ClassLoader hostClassLoader = runtimeInfo.getClassLoader();
         setHostClassLoader(hostClassLoader);
         setApplicationScdl(runtimeInfo.getApplicationSCDL());
         setSystemScdl(runtimeInfo.getSystemSCDL());
@@ -73,77 +58,8 @@
         void runError(Exception e);
     }
 
-    protected Collection<Component> deployExtension(Component parent,
-                                                    URI name,
-                                                    URL extensionSCDL,
-                                                    ClassLoader systemClassLoader) throws LoaderException,
-        BuilderException, ComponentException, ResolutionException {
-
-        SystemCompositeImplementation impl = new SystemCompositeImplementation();
-        impl.setScdlLocation(extensionSCDL);
-        impl.setClassLoader(systemClassLoader);
-        ComponentDefinition<SystemCompositeImplementation> definition = new ComponentDefinition<SystemCompositeImplementation>(
-                                                                                                                               name,
-                                                                                                                               impl);
-
-        Collection<Component> components = getDeployer().deploy(parent, definition);
-        for (Component component : components) {
-            component.start();
-        }
-        return components;
-    }
-
-    /**
-     * Create a facade composite to include all the system and extension SCDLs
-     * @param urls
-     * @return
-     * @throws IOException
-     */
-    private URL merge(List<URL> urls) throws IOException {
-        final StringWriter sw = new StringWriter();
-        final PrintWriter pw = new PrintWriter(sw);
-        pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        pw.print("<composite xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
-        pw.println(" name=\"org.apache.tuscany.System\" autowire=\"true\">");
-        int i = 0;
-        for (URL scdl : urls) {
-            pw.print("<include name=\"");
-            pw.print("composite" + (i++) + "\"");
-            pw.print(" scdlLocation=\"");
-            pw.println(scdl.toString() + "\"/>");
-        }
-        pw.println("</composite>");
-        sw.close();
-        // System.out.println(sw.toString());
-        return new URL(null, "sca:system.scdl", new URLStreamHandler() {
-            @Override
-            protected URLConnection openConnection(URL u) throws IOException {
-                return new URLConnection(u) {
-                    @Override
-                    public InputStream getInputStream() throws IOException {
-                        return new ByteArrayInputStream(sw.toString().getBytes("UTF-8"));
-                    }
-
-                    @Override
-                    public void connect() throws IOException {
-                    }
-                };
-            }
-        });
-    }
-
     @SuppressWarnings("unchecked")
     public Component start() throws Exception {
-        
-        // FIXME: [rfeng] This is a hack to bootstrap extensions
-        SimpleRuntimeInfo runtimeInfo = getRuntimeInfo();
-        List<URL> scdls = new ArrayList<URL>();
-        scdls.add(runtimeInfo.getSystemSCDL());
-        for (URL ext : runtimeInfo.getExtensionSCDLs()) {
-            scdls.add(ext);
-        }
-        setSystemScdl(merge(scdls));
-        // End of hack
         
         initialize();
 

Copied: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java (from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java&r2=525225
==============================================================================
--- incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java Tue Apr  3 11:08:56 2007
@@ -21,12 +21,10 @@
 
 import junit.framework.TestCase;
 
+import org.apache.tuscany.container.crud.CRUD;
 import org.osoa.sca.ComponentContext;
 import org.osoa.sca.ServiceReference;
 
-import calculator.AddService;
-import calculator.CalculatorService;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -35,16 +33,19 @@
      * @throws java.lang.Exception
      */
     protected void setUp() throws Exception {
-        SCARuntime.start("calculator.composite");
+        SCARuntime.start("crud.composite");
     }
 
     public void testStart() throws Exception {
-        ComponentContext context = SCARuntime.getComponentContext("CalculatorServiceComponent");
+        ComponentContext context = SCARuntime.getComponentContext("CRUDServiceComponent");
         assertNotNull(context);
-        ServiceReference<CalculatorService> self = context.createSelfReference(CalculatorService.class);
-        assertEquals(2.0, self.getService().multiply(1.0, 2.0));
-        AddService service = context.getService(AddService.class, "addService");
-        assertEquals(3.0, service.add(1.0, 2.0));
+        ServiceReference<CRUD> self = context.createSelfReference(CRUD.class);
+        CRUD service = self.getService();
+        String id = service.create("ABC");
+        Object result = service.retrieve(id);
+        assertEquals("ABC", result);
+        service.update(id, "EFG");
+        service.delete(id);
     }
 
     /**

Added: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java?view=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.container.crud;
+
+/**
+ * The service interface implemented by CRUD components.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface CRUD {
+
+    String create(Object resource);
+
+    Object retrieve(String id);
+
+    Object update(String id, Object resource);
+
+    void delete(String id);
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,116 @@
+/*
+ * 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.container.crud;
+
+import java.net.URI;
+import java.util.List;
+
+import org.apache.tuscany.core.component.ComponentContextImpl;
+import org.apache.tuscany.core.component.ComponentContextProvider;
+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.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;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+
+/**
+ * The runtime instantiation of Java component implementations
+ * 
+ * @version $Rev$ $Date$
+ */
+public class CRUDAtomicComponent extends AtomicComponentExtension implements ComponentContextProvider {
+    private String directory;
+    private ComponentContext componentContext;
+
+    public CRUDAtomicComponent(URI uri, URI groupId, String directory) {
+        super(uri, null, null, groupId, 50);
+        this.directory = directory;
+        componentContext = new ComponentContextImpl(this);
+
+    }
+
+    public Object createInstance() throws ObjectCreationException {
+        return new CRUDImpl(directory);
+    }
+
+    public InstanceWrapper createInstanceWrapper() throws ObjectCreationException {
+        return new InstanceWrapperBase(createInstance());
+    }
+
+    public Object getTargetInstance() throws TargetResolutionException {
+        return new CRUDImpl(directory);
+    }
+
+    public void attachCallbackWire(Wire arg0) {
+    }
+
+    public void attachWire(Wire arg0) {
+    }
+
+    public void attachWires(List<Wire> arg0) {
+    }
+
+    public List<Wire> getWires(String arg0) {
+        return null;
+    }
+
+    public TargetInvoker createTargetInvoker(String targetName, final Operation operation)
+        throws TargetInvokerCreationException {
+        return new CRUDTargetInvoker(operation, directory);
+
+    }
+
+    public TargetInvoker createTargetInvoker(String targetName, PhysicalOperationDefinition arg1)
+        throws TargetInvokerCreationException {
+        return null;
+    }
+
+    @Override
+    public ComponentContext getComponentContext() {
+        return componentContext;
+    }
+
+    public <B, R extends CallableReference<B>> R cast(B target) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public <B> B getProperty(Class<B> type, String propertyName) {
+        return null;
+    }
+
+    public <B> B getService(Class<B> businessInterface, String referenceName) {
+        return null;
+    }
+
+    public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
+        return new ServiceReferenceImpl<B>(businessInterface, new SingletonObjectFactory<B>((B)createInstance()));
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,47 @@
+/*
+ * 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.container.crud;
+
+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
+ * 
+ * @version $$Rev$$ $$Date: 2007-03-28 09:03:01 -0700 (Wed, 28 Mar
+ *          2007) $$
+ */
+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());
+        return component;
+    }
+
+    protected Class<CRUDImplementation> getImplementationType() {
+        return CRUDImplementation.class;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java?view=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.container.crud;
+
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.ComponentTypeLoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.model.ComponentType;
+import org.apache.tuscany.spi.model.Property;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CRUDComponentTypeLoader extends ComponentTypeLoaderExtension<CRUDImplementation> {
+
+    @Constructor( {"registry"})
+    public CRUDComponentTypeLoader(@Reference LoaderRegistry loaderRegistry) {
+        super(loaderRegistry);
+    }
+
+    @Override
+    protected Class<CRUDImplementation> getImplementationClass() {
+        return CRUDImplementation.class;
+    }
+
+    public void load(CRUDImplementation implementation, DeploymentContext deploymentContext) throws LoaderException {
+        ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> componentType = new ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
+        implementation.setComponentType(componentType);
+        componentType.setImplementationScope(Scope.STATELESS);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,53 @@
+/*
+ * 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.container.crud;
+
+import org.apache.tuscany.core.bootstrap.ExtensionActivator;
+import org.apache.tuscany.core.bootstrap.ExtensionRegistry;
+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);
+        BuilderRegistry builderRegistry = registry.getExtension(BuilderRegistry.class);
+        componentTypeLoader = new CRUDComponentTypeLoader(loaderRegistry);
+        componentTypeLoader.start();
+
+        implementationLoader = new CRUDImplementationLoader(loaderRegistry);
+        implementationLoader.start();
+
+        builder = new CRUDComponentBuilder();
+        builder.setBuilderRegistry(builderRegistry);
+        builder.init();
+    }
+
+    public void stop(ExtensionRegistry registry) {
+        componentTypeLoader.stop();
+        implementationLoader.stop();
+    }
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java?view=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.container.crud;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CRUDImpl implements CRUD {
+    private static int counter;
+    private static final Map<String, Object> STORE = new HashMap<String, Object>();
+
+    private String directory;
+
+    /**
+     * @param directory
+     */
+    public CRUDImpl(String directory) {
+        super();
+        this.directory = directory;
+    }
+
+    public String create(Object resource) {
+        String key = String.valueOf(counter++);
+        STORE.put(key, resource);
+        return key;
+    }
+
+    public void delete(String id) {
+        STORE.remove(id);
+    }
+
+    public Object retrieve(String id) {
+        return STORE.get(id);
+    }
+
+    public Object update(String id, Object resource) {
+        return STORE.put(id, resource);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,48 @@
+/*
+ * 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.container.crud;
+
+import org.apache.tuscany.spi.model.AtomicImplementation;
+import org.apache.tuscany.spi.model.ComponentType;
+
+/**
+ * @version $$Rev$$ $$Date$$
+ */
+public class CRUDImplementation extends AtomicImplementation<ComponentType> {
+    private String directory;
+
+    public CRUDImplementation(String directory) {
+        this.directory = directory;
+    }
+
+    /**
+     * @return the directory
+     */
+    public String getDirectory() {
+        return directory;
+    }
+
+    /**
+     * @param directory the directory to set
+     */
+    public void setDirectory(String directory) {
+        this.directory = directory;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,59 @@
+/*
+ * 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.container.crud;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+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;
+
+public class CRUDImplementationLoader extends LoaderExtension {
+    public static final QName IMPLEMENTATION_CRUD = new QName(SCA_NS, "implementation.crud");
+
+    @Constructor
+    public CRUDImplementationLoader(@Reference LoaderRegistry registry) {
+        super(registry);
+    }
+
+    @Override
+    public QName getXMLType() {
+        return IMPLEMENTATION_CRUD;
+    }
+
+    public ModelObject load(ModelObject object, XMLStreamReader reader, DeploymentContext deploymentContext)
+        throws XMLStreamException, LoaderException {
+        assert IMPLEMENTATION_CRUD.equals(reader.getName());
+        String dir = reader.getAttributeValue(null, "directory");
+
+        CRUDImplementation implementation = new CRUDImplementation(dir);
+        LoaderUtil.skipToEndElement(reader);
+        return implementation;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 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=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java Tue Apr  3 11:08:56 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.container.crud;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.extension.TargetInvokerExtension;
+import org.apache.tuscany.spi.model.Operation;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CRUDTargetInvoker extends TargetInvokerExtension {
+    private static final Map<String, Method> METHODS = new HashMap<String, Method>();
+    static {
+        for (Method m : CRUD.class.getMethods()) {
+            METHODS.put(m.getName(), m);
+        }
+    }
+    private Method operation;
+    private CRUD instance;
+
+    public CRUDTargetInvoker(Operation operation, String directory) {
+        this.operation = METHODS.get(operation.getName());
+        this.instance = new CRUDImpl(directory);
+
+    }
+
+    public Object invokeTarget(Object body, short sequence, WorkContext context) throws InvocationTargetException {
+        try {
+            return operation.invoke(instance, (Object[])body);
+        } catch (IllegalArgumentException e) {
+            throw new AssertionError(e);
+        } catch (IllegalAccessException e) {
+            throw new AssertionError(e);
+        }
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java (from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java&r2=525225
==============================================================================
--- incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java Tue Apr  3 11:08:56 2007
@@ -25,8 +25,6 @@
 
 import org.osoa.sca.ComponentContext;
 
-import calculator.AddService;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -37,17 +35,15 @@
      * @throws java.lang.Exception
      */
     protected void setUp() throws Exception {
-        SimpleRuntimeInfo runtimeInfo = new SimpleRuntimeInfoImpl(getClass().getClassLoader(), "calculator.composite");
+        SimpleRuntimeInfo runtimeInfo = new SimpleRuntimeInfoImpl(getClass().getClassLoader(), "crud.composite");
         runtime = new SimpleRuntimeImpl(runtimeInfo);
         runtime.start();
     }
 
     public void testStart() throws Exception {
         ComponentContext context = runtime.getComponentContext(URI
-            .create("sca://root.application/default/CalculatorServiceComponent"));
+            .create("sca://root.application/default/CRUDServiceComponent"));
         assertNotNull(context);
-        AddService service = context.getService(AddService.class, "addService");
-        assertEquals(3.0, service.add(1.0, 2.0));
     }
 
     /**

Added: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator?view=auto&rev=525225
==============================================================================
--- incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator (added)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator Tue Apr  3 11:08:56 2007
@@ -0,0 +1,2 @@
+# Implementation class for the ExtensionActivator
+org.apache.tuscany.container.crud.CRUDExtensionActivator

Copied: incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite (from r523828, incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite&r2=525225
==============================================================================
--- incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite (original)
+++ incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite Tue Apr  3 11:08:56 2007
@@ -17,30 +17,10 @@
     * specific language governing permissions and limitations
     * under the License.    
 -->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="CalculatorComposite">
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="CRUDComposite">
 
-    <component name="CalculatorServiceComponent">
-        <implementation.java class="calculator.CalculatorServiceImpl" />
-        <reference name="addService" target="AddServiceComponent" />
-        <reference name="subtractService" target="SubtractServiceComponent" />
-        <reference name="multiplyService" target="MultiplyServiceComponent" />
-        <reference name="divideService" target="DivideServiceComponent" />
-    </component>
-
-    <component name="AddServiceComponent">
-        <implementation.java class="calculator.AddServiceImpl" />
-    </component>
-
-    <component name="SubtractServiceComponent">
-        <implementation.java class="calculator.SubtractServiceImpl" />
-    </component>
-
-    <component name="MultiplyServiceComponent">
-        <implementation.java class="calculator.MultiplyServiceImpl" />
-    </component>
-
-    <component name="DivideServiceComponent">
-        <implementation.java class="calculator.DivideServiceImpl" />
+    <component name="CRUDServiceComponent">
+        <implementation.crud diretory="C:\\Temp" />
     </component>
 
 </composite>



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


Re: svn commit: r525225 - in /incubator/tuscany/java/sca/modules/runtime-embedded: ./ src/main/java/org/apache/tuscany/runtime/embedded/ src/test/java/calculator/ src/test/java/org/apache/tuscany/api/ src/test/java/org/apache/tuscany/container/ src/test/ja

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I check in the embedded runtime that works with the minicore to run a simple 
CRUD component. At this moment, it still uses the legacy model and 
deployment. I'll try to migrate it over the interface-based model later.

Thanks,
Raymond

----- Original Message ----- 
From: <rf...@apache.org>
To: <tu...@ws.apache.org>
Sent: Tuesday, April 03, 2007 11:08 AM
Subject: svn commit: r525225 - in 
/incubator/tuscany/java/sca/modules/runtime-embedded: ./ 
src/main/java/org/apache/tuscany/runtime/embedded/ src/test/java/calculator/ 
src/test/java/org/apache/tuscany/api/ 
src/test/java/org/apache/tuscany/container/ src/test/ja...


> Author: rfeng
> Date: Tue Apr  3 11:08:56 2007
> New Revision: 525225
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=525225
> Log:
> Add the embedded runtime that works with the mini-core
>
> Added:
>    incubator/tuscany/java/sca/modules/runtime-embedded/
>      - copied from r523826, incubator/tuscany/java/sca/runtime/embedded/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
>      - copied, changed from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java 
> (with props)
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
>      - copied, changed from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite
>      - copied, changed from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite
> Removed:
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/calculator/
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/application.composite
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/system.composite
> Modified:
>    incubator/tuscany/java/sca/modules/runtime-embedded/.pmd
>    incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml
> 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/main/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImpl.java
>
> Modified: incubator/tuscany/java/sca/modules/runtime-embedded/.pmd
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/.pmd?view=diff&rev=525225&r1=523826&r2=525225
> ==============================================================================
> --- incubator/tuscany/java/sca/modules/runtime-embedded/.pmd (original)
> +++ incubator/tuscany/java/sca/modules/runtime-embedded/.pmd Tue Apr  3 
> 11:08:56 2007
> @@ -1,20 +1,2 @@
> <?xml version="1.0" encoding="UTF-8"?>
> -<!--
> -    * 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.
> --->
> <pmd><useProjectRuleSet>true</useProjectRuleSet><rules/><includeDerivedFiles>false</includeDerivedFiles></pmd>
>
> 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=525225&r1=523826&r2=525225
> ==============================================================================
> --- incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml (original)
> +++ incubator/tuscany/java/sca/modules/runtime-embedded/pom.xml Tue Apr  3 
> 11:08:56 2007
> @@ -25,7 +25,7 @@
>     </parent>
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>org.apache.tuscany.sca.runtime.embedded</groupId>
> -    <artifactId>embedded-host</artifactId>
> +    <artifactId>tuscany-runtime-embedded</artifactId>
>     <packaging>jar</packaging>
>     <name>Apache Tuscany Embedded Runtime Host</name>
>     <description>Host code to support an embedded runtime</description>
> @@ -33,7 +33,7 @@
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.tuscany.sca.kernel</groupId>
> -            <artifactId>tuscany-core</artifactId>
> +            <artifactId>tuscany-minicore</artifactId>
>             <version>2.0-alpha2-incubating-SNAPSHOT</version>
>             <scope>compile</scope>
>         </dependency>
>
> 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=525225&r1=523826&r2=525225
> ==============================================================================
> ---  
> 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 
> Tue Apr  3 11:08:56 2007
> @@ -20,38 +20,23 @@
>
> import static 
> org.apache.tuscany.runtime.embedded.SimpleRuntimeInfo.DEFAULT_COMPOSITE;
>
> -import java.io.ByteArrayInputStream;
> -import java.io.IOException;
> -import java.io.InputStream;
> -import java.io.PrintWriter;
> -import java.io.StringWriter;
> import java.net.URI;
> -import java.net.URL;
> -import java.net.URLConnection;
> -import java.net.URLStreamHandler;
> -import java.util.ArrayList;
> import java.util.Collection;
> -import java.util.List;
>
> import org.apache.tuscany.api.annotation.LogLevel;
> import org.apache.tuscany.core.component.SimpleWorkContext;
> import org.apache.tuscany.core.implementation.PojoWorkContextTunnel;
> -import 
> org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation;
> import org.apache.tuscany.core.runtime.AbstractRuntime;
> -import org.apache.tuscany.spi.builder.BuilderException;
> import org.apache.tuscany.spi.component.AtomicComponent;
> import org.apache.tuscany.spi.component.Component;
> -import org.apache.tuscany.spi.component.ComponentException;
> import org.apache.tuscany.spi.component.SCAObject;
> import org.apache.tuscany.spi.component.ScopeContainer;
> 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.loader.LoaderException;
> import org.apache.tuscany.spi.model.ComponentDefinition;
> import org.apache.tuscany.spi.model.CompositeImplementation;
> import org.apache.tuscany.spi.model.Scope;
> -import org.apache.tuscany.spi.resolver.ResolutionException;
>
> /**
>  * @version $Rev$ $Date$
> @@ -61,7 +46,7 @@
>
>     public SimpleRuntimeImpl(SimpleRuntimeInfo runtimeInfo) {
>         super(SimpleRuntimeInfo.class);
> -        ClassLoader hostClassLoader = ClassLoader.getSystemClassLoader();
> +        ClassLoader hostClassLoader = runtimeInfo.getClassLoader();
>         setHostClassLoader(hostClassLoader);
>         setApplicationScdl(runtimeInfo.getApplicationSCDL());
>         setSystemScdl(runtimeInfo.getSystemSCDL());
> @@ -73,77 +58,8 @@
>         void runError(Exception e);
>     }
>
> -    protected Collection<Component> deployExtension(Component parent,
> -                                                    URI name,
> -                                                    URL extensionSCDL,
> -                                                    ClassLoader 
> systemClassLoader) throws LoaderException,
> -        BuilderException, ComponentException, ResolutionException {
> -
> -        SystemCompositeImplementation impl = new 
> SystemCompositeImplementation();
> -        impl.setScdlLocation(extensionSCDL);
> -        impl.setClassLoader(systemClassLoader);
> -        ComponentDefinition<SystemCompositeImplementation> definition = 
> new ComponentDefinition<SystemCompositeImplementation>(
> - 
> name,
> - 
> impl);
> -
> -        Collection<Component> components = getDeployer().deploy(parent, 
> definition);
> -        for (Component component : components) {
> -            component.start();
> -        }
> -        return components;
> -    }
> -
> -    /**
> -     * Create a facade composite to include all the system and extension 
> SCDLs
> -     * @param urls
> -     * @return
> -     * @throws IOException
> -     */
> -    private URL merge(List<URL> urls) throws IOException {
> -        final StringWriter sw = new StringWriter();
> -        final PrintWriter pw = new PrintWriter(sw);
> -        pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
> -        pw.print("<composite 
> xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"");
> -        pw.println(" name=\"org.apache.tuscany.System\" 
> autowire=\"true\">");
> -        int i = 0;
> -        for (URL scdl : urls) {
> -            pw.print("<include name=\"");
> -            pw.print("composite" + (i++) + "\"");
> -            pw.print(" scdlLocation=\"");
> -            pw.println(scdl.toString() + "\"/>");
> -        }
> -        pw.println("</composite>");
> -        sw.close();
> -        // System.out.println(sw.toString());
> -        return new URL(null, "sca:system.scdl", new URLStreamHandler() {
> -            @Override
> -            protected URLConnection openConnection(URL u) throws 
> IOException {
> -                return new URLConnection(u) {
> -                    @Override
> -                    public InputStream getInputStream() throws 
> IOException {
> -                        return new 
> ByteArrayInputStream(sw.toString().getBytes("UTF-8"));
> -                    }
> -
> -                    @Override
> -                    public void connect() throws IOException {
> -                    }
> -                };
> -            }
> -        });
> -    }
> -
>     @SuppressWarnings("unchecked")
>     public Component start() throws Exception {
> -
> -        // FIXME: [rfeng] This is a hack to bootstrap extensions
> -        SimpleRuntimeInfo runtimeInfo = getRuntimeInfo();
> -        List<URL> scdls = new ArrayList<URL>();
> -        scdls.add(runtimeInfo.getSystemSCDL());
> -        for (URL ext : runtimeInfo.getExtensionSCDLs()) {
> -            scdls.add(ext);
> -        }
> -        setSystemScdl(merge(scdls));
> -        // End of hack
>
>         initialize();
>
>
> Copied: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java 
> (from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java)
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java&r2=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java 
> (original)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java 
> Tue Apr  3 11:08:56 2007
> @@ -21,12 +21,10 @@
>
> import junit.framework.TestCase;
>
> +import org.apache.tuscany.container.crud.CRUD;
> import org.osoa.sca.ComponentContext;
> import org.osoa.sca.ServiceReference;
>
> -import calculator.AddService;
> -import calculator.CalculatorService;
> -
> /**
>  * @version $Rev$ $Date$
>  */
> @@ -35,16 +33,19 @@
>      * @throws java.lang.Exception
>      */
>     protected void setUp() throws Exception {
> -        SCARuntime.start("calculator.composite");
> +        SCARuntime.start("crud.composite");
>     }
>
>     public void testStart() throws Exception {
> -        ComponentContext context = 
> SCARuntime.getComponentContext("CalculatorServiceComponent");
> +        ComponentContext context = 
> SCARuntime.getComponentContext("CRUDServiceComponent");
>         assertNotNull(context);
> -        ServiceReference<CalculatorService> self = 
> context.createSelfReference(CalculatorService.class);
> -        assertEquals(2.0, self.getService().multiply(1.0, 2.0));
> -        AddService service = context.getService(AddService.class, 
> "addService");
> -        assertEquals(3.0, service.add(1.0, 2.0));
> +        ServiceReference<CRUD> self = 
> context.createSelfReference(CRUD.class);
> +        CRUD service = self.getService();
> +        String id = service.create("ABC");
> +        Object result = service.retrieve(id);
> +        assertEquals("ABC", result);
> +        service.update(id, "EFG");
> +        service.delete(id);
>     }
>
>     /**
>
> Added: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java?view=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,36 @@
> +/*
> + * 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.container.crud;
> +
> +/**
> + * The service interface implemented by CRUD components.
> + *
> + * @version $Rev$ $Date$
> + */
> +public interface CRUD {
> +
> +    String create(Object resource);
> +
> +    Object retrieve(String id);
> +
> +    Object update(String id, Object resource);
> +
> +    void delete(String id);
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUD.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,116 @@
> +/*
> + * 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.container.crud;
> +
> +import java.net.URI;
> +import java.util.List;
> +
> +import org.apache.tuscany.core.component.ComponentContextImpl;
> +import org.apache.tuscany.core.component.ComponentContextProvider;
> +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.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;
> +import org.osoa.sca.ComponentContext;
> +import org.osoa.sca.ServiceReference;
> +
> +/**
> + * The runtime instantiation of Java component implementations
> + *
> + * @version $Rev$ $Date$
> + */
> +public class CRUDAtomicComponent extends AtomicComponentExtension 
> implements ComponentContextProvider {
> +    private String directory;
> +    private ComponentContext componentContext;
> +
> +    public CRUDAtomicComponent(URI uri, URI groupId, String directory) {
> +        super(uri, null, null, groupId, 50);
> +        this.directory = directory;
> +        componentContext = new ComponentContextImpl(this);
> +
> +    }
> +
> +    public Object createInstance() throws ObjectCreationException {
> +        return new CRUDImpl(directory);
> +    }
> +
> +    public InstanceWrapper createInstanceWrapper() throws 
> ObjectCreationException {
> +        return new InstanceWrapperBase(createInstance());
> +    }
> +
> +    public Object getTargetInstance() throws TargetResolutionException {
> +        return new CRUDImpl(directory);
> +    }
> +
> +    public void attachCallbackWire(Wire arg0) {
> +    }
> +
> +    public void attachWire(Wire arg0) {
> +    }
> +
> +    public void attachWires(List<Wire> arg0) {
> +    }
> +
> +    public List<Wire> getWires(String arg0) {
> +        return null;
> +    }
> +
> +    public TargetInvoker createTargetInvoker(String targetName, final 
> Operation operation)
> +        throws TargetInvokerCreationException {
> +        return new CRUDTargetInvoker(operation, directory);
> +
> +    }
> +
> +    public TargetInvoker createTargetInvoker(String targetName, 
> PhysicalOperationDefinition arg1)
> +        throws TargetInvokerCreationException {
> +        return null;
> +    }
> +
> +    @Override
> +    public ComponentContext getComponentContext() {
> +        return componentContext;
> +    }
> +
> +    public <B, R extends CallableReference<B>> R cast(B target) {
> +        // TODO Auto-generated method stub
> +        return null;
> +    }
> +
> +    public <B> B getProperty(Class<B> type, String propertyName) {
> +        return null;
> +    }
> +
> +    public <B> B getService(Class<B> businessInterface, String 
> referenceName) {
> +        return null;
> +    }
> +
> +    public <B> ServiceReference<B> getServiceReference(Class<B> 
> businessInterface, String referenceName) {
> +        return new ServiceReferenceImpl<B>(businessInterface, new 
> SingletonObjectFactory<B>((B)createInstance()));
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDAtomicComponent.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,47 @@
> +/*
> + * 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.container.crud;
> +
> +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
> + *
> + * @version $$Rev$$ $$Date: 2007-03-28 09:03:01 -0700 (Wed, 28 Mar
> + *          2007) $$
> + */
> +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());
> +        return component;
> +    }
> +
> +    protected Class<CRUDImplementation> getImplementationType() {
> +        return CRUDImplementation.class;
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentBuilder.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java?view=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,54 @@
> +/*
> + * 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.container.crud;
> +
> +import org.apache.tuscany.spi.deployer.DeploymentContext;
> +import org.apache.tuscany.spi.extension.ComponentTypeLoaderExtension;
> +import org.apache.tuscany.spi.loader.LoaderException;
> +import org.apache.tuscany.spi.loader.LoaderRegistry;
> +import org.apache.tuscany.spi.model.ComponentType;
> +import org.apache.tuscany.spi.model.Property;
> +import org.apache.tuscany.spi.model.ReferenceDefinition;
> +import org.apache.tuscany.spi.model.Scope;
> +import org.apache.tuscany.spi.model.ServiceDefinition;
> +import org.osoa.sca.annotations.Constructor;
> +import org.osoa.sca.annotations.Reference;
> +
> +/**
> + * @version $Rev$ $Date$
> + */
> +public class CRUDComponentTypeLoader extends 
> ComponentTypeLoaderExtension<CRUDImplementation> {
> +
> +    @Constructor( {"registry"})
> +    public CRUDComponentTypeLoader(@Reference LoaderRegistry 
> loaderRegistry) {
> +        super(loaderRegistry);
> +    }
> +
> +    @Override
> +    protected Class<CRUDImplementation> getImplementationClass() {
> +        return CRUDImplementation.class;
> +    }
> +
> +    public void load(CRUDImplementation implementation, DeploymentContext 
> deploymentContext) throws LoaderException {
> +        ComponentType<ServiceDefinition, ReferenceDefinition, 
> Property<?>> componentType = new ComponentType<ServiceDefinition, 
> ReferenceDefinition, Property<?>>();
> +        implementation.setComponentType(componentType);
> +        componentType.setImplementationScope(Scope.STATELESS);
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDComponentTypeLoader.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,53 @@
> +/*
> + * 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.container.crud;
> +
> +import org.apache.tuscany.core.bootstrap.ExtensionActivator;
> +import org.apache.tuscany.core.bootstrap.ExtensionRegistry;
> +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);
> +        BuilderRegistry builderRegistry = 
> registry.getExtension(BuilderRegistry.class);
> +        componentTypeLoader = new 
> CRUDComponentTypeLoader(loaderRegistry);
> +        componentTypeLoader.start();
> +
> +        implementationLoader = new 
> CRUDImplementationLoader(loaderRegistry);
> +        implementationLoader.start();
> +
> +        builder = new CRUDComponentBuilder();
> +        builder.setBuilderRegistry(builderRegistry);
> +        builder.init();
> +    }
> +
> +    public void stop(ExtensionRegistry registry) {
> +        componentTypeLoader.stop();
> +        implementationLoader.stop();
> +    }
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDExtensionActivator.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java?view=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,60 @@
> +/*
> + * 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.container.crud;
> +
> +import java.util.HashMap;
> +import java.util.Map;
> +
> +/**
> + * @version $Rev$ $Date$
> + */
> +public class CRUDImpl implements CRUD {
> +    private static int counter;
> +    private static final Map<String, Object> STORE = new HashMap<String, 
> Object>();
> +
> +    private String directory;
> +
> +    /**
> +     * @param directory
> +     */
> +    public CRUDImpl(String directory) {
> +        super();
> +        this.directory = directory;
> +    }
> +
> +    public String create(Object resource) {
> +        String key = String.valueOf(counter++);
> +        STORE.put(key, resource);
> +        return key;
> +    }
> +
> +    public void delete(String id) {
> +        STORE.remove(id);
> +    }
> +
> +    public Object retrieve(String id) {
> +        return STORE.get(id);
> +    }
> +
> +    public Object update(String id, Object resource) {
> +        return STORE.put(id, resource);
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImpl.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,48 @@
> +/*
> + * 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.container.crud;
> +
> +import org.apache.tuscany.spi.model.AtomicImplementation;
> +import org.apache.tuscany.spi.model.ComponentType;
> +
> +/**
> + * @version $$Rev$$ $$Date$$
> + */
> +public class CRUDImplementation extends 
> AtomicImplementation<ComponentType> {
> +    private String directory;
> +
> +    public CRUDImplementation(String directory) {
> +        this.directory = directory;
> +    }
> +
> +    /**
> +     * @return the directory
> +     */
> +    public String getDirectory() {
> +        return directory;
> +    }
> +
> +    /**
> +     * @param directory the directory to set
> +     */
> +    public void setDirectory(String directory) {
> +        this.directory = directory;
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementation.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,59 @@
> +/*
> + * 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.container.crud;
> +
> +import javax.xml.namespace.QName;
> +import javax.xml.stream.XMLStreamException;
> +import javax.xml.stream.XMLStreamReader;
> +
> +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;
> +
> +public class CRUDImplementationLoader extends LoaderExtension {
> +    public static final QName IMPLEMENTATION_CRUD = new QName(SCA_NS, 
> "implementation.crud");
> +
> +    @Constructor
> +    public CRUDImplementationLoader(@Reference LoaderRegistry registry) {
> +        super(registry);
> +    }
> +
> +    @Override
> +    public QName getXMLType() {
> +        return IMPLEMENTATION_CRUD;
> +    }
> +
> +    public ModelObject load(ModelObject object, XMLStreamReader reader, 
> DeploymentContext deploymentContext)
> +        throws XMLStreamException, LoaderException {
> +        assert IMPLEMENTATION_CRUD.equals(reader.getName());
> +        String dir = reader.getAttributeValue(null, "directory");
> +
> +        CRUDImplementation implementation = new CRUDImplementation(dir);
> +        LoaderUtil.skipToEndElement(reader);
> +        return implementation;
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDImplementationLoader.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Added: 
> 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=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,60 @@
> +/*
> + * 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.container.crud;
> +
> +import java.lang.reflect.InvocationTargetException;
> +import java.lang.reflect.Method;
> +import java.util.HashMap;
> +import java.util.Map;
> +
> +import org.apache.tuscany.spi.component.WorkContext;
> +import org.apache.tuscany.spi.extension.TargetInvokerExtension;
> +import org.apache.tuscany.spi.model.Operation;
> +
> +/**
> + * @version $Rev$ $Date$
> + */
> +public class CRUDTargetInvoker extends TargetInvokerExtension {
> +    private static final Map<String, Method> METHODS = new 
> HashMap<String, Method>();
> +    static {
> +        for (Method m : CRUD.class.getMethods()) {
> +            METHODS.put(m.getName(), m);
> +        }
> +    }
> +    private Method operation;
> +    private CRUD instance;
> +
> +    public CRUDTargetInvoker(Operation operation, String directory) {
> +        this.operation = METHODS.get(operation.getName());
> +        this.instance = new CRUDImpl(directory);
> +
> +    }
> +
> +    public Object invokeTarget(Object body, short sequence, WorkContext 
> context) throws InvocationTargetException {
> +        try {
> +            return operation.invoke(instance, (Object[])body);
> +        } catch (IllegalArgumentException e) {
> +            throw new AssertionError(e);
> +        } catch (IllegalAccessException e) {
> +            throw new AssertionError(e);
> +        }
> +    }
> +
> +}
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/container/crud/CRUDTargetInvoker.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Copied: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java 
> (from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java)
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java&r2=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java 
> (original)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java 
> Tue Apr  3 11:08:56 2007
> @@ -25,8 +25,6 @@
>
> import org.osoa.sca.ComponentContext;
>
> -import calculator.AddService;
> -
> /**
>  * @version $Rev$ $Date$
>  */
> @@ -37,17 +35,15 @@
>      * @throws java.lang.Exception
>      */
>     protected void setUp() throws Exception {
> -        SimpleRuntimeInfo runtimeInfo = new 
> SimpleRuntimeInfoImpl(getClass().getClassLoader(), 
> "calculator.composite");
> +        SimpleRuntimeInfo runtimeInfo = new 
> SimpleRuntimeInfoImpl(getClass().getClassLoader(), "crud.composite");
>         runtime = new SimpleRuntimeImpl(runtimeInfo);
>         runtime.start();
>     }
>
>     public void testStart() throws Exception {
>         ComponentContext context = runtime.getComponentContext(URI
> - 
> .create("sca://root.application/default/CalculatorServiceComponent"));
> + 
> .create("sca://root.application/default/CRUDServiceComponent"));
>         assertNotNull(context);
> -        AddService service = context.getService(AddService.class, 
> "addService");
> -        assertEquals(3.0, service.add(1.0, 2.0));
>     }
>
>     /**
>
> Added: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator?view=auto&rev=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator 
> (added)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/META-INF/services/org.apache.tuscany.core.bootstrap.ExtensionActivator 
> Tue Apr  3 11:08:56 2007
> @@ -0,0 +1,2 @@
> +# Implementation class for the ExtensionActivator
> +org.apache.tuscany.container.crud.CRUDExtensionActivator
>
> Copied: 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite 
> (from r523828, 
> incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite)
> URL: 
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite?view=diff&rev=525225&p1=incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite&r1=523828&p2=incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite&r2=525225
> ==============================================================================
> ---  
> incubator/tuscany/java/sca/runtime/embedded/src/test/resources/calculator.composite 
> (original)
> +++ 
> incubator/tuscany/java/sca/modules/runtime-embedded/src/test/resources/crud.composite 
> Tue Apr  3 11:08:56 2007
> @@ -17,30 +17,10 @@
>     * specific language governing permissions and limitations
>     * under the License.
> -->
> -<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
> name="CalculatorComposite">
> +<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
> name="CRUDComposite">
>
> -    <component name="CalculatorServiceComponent">
> -        <implementation.java class="calculator.CalculatorServiceImpl" />
> -        <reference name="addService" target="AddServiceComponent" />
> -        <reference name="subtractService" 
> target="SubtractServiceComponent" />
> -        <reference name="multiplyService" 
> target="MultiplyServiceComponent" />
> -        <reference name="divideService" target="DivideServiceComponent" 
> />
> -    </component>
> -
> -    <component name="AddServiceComponent">
> -        <implementation.java class="calculator.AddServiceImpl" />
> -    </component>
> -
> -    <component name="SubtractServiceComponent">
> -        <implementation.java class="calculator.SubtractServiceImpl" />
> -    </component>
> -
> -    <component name="MultiplyServiceComponent">
> -        <implementation.java class="calculator.MultiplyServiceImpl" />
> -    </component>
> -
> -    <component name="DivideServiceComponent">
> -        <implementation.java class="calculator.DivideServiceImpl" />
> +    <component name="CRUDServiceComponent">
> +        <implementation.crud diretory="C:\\Temp" />
>     </component>
>
> </composite>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
> 


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