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/14 06:23:46 UTC

svn commit: r528755 - in /incubator/tuscany/java/sca/samples/echo-databinding: ./ src/main/java/echo/ src/main/resources/META-INF/services/ src/test/java/echo/ src/test/resources/

Author: rfeng
Date: Fri Apr 13 21:23:44 2007
New Revision: 528755

URL: http://svn.apache.org/viewvc?view=rev&rev=528755
Log:
Bring up the echo-databinding

Added:
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java   (with props)
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/resources/application.composite
Removed:
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingLoader.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBuilder.java
Modified:
    incubator/tuscany/java/sca/samples/echo-databinding/pom.xml
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBinding.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoInvoker.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoReference.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoService.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/ComponentAImpl.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Echo.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface1.java
    incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface2.java

Modified: incubator/tuscany/java/sca/samples/echo-databinding/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/pom.xml?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/pom.xml (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/pom.xml Fri Apr 13 21:23:44 2007
@@ -1,103 +1,112 @@
 <?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.    
+    * 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.    
 -->
 <project>
-    <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.tuscany.sca</groupId>
         <artifactId>tuscany-samples</artifactId>
         <version>1.0-incubating-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.tuscany.samples.sca</groupId>
     <artifactId>tuscany-sample-echo-databinding</artifactId>
-    <name>Apache Tuscany Echo DataBinding Sample</name>
-    <description>A DataBinding Sample</description>
+    <version>1.0-incubating-SNAPSHOT</version>
+    <name>Echo DataBinding</name>
+    <description>A Sample for DataBinding</description>
 
     <dependencies>
+    
         <dependency>
-            <groupId>org.apache.tuscany.sca.kernel</groupId>
-            <artifactId>tuscany-api</artifactId>
-            <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>compile</scope>
-        </dependency>
+            <groupId>org.osoa</groupId>
+            <artifactId>sca-api</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>        
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.kernel</groupId>
-            <artifactId>tuscany-spi</artifactId>
-            <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>compile</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-assembly</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.kernel</groupId>
-            <artifactId>tuscany-core</artifactId>
-            <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>runtime</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-interface-wsdl</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.extensions.axis2</groupId>
-            <artifactId>databinding-axiom</artifactId>
-            <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>runtime</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-databinding</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+        </dependency>
+                
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-spi</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tuscany.sca.services.idl</groupId>
-            <artifactId>tuscany-wsdl</artifactId>
-            <version>0.1-integration-incubating-SNAPSHOT</version>
-            <scope>compile</scope>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
         </dependency>
 
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
             <groupId>org.apache.ws.commons.axiom</groupId>
             <artifactId>axiom-api</artifactId>
-            <version>SNAPSHOT</version>
+            <version>1.2.2</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.ws.commons.axiom</groupId>
             <artifactId>axiom-impl</artifactId>
-            <version>SNAPSHOT</version>
+            <version>1.2.2</version>
             <scope>runtime</scope>
         </dependency>
-
         <dependency>
             <groupId>org.codehaus.woodstox</groupId>
             <artifactId>wstx-asl</artifactId>
             <version>3.2.0</version>
             <scope>runtime</scope>
         </dependency>
-
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.1</version>
-            <scope>runtime</scope>
-        </dependency>
-
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.2</version>
             <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+            <scope>runtime</scope>
         </dependency>
     </dependencies>
 

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 echo;
+
+public class DefaultEchoBindingFactory implements EchoBindingFactory {
+
+    public EchoBinding createEchoBinding() {
+        return new EchoBindingImpl();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/DefaultEchoBindingFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBinding.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBinding.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBinding.java Fri Apr 13 21:23:44 2007
@@ -16,17 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package echo;
 
-import org.apache.tuscany.spi.model.BindingDefinition;
+package echo;
 
-/**
- * @version $Rev$ $Date$
- */
-public class EchoBinding extends BindingDefinition {
+import org.apache.tuscany.assembly.Binding;
 
-    public Object clone() {
-        return this;
-    }
+public interface EchoBinding extends Binding {
 
 }

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java Fri Apr 13 21:23:44 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 echo;
+
+import java.net.URI;
+
+import org.apache.tuscany.assembly.CompositeReference;
+import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.spi.builder.BuilderException;
+import org.apache.tuscany.spi.component.ReferenceBinding;
+import org.apache.tuscany.spi.component.ServiceBinding;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.BindingBuilderExtension;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EchoBindingBuilder extends BindingBuilderExtension<EchoBinding> {
+    @Override
+    public ServiceBinding build(CompositeService serviceDefinition,
+                                EchoBinding bindingDefinition,
+                                DeploymentContext context) throws BuilderException {
+        return new EchoService(URI.create(context.getComponentId() + "#" + serviceDefinition.getName()));
+    }
+
+    @Override
+    public ReferenceBinding build(CompositeReference referenceDefinition,
+                                  EchoBinding bindingDefinition,
+                                  DeploymentContext context) throws BuilderException {
+        URI targetURI = bindingDefinition.getURI() != null ? URI.create(bindingDefinition.getURI()) : null;
+        return new EchoReference(URI.create(context.getComponentId() + "#" + referenceDefinition.getName()), targetURI);
+    }
+
+    @Override
+    protected Class<EchoBinding> getBindingType() {
+        return EchoBinding.class;
+    }
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,29 @@
+/*
+ * 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 echo;
+
+public interface EchoBindingFactory {
+    /**
+     * Creates a new Echo binding.
+     * 
+     * @return a new Echi binding
+     */
+    EchoBinding createEchoBinding();
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 echo;
+
+import org.apache.tuscany.assembly.impl.BindingImpl;
+
+public class EchoBindingImpl extends BindingImpl implements EchoBinding {
+    public Object clone() {
+        return this;
+    }
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,73 @@
+/*
+ * 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 echo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.contribution.service.ContributionReadException;
+import org.apache.tuscany.contribution.service.ContributionResolveException;
+import org.apache.tuscany.contribution.service.ContributionWireException;
+import org.apache.tuscany.contribution.service.ContributionWriteException;
+import org.apache.tuscany.contribution.service.processor.StAXArtifactProcessor;
+import org.apache.tuscany.contribution.service.resolver.ArtifactResolver;
+
+public class EchoBindingProcessor implements StAXArtifactProcessor<EchoBinding> {
+    private final EchoBindingFactory factory;
+
+    public EchoBindingProcessor() {
+        this.factory = new DefaultEchoBindingFactory();
+    }
+
+    public EchoBindingProcessor(EchoBindingFactory factory) {
+        this.factory = factory;
+    }
+
+    public QName getArtifactType() {
+        return EchoConstants.BINDING_ECHO;
+    }
+
+    public Class<EchoBinding> getModelType() {
+        return EchoBinding.class;
+    }
+
+    public EchoBinding read(XMLStreamReader reader) throws ContributionReadException {
+        String uri = reader.getAttributeValue(null, "uri");
+        EchoBinding echoBinding = factory.createEchoBinding();
+        if (uri != null) {
+            echoBinding.setURI(uri.trim());
+        }
+        return echoBinding;
+    }
+
+    public void write(EchoBinding echoBinding, XMLStreamWriter writer) throws ContributionWriteException {
+        // TODO Auto-generated method stub
+    }
+
+    public void resolve(EchoBinding echoBinding, ArtifactResolver resolver) throws ContributionResolveException {
+        // TODO Auto-generated method stub
+    }
+
+    public void wire(EchoBinding echoBinding) throws ContributionWireException {
+        // TODO Auto-generated method stub
+    }
+
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoBindingProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,28 @@
+/*
+ * 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 echo;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import javax.xml.namespace.QName;
+
+public interface EchoConstants {
+    QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoConstants.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoInvoker.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoInvoker.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoInvoker.java Fri Apr 13 21:23:44 2007
@@ -20,6 +20,7 @@
 
 import java.lang.reflect.InvocationTargetException;
 
+import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.wire.InvocationRuntimeException;
 import org.apache.tuscany.spi.wire.Message;
 import org.apache.tuscany.spi.wire.TargetInvoker;
@@ -45,9 +46,7 @@
 
     public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException {
         // echo back the result, a real binding would invoke some API for flowing the request
-        Object result = ((Object[]) payload)[0];
-        System.out.println("Echo: " + result);
-        return result;
+        return ((Object[])payload)[0];
     }
 
     public Message invoke(Message msg) throws InvocationRuntimeException {
@@ -60,8 +59,18 @@
             msg.setBodyWithFault(e);
         }
         return msg;
+    }  
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.tuscany.spi.wire.TargetInvoker#invokeTarget(java.lang.Object, short, org.apache.tuscany.spi.component.WorkContext)
+     */
+    public Object invokeTarget(Object payload, short sequence, WorkContext workContext) throws InvocationTargetException {
+        // TODO Auto-generated method stub
+        return null;
     }
 
+    @Override
     public Object clone() throws CloneNotSupportedException {
         return super.clone();
     }

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package echo;
+
+import java.util.Map;
+
+import org.apache.tuscany.contribution.service.processor.StAXArtifactProcessorRegistry;
+import org.apache.tuscany.spi.bootstrap.ExtensionPointRegistry;
+import org.apache.tuscany.spi.bootstrap.ModuleActivator;
+import org.apache.tuscany.spi.builder.BuilderRegistry;
+
+
+public class EchoModuleActivator implements ModuleActivator {
+    private final EchoBindingProcessor echoBindingProcessor = new EchoBindingProcessor();
+    private final EchoBindingBuilder echoBindingBuilder = new EchoBindingBuilder();
+
+    public Map<Class, Object> getExtensionPoints() {
+        // No extensionPoints being contributed here
+        return null;
+    }
+
+    public void start(ExtensionPointRegistry registry) {
+
+        // Add the EchoProcessor to the proper registry
+        StAXArtifactProcessorRegistry artifactProcessorRegistry = registry.getExtensionPoint(StAXArtifactProcessorRegistry.class);
+        artifactProcessorRegistry.addArtifactProcessor(echoBindingProcessor);
+        
+        // Add the EchoBuilder to the proper registry
+        BuilderRegistry builderRegistry = registry.getExtensionPoint(BuilderRegistry.class);
+        echoBindingBuilder.setBuilderRegistry(builderRegistry);
+        echoBindingBuilder.init();
+        builderRegistry.register(EchoBinding.class, echoBindingBuilder);
+        
+        // Start the Echo server
+        EchoServer.start();
+    }
+
+    public void stop(ExtensionPointRegistry registry) {
+        // Remove the EchoProcessor from the proper registry
+        StAXArtifactProcessorRegistry artifactProcessorRegistry = registry.getExtensionPoint(StAXArtifactProcessorRegistry.class);
+        artifactProcessorRegistry.removeArtifactProcessor(echoBindingProcessor);
+
+        EchoServer.stop();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoModuleActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoReference.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoReference.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoReference.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoReference.java Fri Apr 13 21:23:44 2007
@@ -18,15 +18,13 @@
  */
 package echo;
 
-import static org.osoa.sca.Constants.SCA_NS;
+import java.net.URI;
 
 import javax.xml.namespace.QName;
 
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.interfacedef.Operation;
+import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.ServiceContract;
 import org.apache.tuscany.spi.wire.TargetInvoker;
 
 /**
@@ -34,22 +32,24 @@
  */
 public class EchoReference extends ReferenceBindingExtension {
 
-    private static final String OM_DATA_BINDING = OMElement.class.getName();
-
-    private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
-
-    public EchoReference(String name, CompositeComponent parent) {
-        super(name, parent);
+    protected EchoReference(URI name, URI targetUri) {
+        super(name, targetUri);
     }
 
     public QName getBindingType() {
-        return BINDING_ECHO;
+        return EchoConstants.BINDING_ECHO;
     }
 
-    @SuppressWarnings("unchecked")
-    public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
-        // HACK to set the databinding
-        operation.setDataBinding(OM_DATA_BINDING);
+    
+    public TargetInvoker createTargetInvoker(String name, Operation operation, boolean isCallback)
+       throws TargetInvokerCreationException {
+    if (isCallback) {
+        throw new UnsupportedOperationException();
+    } else {
         return new EchoInvoker();
     }
+}
+
+    
+
 }

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java Fri Apr 13 21:23:44 2007
@@ -0,0 +1,70 @@
+/*
+ * 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 echo;
+
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * EchoTransport
+ *
+ * @version $Rev$ $Date$
+ */
+public class EchoServer {
+    
+    public static EchoServer server;
+    
+    private Map<URI, EchoService> services = new HashMap<URI, EchoService>(); 
+    
+    public static void start() {
+        server = new EchoServer();
+    }
+    
+    public static void stop() {
+        server = null;
+    }
+    
+    public static EchoServer getServer() {
+        return server;
+    }
+
+    /**
+     * Register a service under the given name.
+     * @param service
+     * @param name
+     */
+    public void register(EchoService service, URI name) {
+        services.put(name, service);
+    }
+
+    /**
+     * Dispatch an incoming interaction to the corresponding service.
+     * @param uri
+     * @param input
+     * @return
+     */
+    public String sendReceive(String composite, String service, String input) throws InvocationTargetException {
+        URI uri = URI.create("/" + composite + "/#" + service);
+        return services.get(uri).sendReceive(input);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoServer.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoService.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoService.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/java/echo/EchoService.java Fri Apr 13 21:23:44 2007
@@ -18,27 +18,70 @@
  */
 package echo;
 
-import static org.osoa.sca.Constants.SCA_NS;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
 
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.core.util.PojoWorkContextTunnel;
+import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.spi.CoreRuntimeException;
-import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.TargetInvokerCreationException;
+import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.extension.ServiceBindingExtension;
+import org.apache.tuscany.spi.wire.Interceptor;
+import org.apache.tuscany.spi.wire.InvocationChain;
+import org.apache.tuscany.spi.wire.Message;
+import org.apache.tuscany.spi.wire.MessageImpl;
+import org.apache.tuscany.spi.wire.TargetInvoker;
 
 /**
  * @version $Rev$ $Date$
  */
 public class EchoService extends ServiceBindingExtension {
-    private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+    
+    public EchoService(URI name) throws CoreRuntimeException {
+        super(name);
+        
+        // Register with the hosting server
+        EchoServer.getServer().register(this, name);
+    }
 
-    public EchoService(String name, CompositeComponent parent) throws CoreRuntimeException {
-        super(name, parent);
-        // do nothing, but this could register with the host environment
+    public QName getBindingType() {
+        return EchoConstants.BINDING_ECHO;
     }
 
+    public TargetInvoker createTargetInvoker(String targetName, Operation operation, boolean isCallback) throws TargetInvokerCreationException {
+        //TODO Show support for callbacks in this sample
+        throw new UnsupportedOperationException();
+    }
 
-    public QName getBindingType() {
-        return BINDING_ECHO;
+    String sendReceive(String input) throws InvocationTargetException {
+        
+        // Get the invocation chain for the first operation in the service interface
+        InvocationChain chain = wire.getInvocationChains().get(0);
+        Interceptor headInterceptor = chain.getHeadInterceptor();
+        WorkContext workContext = PojoWorkContextTunnel.getThreadWorkContext();
+        if (headInterceptor == null) {
+            // short-circuit the dispatch and invoke the target directly
+            TargetInvoker targetInvoker = chain.getTargetInvoker();
+            return (String)targetInvoker.invokeTarget(new Object[]{input}, TargetInvoker.NONE, workContext);
+        } else {
+
+            Message msg = new MessageImpl();
+            msg.setTargetInvoker(chain.getTargetInvoker());
+            msg.setBody(new Object[]{input});
+            msg.setWorkContext(workContext);
+            Message resp;
+
+            // dispatch and get the response
+            resp = headInterceptor.invoke(msg);
+            Object body = resp.getBody();
+            if (resp.isFault()) {
+                throw new InvocationTargetException((Throwable) body);
+            }
+            return (String)body;
+        }
     }
+    
 }

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator Fri Apr 13 21:23:44 2007
@@ -0,0 +1,2 @@
+# Implementation class for the ExtensionActivator
+echo.EchoModuleActivator

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/ComponentAImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/ComponentAImpl.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/ComponentAImpl.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/ComponentAImpl.java Fri Apr 13 21:23:44 2007
@@ -44,22 +44,22 @@
         this.componentBReference = componentBReference;
     }
 
-    public Object call(Object msg) {
+    public String call(String msg) {
         String request = msg + " [" + msg.getClass().getName() + "]";
         System.out.println("ComponentA --> Received message: " + request);
         Object ret = componentBReference.call(msg);
         String response = ret + " [" + ret.getClass().getName() + "]";
         System.out.println("ComponentA --> Returned message: " + response);
-        return ret;
+        return (String) ret;
     }
 
-    public Object call1(Object msg) {
+    public String call1(String msg) {
         String request = msg + " [" + msg.getClass().getName() + "]";
         System.out.println("ComponentA --> Received message: " + request);
         Object ret = componentBReference.call1(msg);
         String response = ret + " [" + ret.getClass().getName() + "]";
         System.out.println("ComponentA --> Returned message: " + response);
-        return ret;
+        return (String) ret;
     }
 
     @Property(name="prefix")

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Echo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Echo.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Echo.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Echo.java Fri Apr 13 21:23:44 2007
@@ -18,14 +18,14 @@
  */
 package echo;
 
-import org.apache.tuscany.api.annotation.DataType;
+import org.apache.tuscany.databinding.annotation.DataBinding;
 import org.osoa.sca.annotations.Remotable;
 
 /**
  * @version $Rev$ $Date$
  */
 // @DataType(name="org.apache.axiom.om.OMElement")
-@DataType(name="org.w3c.dom.Node")
+@DataBinding("org.w3c.dom.Node")
 @Remotable
 public interface Echo {
     Object echo(Object msg);

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/EchoDataBindingTestCase.java Fri Apr 13 21:23:44 2007
@@ -21,29 +21,31 @@
 import junit.framework.TestCase;
 
 import org.apache.tuscany.api.SCARuntime;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
 
 /**
  * @version $Rev$ $Date$
  */
 public class EchoDataBindingTestCase extends TestCase {
 
-    private Interface1 componentA;
+    @Override
+    protected void setUp() throws Exception {
+        SCARuntime.start();
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        SCARuntime.stop();
+    }
+
+    protected Interface1 componentA;
 
     public void testTransform() {
+        ComponentContext context = SCARuntime.getComponentContext("ComponentA");
+        ServiceReference<Interface1> ref = context.createSelfReference(Interface1.class);
+        componentA = ref.getService();
         componentA.call("<message><foo>123</foo></message>");
         componentA.call1("<message><foo>123</foo></message>");
-    }
-
-    protected void setUp() throws Exception {
-    	SCARuntime.start("EchoDataBinding.composite");
-    	
-        CompositeContext context = CurrentCompositeContext.getContext();
-        componentA = context.locateService(Interface1.class, "ComponentA");
-    }
-    
-    protected void tearDown() throws Exception {
-    	SCARuntime.stop();
     }
 }

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface1.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface1.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface1.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface1.java Fri Apr 13 21:23:44 2007
@@ -18,15 +18,15 @@
  */
 package echo;
 
-import org.apache.tuscany.api.annotation.DataType;
+import org.apache.tuscany.databinding.annotation.DataBinding;
 import org.osoa.sca.annotations.Remotable;
 
 /**
  * @version $Rev$ $Date$
  */
-@DataType(name="java.lang.String")
+@DataBinding("java.lang.String")
 @Remotable
 public interface Interface1 {
-    Object call(Object msg);
-    Object call1(Object msg);
+    String call(String msg);
+    String call1(String msg);
 }

Modified: incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface2.java?view=diff&rev=528755&r1=528754&r2=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface2.java (original)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/java/echo/Interface2.java Fri Apr 13 21:23:44 2007
@@ -20,17 +20,17 @@
 
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.tuscany.api.annotation.DataType;
+import org.apache.tuscany.databinding.annotation.DataBinding;
 import org.osoa.sca.annotations.Remotable;
 import org.w3c.dom.Node;
 
 /**
  * @version $Rev$ $Date$
  */
-@DataType(name="org.w3c.dom.Node")
+@DataBinding("org.w3c.dom.Node")
 @Remotable
 public interface Interface2 {
     Node call(Node msg);
-    @DataType(name="javax.xml.stream.XMLStreamReader")
+    @DataBinding("javax.xml.stream.XMLStreamReader")
     XMLStreamReader call1(XMLStreamReader msg);
 }

Added: incubator/tuscany/java/sca/samples/echo-databinding/src/test/resources/application.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-databinding/src/test/resources/application.composite?view=auto&rev=528755
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-databinding/src/test/resources/application.composite (added)
+++ incubator/tuscany/java/sca/samples/echo-databinding/src/test/resources/application.composite Fri Apr 13 21:23:44 2007
@@ -0,0 +1,64 @@
+<?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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:local="http://tuscany.apache.org/xmlns/sca/binding/1.0" xmlns:f="http://foo"
+    xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance" name="echo.sample">
+
+    <service name="EchoService" promote="ComponentB">
+        <interface.java interface="echo.Interface1" />
+        <binding.echo/>
+    </service>
+
+    <component name="ComponentA">
+        <implementation.java class="echo.ComponentAImpl" />
+        <reference name="componentBReference" target="ComponentB" />
+        <property name="prefix">ABC</property>
+        <property name="prefix1" source="$messagePrefix"></property>
+        <property name="bar" source="$complexProperty/*[local-name()='foo']/*[local-name()='bar']"></property>
+        <property name="omProperty">
+            <a>
+                <b>XYZ</b>
+            </a>
+        </property>
+    </component>
+
+    <component name="ComponentB">
+        <implementation.java class="echo.ComponentBImpl" />
+    </component>
+
+    <reference name="EchoReference" promote="ComponentB/echoReference">
+        <!-- 
+            <interface.java interface="echo.Echo"/>
+        -->
+        <interface.wsdl interface="http://example.com/echo.wsdl#wsdl.interface(EchoPortType)"
+            wsdli:wsdlLocation="http://example.com/echo.wsdl wsdl/echo.wsdl">
+            <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
+        </interface.wsdl>
+        <binding.echo/>
+    </reference>
+
+    <property name="messagePrefix" type="xsd:string">ABC</property>
+    <property name="complexProperty" type="f:FooType">
+        <foo>
+            <bar attr="barAttr">BAR</bar>
+        </foo>
+    </property>
+
+</composite>



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