Tag rc1
git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/tags/2.0-Beta1-RC1@1027571 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/LICENSE b/LICENSE
index ddd3012..c0ae1ad 100644
--- a/LICENSE
+++ b/LICENSE
@@ -212,52 +212,6 @@
code for the these subcomponents is subject to the terms and
conditions of the following licenses.
-===============================================================================================================
-
-The module itest/databindings/common includes the test schema; datagraph.xsd, sdoJava.xsd, and sdoModel.xsd
-under the following license:
-
-License for the Service Data Objects JavaDoc, Interface Definition files
-and XSD files.
-
-The Service Data Objects JavaDoc, Interface Definition files and XSD files
-are being provided by the copyright holders under the following license.
-By using and/or copying this work, you agree that you have read,
-understood and will comply with the following terms and conditions:
-
-Permission to copy, display, make derivative works of and distribute
-the Service Data Objects JavaDoc, Interface Definition files and XSD files
-(the "Artifacts") in any medium without fee or royalty is hereby granted,
-provided that you include the following on ALL copies of the Artifacts,
-or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Data+Objects+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-
-
-THE ARTIFACTS ARE PROVIDED "AS IS" AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS,
-INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Data
-Objects Specification or its contents without specific, written prior
-permission. Title to copyright in the Service Data Objects
-Specification will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.11, last updated on 2007/12/21
-
=================================================================================================================
The module implementation-script temporarily includes one file under the following BSD license:
@@ -297,52 +251,7 @@
=================================================================================================================
-The module assembly-xsd includes XSD files under the following license:
-
-License for the Service Component Architecture JavaDoc, Interface
-Definition files and XSD files.
-
-The Service Component Architecture JavaDoc, Interface Definition files,
-and XSD files are being provided by the copyright holders under the
-following license. By using and/or copying this work, you agree that
-you have read, understood and will comply with the following terms and
-conditions:
-
-Permission to copy, display, make derivative works of, and distribute
-the Service Component Architecture JavaDoc, Interface Definition Files
-and XSD files (the "Artifacts") in any medium without fee or royalty is
-hereby granted, provided that you include the following on ALL copies
-of the Artifacts, or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-THE ARTIFACTS ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Component
-Architecture Specification or its contents without specific, written
-prior permission. Title to copyright in the Service Component
-Architecture Specification and the JavaDoc, Interface Definition Files
-and XSD Files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.1, last updated on 2007/11/19
-
-=================================================================================================================
-
-The modules assembly-xsd and definitions-xml includes XSD and XML files under the following license:
+The module assembly-xsd includes XSD and XML files under the following license:
Copyright OASIS 2005, 2009. All Rights Reserved.
All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual
@@ -427,25 +336,23 @@
=================================================================================================================
-The module assembly-xsd includes XSD files under the following license:
-
The modules
-binding-ws-xml
+binding-ws
databinding
databinding-axiom
databinding-jaxb
+databinding-jaxb-axiom
databinding-json
databinding-sdo
databinding-sdo-axiom
-databinding-xmlbeans
-interface-wsdl-xml
+interface-wsdl
Include the ipo.xsd and address.xsd information from the XML Schema Primer
(http://www.w3.org/TR/2004/PER-xmlschema-0-20040318/) combined into the
file ipo.xsd and extended with UK postcode structures.
-The ipo.xsd file is also included under the following license:
+The ipo.xsd and address.xml information included under the following license:
W3C(c) SOFTWARE NOTICE AND LICENSE
http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
@@ -483,3 +390,59 @@
publicity pertaining to the software without specific, written prior permission.
Title to copyright in this software and any associated documentation will at all
times remain with copyright holders.
+
+=================================================================================================================
+
+The module implementation-python-runtime includes files under the following license:
+
+Copyright (c) Django Software Foundation and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of Django nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+=================================================================================================================
+
+The module binding-comet-runtime includes files under the following license:
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/archetypes/contribution-jar/pom.xml b/archetypes/contribution-jar/pom.xml
deleted file mode 100644
index 9179636..0000000
--- a/archetypes/contribution-jar/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-contribution-jar</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create an SCA JAR contribution project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-3</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-3</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
deleted file mode 100644
index 88cc6ab..0000000
--- a/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>jar</packaging>
- <version>${version}</version>
- #literal()<!-- TODO project name -->
- <name>quickstart</name>
- <description></description>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-Beta1</tuscany.version>
- </properties>
- #end
-</project>
diff --git a/archetypes/contribution-zip/pom.xml b/archetypes/contribution-zip/pom.xml
deleted file mode 100644
index 7ad1c19..0000000
--- a/archetypes/contribution-zip/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-contribution-zip</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create an SCA ZIP contribution project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-3</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-3</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/pom.xml b/archetypes/pom.xml
deleted file mode 100644
index bc1a726..0000000
--- a/archetypes/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-archetype</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Maven Archetypes</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <modules>
- <module>contribution-jar</module>
- <module>contribution-zip</module>
- <module>contribution-zip-discriptor</module>
- <module>quickstart</module>
- <module>quickstart-jsf</module>
- <module>quickstart-stripes</module>
- <module>quickstart-bpel</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
diff --git a/archetypes/quickstart-bpel/pom.xml b/archetypes/quickstart-bpel/pom.xml
deleted file mode 100644
index 63aefd0..0000000
--- a/archetypes/quickstart-bpel/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-bpel</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create an SCA Webapp project using BPEL</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-3</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-3</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/quickstart-jsf/pom.xml b/archetypes/quickstart-jsf/pom.xml
deleted file mode 100644
index d89400e..0000000
--- a/archetypes/quickstart-jsf/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-jsf</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a Tuscany SCA and JSF project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/quickstart-jsonp/pom.xml b/archetypes/quickstart-jsonp/pom.xml
deleted file mode 100644
index b9042bd..0000000
--- a/archetypes/quickstart-jsonp/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-jsonp</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a Tuscany SCA webapp project using the JSONP binding</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/quickstart-stripes/pom.xml b/archetypes/quickstart-stripes/pom.xml
deleted file mode 100644
index 22f454e..0000000
--- a/archetypes/quickstart-stripes/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-stripes</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a simple Apache Tuscany SCA webapp project using the Stripes Web Framework</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml
deleted file mode 100644
index ac4f4bf..0000000
--- a/archetypes/quickstart/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a simple Apache Tuscany SCA webapp project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/compliance-tests/assembly/pom.xml b/compliance-tests/assembly/pom.xml
deleted file mode 100644
index b2f2d12..0000000
--- a/compliance-tests/assembly/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-assembly</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Assembly</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-assembly-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- Real otest/Tuscany problems -->
- <exclude>**/ASM_10002_TestCase.java</exclude><!-- see TUSCANY-3503 -->
-
- <!-- actually is working but the err msgs come out in a different order so the msg text test fails -->
- <exclude>**/ASM_13004_TestCase.java</exclude>
-
-
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-assembly-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-assembly-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
deleted file mode 100644
index c3829af..0000000
--- a/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * 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.sca.otest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.apache.tuscany.sca.node2.Node;
-import org.apache.tuscany.sca.node2.NodeFactory;
-
-import client.RuntimeBridge;
-import client.TestConfiguration;
-
-/**
- * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
- *
- */
-public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
- protected NodeFactory launcher;
- protected Node node;
- protected Properties expectedErrorMessages;
-
- TestConfiguration testConfiguration = null;
-
- public TuscanyRuntimeBridge() {
- // read test error mapping
- expectedErrorMessages = new Properties();
- try {
- InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
- expectedErrorMessages.load(propertiesStream);
- } catch (IOException e) {
- System.out.println("Unable to read oasis-sca-tests-errors.properties file");
- }
- }
-
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception {
- try {
- // Tuscany specific code which starts the contribution(s) holding the test
- Properties ps = new Properties();
- ps.setProperty("defaultScheme", "vm");
- ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080");
- launcher = NodeFactory.newInstance(ps);
- node = launcher.createNode("default");
-
-// Contribution[] contributions = new Contribution[contributionNames.length];
- String[] contributionURIs = getContributionURIs(contributionLocation);
-// for (int i = 0; i < contributions.length; i++) {
-// contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
-// } // end for
-
- for (int i=contributionURIs.length-1; i > -1; i--) {
- node.installContribution(contributionNames[i], contributionURIs[i], null, null, false);
- }
-
- node.addToDomainLevelComposite(contributionNames[0] + "/" + testConfiguration.getComposite());
-
-// node = NodeFactory.createNode(testConfiguration.getComposite(), contributionURIs);
- // Start the node
-// node.start();
-
- // For debugging
- // print out the composites that have been read in success cases
- // System.out.println(((NodeImpl)node).dumpDomainComposite());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- throw e;
- } // end try
-
- return true;
- } // end method startContribution
-
- /**
- * Gets the location of the Contributions as URIs
- * @param contributionLocation - a location pattern URI, which contains one or more "%1"
- * substrings, which are substituted with the name of the contribution to get the URI of
- * the contribution
- * @return the contribution locations as an array of Strings
- */
- protected String[] getContributionURIs(String contributionLocation) throws Exception {
- String[] locations;
- locations = testConfiguration.getContributionNames();
-
- if (locations != null && contributionLocation != null) {
-
- for (int i = 0; i < locations.length; i++) {
- String aLocation = contributionLocation.replaceAll("%1", locations[i]);
- // Looks like bugs in the oasis code that sometimes still uses jars for some
- if (aLocation.endsWith("_Java-1.0.zip") && !aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
- aLocation = aLocation.substring(0, aLocation.length()-3) + "jar";
- }
- if (!(new File(aLocation)).exists()) {
- aLocation = aLocation.replace(".zip", ".jar");
- }
- locations[i] = aLocation;
- } // end for
- } else {
- if (locations == null) {
- // No contribution specified - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
- } else {
- // No contribution location supplied - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
- } // end if
- } // end if
-
- return locations;
- } // end getContributionURI
-
- public void stopContribution() {
- if (node != null) {
- node.stop();
- } // end if
- if (launcher != null) {
- launcher.stop();
- } // end if
- } // end method stopContribution
-
- public void checkError(String testName, Throwable ex) throws Throwable {
-
- String expectedMessage = expectedErrorMessages.getProperty(testName);
- String receivedMessage = ex.getMessage();
- if (ex instanceof ValidationException && ex.getCause() == null) {
- receivedMessage = "org.apache.tuscany.sca.monitor.ValidationException: " + receivedMessage;
- }
-
- if (expectedMessage == null){
- writeMissingMessage(testName, ex);
- fail("Null expected error message for test " + testName +
- "Please add message to oasis-sca-tests-errors.properties");
- } // end if
-
- if (receivedMessage == null){
- ex.printStackTrace();
- fail("Null received error message for test " + testName);
- } // end if
-
- if (expectedMessage.startsWith("*")) {
- // allow using * to ignore a message comparison
- return;
- }
-
- // Deal with the case where the message has variable parts within it
- // marked with the characters ***. Here we tokenize the epected string
- // and make sure all the individual parts are present in the results string
- String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
-
- if (expectedMessageParts.length > 1){
- int foundParts = 0;
- for(int i = 0; i < expectedMessageParts.length; i++){
- if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
- foundParts++;
- }
- }
-
- if (foundParts == expectedMessageParts.length){
- return;
- }
- }
-
-
- // Deal with the case where the end of the message is variable (eg contains absolute filenames)
- // and where the only relevant part is the start of the message - in this case the expected
- // message only contains the stem section which is unchanging...
- if( receivedMessage.length() > expectedMessage.length() ) {
- // Truncate the received message to the length of the expected message
- receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
- } // end if
-
- if (!expectedMessage.equals(receivedMessage)) {
- writeIncorrectMessage(testName, expectedMessage, receivedMessage);
- }
-
- assertEquals( expectedMessage, receivedMessage );
-
- return;
-
- }
-
- protected void writeMissingMessage(String testName, Throwable ex) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
- out.write(testName + "=*");
- out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
- protected void writeIncorrectMessage(String testName, String expected, String received) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
- out.write(testName); out.newLine();
- out.write(" " + expected); out.newLine();
- out.write(" " + received); out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
-} // end class TuscanyRuntimeBridge
diff --git a/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties b/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 0d8cc27..0000000
--- a/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=Java
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index f2a8fe4..0000000
--- a/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,94 +0,0 @@
-# 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.
-
-ASM_4002=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TestComponent1 Service = Service1
-ASM_4003=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = TestComponent1 Reference = Reference1
-ASM_4004=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40005,ASM60014] Duplicate implementation property name: Component = TestComponent1 Property = propertyName
-ASM_4007=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - propertyName
-ASM_4008=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40011,ASM60034] No value configured on a mustSupply property: Component = TestComponent1 Property = propertyName
-ASM_5004=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - [ASM50022] Too many targets on reference: reference1
-ASM_5005=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: Test_ASM_5005Component1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = Test_ASM_5005Component1 Service = Service1
-ASM_5006=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Component type service not found for component service (missing @Remotable annotation?): Component = TestComponent1 Service = InvalidName
-ASM_5007=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: Test_ASM_5007Component1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = Test_ASM_5007Component1 Reference = Reference1
-ASM_5008=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50008] Component type reference not found for component reference: Component = TestComponent1 Reference = InvalidName
-ASM_5009=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [ASM50001] Duplicate component name: Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component = TestComponent1
-ASM_5010=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComponent1 Service = Service1
-ASM_5014=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50009] Component reference multiplicity incompatible with reference multiplicity: Component = TestComponent1 Reference = Reference1
-ASM_5023=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite11, Component: Composite11Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite4, Component: Composite4Component1] - [ASM50022] Too many targets on reference: reference1
-ASM_5024=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Reference: Reference1] - [ASM50026] Composite {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component TestComponent1 Reference Reference1 must not specify endpoints using both target attribute and with a binding child element
-ASM_5027=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Duplicate component property name: Component = TestComponent1 Property = serviceName
-ASM_5028=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50031] Property not found for component property: Component = TestComponent1 Property = randomName
-ASM_5029=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50032] The property component TestComponent1 property complexType has many values but its "many" attribute is set to false
-ASM_5030=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_5030, Artifact: Test_ASM_5030.composite] - ASM50033: value attribute exists for the property element
-ASM_5035=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - complexType
-ASM_5036=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5036Component1] - [ASM_5036] The property component TEST_ASM_5036Component1 property complexType has XSD type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType2 while its component type property has the XSD type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType1
-ASM_5037=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5037Component1] - [ASM50031] Property not found for component property: Component = TEST_ASM_5037Component1 Property = bogusName
-ASM_5038=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5038Component1] - [ASM50027] The property serviceData1 on component TEST_ASM_5038Component1 has a value which does not match the simple type {http://www.w3.org/2001/XMLSchema}float with which it is associated
-ASM_5039=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5039Component1] - [ASM50038] The property complexType on component TEST_ASM_5039Component1 has a value which does not match the complex type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType1 with which it is associated. Validation reported cvc-complex-type.2.4.d: Invalid content was found starting with element 'test:thirdData'. No child element is expected at this point.
-ASM_5040=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5040Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite74] - [ASM50042] Composite reference promotes component reference with 1..1 multiplicity and nonOverridable flag set true: Composite = TestComposite74.composite Composite reference = Reference1 Component reference = Reference1
-ASM_6001=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_6001, Artifact: TestDuplicate1.composite] - [ASM_6001] More than one composite with the same name {http://docs.oasis-open.org/ns/opencsa/scatests/200903}DuplicateComposite found in contribution
-ASM_6002=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TestComponent1 Service = Service1
-ASM_6003=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite17] - [ASM60004,ASM60032] Promoted component service not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite17 Service = SpuriousComponent/SpuriousService
-ASM_6005=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = TestComponent1 Reference = Reference1
-ASM_6006=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite20] - [ASM60007] Promoted component reference not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite20 Reference = Composite20Componentz/Reference1
-ASM_6008=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6008Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite22] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference. Operation operation2 not found on target
-ASM_6012=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6012TestComponent1] - [ASM40005,ASM60014] Duplicate implementation property name: Component = TEST_ASM_6012TestComponent1 Property = propertyName
-ASM_6016=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite30, Component: TestComponent1, Reference: Reference1] - [ASM60028] No target services found for the component reference to be autowired: Reference1
-ASM_6020=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Reference: Reference1] - [ASM60028] No target services found for the component reference to be autowired: Reference1
-ASM_6021=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6021TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite31] - [ASM60004,ASM60032] Promoted component service not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite31 Service = Not_A_URI_of_a_Component
-ASM_6022=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite32, Component: TestComponent1] - [ASM60033] No targets for reference: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite32 Reference = Reference1
-ASM_6023=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40011,ASM60034] No value configured on a mustSupply property: Component = TestComponent1 Property = simpleType
-ASM_6024=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM60030,JCI50004,JCI80001] Component implementation not resolved: Component = TestComponent1 Uri = TestComponent1
-ASM_6025=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [ASM50001] Duplicate component name: Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component = TestComponent1
-ASM_6028=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - InvalidProperty
-ASM_6029=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [ASM60041] Error: Composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_ASM_6029 can only include another composite with the identical @local attribute value
-ASM_6030=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [ASM60042] Error: Composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Invalid_composite_name is not a valid composite within the domain
-ASM_6031=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite39] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
-ASM_6032=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite40] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
-ASM_6033=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite41] - [ASM60011] Composite reference multiplicity incompatible with component reference multiplicity: Composite = TestComposite41.composite Composite reference = Reference1 Component reference = Reference1
-ASM_6036=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - No endpoints found in the domain that match the reference (@***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (@***)Endpoint: URI = TEST_ASM_6036Component1#service(ServiceZ) [Unresolved]
-ASM_6039=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - No endpoints found in the domain that match the reference (@***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (@***)Endpoint: URI = TEST_ASM_6039Component1#service-binding(Service1/harry) [Unresolved]
-ASM_8001=org.apache.tuscany.sca.interfacedef.OverloadedOperationException: [JCA20001] Cannot overload operation operation1 on org.oasisopen.sca.test.Service3 as it is a @Remotable interface
-ASM_8004=org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callback org.oasisopen.sca.test.Service6Callback must be remotable on remotable interface org.oasisopen.sca.test.Service6
-ASM_8005=org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callbackorg.oasisopen.sca.test.Service7Callback must not be remotable on local interface org.oasisopen.sca.test.Service7
-ASM_8006=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_8006, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_ASM_8006] - The interface.wsdl element has a forward interface with a callback declared in the WSDL {http://test.sca.oasisopen.org/}Service9Callback and a callback interface also declared using the callbackInterface attribute {http://test.sca.oasisopen.org/}Service8Callback but the callback interfaces are not equal.
-ASM_8007=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent2] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComponent2 Service = Service1
-ASM_8008=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TestComponent1 Reference = Reference1
-ASM_8009=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8009Component1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TEST_ASM_8009Component1 Reference = Reference1
-ASM_8010=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8010Component2, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite63] - Interface of composite service Service1 must be subset of the interface declared by promoted component service. Callback operation not found on target
-ASM_8011=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite62] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference. Callback operation not found on target
-ASM_8012=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8012Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite64] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference.
-ASM_8017=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8017Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite72] - Interface of composite service Service1a must be subset of the interface declared by promoted component service. Callback interface doesn't match
-ASM_8018=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestClient Service = TestInvocation
-ASM_8019=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_8019, Artifact: Test_ASM_8019.composite] - The interface.wsdl interface {http://test.sca.oasisopen.org/}Service1 element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: false.
-ASM_9002=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Multiple bindings with the same name for a service: Service = Service1 Binding name = Fred
-ASM_9005=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_9005Component1] - [ASM90005] The SCA binding Service1 on component TEST_ASM_9005Component1 service Service1 should not have a URI and the URI is currently set to http://example/bar
-ASM_10001=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_10001, Artifact: META-INF/definitions.xml, Definitions: jar:file:***ASM_10001***.zip!/META-INF/definitions.xml] - [ASM10001,POL30002] Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Fred found in domain
-ASM_10003=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_10003, Artifact: META-INF/definitions.xml, Definitions: jar:file:***ASM_10003***.zip!/META-INF/definitions.xml] - XMLSchema validation error occured in: Test_ASM_10003.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":intent, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySet, "http://docs.oasis-open.org/ns/opencsa/sca/200912":bindingType, "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementationType, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
-ASM_12003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Invalid interface when resolving
-ASM_12007=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComposite5TestComponent1 Service = Service1 Operations called operation2 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}int target = {http://www.w3.org/2001/XMLSchema}string don't match for output types
-ASM_12008=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_12008TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComposite5TestComponent1 Service = Service1 Operations called operation2 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}int target = {http://www.w3.org/2001/XMLSchema}string don't match for output types
-ASM_12011=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM60030,JCI50004,JCI80001] Component implementation not resolved: Component = TestComponent1 Uri = TestComponent1
-ASM_12012=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_12012, Artifact: META-INF/sca-contribution.xml] - XMLSchema validation error occured in: jar:file:***ASM_12012***.zip!/META-INF/sca-contribution.xml ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":deployable, "http://docs.oasis-open.org/ns/opencsa/sca/200912":importBase, "http://docs.oasis-open.org/ns/opencsa/sca/200912":exportBase, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
-ASM_13001=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13001, Artifact: Test_ASM_13001.composite] - XMLSchema validation error occured in: Test_ASM_13001.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'sevrice'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
-ASM_13002=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13002, Artifact: Test_ASM_13002.composite] - XMLSchema validation error occured in: Test_ASM_13002.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
-ASM_13003=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13003, Artifact: Test_ASM_13003.composite] - XMLSchema validation error occured in: Test_ASM_13003.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'binding.ws'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":include, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":component, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wire, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
-ASM_13004=org.apache.tuscany.sca.monitor.ValidationException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestClient_0002, Component: TestClient_0002TestClient] - [ASM40011,ASM60034] No value configured on a mustSupply property
-ASM_13005=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13005, Artifact: Test_ASM_13005.composite] - XMLSchema validation error occured in: Test_ASM_13005.composite ,line = ***, column = ***, Message = cvc-elt.2: The value of {abstract} in the element declaration for 'implementation' must be false.
-ASM_13006=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13006, Artifact: Test_ASM_13006.composite] - XMLSchema validation error occured in: Test_ASM_13006.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'callback' is not allowed to appear in element 'interface.java'.
-ASM_13007=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13007, Artifact: Test_ASM_13007.composite] - XMLSchema validation error occured in: Test_ASM_13007.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'mulplicity' is not allowed to appear in element 'reference'.
-ASM_13008=org.apache.tuscany.sca.monitor.ValidationException: [Contribution: ASM_13008, Artifact: Test_ASM_13008.composite] - XMLSchema validation error occured in: Test_ASM_13008.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wireFormat, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationSelector, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment}' is expected.
diff --git a/compliance-tests/binding-jms/pom.xml b/compliance-tests/binding-jms/pom.xml
deleted file mode 100644
index c5ad560..0000000
--- a/compliance-tests/binding-jms/pom.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-binding-jms</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Binding JMS</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-jms-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-jms</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- exclude>**/POJO_8011_TestCase.java</exclude -->
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-jms-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-jms-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties b/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 33192c4..0000000
--- a/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=Java
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index 1788c1f..0000000
--- a/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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.
-BJM_3001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3001, Artifact: Test_BJM_3001.composite] - URI must start with the scheme jms: for uri: http://test.sca.oasisopen.org/
-BJM_3002=Test service got an exception during execution: org.apache.tuscany.sca.binding.jms.JMSBindingException JMS Destination jndi:BJM_3002_Queue not found with create mode of "ifnotexist" while registering binding Reference1 invoker
-BJM_3003=No error expected
-BJM_3004=No error expected
-BJM_3005=No error expected
-BJM_3010=**testcase incomplete**
-BJM_3011=org.apache.tuscany.sca.binding.jms.JMSBindingException: Error starting JMSServiceBinding
-BJM_3012=**testcase incomplete**
-BJM_3013=org.apache.tuscany.sca.binding.jms.JMSBindingException: Error starting JMSServiceBinding
-BJM_3014=**testcase incomplete**
-BJM_3015=**testcase incomplete**
-BJM_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3017, Artifact: Test_BJM_3017.composite] - XMLSchema validation error occured in: Test_BJM_3017.composite ,line = 36, column = 17, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'activationSpec'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":response, "http://docs.oasis-open.org/ns/opencsa/sca/200912":headers, "http://docs.oasis-open.org/ns/opencsa/sca/200912":messageSelection, "http://docs.oasis-open.org/ns/opencsa/sca/200912":resourceAdapter, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationProperties}' is expected.
-BJM_3018=**testcase incomplete**
-BJM_3019=**testcase incomplete**
-BJM_3020=**testcase incomplete**
-BJM_3021=**testcase incomplete**
-BJM_3022=**testcase incomplete**
-BJM_3023=**testcase incomplete**
-BJM_3024=**testcase incomplete**
-BJM_3025=**testcase incomplete**
-BJM_3026=**testcase incomplete**
-BJM_3029=**testcase incomplete**
-BJM_3034=**testcase incomplete**
-BJM_3037=**testcase incomplete**
-BJM_4011=*
-
-
diff --git a/compliance-tests/binding-ws/pom.xml b/compliance-tests/binding-ws/pom.xml
deleted file mode 100644
index ab6305d..0000000
--- a/compliance-tests/binding-ws/pom.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-binding-ws</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Binding WS</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-ws-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- exclude>**/BWS_2003_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2006_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2008_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2009_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2011_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2013_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2016_TestCase.java</exclude -->
- <!-- exclude>**/BWS_2017_TestCase.java</exclude -->
- <!-- exclude>**/BWS_4007_TestCase.java</exclude -->
- <!-- exclude>**/BWS_5001_TestCase.java</exclude -->
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-ws-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-binding-ws-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
deleted file mode 100644
index 6f4aa8e..0000000
--- a/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.sca.otest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import client.RuntimeBridge;
-import client.TestConfiguration;
-
-/**
- * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
- *
- */
-public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
- protected NodeFactory launcher;
- protected Node node;
- protected Properties expectedErrorMessages;
-
- TestConfiguration testConfiguration = null;
-
- public TuscanyRuntimeBridge() {
- // read test error mapping
- expectedErrorMessages = new Properties();
- try {
- InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
- expectedErrorMessages.load(propertiesStream);
- } catch (IOException e) {
- System.out.println("Unable to read oasis-sca-tests-errors.properties file");
- }
- }
-
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- public boolean startContribution(String compositeName,
- String contributionLocation, String[] contributionNames)
- throws Exception {
- //TODO:
- return startContribution(contributionLocation, contributionNames);
- }
-
- public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception {
- try {
- // Tuscany specific code which starts the contribution(s) holding the test
- Properties ps = new Properties();
- ps.setProperty("defaultScheme", "vm");
- ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080");
- launcher = NodeFactory.newInstance(ps);
-
- Contribution[] contributions = new Contribution[contributionNames.length];
- String[] contributionURIs = getContributionURIs(contributionLocation);
- for (int i = 0; i < contributions.length; i++) {
- contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
- } // end for
-
- node = launcher.createNode(testConfiguration.getComposite(), contributions);
- // Start the node
- node.start();
-
- // For debugging
- // print out the composites that have been read in success cases
- // System.out.println(((NodeImpl)node).dumpDomainComposite());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- throw e;
- } // end try
-
- return true;
- } // end method startContribution
-
- /**
- * Gets the location of the Contributions as URIs
- * @param contributionLocation - a location pattern URI, which contains one or more "%1"
- * substrings, which are substituted with the name of the contribution to get the URI of
- * the contribution
- * @return the contribution locations as an array of Strings
- */
- protected String[] getContributionURIs(String contributionLocation) throws Exception {
- String[] locations;
- locations = testConfiguration.getContributionNames();
-
- if (locations != null && contributionLocation != null) {
-
- for (int i = 0; i < locations.length; i++) {
- String aLocation = contributionLocation.replaceAll("%1", locations[i]);
- // Looks like bugs in the oasis code that sometimes still uses jars for some
- if (aLocation.endsWith("_POJO.zip") && !aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
- aLocation = aLocation.substring(0, aLocation.length()-3) + "jar";
- }
- if (!(new File(aLocation)).exists()) {
- aLocation = aLocation.replace(".zip", ".jar");
- }
- locations[i] = aLocation;
- } // end for
- } else {
- if (locations == null) {
- // No contribution specified - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
- } else {
- // No contribution location supplied - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
- } // end if
- } // end if
-
- return locations;
- } // end getContributionURI
-
- public void stopContribution() {
- if (node != null) {
- node.stop();
- } // end if
- if (launcher != null) {
- launcher.destroy();
- } // end if
- } // end method stopContribution
-
- public String getContributionLocation(Class<?> testClass) {
- return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- } // end method getContributionLocation
-
- public void checkError(String testName, Throwable ex) throws Throwable {
-
- String expectedMessage = expectedErrorMessages.getProperty(testName);
- String receivedMessage = ex.getMessage();
-
- if (expectedMessage == null){
- writeMissingMessage(testName, ex);
- fail("Null expected error message for test " + testName +
- "Please add message to oasis-sca-tests-errors.properties");
- } // end if
-
- if (receivedMessage == null){
- ex.printStackTrace();
- fail("Null received error message for test " + testName);
- } // end if
-
- if (expectedMessage.startsWith("*")) {
- // allow using * to ignore a message comparison
- return;
- }
-
- // Deal with the case where the message has variable parts within it
- // marked with the characters ***. Here we tokenize the epected string
- // and make sure all the individual parts are present in the results string
- String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
-
- if (expectedMessageParts.length > 1){
- int foundParts = 0;
- for(int i = 0; i < expectedMessageParts.length; i++){
- if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
- foundParts++;
- }
- }
-
- if (foundParts == expectedMessageParts.length){
- return;
- }
- }
-
-
- // Deal with the case where the end of the message is variable (eg contains absolute filenames)
- // and where the only relevant part is the start of the message - in this case the expected
- // message only contains the stem section which is unchanging...
- if( receivedMessage.length() > expectedMessage.length() ) {
- // Truncate the received message to the length of the expected message
- receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
- } // end if
-
- if (!expectedMessage.equals(receivedMessage)) {
- writeIncorrectMessage(testName, expectedMessage, receivedMessage);
- }
-
- assertEquals( expectedMessage, receivedMessage );
-
- return;
-
- }
-
- protected void writeMissingMessage(String testName, Throwable ex) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
- out.write(testName + "=*");
- out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
- protected void writeIncorrectMessage(String testName, String expected, String received) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
- out.write(testName); out.newLine();
- out.write(" " + expected); out.newLine();
- out.write(" " + received); out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
-} // end class TuscanyRuntimeBridge
diff --git a/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties b/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 33192c4..0000000
--- a/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=Java
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index 4e8b4e5..0000000
--- a/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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.
-BWS_2020=*
-BWS_3001=*
-BWS_4008=*
-BWS_2007=*
-BWS_2018=*
-BWS_2005=*
-BWS_2001=*
-BWS_2022=*
-BWS_2002=*
-BWS_2019=*
-
diff --git a/compliance-tests/java-caa/pom.xml b/compliance-tests/java-caa/pom.xml
deleted file mode 100644
index 2c669e4..0000000
--- a/compliance-tests/java-caa/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-java-caa</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Java CAA</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javacaa-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/JCA_11008_TestCase.java</exclude><!-- could be due to out of date compliance artifacts -->
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javacaa-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javacaa-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
deleted file mode 100644
index 136e566..0000000
--- a/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.sca.otest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import client.RuntimeBridge;
-import client.TestConfiguration;
-
-/**
- * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
- *
- */
-public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
- protected NodeFactory launcher;
- protected Node node;
- protected Properties expectedErrorMessages;
-
- TestConfiguration testConfiguration = null;
-
- public TuscanyRuntimeBridge() {
- // read test error mapping
- expectedErrorMessages = new Properties();
- try {
- InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
- expectedErrorMessages.load(propertiesStream);
- } catch (IOException e) {
- System.out.println("Unable to read oasis-sca-tests-errors.properties file");
- }
- }
-
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- public boolean startContribution(String compositeName,
- String contributionLocation, String[] contributionNames)
- throws Exception {
- //TODO:
- return startContribution(contributionLocation, contributionNames);
- }
-
- public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception {
- try {
- // Tuscany specific code which starts the contribution(s) holding the test
- Properties ps = new Properties();
- ps.setProperty("defaultScheme", "vm");
- ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080");
- launcher = NodeFactory.newInstance(ps);
-
- Contribution[] contributions = new Contribution[contributionNames.length];
- String[] contributionURIs = getContributionURIs(contributionLocation);
- for (int i = 0; i < contributions.length; i++) {
- contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
- } // end for
-
- node = launcher.createNode(testConfiguration.getComposite(), contributions);
- // Start the node
- node.start();
-
- // For debugging
- // print out the composites that have been read in success cases
- // System.out.println(((NodeImpl)node).dumpDomainComposite());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- throw e;
- } // end try
-
- return true;
- } // end method startContribution
-
- /**
- * Gets the location of the Contributions as URIs
- * @param contributionLocation - a location pattern URI, which contains one or more "%1"
- * substrings, which are substituted with the name of the contribution to get the URI of
- * the contribution
- * @return the contribution locations as an array of Strings
- */
- protected String[] getContributionURIs(String contributionLocation) throws Exception {
- String[] locations;
- locations = testConfiguration.getContributionNames();
-
- if (locations != null && contributionLocation != null) {
-
- for (int i = 0; i < locations.length; i++) {
- String aLocation = contributionLocation.replaceAll("%1", locations[i]);
- // Looks like bugs in the oasis code that sometimes still uses jars for some
- if (aLocation.endsWith("_POJO.zip") && !aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
- aLocation = aLocation.substring(0, aLocation.length()-3) + "jar";
- }
- if (!(new File(aLocation)).exists()) {
- aLocation = aLocation.replace(".zip", ".jar");
- }
- locations[i] = aLocation;
- } // end for
- } else {
- if (locations == null) {
- // No contribution specified - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
- } else {
- // No contribution location supplied - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
- } // end if
- } // end if
-
- return locations;
- } // end getContributionURI
-
- public void stopContribution() {
- if (node != null) {
- node.stop();
- } // end if
- if (launcher != null) {
- launcher.destroy();
- } // end if
- } // end method stopContribution
-
- public String getContributionLocation(Class<?> testClass) {
- return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- } // end method getContributionLocation
-
- public void checkError(String testName, Throwable ex) throws Throwable {
-
- String expectedMessage = expectedErrorMessages.getProperty(testName);
- String receivedMessage = ex.getMessage();
-
- if (expectedMessage == null){
- writeMissingMessage(testName, ex);
- fail("Null expected error message for test " + testName +
- "Please add message to oasis-sca-tests-errors.properties");
- } // end if
-
- if (receivedMessage == null){
- ex.printStackTrace();
- fail("Null received error message for test " + testName);
- } // end if
-
- if (expectedMessage.startsWith("*")) {
- // allow using * to ignore a message comparison
- return;
- }
-
- // Deal with the case where the message has variable parts within it
- // marked with the characters ***. Here we tokenize the epected string
- // and make sure all the individual parts are present in the results string
- String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
-
- if (expectedMessageParts.length > 1){
- int foundParts = 0;
- for(int i = 0; i < expectedMessageParts.length; i++){
- if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
- foundParts++;
- }
- }
-
- if (foundParts == expectedMessageParts.length){
- return;
- }
- }
-
-
- // Deal with the case where the end of the message is variable (eg contains absolute filenames)
- // and where the only relevant part is the start of the message - in this case the expected
- // message only contains the stem section which is unchanging...
- if( receivedMessage.length() > expectedMessage.length() ) {
- // Truncate the received message to the length of the expected message
- receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
- } // end if
-
- if (!expectedMessage.equals(receivedMessage)) {
- writeIncorrectMessage(testName, expectedMessage, receivedMessage);
- }
-
- assertEquals( expectedMessage, receivedMessage );
-
- return;
-
- }
-
- protected void writeMissingMessage(String testName, Throwable ex) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
- out.write(testName + "=*");
- out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
- protected void writeIncorrectMessage(String testName, String expected, String received) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
- out.write(testName); out.newLine();
- out.write(" " + expected); out.newLine();
- out.write(" " + received); out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
-} // end class TuscanyRuntimeBridge
diff --git a/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties b/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 38e1e01..0000000
--- a/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=POJO
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index 2e00172..0000000
--- a/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,57 +0,0 @@
-# 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.
-JCA_2001=org.apache.tuscany.sca.interfacedef.OverloadedOperationException: [JCA20001] Cannot overload operation operation1 on org.oasisopen.sca.test.Service1Overload as it is a @Remotable interface
-JCA_3001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3001, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3001] - Class Not Found Exception: Service1
-JCA_3002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3002, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3002] - Class Not Found Exception: Service1
-JCA_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3003, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3003] - Class Not Found Exception: Service3Callback
-JCA_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3004, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3004] - Class Not Found Exception: Service3Callback
-JCA_3006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3006Component2] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TEST_JCA_3006Component2 Service = Service3WithCallback Callback operation not found on target
-JCA_3007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3007Component1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TEST_JCA_3007Component1 Reference = reference1
-JCA_3008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3008, Artifact: Test_JCA_3008.composite] - XMLSchema validation error occured in: Test_JCA_3008.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'oops' is not allowed to appear in element 'interface.java'.
-JCA_3009=org.apache.tuscany.sca.interfacedef.InvalidAnnotationException: [JCA30005] @Remotable annotation present in a interface marked as not remotable in the SCDL
-JCA_3011=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3011, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3011] - [JCA30006] Forbidden annotation interface org.oasisopen.sca.annotation.Property found on service interface in class org.oasisopen.sca.test.JCA3011Service
-JCA_3012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3012, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3012] - [JCA30007] Forbidden annotation interface org.oasisopen.sca.annotation.Property found on callback interface in class org.oasisopen.sca.test.JCA3012Service3Callback
-JCA_10001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalPropertyException: [JCA90001] Argument 1 of method operation1 in class class org.oasisopen.sca.test.service1BadAnnotation can not be a Property
-JCA_10002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_10002, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_10002] - [JCA9002] SCA annotations are not permitted on static members: org.oasisopen.sca.test.service1Sta
-JCA_10003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_10003, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_10003] - [JCA9002] SCA annotations are not permitted on static members: org.oasisopen.sca.test.service1Sta
-JCA_10004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalCallbackReferenceException: [JCA90046] @Callback on field of method must not have any parameters
-JCA_10006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: JCA90003 constructor parameters for class *** must have @Property or @Reference annotation
-JCA_10007=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalDestructorException: [JCA90004] Destructor must not have arguments
-JCA_10008=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalInitException: [JCA90008] Initializer must not have argments
-JCA_10009=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalPropertyException: [JCA90011] Final field serviceName in class org.oasisopen.sca.test.service1BadPropImpl can not be annotated as a Property
-JCA_10010=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidPropertyException: [JCA90013] Missing property name: public org.oasisopen.sca.test.service1ConstrBadPropImpl(java.lang.String)[0]
-JCA_10011=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidPropertyException: [JCA90014] Constructor property must not have required=false: org.oasisopen.sca.test.service1ConstrBadPropImpl
-JCA_10014=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidReferenceException: [JCA90018] @Reference in a Constructor must have a name attributeorg.oasisopen.sca.test.service1ConstrBad
-JCA_10015=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidReference
-JCA_10046=org.oasisopen.sca.ServiceRuntimeException: [] - [JCA90040] Exception while generating WSDL for TEST_JCA_10046Component1/Unmappable exception was:
-JCA_10047=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90041] @Scope annotation not allowed on service interface
-JCA_10048=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90042,JCI20002] Implementation missing service method operation2 service interface org.oasisopen.sca.test.Service1Superset
-JCA_10049=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90050] The number of Strings in the names attribute array of the @Service annotation MUST match the number of elements in the value attribute array
-JCA_10050=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_10050Component1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TEST_JCA_10050Component1 Service = Service1
-JCA_10051=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90059] The array of interfaces or classes specified by the value attribute of the @Service annotation
-JCA_10052=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90060] The value of each element in the @Service names array MUST be unique amongst all the other element values in the array
-JCA_11005=org.oasisopen.sca.ServiceRuntimeException: [Component: TEST_JCA_11005Component1, Service: Service1] - [JCA100006] JAX-WS client-side asynchronous polling and callback methods are not allowed in service interfaces
-# Intent and PolicySet related tests
-JCA_8001=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_8001Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent1 are mutually exclusive
-JCA_8002=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8002: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Method that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadIntent.operation1(java.lang.String)
-JCA_8003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8003: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Field that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadIntent.someField
-JCA_8004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8004: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Constructor parameter that is not an SCA reference cannot have policySet/intent annotations: public org.oasisopen.sca.test.service1BadIntent(java.lang.String)[0]
-JCA_8006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_8006Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent1 are mutually exclusive
-JCA_8008=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8008: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Method that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadPolicySet.operation1(java.lang.String)
-JCA_8009=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8009: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Field that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadPolicySet.someField
-JCA_8010=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8010: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Constructor parameter that is not an SCA reference cannot have policySet/intent annotations: public org.oasisopen.sca.test.service1BadPolicySet(java.lang.String)[0]
-
diff --git a/compliance-tests/java-ci/pom.xml b/compliance-tests/java-ci/pom.xml
deleted file mode 100644
index dea61d5..0000000
--- a/compliance-tests/java-ci/pom.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-java-ci</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Java CI</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-javaci-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
deleted file mode 100644
index 136e566..0000000
--- a/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.sca.otest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import client.RuntimeBridge;
-import client.TestConfiguration;
-
-/**
- * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
- *
- */
-public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
- protected NodeFactory launcher;
- protected Node node;
- protected Properties expectedErrorMessages;
-
- TestConfiguration testConfiguration = null;
-
- public TuscanyRuntimeBridge() {
- // read test error mapping
- expectedErrorMessages = new Properties();
- try {
- InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
- expectedErrorMessages.load(propertiesStream);
- } catch (IOException e) {
- System.out.println("Unable to read oasis-sca-tests-errors.properties file");
- }
- }
-
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- public boolean startContribution(String compositeName,
- String contributionLocation, String[] contributionNames)
- throws Exception {
- //TODO:
- return startContribution(contributionLocation, contributionNames);
- }
-
- public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception {
- try {
- // Tuscany specific code which starts the contribution(s) holding the test
- Properties ps = new Properties();
- ps.setProperty("defaultScheme", "vm");
- ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080");
- launcher = NodeFactory.newInstance(ps);
-
- Contribution[] contributions = new Contribution[contributionNames.length];
- String[] contributionURIs = getContributionURIs(contributionLocation);
- for (int i = 0; i < contributions.length; i++) {
- contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
- } // end for
-
- node = launcher.createNode(testConfiguration.getComposite(), contributions);
- // Start the node
- node.start();
-
- // For debugging
- // print out the composites that have been read in success cases
- // System.out.println(((NodeImpl)node).dumpDomainComposite());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- throw e;
- } // end try
-
- return true;
- } // end method startContribution
-
- /**
- * Gets the location of the Contributions as URIs
- * @param contributionLocation - a location pattern URI, which contains one or more "%1"
- * substrings, which are substituted with the name of the contribution to get the URI of
- * the contribution
- * @return the contribution locations as an array of Strings
- */
- protected String[] getContributionURIs(String contributionLocation) throws Exception {
- String[] locations;
- locations = testConfiguration.getContributionNames();
-
- if (locations != null && contributionLocation != null) {
-
- for (int i = 0; i < locations.length; i++) {
- String aLocation = contributionLocation.replaceAll("%1", locations[i]);
- // Looks like bugs in the oasis code that sometimes still uses jars for some
- if (aLocation.endsWith("_POJO.zip") && !aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
- aLocation = aLocation.substring(0, aLocation.length()-3) + "jar";
- }
- if (!(new File(aLocation)).exists()) {
- aLocation = aLocation.replace(".zip", ".jar");
- }
- locations[i] = aLocation;
- } // end for
- } else {
- if (locations == null) {
- // No contribution specified - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
- } else {
- // No contribution location supplied - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
- } // end if
- } // end if
-
- return locations;
- } // end getContributionURI
-
- public void stopContribution() {
- if (node != null) {
- node.stop();
- } // end if
- if (launcher != null) {
- launcher.destroy();
- } // end if
- } // end method stopContribution
-
- public String getContributionLocation(Class<?> testClass) {
- return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- } // end method getContributionLocation
-
- public void checkError(String testName, Throwable ex) throws Throwable {
-
- String expectedMessage = expectedErrorMessages.getProperty(testName);
- String receivedMessage = ex.getMessage();
-
- if (expectedMessage == null){
- writeMissingMessage(testName, ex);
- fail("Null expected error message for test " + testName +
- "Please add message to oasis-sca-tests-errors.properties");
- } // end if
-
- if (receivedMessage == null){
- ex.printStackTrace();
- fail("Null received error message for test " + testName);
- } // end if
-
- if (expectedMessage.startsWith("*")) {
- // allow using * to ignore a message comparison
- return;
- }
-
- // Deal with the case where the message has variable parts within it
- // marked with the characters ***. Here we tokenize the epected string
- // and make sure all the individual parts are present in the results string
- String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
-
- if (expectedMessageParts.length > 1){
- int foundParts = 0;
- for(int i = 0; i < expectedMessageParts.length; i++){
- if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
- foundParts++;
- }
- }
-
- if (foundParts == expectedMessageParts.length){
- return;
- }
- }
-
-
- // Deal with the case where the end of the message is variable (eg contains absolute filenames)
- // and where the only relevant part is the start of the message - in this case the expected
- // message only contains the stem section which is unchanging...
- if( receivedMessage.length() > expectedMessage.length() ) {
- // Truncate the received message to the length of the expected message
- receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
- } // end if
-
- if (!expectedMessage.equals(receivedMessage)) {
- writeIncorrectMessage(testName, expectedMessage, receivedMessage);
- }
-
- assertEquals( expectedMessage, receivedMessage );
-
- return;
-
- }
-
- protected void writeMissingMessage(String testName, Throwable ex) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
- out.write(testName + "=*");
- out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
- protected void writeIncorrectMessage(String testName, String expected, String received) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
- out.write(testName); out.newLine();
- out.write(" " + expected); out.newLine();
- out.write(" " + received); out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
-} // end class TuscanyRuntimeBridge
diff --git a/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties b/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 38e1e01..0000000
--- a/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=POJO
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index aebd49c..0000000
--- a/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-POJO_2003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90042,JCI20002] Implementation missing service method operation2 service interface org.oasisopen.sca.test.Service1Superset
-POJO_5001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException: [JCI50001] No public constructor for class
-POJO_5005=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException:
-POJO_5006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateConstructorException: [JCI50002] Multiple constructors marked with @Constructor
-POJO_5007=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: [JCI50005] Multiple annotated constructors
-POJO_8002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8002Component1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TEST_POJO_8002Component1 Service = Service1Superset Operation operationb not found on target
-POJO_8003=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8003Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
-POJO_8008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8008Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
-POJO_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}managedTransaction.global and {http://docs.oasis-open.org/ns/opencsa/sca/200912}noManagedTransaction are mutually exclusive
-POJO_8013=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicatePropertyException: duplicateProperty
-POJO_8014=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateReferenceException: duplicateReference
-POJO_9001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_9001, Artifact: Test_POJO_9001.composite] - XMLSchema validation error occured in: Test_POJO_9001.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'interface' is not allowed to appear in element 'implementation.java'.
-POJO_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10001, Artifact: META-INF/sca-contribution.xml] - [JCI10001] The value of the @package attribute on the <import.java/> element is not unique across all other <import.java/> elements within the contribution.
-POJO_10004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [JCI100007] A Java package org.oasisopen.sca.test;version=1.0.0 that is specified on an export element MUST be contained within the contribution containing the export element.
-POJO_10005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10005, Artifact: META-INF/sca-contribution.xml] - [JCI10004] The value of the @package attribute on the <export.java/> element is not unique across all other <export.java/> elements within the contribution.
-POJO_10006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [JCI100007] A Java package org.oasisopen.sca.test.y that is specified on an export element MUST be contained within the contribution containing the export element.
-
diff --git a/compliance-tests/policy/pom.xml b/compliance-tests/policy/pom.xml
deleted file mode 100644
index 2cc9622..0000000
--- a/compliance-tests/policy/pom.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-compliance-tests</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-compliance-test-policy</artifactId>
- <name>Apache Tuscany SCA Specification Compliance Tests Policy</name>
-
- <dependencies>
-
- <dependency>
- <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
- <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-policy-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <!-- This is need for POL_4013 and POL_4028 when running with Sun JDK which
- gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
- when Tuscany is writing a property value -->
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>**/POL_3001_TestCase.java</exclude><!-- see TUSCANY-3370 -->
- <exclude>**/POL_3002_TestCase.java</exclude><!-- see TUSCANY-3370 -->
- <exclude>**/POL_4003_TestCase.java</exclude><!-- see TUSCANY-3488 -->
- <exclude>**/POL_4028_TestCase.java</exclude><!-- see TUSCANY-xxxx - Passes in otest module -->
- <!-- transaction intents -->
- <exclude>**/POL_9006_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <exclude>**/POL_9009_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <exclude>**/POL_9015_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <exclude>**/POL_9016_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <exclude>**/POL_9017_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <exclude>**/POL_9018_TestCase.java</exclude><!-- see TUSCANY-3487-->
- <!-- noListener intents -->
- <exclude>**/POL_10001_TestCase.java</exclude><!-- see TUSCANY-3491-->
- <exclude>**/POL_10002_TestCase.java</exclude><!-- see TUSCANY-3491-->
-
- <exclude>**/POL_11001_TestCase.java</exclude><!-- see TUSCANY-xxxx -->
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>test-compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-policy-contributions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>zip</type>
- <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>oasis-policy-test-runner</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>jar</type>
- <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
- <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
deleted file mode 100644
index 136e566..0000000
--- a/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.sca.otest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import client.RuntimeBridge;
-import client.TestConfiguration;
-
-/**
- * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
- *
- */
-public class TuscanyRuntimeBridge implements RuntimeBridge {
-
- static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
-
- protected NodeFactory launcher;
- protected Node node;
- protected Properties expectedErrorMessages;
-
- TestConfiguration testConfiguration = null;
-
- public TuscanyRuntimeBridge() {
- // read test error mapping
- expectedErrorMessages = new Properties();
- try {
- InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
- expectedErrorMessages.load(propertiesStream);
- } catch (IOException e) {
- System.out.println("Unable to read oasis-sca-tests-errors.properties file");
- }
- }
-
- public TestConfiguration getTestConfiguration() {
- return testConfiguration;
- }
-
- public void setTestConfiguration(TestConfiguration testConfiguration) {
- this.testConfiguration = testConfiguration;
- }
-
- public boolean startContribution(String compositeName,
- String contributionLocation, String[] contributionNames)
- throws Exception {
- //TODO:
- return startContribution(contributionLocation, contributionNames);
- }
-
- public boolean startContribution(String contributionLocation, String[] contributionNames) throws Exception {
- try {
- // Tuscany specific code which starts the contribution(s) holding the test
- Properties ps = new Properties();
- ps.setProperty("defaultScheme", "vm");
- ps.setProperty("org.apache.tuscany.sca.binding.ws.jaxws.ri.JAXWSBindingProviderFactory.defaultPort", "8080");
- launcher = NodeFactory.newInstance(ps);
-
- Contribution[] contributions = new Contribution[contributionNames.length];
- String[] contributionURIs = getContributionURIs(contributionLocation);
- for (int i = 0; i < contributions.length; i++) {
- contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
- } // end for
-
- node = launcher.createNode(testConfiguration.getComposite(), contributions);
- // Start the node
- node.start();
-
- // For debugging
- // print out the composites that have been read in success cases
- // System.out.println(((NodeImpl)node).dumpDomainComposite());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- throw e;
- } // end try
-
- return true;
- } // end method startContribution
-
- /**
- * Gets the location of the Contributions as URIs
- * @param contributionLocation - a location pattern URI, which contains one or more "%1"
- * substrings, which are substituted with the name of the contribution to get the URI of
- * the contribution
- * @return the contribution locations as an array of Strings
- */
- protected String[] getContributionURIs(String contributionLocation) throws Exception {
- String[] locations;
- locations = testConfiguration.getContributionNames();
-
- if (locations != null && contributionLocation != null) {
-
- for (int i = 0; i < locations.length; i++) {
- String aLocation = contributionLocation.replaceAll("%1", locations[i]);
- // Looks like bugs in the oasis code that sometimes still uses jars for some
- if (aLocation.endsWith("_POJO.zip") && !aLocation.endsWith("ASM_8005_Java-1.0.zip")) {
- aLocation = aLocation.substring(0, aLocation.length()-3) + "jar";
- }
- if (!(new File(aLocation)).exists()) {
- aLocation = aLocation.replace(".zip", ".jar");
- }
- locations[i] = aLocation;
- } // end for
- } else {
- if (locations == null) {
- // No contribution specified - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
- } else {
- // No contribution location supplied - throw an Exception
- throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
- } // end if
- } // end if
-
- return locations;
- } // end getContributionURI
-
- public void stopContribution() {
- if (node != null) {
- node.stop();
- } // end if
- if (launcher != null) {
- launcher.destroy();
- } // end if
- } // end method stopContribution
-
- public String getContributionLocation(Class<?> testClass) {
- return ContributionLocationHelper.getContributionLocation(testConfiguration.getTestClass());
- } // end method getContributionLocation
-
- public void checkError(String testName, Throwable ex) throws Throwable {
-
- String expectedMessage = expectedErrorMessages.getProperty(testName);
- String receivedMessage = ex.getMessage();
-
- if (expectedMessage == null){
- writeMissingMessage(testName, ex);
- fail("Null expected error message for test " + testName +
- "Please add message to oasis-sca-tests-errors.properties");
- } // end if
-
- if (receivedMessage == null){
- ex.printStackTrace();
- fail("Null received error message for test " + testName);
- } // end if
-
- if (expectedMessage.startsWith("*")) {
- // allow using * to ignore a message comparison
- return;
- }
-
- // Deal with the case where the message has variable parts within it
- // marked with the characters ***. Here we tokenize the epected string
- // and make sure all the individual parts are present in the results string
- String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
-
- if (expectedMessageParts.length > 1){
- int foundParts = 0;
- for(int i = 0; i < expectedMessageParts.length; i++){
- if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
- foundParts++;
- }
- }
-
- if (foundParts == expectedMessageParts.length){
- return;
- }
- }
-
-
- // Deal with the case where the end of the message is variable (eg contains absolute filenames)
- // and where the only relevant part is the start of the message - in this case the expected
- // message only contains the stem section which is unchanging...
- if( receivedMessage.length() > expectedMessage.length() ) {
- // Truncate the received message to the length of the expected message
- receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
- } // end if
-
- if (!expectedMessage.equals(receivedMessage)) {
- writeIncorrectMessage(testName, expectedMessage, receivedMessage);
- }
-
- assertEquals( expectedMessage, receivedMessage );
-
- return;
-
- }
-
- protected void writeMissingMessage(String testName, Throwable ex) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
- out.write(testName + "=*");
- out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
- protected void writeIncorrectMessage(String testName, String expected, String received) {
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
- out.write(testName); out.newLine();
- out.write(" " + expected); out.newLine();
- out.write(" " + received); out.newLine();
- out.close();
- } catch (IOException e) {
- }
- }
-
-} // end class TuscanyRuntimeBridge
diff --git a/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties b/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties
deleted file mode 100644
index 0d8cc27..0000000
--- a/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=Java
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
-org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1.zip
-
diff --git a/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
deleted file mode 100644
index 8a17b24..0000000
--- a/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-# 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.
-
-POL_3001=TUSCANY-3370
-POL_3002=TUSCANY-3370
-POL_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3003, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3003.zip!/META-INF/definitions.xml] - [ASM10001,POL30002] Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}dupIntent found in domain
-POL_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3004, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3004.zip!/META-INF/definitions.xml] - [POL30004] Intent twoDefaults has more than one qualifier marked as the default qualifier
-POL_3005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3005, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3005.zip!/META-INF/definitions.xml] - [POL30005] The intent dupQualifiers has more than one qualifier with the name qual1
-POL_3006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3006, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3006.zip!/META-INF/definitions.xml] - [POL30006] The profile intent name bad.ProfileIntent must not have the character "." in it
-POL_3009=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3009, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3009.zip!/META-INF/definitions.xml] - [POL30010] The policy set TwoIntentMapPolicySet has more than one intent map with the name testIntent6
-POL_3012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30015] Required Intent - {http://docs.oasis-open.org/ns/opencsa/scatests/200903}undefinedIntent2 not found for ProfileIntent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}badProfileIntent
-POL_3013=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30016] Excluded Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}undefinedIntent not found for intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}noMuxIntent
-POL_3014=org.oasisopen.sca.ServiceRuntimeException: [Contribution: Policy_General, Definitions: jar:file:***/Policy_General.zip!/META-INF/definitions.xml] - DuplicatePolicySet
-POL_3015=org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.xpath.XPathExpressionException
-POL_3016=org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.xpath.XPathExpressionException
-POL_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30020] The policy set {http://docs.oasis-open.org/ns/opencsa/scatests/200903}BadIntentMapPolicySet intent map testIntent6 has missing qualifiers: testIntent6.qual2 The intent map qualifiers must match the provided intent qualifiers.
-POL_3018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3018, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3018.zip!/META-INF/definitions.xml] - [POL30021] Intent Map provides for Intent not specified as provided by parent PolicySet - BadIntentMapPolicySet
-POL_3020=TUSCANY-3371
-POL_4012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent3 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent4 are mutually exclusive
-POL_4027=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4027, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_4027.zip!/META-INF/definitions.xml] - [POL40020] Duplicate binding type {http://docs.oasis-open.org/ns/opencsa/sca/200912}dupBinding.type found in domain
-POL_4028=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [POL40002] The policy {http://docs.oasis-open.org/ns/opencsa/scatests/200903}PolicySetExtAttachProp has been attached to a property or one of its children. This is not allowed.
-POL_5001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL50001] An extension to support the implementation type {http://docs.oasis-open.org/ns/opencsa/sca/200912}unknown.type cant be found in the domain
-POL_9006=TUSCANY-1649
-POL_9009=TUSCANY-1649
-POL_9015=TUSCANY-1649
-POL_9016=TUSCANY-1649
-POL_9017=TUSCANY-1649
-POL_9018=TUSCANY-1649
-POL_10001=TUSCANY-3381
-POL_11001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_11001, Artifact: Test_POL_11001.composite] - XMLSchema validation error occured in: Test_POL_11001.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'policySetAttachment'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":interface, "http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected
\ No newline at end of file
diff --git a/compliance-tests/pom.xml b/compliance-tests/pom.xml
deleted file mode 100644
index aeb1911..0000000
--- a/compliance-tests/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <packaging>pom</packaging>
- <artifactId>tuscany-compliance-tests</artifactId>
- <name>Apache Tuscany SCA Compliance Tests</name>
-
- <repositories>
- <repository>
- <!-- OASIS will eventually publish these themselves but for now they're at my people place -->
- <id>oasis.contributions</id>
- <url>http://people.apache.org/~antelder/tuscany/otests/maven</url>
- </repository>
- </repositories>
-
- <modules>
- <module>assembly</module>
- <module>policy</module>
- <module>java-caa</module>
- <module>java-ci</module>
- </modules>
-
-</project>
diff --git a/distribution/aggregations/base-runtime-aggregation/pom.xml b/distribution/aggregations/base-runtime-aggregation/pom.xml
new file mode 100644
index 0000000..3914954
--- /dev/null
+++ b/distribution/aggregations/base-runtime-aggregation/pom.xml
@@ -0,0 +1,171 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-base-runtime-aggregation</artifactId>
+ <name>Apache Tuscany SCA Base Runtime Aggregation</name>
+
+ <properties>
+ <bundle-symbolic-name>${project.groupId}.${artifactId}</bundle-symbolic-name>
+ </properties>
+
+
+ <!--
+ The dependencies required to run the Assembly otests minus the web service
+ binding (which is only required by the otest framework). Provides a minimum
+ set of function for running composites using implementation.java and local
+ wiring. Other extensions can be added to this base when required
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>${pom.version}</version>
+ <type>pom</type>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+<!-- shades plugin but not worrying about manifests for the time being -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.3.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar>true</createSourcesJar>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+<!--
+ various different approaches to the problem of building aggregate jars
+ leaving here for reference while the build settles down
+-->
+
+<!-- Our bundle plugin aggregation function
+ 1/ it relies on generating the modules directory (which is not such a big deal)
+ 2/ it generates a bundle with contains jars and a bundle classpath so is not jse friendly.
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.0.7-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>distribution-modules</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>generate-modules</goal>
+ </goals>
+ <configuration>
+ <targetDirectory>target/modules</targetDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>aggregate</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>aggregate-modules</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+-->
+
+<!-- Using the bundle plugin etc.
+ Unpack doesn't work with pom dependencies
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>unpack-dependencies</id>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <instructions>
+ <Bundle-RequiredExecutionEnvironment>J2SE-1.6</Bundle-RequiredExecutionEnvironment>
+ </instructions>
+ </configuration>
+ </plugin>
+-->
+ </plugins>
+ </build>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/distribution/aggregations/base-runtime-aggregation/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to distribution/aggregations/base-runtime-aggregation/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/distribution/aggregations/base-runtime-aggregation/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to distribution/aggregations/base-runtime-aggregation/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/distribution/aggregations/base-runtime-aggregation/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to distribution/aggregations/base-runtime-aggregation/src/main/resources/README.txt
diff --git a/distribution/aggregations/base-runtime-nodep/pom.xml b/distribution/aggregations/base-runtime-nodep/pom.xml
new file mode 100644
index 0000000..e2a59b2
--- /dev/null
+++ b/distribution/aggregations/base-runtime-nodep/pom.xml
@@ -0,0 +1,121 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-nodep</artifactId>
+ <name>Apache Tuscany SCA Base Runtime Jar including dependencies</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Tuscany uses java.util.logging but extensions and dependencies may use
+ log4j, commons-logging, slf4j, or java.util.logging. So inlcude slf4j
+ modules for all of those that delegate to java.util.logging. This should
+ mean there's no need for any other logging jars and no conflicts on
+ logging verisons as those are handled transparently by slf4j, and,
+ everything uses and can be configured just with java.util.logging.
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>log4j-over-slf4j</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+ -->
+
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <version>3.5.0-v20090520</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.3.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar>true</createSourcesJar>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/shades/base-nodep/src/main/java/org/apache/tuscany/sca/base/AggregatedBundleActivator.java b/distribution/aggregations/base-runtime-nodep/src/main/java/org/apache/tuscany/sca/base/AggregatedBundleActivator.java
similarity index 100%
rename from shades/base-nodep/src/main/java/org/apache/tuscany/sca/base/AggregatedBundleActivator.java
rename to distribution/aggregations/base-runtime-nodep/src/main/java/org/apache/tuscany/sca/base/AggregatedBundleActivator.java
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/distribution/aggregations/base-runtime-nodep/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to distribution/aggregations/base-runtime-nodep/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/META-INF/MANIFEST.MF b/distribution/aggregations/base-runtime-nodep/src/main/resources/META-INF/MANIFEST.MF
similarity index 100%
rename from shades/base-nodep/src/main/resources/META-INF/MANIFEST.MF
rename to distribution/aggregations/base-runtime-nodep/src/main/resources/META-INF/MANIFEST.MF
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/distribution/aggregations/base-runtime-nodep/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to distribution/aggregations/base-runtime-nodep/src/main/resources/NOTICE
diff --git a/shades/base-nodep/src/main/resources/README.txt b/distribution/aggregations/base-runtime-nodep/src/main/resources/README.txt
similarity index 100%
rename from shades/base-nodep/src/main/resources/README.txt
rename to distribution/aggregations/base-runtime-nodep/src/main/resources/README.txt
diff --git a/distribution/aggregations/base-runtime/pom.xml b/distribution/aggregations/base-runtime/pom.xml
new file mode 100644
index 0000000..943bde4
--- /dev/null
+++ b/distribution/aggregations/base-runtime/pom.xml
@@ -0,0 +1,329 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <name>Apache Tuscany SCA Base Runtime Jar</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-node</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-launcher</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${pom.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-shell</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>${pom.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>net.sourceforge.stripes</groupId>
+ <artifactId>stripes</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-wink</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-jaxws-ri</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-security</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+<!-- All the scdl modules -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonp</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <!-- dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-jaxrs</artifactId>
+ <version>${pom.version}</version>
+ </dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-widget</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+<!-- these remaining dependencies are not required when using JDK6, so use a scope of provided -->
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+ <version>1.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.12</version>
+ <scope>provided</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>1.0-MR1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0-2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.3.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar>true</createSourcesJar>
+ <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+ <artifactSet>
+ <includes>
+ <include>org.apache.tuscany.sca:*</include>
+ </includes>
+ </artifactSet>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <manifestEntries>
+ <Main-Class>org.apache.tuscany.sca.launcher.LauncherMain</Main-Class>
+ </manifestEntries>
+ </transformer>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
diff --git a/shades/base/src/main/resources/LICENSE b/distribution/aggregations/base-runtime/src/main/resources/LICENSE
similarity index 100%
rename from shades/base/src/main/resources/LICENSE
rename to distribution/aggregations/base-runtime/src/main/resources/LICENSE
diff --git a/shades/base/src/main/resources/NOTICE b/distribution/aggregations/base-runtime/src/main/resources/NOTICE
similarity index 100%
rename from shades/base/src/main/resources/NOTICE
rename to distribution/aggregations/base-runtime/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/distribution/aggregations/base-runtime/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to distribution/aggregations/base-runtime/src/main/resources/README.txt
diff --git a/distribution/aggregations/binding-rmi-runtime-aggregation/pom.xml b/distribution/aggregations/binding-rmi-runtime-aggregation/pom.xml
new file mode 100644
index 0000000..244269c
--- /dev/null
+++ b/distribution/aggregations/binding-rmi-runtime-aggregation/pom.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-binding-rmi-runtime-aggregation</artifactId>
+ <name>Apache Tuscany SCA Binding RMI Runtime Aggregation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>${pom.version}</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+<!-- shades plugin but not worrying about manifests for the time being -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.3.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar>true</createSourcesJar>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to distribution/aggregations/binding-rmi-runtime-aggregation/src/main/resources/README.txt
diff --git a/distribution/aggregations/binding-ws-runtime-axis2-aggregation/pom.xml b/distribution/aggregations/binding-ws-runtime-axis2-aggregation/pom.xml
new file mode 100644
index 0000000..fdbf31f
--- /dev/null
+++ b/distribution/aggregations/binding-ws-runtime-axis2-aggregation/pom.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2-aggregation</artifactId>
+ <name>Apache Tuscany SCA Binding WS Runtime Axis2 Aggregation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>${pom.version}</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+<!-- shades plugin but not worrying about manifests for the time being -->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.3.2</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <createSourcesJar>true</createSourcesJar>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+ </transformers>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to distribution/aggregations/binding-ws-runtime-axis2-aggregation/src/main/resources/README.txt
diff --git a/distribution/all/pom.xml b/distribution/all/pom.xml
index 7d9f66c..cbbee5b 100644
--- a/distribution/all/pom.xml
+++ b/distribution/all/pom.xml
@@ -31,56 +31,33 @@
<packaging>pom</packaging>
<dependencies>
+
+ <!-- module jars for modules directory -->
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-feature-all</artifactId>
<type>pom</type>
<version>2.0-Beta1</version>
</dependency>
+
+ <!-- aggregation jars for lib directory -->
+
<dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-domain-node</artifactId>
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-base-runtime-aggregation</artifactId>
<version>2.0-Beta1</version>
</dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ejb-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-tracing-aspectj</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.6.8</version>
- </dependency>
<dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-binding-rmi-runtime-aggregation</artifactId>
<version>2.0-Beta1</version>
</dependency>
+
<dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-spring</artifactId>
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2-aggregation</artifactId>
<version>2.0-Beta1</version>
</dependency>
@@ -184,7 +161,10 @@
<plugin>
<groupId>org.apache.tuscany.maven.plugins</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>1.0.6</version>
+<!-- TUSCANY-3674
+ <version>1.0.6</version>
+-->
+ <version>1.0.7-SNAPSHOT</version>
<executions>
<execution>
<id>distribution-modules</id>
@@ -197,8 +177,9 @@
<useDistributionName>${useDistributionName}</useDistributionName>
<generateAggregatedBundle>${generateAggregatedBundle}</generateAggregatedBundle>
<generateManifestJar>true</generateManifestJar>
+ <featuresName>features</featuresName>
<excludeGroupIds>
- <groupId>org.apache.tuscany.sca.shades</groupId>
+ <groupId>org.apache.tuscany.sca.aggregation</groupId>
</excludeGroupIds>
<artifactManifests>
<artifactManifest>
@@ -254,6 +235,174 @@
</artifactAggregations-->
</configuration>
</execution>
+<!-- TUSCANY-3674
+ uncomment when using maven-bundle-plugin v1.0.7-SNAPSHOT
+-->
+ <execution>
+ <id>extensions-build</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate-meta-data</goal>
+ </goals>
+ <configuration>
+ <generateModules>false</generateModules>
+ <useDistributionName>false</useDistributionName>
+ <generateManifestJar>true</generateManifestJar>
+ <generateConfig>false</generateConfig>
+ <generateAntScript>true</generateAntScript>
+ <generateTargetPlatform>false</generateTargetPlatform>
+ <generateAggregatedBundle>false</generateAggregatedBundle>
+ <featuresName>features</featuresName>
+ <features>
+ <feature>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ </feature>
+ </features>
+ <extensions>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-commet-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-hazelcase-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonp-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rss-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-jaxes-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-osgi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-python-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-widget-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+
+ <extension>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </extension>
+ </extensions>
+ <artifactManifests>
+ <artifactManifest>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ <version>1.2.8</version>
+ <manifestFile>${basedir}/manifests/axiom-api-1.2.8.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
+ <version>1.0M8</version>
+ <manifestFile>${basedir}/manifests/woden-impl-dom-1.0M8.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-kernel</artifactId>
+ <version>1.5.1</version>
+ <manifestFile>${basedir}/manifests/axis2-kernel-1.5.1.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-transport-http</artifactId>
+ <version>1.5.1</version>
+ <manifestFile>${basedir}/manifests/axis2-transport-http-1.5.1.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>*</artifactId>
+ <version>*</version>
+ </artifactManifest>
+ </artifactManifests>
+ </configuration>
+ </execution>
+
<!--
<execution>
<id>distribution-singlebundle</id>
diff --git a/distribution/all/src/main/assembly/src.xml b/distribution/all/src/main/assembly/src.xml
index 89d50a7..e603b98 100644
--- a/distribution/all/src/main/assembly/src.xml
+++ b/distribution/all/src/main/assembly/src.xml
@@ -38,8 +38,11 @@
<exclude>**/target</exclude>
<exclude>**/target/**/*</exclude>
<exclude>**/maven-eclipse.xml</exclude>
+ <exclude>**/dependency-reduced-pom.xml</exclude>
<exclude>modules/web-javascript-dojo/src/main/resources/dojo/**</exclude>
- <exclude>shades/**/dependency-reduced-pom.xml</exclude>
+ <exclude>samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/dojo/**</exclude>
+ <exclude>unreleased</exclude>
+ <exclude>unreleased/**</exclude>
</excludes>
</fileSet>
</fileSets>
diff --git a/distribution/all/src/main/components/bin-lib.xml b/distribution/all/src/main/components/bin-lib.xml
index 1da6beb..6860d0c 100644
--- a/distribution/all/src/main/components/bin-lib.xml
+++ b/distribution/all/src/main/components/bin-lib.xml
@@ -24,6 +24,20 @@
<useTransitiveDependencies>true</useTransitiveDependencies>
<unpack>false</unpack>
<includes>
+ <include>org.apache.tuscany.sca.aggregation:tuscany-base-runtime-aggregation</include>
+ <include>org.apache.tuscany.sca.aggregation:tuscany-binding-rmi-runtime-aggregation</include>
+ <include>org.apache.tuscany.sca.aggregation:tuscany-binding-ws-runtime-axis2-aggregation</include>
+ <!-- needed by some of the sample build scripts but don't think we actually need to put this here -->
+ <include>org.apache.tuscany.sca:tuscany-sca-api</include>
+ </includes>
+ </dependencySet>
+
+<!-- dependencies referring to the shade jars, disabling for the time being
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <useTransitiveDependencies>true</useTransitiveDependencies>
+ <unpack>false</unpack>
+ <includes>
<include>org.apache.tuscany.sca.shades:tuscany-base</include>
<include>org.apache.ws.commons.schema:XmlSchema</include>
<include>cglib:cglib</include>
@@ -42,6 +56,7 @@
<include>org.springframework:*</include>
</includes>
</dependencySet>
+-->
</dependencySets>
<fileSets>
<fileSet>
diff --git a/distribution/all/src/main/components/bin-samples.xml b/distribution/all/src/main/components/bin-samples.xml
index 5fe9c55..90e5d25 100644
--- a/distribution/all/src/main/components/bin-samples.xml
+++ b/distribution/all/src/main/components/bin-samples.xml
@@ -39,8 +39,12 @@
<exclude>**/target/dependency-maven-plugin-markers/**/*</exclude>
<exclude>**/target/.felix</exclude>
<exclude>**/target/.felix/**/*</exclude>
+ <exclude>**/target/generated-sources</exclude>
+ <exclude>**/target/generated-sources/**/*</exclude>
<exclude>**/target/maven-archiver</exclude>
<exclude>**/target/maven-archiver/**/*</exclude>
+ <exclude>**/target/maven-shared-archive-resources</exclude>
+ <exclude>**/target/maven-shared-archive-resources/**/*</exclude>
<exclude>**/target/test-classes</exclude>
<exclude>**/target/test-classes/**/*</exclude>
<exclude>**/target/sdo-source</exclude>
@@ -51,8 +55,11 @@
<exclude>**/target/surefire-osgi-reports/**/*</exclude>
<exclude>**/target/war</exclude>
<exclude>**/target/war/**/*</exclude>
- <exclude>webapps/*/target</exclude>
- <exclude>webapps/*/target/**/*</exclude>
+ <exclude>**/target/work</exclude>
+ <exclude>**/target/work/**/*</exclude>
+ <exclude>**/*-webapp/target</exclude>
+ <exclude>**/*-webapp/target/**/*</exclude>
+ <exclude>**/*-webapp/src/main/webapp/dojo/**/*</exclude>
</excludes>
</fileSet>
</fileSets>
diff --git a/distribution/all/src/main/release/bin/LICENSE b/distribution/all/src/main/release/bin/LICENSE
index 941dc04..7bf827f 100644
--- a/distribution/all/src/main/release/bin/LICENSE
+++ b/distribution/all/src/main/release/bin/LICENSE
@@ -257,19 +257,17 @@
derby-10.4.1.3.jar
dwr-2.0.3.jar
geronimo-activation_1.1_spec-1.0.1.jar
- geronimo-connector-2.1.3.jar
+ geronimo-connector-2.1.4.jar
geronimo-ejb_3.0_spec-1.0.1.jar
- geronimo-el_1.0_spec-1.0.1.jar
geronimo-javamail_1.4_spec-1.6.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-jpa_3.0_spec-1.1.1.jar
- geronimo-jsp_2.1_spec-1.0.1.jar
geronimo-jta_1.0.1B_spec-1.0.jar
geronimo-jta_1.1_spec-1.1.1.jar
geronimo-j2ee-connector_1.5_spec-2.0.0.jar
geronimo-kernel-2.0.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
- geronimo-transaction-2.1.3.jar
+ geronimo-transaction-2.1.4.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
groovy-all-1.7.1.jar
hazelcast-1.8.3.jar
@@ -278,9 +276,9 @@
httpcore-4.0.1.jar
httpcore-nio-4.0.1.jar
jabsorb-1.3.1.jar
- jackson-core-asl-1.5.4.jar
- jackson-mapper-asl-1.5.4.jar
- jackson-xc-1.5.4.jar
+ jackson-core-asl-1.6.0.jar
+ jackson-mapper-asl-1.6.0.jar
+ jackson-xc-1.6.0.jar
jettison-1.2.jar
jetty-6.1.19.jar
jetty-util-6.1.19.jar
@@ -310,14 +308,12 @@
rampart-policy-1.4.jar
rampart-trust-1.4.jar
regexp-1.3.jar
- rome-1.0.jar
- spring-aop-3.0.2.RELEASE.jar
- spring-asm-3.0.2.RELEASE.jar
+ spring-aop-3.0.2.RELEASE.jar
+ spring-asm-3.0.2.RELEASE.jar
spring-beans-3.0.2.RELEASE.jar
spring-context-3.0.2.RELEASE.jar
- spring-core-3.0.2.RELEASE.jar
+ spring-core-3.0.2.RELEASE.jar
spring-expression-3.0.2.RELEASE.jar
- stripes-1.5.2.jar
tranql-connector-1.1.jar
tribes-6.0.26.jar
wink-common-1.1.1-incubating.jar
@@ -327,7 +323,6 @@
woden-impl-dom-1.0M8.jar
wss4j-1.5.4.jar
wstx-asl-3.2.4.jar
- wstx-asl-3.2.6.jar
xalan-2.7.0.jar
xercesImpl-2.8.1.jar
xml-apis-1.3.04.jar
@@ -1613,53 +1608,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-==========================================================================================
-
-
-The tuscany-assembly-xsd-osoa jar includes XSD files under the following SCA Collaboration license:
-
-License for the Service Component Architecture JavaDoc, Interface
-Definition files and XSD files.
-
-The Service Component Architecture JavaDoc, Interface Definition files,
-and XSD files are being provided by the copyright holders under the
-following license. By using and/or copying this work, you agree that
-you have read, understood and will comply with the following terms and
-conditions:
-
-Permission to copy, display, make derivative works of, and distribute
-the Service Component Architecture JavaDoc, Interface Definition Files
-and XSD files (the "Artifacts") in any medium without fee or royalty is
-hereby granted, provided that you include the following on ALL copies
-of the Artifacts, or portions thereof, that you make:
-
-1. A link or URL to the Artifacts at this location:
-http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications
-
-2. The full text of this copyright notice as shown in the Artifacts.
-
-THE ARTIFACTS ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE
-ARTIFACTS AND THE IMPLEMENTATION OF THEIR CONTENTS, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE, NON-INFRINGEMENT OR TITLE.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE OR DISTRIBUTION OF THE ARTIFACTS.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Service Component
-Architecture Specification or its contents without specific, written
-prior permission. Title to copyright in the Service Component
-Architecture Specification and the JavaDoc, Interface Definition Files
-and XSD Files will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Revision level 1.1, last updated on 2007/11/19
-
-
================================================================================
The tuscany-assembly-xsd.jar and tuscany-sca-api.jar include files under the following OASIS license:
@@ -2275,7 +2223,7 @@
Original Code Source Code for Your Modifications.]
========================================================================================================
-The jython-2.2.1.jar includes files under the following licenses:
+The jython-2.5.2-beta1.jar includes files under the following licenses:
The Jython License
A. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING JYTHON
diff --git a/distribution/all/src/main/release/launcher/default.config b/distribution/all/src/main/release/launcher/default.config
index d0f68de..7ca60ac 100644
--- a/distribution/all/src/main/release/launcher/default.config
+++ b/distribution/all/src/main/release/launcher/default.config
@@ -16,7 +16,7 @@
#
classpath=modules/**
-mainClass=[firstArgJarManifestMainClass]|org.apache.tuscany.sca.domain.node.DomainNodeMain
+mainClass=[firstArgJarManifestMainClass]|org.apache.tuscany.sca.shell.Shell
-Djava.util.logging.config.file={TUSCANY_HOME}/samples/logging.properties
diff --git a/distribution/all/src/main/release/launcher/tuscany.bat b/distribution/all/src/main/release/launcher/tuscany.bat
index cbf6962..191b02c 100644
--- a/distribution/all/src/main/release/launcher/tuscany.bat
+++ b/distribution/all/src/main/release/launcher/tuscany.bat
@@ -18,8 +18,9 @@
REM # under the License.
REM TODO: can't get these to work yet when using the tribes domaim URI in quotes
-REM if "%1".=="/?". goto help
-REM if "%1".=="-help". goto help
+if "%1".=="/?". goto help
+if "%1".=="-help". goto help
+if "%1".=="-help". goto help
if not "%TUSCANY_HOME%"=="" goto gotHome
SET TUSCANY_HOME=%~dp0\..
@@ -32,13 +33,13 @@
set _XDEBUG=
-if not %1==debug goto skipDebug
+if not "%1"=="debug" goto skipDebug
set _XDEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y
shift
:skipDebug
set _FORK=
-if not %1==fork goto skipFork
+if not "%1"=="fork" goto skipFork
set _FORK=start
shift
:skipFORK
diff --git a/distribution/pom.xml b/distribution/pom.xml
index a35d5a4..1153d8d 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -31,6 +31,12 @@
<name>Apache Tuscany SCA Distributions</name>
<modules>
+ <module>aggregations/base-runtime</module>
+ <module>aggregations/base-runtime-nodep</module>
+ <module>aggregations/base-runtime-aggregation</module>
+ <module>aggregations/binding-rmi-runtime-aggregation</module>
+ <module>aggregations/binding-ws-runtime-axis2-aggregation</module>
+
<module>all</module>
<module>tomcat</module>
</modules>
diff --git a/distribution/tomcat/testing/legal-checks/pom.xml b/distribution/tomcat/testing/legal-checks/pom.xml
index 34ba0fa..4bffcf3 100644
--- a/distribution/tomcat/testing/legal-checks/pom.xml
+++ b/distribution/tomcat/testing/legal-checks/pom.xml
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
+ <artifactId>tuscany-distribution-tomcat-testing</artifactId>
<version>2.0-Beta1</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -29,6 +29,12 @@
<name>Apache Tuscany SCA WAR Distribution Legal Checks</name>
<dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/distribution/tomcat/tomcat-war/pom.xml b/distribution/tomcat/tomcat-war/pom.xml
index 2756da2..72743b1 100644
--- a/distribution/tomcat/tomcat-war/pom.xml
+++ b/distribution/tomcat/tomcat-war/pom.xml
@@ -47,33 +47,10 @@
<version>2.0-Beta1</version>
</dependency>
<dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-webservices</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonp-runtime</artifactId>
+ <artifactId>tuscany-base-runtime</artifactId>
<version>2.0-Beta1</version>
</dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
--->
-
</dependencies>
<build>
diff --git a/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE b/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE
index f4f88da..62a8772 100644
--- a/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE
+++ b/distribution/tomcat/tomcat-war/src/main/webapp/LICENSE
@@ -216,8 +216,6 @@
The following components come under Apache Software License 2.0
cglib-2.2.jar
- hazelcast-1.8.3.jar
- hazelcast-client-1.8.3.jar
swizzle-stream-1.0.2.jar
XmlSchema-1.4.3.jar
diff --git a/features/all/pom.xml b/features/all/pom.xml
index fbed44c..ba1bd1b 100644
--- a/features/all/pom.xml
+++ b/features/all/pom.xml
@@ -32,6 +32,12 @@
<dependencies>
+
+<!-- Change to explicit dependencies to
+ 1/ be absolutely transparent about what's included
+ 2/ install a common approach for features following the base + extensions idea
+ 3/ currently it's a strange mix of features and artifacts.
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-feature-api</artifactId>
@@ -106,6 +112,290 @@
<artifactId>tuscany-tracing-aspectj</artifactId>
<version>2.0-Beta1</version>
</dependency>
+-->
+
+ <!-- base runtimes -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- binding extensions -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom-js-dojo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+<!-- not in distro until build settles down
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+-->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <!-- for now til the base contents is sorted -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonp-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-js-dojo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- implementation extensions -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-jaxrs-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-osgi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-python-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-client</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-widget-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-widget-runtime-dojo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- policy extensions -->
+
+<!-- not in distro until build settles down
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-logging</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+-->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-transaction-runtime-geronimo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- databinding extensions -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo-axiom</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- host extensions -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jee</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jse</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jse-tns</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- registry extensions -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-tribes</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- utilities -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-launcher</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-node</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-myfaces</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-shell</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-tracing-aspectj</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <!-- test dependency of tuscany-tracing-aspectj but previously included in the distro? -->
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.8</version>
+ </dependency>
</dependencies>
diff --git a/features/binding-ws/pom.xml b/features/binding-ws/pom.xml
deleted file mode 100644
index ffa5685..0000000
--- a/features/binding-ws/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-binding-ws</artifactId>
- <name>Apache Tuscany SCA binding.ws Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <!-- Core distribution -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Bindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>addressing</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb-codegen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- </exclusion>
- <exclusion>
- <groupId>opensaml</groupId>
- <artifactId>opensaml</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Databindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Hosts -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/features/core/pom.xml b/features/core/pom.xml
index 3b27501..3111527 100644
--- a/features/core/pom.xml
+++ b/features/core/pom.xml
@@ -230,6 +230,13 @@
<artifactId>tuscany-xsd</artifactId>
<version>2.0-Beta1</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-shell</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
</dependencies>
</project>
diff --git a/features/ejava/pom.xml b/features/ejava/pom.xml
index 2cb825b..9bc1e02 100644
--- a/features/ejava/pom.xml
+++ b/features/ejava/pom.xml
@@ -162,12 +162,7 @@
<!-- Hazelcast registry -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
<version>2.0-Beta1</version>
</dependency>
diff --git a/features/pom.xml b/features/pom.xml
index 23ebbcb..b13b918 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -31,6 +31,14 @@
<name>Apache Tuscany SCA Features</name>
<modules>
+
+ <!--
+ Features
+
+ Somewhat arbitrary and necessarily overlapping collections of Tuscany
+ modules targetted at supporting specific types of application with
+ appropriate groups of function
+ -->
<module>all</module>
<module>api</module>
<module>core</module>
@@ -44,8 +52,7 @@
<!--
<module>manager</module>
<module>repository</module>
--->
- <module>binding-ws</module>
+-->
</modules>
</project>
diff --git a/features/web20/pom.xml b/features/web20/pom.xml
index 7eb709f..70567a9 100644
--- a/features/web20/pom.xml
+++ b/features/web20/pom.xml
@@ -115,12 +115,6 @@
<version>2.0-Beta1</version>
</dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rss-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
<!-- Dojo and Dojo Extensions -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
diff --git a/itest/T3558/pom.xml b/itest/T3558/pom.xml
deleted file mode 100644
index e20591e..0000000
--- a/itest/T3558/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-t3558</artifactId>
- <name>Apache Tuscany SCA iTest T3558</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/itest/base/dependencies/pom.xml b/itest/base/dependencies/pom.xml
deleted file mode 100644
index 7f10c09..0000000
--- a/itest/base/dependencies/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-base-dependencies</artifactId>
- <name>Apache Tuscany SCA iTest Base Dependencies</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Copy all the dependencies so the test can verify only the expected ones get dragged in -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>compile</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java b/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java
deleted file mode 100644
index e9691cb..0000000
--- a/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.sca.itest.base.dependencies;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-/**
- * Test case for verifying the expected dependencies of the base jar
- * (Uses maven-dependency-plugin config in the pom.xml to generate the dependency list)
- *
- * *** NOTE: this is an API! If the dependencies change the API is changed and users will be broken.
- * Don't just change the list without thinking about the consequencies
- *
- * Current required jars are:
- * asm-3.1.jar
- * cglib-2.2.jar
- * hazelcast-1.8.3.jar
- * hazelcast-client-1.8.3.jar
- * tuscany-base-2.0-SNAPSHOT.jar
- * wsdl4j-1.6.2.jar
- * XmlSchema-1.4.3.jar
- *
- * junit-4.8.1.jar (only from this testcase)
- *
- */
-public class ValidateDependenciesTestCase {
-
- @Test
- public void countDependencies() {
-
- File dependenciesDir = new File("target/dependency");
- Assert.assertTrue(dependenciesDir.exists());
-
- File[] dependencyFiles = dependenciesDir.listFiles();
- Assert.assertEquals(8, dependencyFiles.length);
- }
-}
diff --git a/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java b/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
deleted file mode 100644
index 86e6e4e..0000000
--- a/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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 helloworld;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests the BPEL Helloworld Service
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldTestCase {
-
- private static Node node;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUp() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("helloworld/helloworld.composite");
- node = NodeFactory.newInstance().createNode("helloworld/helloworld.composite", new Contribution("c1", location));
- node.start();
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void testServiceInvocation() throws Exception {
- HelloPortType bpelService = node.getService(HelloPortType.class, "BPELHelloWorldService");
- String response = bpelService.hello("Hello");
- Assert.assertEquals("Hello World", response);
- }
-
- @Test
- public void testReferenceInvocation() throws Exception {
- HelloWorld bpelService = node.getService(HelloWorld.class, "BPELHelloWorld");
- String response = bpelService.hello("Hello");
- Assert.assertEquals("Hello World", response);
- }
-}
diff --git a/itest/builder/pom.xml b/itest/builder/pom.xml
deleted file mode 100644
index 96983b4..0000000
--- a/itest/builder/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-builder</artifactId>
- <name>Apache Tuscany SCA iTest Builder</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java b/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
deleted file mode 100644
index e2fda0e..0000000
--- a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
+++ /dev/null
@@ -1,814 +0,0 @@
-/*
- * 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.sca.itest.builder;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.xml.namespace.QName;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Load and build some composites and inspect the results.
- *
- * @version $Rev$ $Date$
- */
-public class BuilderTestCase {
- private CustomCompositeBuilder customBuilder;
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- /* OASIS doesn't take notice of top level composite services
- *
- // Scenario 1: <binding.ws> on outer composite service CompositeA/Service1
- @Ignore
- @Test
- public void testScenario1() throws Exception {
- System.out.println("====>Running testScenario1");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario1Results(false);
- }
-
- @Ignore
- @Test
- public void testScenario1NonWiring() throws Exception {
- System.out.println("====>Running testScenario1NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario1Results(true);
- }
-
- private void checkScenario1Results(boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- if (!nonWiring) {
- // Should create component service $promoted$Service1 on innermost component
- // ComponentD, with <binding.ws> and uri="/Service1"
- // No other services on ComponentD should have <binding.ws>
- WebServiceBinding wsBinding = null;
- for (ComponentService service : componentD.getServices()) {
- WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
- if ("$promoted$Service1".equals(service.getName())) {
- wsBinding = wsb;
- } else {
- assert wsb == null;
- }
- }
- assert "/Service1".equals(wsBinding.getURI());
-
- // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
- Definition def = wsBinding.getWSDLDocument();
- javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- Port port = svc.getPort("Service3Port");
- assert "/Service1".equals(TestUtils.getPortAddress(port));
- } else {
- // Should not create component service $promoted$Service1 on innermost component ComponentD
- // No component services on ComponentD should have <binding.ws>
- for (ComponentService service : componentD.getServices()) {
- assert !"$promoted$Service1".equals(service.getName());
- assert service.getBinding(WebServiceBinding.class) == null;
- }
- }
-
- // No services on ComponentB should have <binding.ws>
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- for (ComponentService service : componentB.getServices()) {
- assert service.getBinding(WebServiceBinding.class) == null;
- }
-
- // No services on CompositeC should have <binding.ws>
- Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario1", "CompositeC"));
- for (Service service : compositeC.getServices()) {
- assert service.getBinding(WebServiceBinding.class) == null;
- }
-
- if (nonWiring) {
- // Should not add a WSDL document to domain composite service Service1
- WebServiceBinding wsBinding = null;
- for (Service service : domainComposite.getServices()) {
- if ("Service1".equals(service.getName())) {
- wsBinding = service.getBinding(WebServiceBinding.class);
- }
- }
- assert wsBinding.getWSDLDocument() == null;
- }
-
- String expectedEndpoints = "Component - ComponentB\n" +
- "Service - Service2\n" +
- "Endpoint - Service2\n" +
- "Service - Service2a\n" +
- "Endpoint - Service2a\n" +
- "Reference - reference2\n" +
- "Component - ComponentB has composite impl\n" +
- " Component - ComponentD\n" +
- " Service - Service3\n" +
- " Endpoint - Service3\n" +
- " Service - Service3a\n" +
- " Endpoint - Service3a\n" +
- " Reference - reference3";
-
- String actualEndpoints = TestUtils.printEndpoints(domainComposite);
- System.out.println(actualEndpoints);
-
- Assert.assertEquals(expectedEndpoints, actualEndpoints);
- }
-*/
-
- // Scenario 2: <binding.ws> on outer component service ComponentB/Service2
- @Test
- public void testScenario2() throws Exception {
- System.out.println("====>Running testScenario2");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario2and3Results("http://scenario2", false);
- }
-
- public void testScenario2NonWiring() throws Exception {
- System.out.println("====>Running testScenario2NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario2and3Results("http://scenario2", true);
- }
-
- private void checkScenario2and3Results(String namespace, boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- // Test that endpoint structure matches expected
- String structure = TestUtils.printStructure(domainComposite, "");
- System.out.println(structure);
-
- String expectedStructure = "Component URI - ComponentB\n" +
- " Component URI - ComponentB/ComponentD\n" +
- " Endpoint: URI = ComponentB/ComponentD#service-binding(Service3/Service3) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n" +
- " Endpoint: URI = ComponentB/ComponentD#service-binding(Service3a/Service3a) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n" +
- "Endpoint: URI = ComponentB#service-binding(Service2/Service2) org.apache.tuscany.sca.binding.ws.impl.WebServiceBindingImpl\n" +
- "Endpoint: URI = ComponentB#service-binding(Service2a/Service3a) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n";
-
- Assert.assertEquals(expectedStructure, structure);
-
- // Test that generated WSDL matches expected
- // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
- // No other services on ComponentB should have <binding.ws>
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- WebServiceBinding wsBinding = null;
-
- for (ComponentService service : componentB.getServices()) {
- WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
- if ("Service2".equals(service.getName())) {
- wsBinding = wsb;
- } else {
- assert wsb == null;
- }
- }
-
- Definition def = wsBinding.getGeneratedWSDLDocument();
- TestUtils.writeWSDL(def);
-
- javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- Port port = svc.getPort("Service3Port");
- Assert.assertEquals("/ComponentB/Service2",TestUtils.getPortAddress(port));
-
- }
-/*
- // Scenario 3: <binding.ws> on inner composite service CompositeC/Service2
- public void testScenario3() throws Exception {
- System.out.println("====>Running testScenario3");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario2and3Results("http://scenario3", false);
- }
-
- public void testScenario3NonWiring() throws Exception {
- System.out.println("====>Running testScenario3NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario2and3Results("http://scenario3", true);
- }
-
- // Scenario 4: <binding.ws> on inner component service ComponentD/Service3
- public void testScenario4() throws Exception {
- System.out.println("====>Running testScenario4");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario4Results(false);
- }
-
- public void testScenario4NonWiring() throws Exception {
- System.out.println("====>Running testScenario4NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario4Results(true);
- }
-
- private void checkScenario4Results(boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- // Should create WSDL document for ComponentD/Service3 with endpoint uri="/ComponentD/Service3"
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- WebServiceBinding wsBinding = null;
- for (ComponentService service : componentD.getServices()) {
- if ("Service3".equals(service.getName())) {
- wsBinding = service.getBinding(WebServiceBinding.class);
- }
- }
- Definition def = wsBinding.getWSDLDocument();
- javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- Port port = svc.getPort("Service3Port");
- assert "/ComponentB/ComponentD/Service3".equals(TestUtils.getPortAddress(port));
-
- // Should add <binding.ws> to inner composite service CompositeC/Service2
- // No other services on CompositeC should have <binding.ws>
- Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario4", "CompositeC"));
- wsBinding = null;
- for (Service service : compositeC.getServices()) {
- WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
- if ("Service2".equals(service.getName())) {
- wsBinding = wsb;
- } else {
- assert wsb == null;
- }
- }
- assert "/ComponentB/Service2".equals(wsBinding.getURI());
-
- // Should add <binding.ws> to outer component service ComponentB/Service2
- // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
- // No other services on ComponentB should have <binding.ws>
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- wsBinding = null;
- for (ComponentService service : componentB.getServices()) {
- WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
- if ("Service2".equals(service.getName())) {
- wsBinding = wsb;
- } else {
- assert wsb == null;
- }
- }
- assert "/ComponentB/Service2".equals(wsBinding.getURI());
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- port = svc.getPort("Service3Port");
- assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
-
- if (!nonWiring) {
- // Should create component service $promoted$ComponentB$slash$Service2 on innermost component
- // ComponentD, with <binding.ws> and uri="/ComponentB/Service2"
- wsBinding = null;
- for (ComponentService service : componentD.getServices()) {
- if ("$promoted$ComponentB$slash$Service2".equals(service.getName())) {
- wsBinding = service.getBinding(WebServiceBinding.class);
- }
- }
- assert "/ComponentB/Service2".equals(wsBinding.getURI());
-
- // Should create WSDL document for ComponentD/$promoted$ComponentB$slash$Service2 with endpoint uri="/ComponentB/Service2"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- port = svc.getPort("Service3Port");
- assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
- } else {
- // Should not create component service $promoted$ComponentB$slash$Service2 on innermost component ComponentD
- for (ComponentService service : componentD.getServices()) {
- assert !"$promoted$ComponentB$slash$Service2".equals(service.getName());
- }
- }
-
- // Should add <binding.ws> to outer composite service CompositeA/Service1
- wsBinding = null;
- for (Service service : domainComposite.getServices()) {
- if ("Service1".equals(service.getName())) {
- wsBinding = service.getBinding(WebServiceBinding.class);
- }
- }
- assert wsBinding != null;
- if (nonWiring) {
- // Should not add a WSDL document to domain composite service Service1
- assert wsBinding.getWSDLDocument() == null;
- }
-
- if (!nonWiring) {
- // Should create component service $promoted$Service1 on innermost component
- // ComponentD, with <binding.ws> and uri="/Service1"
- wsBinding = null;
- for (ComponentService service : componentD.getServices()) {
- if ("$promoted$Service1".equals(service.getName())) {
- wsBinding = service.getBinding(WebServiceBinding.class);
- }
- }
- assert "/Service1".equals(wsBinding.getURI());
-
- // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
- port = svc.getPort("Service3Port");
- assert "/Service1".equals(TestUtils.getPortAddress(port));
- } else {
- // Should not create component service $promoted$.Service1 on innermost component ComponentD
- for (ComponentService service : componentD.getServices()) {
- assert !"$promoted$Service1".equals(service.getName());
- }
- }
-
- // No services on ComponentD should have <binding.ws>, except for Service3,
- // $promoted$.Service1 and $promoted$.ComponentB.Service2
- for (ComponentService service : componentD.getServices()) {
- if (!"Service3".equals(service.getName()) &&
- !"$promoted$Service1".equals(service.getName()) &&
- !"$promoted$ComponentB$slash$Service2".equals(service.getName())) {
- assert service.getBinding(WebServiceBinding.class) == null;
- }
- }
- }
-
- // Scenario 5: <binding.ws> and <interface.wsdl> on outer composite reference CompositeA/reference1
- @Test
- public void testScenario5() throws Exception {
- System.out.println("====>Running testScenario5");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario5Results(false);
- }
-
- @Test
- public void testScenario5NonWiring() throws Exception {
- System.out.println("====>Running testScenario5NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario5Results(true);
- }
-
- private void checkScenario5Results(boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- // Should not add <binding.ws> to any outer component references
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- for (ComponentReference reference : componentB.getReferences()) {
- assert reference.getBinding(WebServiceBinding.class) == null;
- }
-
- Definition def;
- javax.wsdl.Service svc;
- Port port;
- WebServiceBinding wsBinding;
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- if (!nonWiring) {
- // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
- // Should set <interface.wsdl> on inner component reference ComponentD/reference3
- wsBinding = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
- }
- }
- assert "http://foo.com/bar".equals(wsBinding.getURI());
-
- // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
- port = svc.getPort("Service3aPort");
- assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
- } else {
- // Should not add <binding.ws> to any inner component references
- for (ComponentReference reference : componentD.getReferences()) {
- assert reference.getBinding(WebServiceBinding.class) == null;
- }
- }
-
- // Should not add <binding.ws> or <interface.wsdl> to inner composite reference CompositeC/reference2
- Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario5", "CompositeC"));
- for (Reference reference : compositeC.getReferences()) {
- assert reference.getBinding(WebServiceBinding.class) == null;
- assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
- }
-
- String expectedEndpoints = "Component - ComponentB\n" +
- "Service - Service2\n" +
- "Endpoint - Service2\n" +
- "Service - Service2a\n" +
- "Endpoint - Service2a\n" +
- "Reference - reference2\n" +
- "Component - ComponentB has composite impl\n" +
- " Component - ComponentD\n" +
- " Service - Service3\n" +
- " Endpoint - Service3\n" +
- " Service - Service3a\n" +
- " Endpoint - Service3a\n" +
- " Reference - reference3";
-
- String actualEndpoints = TestUtils.printEndpoints(domainComposite);
- System.out.println(actualEndpoints);
-
- Assert.assertEquals(expectedEndpoints, actualEndpoints);
- }
-
-
- // Scenario 6: <binding.ws> and <interface.wsdl> on outer component reference ComponentB/reference2
- @Ignore
- @Test
- public void testScenario6() throws Exception {
- System.out.println("====>Running testScenario6");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario6and7Results("http://scenario6", false);
- }
-
- @Ignore
- @Test
- public void testScenario6NonWiring() throws Exception {
- System.out.println("====>Running testScenario6NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario6and7Results("http://scenario6", true);
- }
-
- private void checkScenario6and7Results(String namespace, boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- // Should remove target= on ComponentB/reference2 (for Scenario 6) or
- // CompositeC/reference2 (for Scenario 7), and add uri="http://foo.com/bar"
- // to the <binding.ws> element on ComponentB/reference2
- // For nonWiring, ComponentB/reference2 should have target=
- // and no uri= should be added
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- WebServiceBinding wsBinding = null;
- for (ComponentReference reference : componentB.getReferences()) {
- if ("reference2".equals(reference.getName())) {
- if (!nonWiring) {
- assert reference.getTargets().size() == 0;
- } else {
- assert reference.getTargets().size() == 1;
- }
- wsBinding = reference.getBinding(WebServiceBinding.class);
- }
- }
- if (!nonWiring) {
- assert "http://foo.com/bar".equals(wsBinding.getURI());
- } else {
- assert wsBinding.getURI() == null;
- }
-
- Definition def;
- javax.wsdl.Service svc;
- Port port;
- if (!nonWiring) {
- // Should create WSDL document for ComponentB/reference2 with endpoint uri="http://foo.com/bar"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
- port = svc.getPort("Service3aPort");
- assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
- }
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- if (!nonWiring) {
- // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
- // Should set <interface.wsdl> on inner component reference ComponentD/reference3
- wsBinding = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getBindings().size() == 1;
- assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
- }
- }
- assert "http://foo.com/bar".equals(wsBinding.getURI());
-
- // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
- port = svc.getPort("Service3aPort");
- assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
- } else {
- // Should not add <binding.ws> to any inner component references
- for (ComponentReference reference : componentD.getReferences()) {
- assert reference.getBinding(WebServiceBinding.class) == null;
- }
- }
-
- // No references on CompositeC should have <binding.ws> or <interface.wsdl>, except for
- // reference2 in Scenario 7
- Composite compositeC = TestUtils.getComposite(domainComposite, new QName(namespace, "CompositeC"));
- for (Reference reference : compositeC.getReferences()) {
- if ("http://scenario7".equals(namespace) && "reference2".equals(reference.getName())) {
- assert reference.getBinding(WebServiceBinding.class)!= null;
- assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
- } else {
- assert reference.getBinding(WebServiceBinding.class) == null;
- assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
- }
- }
-
- // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
- wsBinding = null;
- for (Reference reference : domainComposite.getReferences()) {
- if ("reference1".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
- }
- }
- assert wsBinding.getURI() == null;
-
- // Should not add a WSDL document to domain composite reference reference1
- assert wsBinding.getWSDLDocument() == null;
-
- String expectedEndpoints = "Component - ComponentB\n" +
- "Service - Service2\n" +
- "Endpoint - Service2\n" +
- "Service - Service2a\n" +
- "Endpoint - Service2a\n" +
- "Reference - reference2\n" +
- "Component - ComponentB has composite impl\n" +
- " Component - ComponentD\n" +
- " Service - Service3\n" +
- " Endpoint - Service3\n" +
- " Service - Service3a\n" +
- " Endpoint - Service3a\n" +
- " Reference - reference3";
-
- String actualEndpoints = TestUtils.printEndpoints(domainComposite);
- System.out.println(actualEndpoints);
-
- Assert.assertEquals(expectedEndpoints, actualEndpoints);
- }
-
- // Scenario 7: <binding.ws> and <interface.wsdl> on inner composite reference CompositeC/reference2
- public void testScenario7() throws Exception {
- System.out.println("====>Running testScenario7");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario6and7Results("http://scenario7", false);
- }
-
- public void testScenario7NonWiring() throws Exception {
- System.out.println("====>Running testScenario7NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario6and7Results("http://scenario7", true);
- }
-
- // Scenario 8: <binding.ws> and <interface.wsdl> on inner component reference ComponentD/reference3
- public void testScenario8() throws Exception {
- System.out.println("====>Running testScenario8");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario8Results(false);
- }
-
- public void testScenario8NonWiring() throws Exception {
- System.out.println("====>Running testScenario8NonWiring");
- customBuilder = new CustomCompositeBuilder(true);
- customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario8Results(true);
- }
-
- private void checkScenario8Results(boolean nonWiring) {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- // Should replace target= on ComponentD/reference3 by uri="http://foo.com/bar" on <binding.ws>
- // For nonWiring, the original target= is preserved and there is no uri=
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- WebServiceBinding wsBinding = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3".equals(reference.getName())) {
- if (!nonWiring) {
- assert reference.getTargets().size() == 0;
- } else {
- assert reference.getTargets().size() == 1;
- }
- wsBinding = reference.getBinding(WebServiceBinding.class);
- }
- }
- if (!nonWiring) {
- assert "http://foo.com/bar".equals(wsBinding.getURI());
- } else {
- assert wsBinding.getURI() == null;
- }
-
- Definition def;
- javax.wsdl.Service svc;
- Port port;
- if (!nonWiring) {
- // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
- def = wsBinding.getWSDLDocument();
- svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
- port = svc.getPort("Service3aPort");
- assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
- }
-
- // Should add <binding.ws> and <interface.wsdl> to inner composite reference CompositeC/reference2
- Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario8", "CompositeC"));
- wsBinding = null;
- for (Reference reference : compositeC.getReferences()) {
- if ("reference2".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
- }
- }
- assert wsBinding.getURI() == null;
-
- // Should add <binding.ws> and <interface.wsdl> to outer component reference ComponentB/reference2
- Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
- wsBinding = null;
- for (ComponentReference reference : componentB.getReferences()) {
- if ("reference2".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
- }
- }
- assert wsBinding.getURI() == null;
-
- // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
- wsBinding = null;
- for (Reference reference : domainComposite.getReferences()) {
- if ("reference1".equals(reference.getName())) {
- wsBinding = reference.getBinding(WebServiceBinding.class);
- assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
- }
- }
- assert wsBinding.getURI() == null;
-
- // Should not add a WSDL document to domain composite reference reference1
- assert wsBinding.getWSDLDocument() == null;
- }
-
- // Scenario 9: target in reference CDR3A and binding.ws uri= at CAR1A
- public void testScenario9() throws Exception {
- System.out.println("====>Running testScenario9");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario9.composite", "TestContribution", "src/main/resources/scenario9/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario9Results();
- }
-
- private void checkScenario9Results() {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- ComponentReference componentRef = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3a".equals(reference.getName())) {
- componentRef = reference;
- assertTrue(reference.getBindings().size() == 2);
- assertTrue(reference.getBindings().get(0) instanceof SCABinding);
- assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
- }
- }
- assertTrue(componentRef != null);
- }
-
- // Scenario 10: targets in references CBR2A and CDR3A and binding.ws at CBR2A
- public void testScenario10() throws Exception {
- System.out.println("====>Running testScenario10");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario10.composite", "TestContribution", "src/main/resources/scenario10/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario10And11Results();
- }
-
- // Scenario 11: targets in references CBR2A and CDR3A and binding.ws at CCR2A
- public void testScenario11() throws Exception {
- System.out.println("====>Running testScenario11");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario11.composite", "TestContribution", "src/main/resources/scenario11/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario10And11Results();
- }
-
- private void checkScenario10And11Results() {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- ComponentReference componentRef = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3a".equals(reference.getName())) {
- componentRef = reference;
- assertTrue(reference.getBindings().size() == 2);
- Binding binding1 = reference.getBindings().get(0);
- assertTrue(binding1 instanceof SCABinding);
- assertTrue(reference.getInterfaceContract(binding1) instanceof JavaInterfaceContract);
- Binding binding2 = reference.getBindings().get(1);
- assertTrue(binding2 instanceof WebServiceBinding);
- assertTrue(reference.getInterfaceContract(binding2) instanceof WSDLInterfaceContract);
- }
- }
- assertTrue(componentRef != null);
- }
-
- // Scenario 12: targets in references CBR2A and CDR3A and binding.ws at CDR3A
- public void testScenario12() throws Exception {
- System.out.println("====>Running testScenario12");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario12.composite", "TestContribution", "src/main/resources/scenario12/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario12Results();
- }
-
- private void checkScenario12Results() {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- ComponentReference componentRef = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3a".equals(reference.getName())) {
- componentRef = reference;
- assertTrue(reference.getBindings().size() == 2);
- assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
- assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
- }
- }
- assertTrue(componentRef != null);
- }
-
- // Scenario 13: target in reference CDR3A
- public void testScenario13() throws Exception {
- System.out.println("====>Running testScenario13");
- customBuilder = new CustomCompositeBuilder(false);
- customBuilder.loadContribution("scenario13.composite", "TestContribution", "src/main/resources/scenario13/");
- //TestUtils.printResults(customBuilder);
- TestUtils.checkProblems(customBuilder);
- checkScenario13Results();
- }
-
- private void checkScenario13Results() {
- Composite domainComposite = customBuilder.getDomainComposite();
-
- Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
- ComponentReference componentRef = null;
- for (ComponentReference reference : componentD.getReferences()) {
- if ("reference3a".equals(reference.getName())) {
- componentRef = reference;
- assertTrue(reference.getBindings().size() == 1);
- assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
- }
- }
- assertTrue(componentRef != null);
- }
-*/
-}
diff --git a/itest/callback-two-nodes/pom.xml b/itest/callback-two-nodes/pom.xml
deleted file mode 100644
index 4ac8ccc..0000000
--- a/itest/callback-two-nodes/pom.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-callback-two-nodes</artifactId>
- <name>Apache Tuscany SCA iTest Callback Two Nodes</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <properties>
- <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
- <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
- </properties>
-</project>
diff --git a/itest/distribution/bin-distro-unzip/build.xml b/itest/distribution/bin-distro-unzip/build.xml
deleted file mode 100644
index 6c4b1fd..0000000
--- a/itest/distribution/bin-distro-unzip/build.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- * 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 name="itest-unzip" default="unzip">
-
- <target name="unzip">
- <delete dir="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir"/>
- <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.zip"
- dest="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir"/>
- </target>
-
-</project>
diff --git a/itest/distribution/contribution-binding-rmi-calculator/build.xml b/itest/distribution/contribution-binding-rmi-calculator/build.xml
deleted file mode 100644
index 86afb7a..0000000
--- a/itest/distribution/contribution-binding-rmi-calculator/build.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
- <ant antfile="build.xml"
- dir="${distro.root}/samples/binding-rmi/contribution-calculator-reference"/>
- <ant antfile="build.xml"
- dir="${distro.root}/samples/binding-rmi/contribution-calculator-service"/>
- </target>
-
-</project>
diff --git a/itest/distribution/contribution-binding-sca-calculator/build.xml b/itest/distribution/contribution-binding-sca-calculator/build.xml
deleted file mode 100644
index bd5f247..0000000
--- a/itest/distribution/contribution-binding-sca-calculator/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/binding-sca/contribution-calculator"/>
-
- </target>
-
-</project>
diff --git a/itest/distribution/contribution-binding-ws-calculator/build.xml b/itest/distribution/contribution-binding-ws-calculator/build.xml
deleted file mode 100644
index de8ea97..0000000
--- a/itest/distribution/contribution-binding-ws-calculator/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/contribution-binding-ws-calculator"/>
-
- </target>
-
-</project>
diff --git a/itest/distribution/contribution-implementation-java-calculator/build.xml b/itest/distribution/contribution-implementation-java-calculator/build.xml
deleted file mode 100644
index 52704f4..0000000
--- a/itest/distribution/contribution-implementation-java-calculator/build.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/contribution-implementation-java-calculator"/>
-
- </target>
-
-</project>
diff --git a/itest/distribution/launcher-embedded-jse/build.xml b/itest/distribution/launcher-embedded-jse/build.xml
deleted file mode 100644
index cd569b3..0000000
--- a/itest/distribution/launcher-embedded-jse/build.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant dir="${distro.root}/samples/launcher-embedded-jse"
- target="run-contribution-binding-sca-calculator">
- </ant>
-
- </target>
-
-</project>
diff --git a/itest/distribution/launcher-embedded-osgi/build.xml b/itest/distribution/launcher-embedded-osgi/build.xml
deleted file mode 100644
index c6874ed..0000000
--- a/itest/distribution/launcher-embedded-osgi/build.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- * 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 name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
-<!-- Seems to be hanging in the console at the end of the OSGi run
- configure it to run no tests for now
- <ant dir="${distro.root}/samples/launcher-embedded-osgi"
- target="run-contribution-binding-sca-calculator"/>
--->
-
- <ant dir="${distro.root}/samples/launcher-embedded-osgi"/>
-
- </target>
-
-</project>
diff --git a/itest/distribution/legal-checks/pom.xml b/itest/distribution/legal-checks/pom.xml
deleted file mode 100644
index 21937fe..0000000
--- a/itest/distribution/legal-checks/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-legal-checks</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Legal Checks</name>
-
- <profiles>
- <profile>
- <id>distribution</id>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.6</version>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <basedir>../../../distribution/all/target/apache-tuscany-sca-all-2.0-Beta1.dir</basedir>
- <excludeSubProjects>false</excludeSubProjects>
- <excludes>
- <exclude>tuscany-sca-2.0-Beta1/CHANGES</exclude>
- <exclude>**/MANIFEST.MF</exclude>
- <exclude>**/target/**/*.log</exclude>
- <exclude>tuscany-sca-2.0-Beta1/features/configuration/config.ini</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
deleted file mode 100644
index 2fdbf62..0000000
--- a/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * 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 itest;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.junit.Test;
-
-/**
- * Checks that all jar files included in the distribution are mentioned in the LICENSE file
- * and that all jars mentioned in the LICENSE are in the distribution.
- */
-public class JarsInLICENSETestCase {
-
- @Test
- public void testJars() throws Exception {
- File distroRoot = getUnzipedDistroRoot();
-
- File licenseFile = new File(distroRoot, "LICENSE");
- if (!licenseFile.exists()) {
- throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
- }
-
- File libDirectory = new File(distroRoot, "modules");
- if (!libDirectory.exists()) {
- throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
- }
-
- List<String> jars = getJarsInDistro(libDirectory);
-
- List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
- if (bad2.size() > 0) {
- System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
- }
-
- List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
- if (bad1.size() > 0) {
- System.err.println("Jars in distribution but not in LICENSE: " + bad1);
- }
-
- if (bad1.size() > 0 || bad2.size() > 0) {
- throw new IllegalStateException("LICENSE problems, check log");
- }
- }
-
- private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
- List<String> badJars = new ArrayList<String>();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- String line = null;
- while ((line = reader.readLine()) != null) {
- line = line.trim();
- if (line.contains(".jar")) {
- StringTokenizer st = new StringTokenizer(line);
- while (st.hasMoreTokens()) {
- String s = st.nextToken();
- if (s.contains(".jar")) {
- if (s.startsWith("(")) {
- s = s.substring(1);
- }
- if (s.endsWith(",") || s.endsWith(":")) {
- s = s.substring(0, s.length()-1);
- }
- if (s.endsWith(")")) {
- s = s.substring(0, s.length()-1);
- }
- if (!jars.contains(s) && !s.startsWith("tuscany-")) {
- badJars.add(s);
- }
- }
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
- List<String> badJars = new ArrayList<String>();
- String licenseText = readLICENSE(licenseFile);
- for (String jar : jars) {
- if (!licenseText.contains(jar)) {
- if (jar.startsWith("tuscany-") || jar.startsWith("sample-") || jar.startsWith("test-") || jar.startsWith("itest-")) {
- // ignore tuscany jars as they're not mentioned in the LICENSE file
- } else {
- badJars.add(jar);
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsInDistro(File directory) {
- List<String> jars = new ArrayList<String>();
- for (String fn : directory.list()){
- if (fn.endsWith(".jar")) {
- jars.add(fn);
- } else {
- File f = new File(directory, fn);
- if (f.isDirectory()) {
- jars.addAll(getJarsInDistro(f));
- }
- }
- }
- return jars;
- }
-
- private File getUnzipedDistroRoot() {
- File distroTarget = new File("../../../distribution/all/target");
- File root = null;
- for (String f : distroTarget.list()) {
- if (f.endsWith(".dir")) {
- root = new File(distroTarget, f);
- break;
- }
- }
- if (root == null) {
- throw new IllegalStateException("can't find distro root");
- }
- if (root.list().length != 1) {
- throw new IllegalStateException("expecting one directory in distro root");
- }
- root = new File(root, root.list()[0]);
- return root;
- }
-
- private static String readLICENSE(File licenseFile) throws java.io.IOException {
- StringBuffer fileData = new StringBuffer();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- char[] buf = new char[1024];
- int numRead = 0;
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf, 0, numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- reader.close();
- return fileData.toString();
- }
-
-}
diff --git a/itest/distribution/pom.xml b/itest/distribution/pom.xml
deleted file mode 100644
index ee5a55a..0000000
--- a/itest/distribution/pom.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <packaging>pom</packaging>
- <artifactId>itest-distribution</artifactId>
- <name>Apache Tuscany SCA iTest Distribution</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-all</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>legal-checks</module>
- <module>contribution-binding-sca-calculator</module>
- <module>contribution-binding-ws-calculator</module>
- <module>contribution-binding-rmi-calculator</module>
- <module>contribution-implementation-java-calculator</module>
- <module>launcher-embedded-jse</module>
- <module>launcher-embedded-osgi</module>
- </modules>
- </profile>
-
- <profile>
- <id>distribution</id>
- <activation>
- <property>
- <name>buildZips</name>
- <value>true</value>
- </property>
- </activation>
- <modules>
- <module>src-distro-unzip</module>
- <module>src-distro-rat</module>
- <module>bin-distro-unzip</module>
- <module>legal-checks</module>
- <module>contribution-binding-sca-calculator</module>
- <module>contribution-binding-ws-calculator</module>
- <module>contribution-binding-rmi-calculator</module>
- <module>contribution-implementation-java-calculator</module>
- <module>launcher-embedded-jse</module>
- <module>launcher-embedded-osgi</module>
- </modules>
- </profile>
- </profiles>
-
- <build>
- <defaultGoal>install</defaultGoal>
- </build>
-
-</project>
diff --git a/itest/distribution/src-distro-rat/pom.xml b/itest/distribution/src-distro-rat/pom.xml
deleted file mode 100644
index 40703cb..0000000
--- a/itest/distribution/src-distro-rat/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-src-dsitro-rat</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Src Distro RAT</name>
-
- <profiles>
- <profile>
- <id>distribution</id>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-src-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <version>0.6</version>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <basedir>../../../distribution/all/target/apache-tuscany-sca-all-2.0-Beta1-src.dir</basedir>
- <excludeSubProjects>false</excludeSubProjects>
- <excludes>
- <exclude>tuscany-sca-2.0-Beta1-src/CHANGES</exclude>
- <exclude>**/*.MF</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/compliance-tests/binding-ws/sca_variables.dtd</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/repository/modules/modules.list</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/repository/services/services.list</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.schemas</exclude>
-
- <!-- these ones we need to implement RAT license processors to handle the non-AL headers, just exclude for now -->
- <exclude>tuscany-sca-2.0-Beta1-src/modules/assembly-xsd/**/*.*</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/sca-api/**/*.*</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-web-runtime/src/main/resources/META-INF/sca.tld</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/assembly-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd03.xml</exclude>
- <exclude>tuscany-sca-2.0-Beta1-src/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryFinderImpl.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/itest/distribution/src-distro-unzip/build.xml b/itest/distribution/src-distro-unzip/build.xml
deleted file mode 100644
index c98e19b..0000000
--- a/itest/distribution/src-distro-unzip/build.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- * 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 name="itest-unzip" default="unzip">
-
- <target name="unzip">
- <delete dir="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.dir"/>
- <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.zip"
- dest="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.dir"/>
- </target>
-
-</project>
diff --git a/itest/domains/distributed/pom.xml b/itest/domains/distributed/pom.xml
deleted file mode 100644
index 2b6be65..0000000
--- a/itest/domains/distributed/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>itest-domains-distributed</artifactId>
- <name>Apache Tuscany SCA itest domain distributed</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
diff --git a/itest/implementation-spring/pom.xml b/itest/implementation-spring/pom.xml
deleted file mode 100644
index 68ff317..0000000
--- a/itest/implementation-spring/pom.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-implementation-spring</artifactId>
- <name>Apache Tuscany SCA iTest Spring Implementation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Spring dependencies... -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>3.0.2.RELEASE</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>3.0.2.RELEASE</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>3.0.2.RELEASE</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml b/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml
deleted file mode 100644
index 42e0cdb..0000000
--- a/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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.
--->
-<!-- Application context for the SpringExplicitHelloWorld testcase
-In this case, the service offered by the Spring application is specified
-explicitly using an sca:service element -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="fooService"
- type="helloworld.HelloWorld"
- target="testBean"/>
-
- <bean id="testBean"
- class="mock.TestHelloWorldBean"
- lazy-init="true">
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/itest/import-export/tests/pom.xml b/itest/import-export/tests/pom.xml
deleted file mode 100644
index f6fa41a..0000000
--- a/itest/import-export/tests/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-import-export-tests</artifactId>
- <name>Apache Tuscany SCA iTest Import Export Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/itest/jms/DynamicReplyQ/pom.xml b/itest/jms/DynamicReplyQ/pom.xml
deleted file mode 100644
index 2d89aa2..0000000
--- a/itest/jms/DynamicReplyQ/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-dynamic-replyq</artifactId>
- <name>Apache Tuscany SCA iTest JMS with dynamic replyq</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/args/pom.xml b/itest/jms/args/pom.xml
deleted file mode 100644
index b2673e1..0000000
--- a/itest/jms/args/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-args</artifactId>
- <name>Apache Tuscany SCA iTest JMS Args</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- uses ActiveMQ 5.1 as 4.1 Session.createQueue does not work using
- a temporary queue name -->
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
diff --git a/itest/jms/args/src/main/resources/jndi.properties b/itest/jms/args/src/main/resources/jndi.properties
deleted file mode 100644
index 7ce468a..0000000
--- a/itest/jms/args/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory, ConnectionFactory2
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-topic.ServiceTopic = ServiceTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/args/src/main/resources/selectors/selectors.composite b/itest/jms/args/src/main/resources/selectors/selectors.composite
deleted file mode 100644
index 827d3a7..0000000
--- a/itest/jms/args/src/main/resources/selectors/selectors.composite
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="DefinitionsTests">
-
- <component name="Client1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:MyService" />
- </reference>
- </component>
-
- <component name="Service1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
- <service name="MyService">
- <binding.jms />
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/callbacks/pom.xml b/itest/jms/callbacks/pom.xml
deleted file mode 100644
index cdeb02c..0000000
--- a/itest/jms/callbacks/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-jms-callbacks</artifactId>
- <name>Apache Tuscany SCA iTest JMS Tests For Callbacks</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- uses ActiveMQ 5.1 as 4.1 Session.createQueue does not work using
- a temporary queue name -->
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/callbacks/src/main/resources/jndi.properties b/itest/jms/callbacks/src/main/resources/jndi.properties
deleted file mode 100644
index be362c5..0000000
--- a/itest/jms/callbacks/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.ServiceQueue = ServiceQueue
-queue.ServiceQueue = TQServiceQueue
-queue.CallbackQueue = CallbackQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/callbacks/src/main/resources/simple/client.composite b/itest/jms/callbacks/src/main/resources/simple/client.composite
deleted file mode 100644
index 671fdda..0000000
--- a/itest/jms/callbacks/src/main/resources/simple/client.composite
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="CallbackClientComposite">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSClientImpl" />
- <reference name="myService">
- <binding.jms uri="jms:ServiceQueue"/>
- <callback>
- <binding.jms uri="jms:CallbackQueue"/>
- </callback>
- </reference>
- </component>
-
- <component name="ServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSServiceImpl" />
- <service name="JMSService">
- <binding.jms uri="jms:ServiceQueue"/>
- <callback>
- <binding.jms uri="jms:CallbackQueue"/>
- </callback>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/callbacks/src/main/resources/simple/tempq.composite b/itest/jms/callbacks/src/main/resources/simple/tempq.composite
deleted file mode 100644
index e140bdf..0000000
--- a/itest/jms/callbacks/src/main/resources/simple/tempq.composite
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="CallbackTempQComposite">
-
-<!--
-
-The client component does not define the callback destination so a temporary queue should be used
-
--->
-
- <component name="TQClientComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSClientImpl" />
- <reference name="myService">
- <binding.jms uri="jms:TQServiceQueue"/>
- <callback>
- <binding.jms />
- </callback>
- </reference>
- </component>
-
- <component name="TQServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSServiceImpl" />
- <service name="JMSService">
- <binding.jms uri="jms:TQServiceQueue"/>
- <callback>
- <binding.jms />
- </callback>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/defaults/pom.xml b/itest/jms/defaults/pom.xml
deleted file mode 100644
index 99346aa..0000000
--- a/itest/jms/defaults/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-defaults</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Defaults</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/defaults/src/main/resources/defaults/client.composite b/itest/jms/defaults/src/main/resources/defaults/client.composite
deleted file mode 100644
index 0601095..0000000
--- a/itest/jms/defaults/src/main/resources/defaults/client.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="DefaultClientComposite">
-
- <component name="HelloWorldClient">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:HelloWorldService" />
- </reference>
- </component>
-
-</composite>
diff --git a/itest/jms/defaults/src/main/resources/jndi.properties b/itest/jms/defaults/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/defaults/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/definitions/pom.xml b/itest/jms/definitions/pom.xml
deleted file mode 100644
index dca9434..0000000
--- a/itest/jms/definitions/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-definitions</artifactId>
- <name>Apache Tuscany SCA iTest JMS Tests For Properties</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- uses ActiveMQ 5.1 as 4.1 Session.createQueue does not work using
- a temporary queue name -->
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/exceptions/pom.xml b/itest/jms/exceptions/pom.xml
deleted file mode 100644
index 85e82fa..0000000
--- a/itest/jms/exceptions/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-nonscaclient-exceptions</artifactId>
- <name>Apache Tuscany SCA iTest JMS NonSCA Client Exceptions</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
- <version>1.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
deleted file mode 100644
index a1a6c4a..0000000
--- a/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * 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.sca.binding.jms;
-
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.xml.sax.SAXException;
-
-/**
- * This shows how to test the JMS binding using a simple HelloWorld application.
- */
-public class ExceptionsTestCase {
-
- private Node node;
- private Session session;
- private InitialContext context;
- private Connection connection;
-
- private static final String CHECKED_XML =
- "<ns2:CheckedExcpetion xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>foo</message></ns2:CheckedExcpetion>";
- private static final String CHECKED_NOARGS_XML = "<ns2:CheckedExcpetionNoArgs xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\" />";
- private static final String CHECKED_2ARGS_XML =
- "<ns2:CheckedExcpetion2Args xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>foo</message></ns2:CheckedExcpetion2Args>";
- private static final String CHECKED_CHAINED_XML =
- "<ns2:CheckedExcpetionChained xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>java.lang.Exception: bla</message></ns2:CheckedExcpetionChained>";
-
- @Before
- public void init() {
- node = NodeFactory.newInstance().createNode().start();
- }
-
- @Test
- public void testTextChecked() throws NamingException, JMSException, SAXException, IOException {
- sendJMSTextRequest("throwChecked");
- Message m = receiveJMSResponse();
- assertXMLEqual(CHECKED_XML, ((TextMessage)m).getText());
- }
-
- @Test
- public void testTextCheckedNoArgs() throws NamingException, JMSException, SAXException, IOException {
- sendJMSTextRequest("throwCheckedNoArgs");
- Message m = receiveJMSResponse();
- assertXMLEqual(CHECKED_NOARGS_XML, ((TextMessage)m).getText());
- }
-
- @Test
- public void testTextChecked2Args() throws NamingException, JMSException, SAXException, IOException {
- sendJMSTextRequest("throwChecked2Args");
- Message m = receiveJMSResponse();
- assertXMLEqual(CHECKED_2ARGS_XML, ((TextMessage)m).getText());
- }
-
- @Test
- public void testTextCheckedChained() throws NamingException, JMSException, SAXException, IOException {
- sendJMSTextRequest("throwCheckedChained");
- Message m = receiveJMSResponse();
- assertXMLEqual(CHECKED_CHAINED_XML, ((TextMessage)m).getText());
- }
-
- @Test
- public void testTextUnChecked() throws NamingException, JMSException, SAXException, IOException {
- sendJMSTextRequest("throwUnChecked");
- Message m = receiveJMSResponse();
-
- // FIXME: what should the response message be for unchecked exceptions with wireFormat.textXML???
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof RuntimeException);
- assertTrue("java.lang.RuntimeException".equals(o.getClass().getName()));
- assertEquals("bla", ((RuntimeException)o).getMessage());
- }
-
- @Test
- public void testObjectChecked() throws NamingException, JMSException {
- sendJMSObjectRequest("throwChecked");
- Message m = receiveJMSResponse();
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof CheckedExcpetion);
- assertEquals("foo", ((CheckedExcpetion)o).getMessage());
- }
-
- @Test
- public void testObjectCheckedNoArgs() throws NamingException, JMSException {
- sendJMSObjectRequest("throwCheckedNoArgs");
- Message m = receiveJMSResponse();
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof CheckedExcpetionNoArgs);
- }
-
- @Test
- public void testObjectChecked2Args() throws NamingException, JMSException {
- sendJMSObjectRequest("throwChecked2Args");
- Message m = receiveJMSResponse();
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof CheckedExcpetion2Args);
- assertEquals("foo", ((CheckedExcpetion2Args)o).getMessage());
- assertEquals("bla", ((CheckedExcpetion2Args)o).getCause().getMessage());
- }
-
- @Test
- public void testObjectCheckedChained() throws NamingException, JMSException {
- sendJMSObjectRequest("throwCheckedChained");
- Message m = receiveJMSResponse();
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof CheckedExcpetionChained);
- assertEquals("bla", ((CheckedExcpetionChained)o).getCause().getMessage());
- }
-
- @Test
- public void testObjectUnChecked() throws NamingException, JMSException {
- sendJMSObjectRequest("throwUnChecked");
- Message m = receiveJMSResponse();
- Object o = ((ObjectMessage)m).getObject();
- assertTrue(o instanceof RuntimeException);
- assertTrue("java.lang.RuntimeException".equals(o.getClass().getName()));
- assertEquals("bla", ((RuntimeException)o).getMessage());
- }
-
- @After
- public void end() throws JMSException {
- if (node != null) {
- node.stop();
- }
- if (connection != null) {
- connection.close();
- }
- }
-
- private void sendJMSTextRequest(String operationName) throws NamingException, JMSException {
- context = new InitialContext(new Properties());
- ConnectionFactory cf = (ConnectionFactory)context.lookup("ConnectionFactory");
- connection = cf.createConnection();
- connection.start();
-
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Destination toDest = (Destination)context.lookup("TextExceptionService");
-
- TextMessage m = session.createTextMessage();
- m.setStringProperty("scaOperationName", operationName);
- m.setJMSReplyTo((Destination)context.lookup("ResponseQueue"));
- m.setText("<_ns_:" + operationName + " xmlns:_ns_=\"http://jms.binding.sca.tuscany.apache.org/\" />");
-
- MessageProducer producer = session.createProducer(toDest);
- producer.send(m);
- }
-
- private void sendJMSObjectRequest(String operationName) throws NamingException, JMSException {
- context = new InitialContext(new Properties());
- ConnectionFactory cf = (ConnectionFactory)context.lookup("ConnectionFactory");
- connection = cf.createConnection();
- connection.start();
-
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Destination toDest = (Destination)context.lookup("ObjectExceptionService");
-
- ObjectMessage m = session.createObjectMessage();
- m.setStringProperty("scaOperationName", operationName);
- m.setJMSReplyTo((Destination)context.lookup("ResponseQueue"));
- m.setObject(new Object[0]);
-
- MessageProducer producer = session.createProducer(toDest);
- producer.send(m);
- }
-
- private Message receiveJMSResponse() throws NamingException, JMSException {
- Destination replyDest = (Destination)context.lookup("ResponseQueue");
- MessageConsumer consumer = session.createConsumer(replyDest);
- Message m = consumer.receive(5000);
- if (m == null) {
- throw new RuntimeException("No reply message received");
- }
- return m;
- }
-}
diff --git a/itest/jms/exceptions1/pom.xml b/itest/jms/exceptions1/pom.xml
deleted file mode 100644
index 80c9d48..0000000
--- a/itest/jms/exceptions1/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-exceptions1</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Exceptions1</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/exceptions1/src/main/resources/exceptions/client.composite b/itest/jms/exceptions1/src/main/resources/exceptions/client.composite
deleted file mode 100644
index 162d7d6..0000000
--- a/itest/jms/exceptions1/src/main/resources/exceptions/client.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="ExceptionClientComposite">
-
- <component name="ExceptionServiceClient">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ExceptionServiceClient"/>
- <reference name="service">
- <binding.jms uri="jms:ExceptionService" />
- </reference>
- </component>
-
-</composite>
diff --git a/itest/jms/exceptions1/src/main/resources/jndi.properties b/itest/jms/exceptions1/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/exceptions1/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
deleted file mode 100644
index 0d897d8..0000000
--- a/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.sca.binding.jms;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This shows how to test the JMS binding using a simple HelloWorld application.
- */
-public class ExceptionsTestCase {
-
- private static Node node;
-
- @Before
- public void init() {
- node = NodeFactory.newInstance().createNode().start();
- }
-
- @Test
- public void testChecked() {
- ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
- try {
- service.throwChecked();
- fail();
- } catch (CheckedExcpetion e) {
- assertEquals("foo", e.getMessage());
- } catch (Throwable e) {
- fail();
- }
- }
-
- @Test
- public void testCheckedNoArgs() {
- ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
- try {
- service.throwCheckedNoArgs();
- fail();
- } catch (CheckedExcpetionNoArgs e) {
- // ok
- }
- }
-
- @Test
- public void testChecked2Args() {
- ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
- try {
- service.throwChecked2Args();
- fail();
- } catch (CheckedExcpetion2Args e) {
- assertEquals("foo", e.getMessage());
-// FIXME: TUSCANY-2848: lost the cause!
-// assertNotNull(e.getCause());
-// assertEquals("bla", e.getCause().getMessage());
- }
- }
-
- @Test
- public void testCheckedChained() {
- ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
- try {
- service.throwCheckedChained();
- fail();
- } catch (CheckedExcpetionChained e) {
- // FIXME: TUSCANY-2848: lost the cause!
-// assertNotNull(e.getCause());
-// assertEquals("bla", e.getCause().getMessage());
- }
- }
-
- @Test
- public void testUnChecked() {
- ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
- try {
- service.throwUnChecked();
- fail();
- } catch (Exception e) {
- assertEquals("bla", e.getCause().getMessage());
- }
- }
-
- @After
- public void end() {
- if (node != null) {
- node.stop();
- }
- }
-}
diff --git a/itest/jms/externalBroker/pom.xml b/itest/jms/externalBroker/pom.xml
deleted file mode 100644
index 62f9c15..0000000
--- a/itest/jms/externalBroker/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-external-broker</artifactId>
- <name>Apache Tuscany SCA iTest JMS with External JMS Broker</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsbytes/pom.xml b/itest/jms/format-jmsbytes/pom.xml
deleted file mode 100644
index 484edbd..0000000
--- a/itest/jms/format-jmsbytes/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmsbytes</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmsbytes</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsbytesxml/pom.xml b/itest/jms/format-jmsbytesxml/pom.xml
deleted file mode 100644
index 2d82ee4..0000000
--- a/itest/jms/format-jmsbytesxml/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmsbytesxml</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmsbytesxml</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsdefault/pom.xml b/itest/jms/format-jmsdefault/pom.xml
deleted file mode 100644
index 8a3c9e0..0000000
--- a/itest/jms/format-jmsdefault/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmsdefault</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmsdefault</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite b/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite
deleted file mode 100644
index 96fa9ab..0000000
--- a/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite
+++ /dev/null
@@ -1,94 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:hw="http://helloworld"
- name="helloworld">
-
- <component name="HelloWorldReferenceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldReferenceImpl" />
- <reference name="helloWorldService1" >
- <binding.jms>
- <destination jndiName="HelloWorldService1"/>
- </binding.jms>
- </reference>
- <reference name="helloWorldService2" >
- <binding.jms>
- <tuscany:wireFormat.jmsdefault/>
- <destination jndiName="HelloWorldService2"/>
- </binding.jms>
- </reference>
- <reference name="helloWorldService3" >
- <binding.jms>
- <tuscany:wireFormat.jmsdefault/>
- <destination jndiName="HelloWorldService3"/>
- </binding.jms>
- </reference>
- <reference name="helloWorldService4" >
- <binding.jms>
- <tuscany:wireFormat.jmsdefault sendFormat="text"/>
- <destination jndiName="HelloWorldService4"/>
- </binding.jms>
- </reference>
- </component>
-
- <component name="HelloWorldServiceComponent1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms>
- <destination jndiName="HelloWorldService1"/>
- </binding.jms>
- </service>
- </component>
-
- <component name="HelloWorldServiceComponent2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <interface.java interface="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldService" />
- <binding.jms>
- <destination jndiName="HelloWorldService2"/>
- </binding.jms>
- </service>
- </component>
-
- <component name="HelloWorldServiceComponent3">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <!--interface.wsdl interface="http://helloworld/textxml#wsdl.interface(HelloWorld)" /-->
- <binding.jms>
- <tuscany:wireFormat.jmsdefault />
- <destination jndiName="HelloWorldService3"/>
- </binding.jms>
- </service>
- </component>
-
- <component name="HelloWorldServiceComponent4">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <!--interface.wsdl interface="http://helloworld/textxml#wsdl.interface(HelloWorld)" /-->
- <binding.jms>
- <tuscany:wireFormat.jmsdefault />
- <destination jndiName="HelloWorldService4"/>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/format-jmsmessage/pom.xml b/itest/jms/format-jmsmessage/pom.xml
deleted file mode 100644
index f1348a1..0000000
--- a/itest/jms/format-jmsmessage/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmsmessage</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmsmessage</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsobject/pom.xml b/itest/jms/format-jmsobject/pom.xml
deleted file mode 100644
index 564adec..0000000
--- a/itest/jms/format-jmsobject/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmsobject</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmsobject</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java b/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
deleted file mode 100644
index 443d2aa..0000000
--- a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.sca.binding.jms.format.jmsobject.helloworld;
-
-import org.oasisopen.sca.annotation.Reference;
-
-
-public class HelloWorldReferenceImpl implements HelloWorldReference {
-
- @Reference
- protected HelloWorldService helloWorldServiceWrapSingle;
-
- @Reference
- protected HelloWorldService helloWorldServiceDontWrapSingle;
-
- public String getGreetingsWrapSingle(String firstName, String lastName){
- Person person = new Person();
- person.setFirstName(firstName);
- person.setLastName(lastName);
-
- String returnString = "";
-
- Person returnPerson = helloWorldServiceWrapSingle.getPersonGreetings(person);
- returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName();
-
- Person returnNullPerson = helloWorldServiceWrapSingle.getNullReturnGreetings(person);
-
- if (returnNullPerson == null){
- returnString += " Hello2 null";
- }
-
- String returnGreeting = helloWorldServiceWrapSingle.getArrayGreeting(new String[]{firstName, lastName});
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName});
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceWrapSingle.getMultiGreetings(firstName, lastName);
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceWrapSingle.getObjectGreeting(person);
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceWrapSingle.getObjectArrayGreeting(new Object[]{person});
- returnString += " " + returnGreeting;
-
- return returnString;
- }
-
- public String getGreetingsDontWrapSingle(String firstName, String lastName){
- Person person = new Person();
- person.setFirstName(firstName);
- person.setLastName(lastName);
-
- String returnString = "";
-
- Person returnPerson = helloWorldServiceDontWrapSingle.getPersonGreetings(person);
- returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName();
-
- Person returnNullPerson = helloWorldServiceDontWrapSingle.getNullReturnGreetings(person);
-
- if (returnNullPerson == null){
- returnString += " Hello2 null";
- }
-
- String returnGreeting = helloWorldServiceDontWrapSingle.getArrayGreeting(new String[]{firstName, lastName});
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceDontWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName});
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceDontWrapSingle.getMultiGreetings(firstName, lastName);
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceDontWrapSingle.getObjectGreeting(person);
- returnString += " " + returnGreeting;
-
- returnGreeting = helloWorldServiceDontWrapSingle.getObjectArrayGreeting(new Object[]{person});
- returnString += " " + returnGreeting;
-
- try {
- helloWorldServiceDontWrapSingle.throwChecked(person);
- } catch (CheckedException e) {
- returnString += " " + e.getMessage();
- }
-
- try {
- helloWorldServiceDontWrapSingle.throwUnChecked(person);
- } catch (Exception e) {
- returnString += " " + e.getCause().getMessage();
- }
-
- return returnString;
- }
-}
-
diff --git a/itest/jms/format-jmstext/pom.xml b/itest/jms/format-jmstext/pom.xml
deleted file mode 100644
index 9afc805..0000000
--- a/itest/jms/format-jmstext/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmstext</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmstext</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmstextxml/pom.xml b/itest/jms/format-jmstextxml/pom.xml
deleted file mode 100644
index 9f0d2ec..0000000
--- a/itest/jms/format-jmstextxml/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmstextxml</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmstextxml</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml b/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml
deleted file mode 100644
index c4cf999..0000000
--- a/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-format-jmstextxmlinjmsobjectout</artifactId>
- <name>Apache Tuscany SCA iTest JMS Message Format jmstextxmlinjmsobjectout</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java b/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java
deleted file mode 100644
index 8fc3d77..0000000
--- a/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.sca.binding.jms.format;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.binding.jms.format.jmstextxmlinjmsobjectout.helloworld.HelloWorldService;
-import org.apache.tuscany.sca.binding.jms.format.jmstextxmlinjmsobjectout.helloworld.Person;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-/**
- * This shows how to test the JMS binding using a simple HelloWorld application.
- */
-public class FormatJMSTextXMLInJMSObjectOutTestCase {
-
- private static Node node;
-
- @Before
- public void init() {
- node = NodeFactory.newInstance().createNode().start();
- }
-
- @Test
- public void testHelloWorldCreate() throws Exception {
- HelloWorldService helloWorldService = node.getService(HelloWorldService.class, "HelloWorldReferenceComponent");
-
- assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
-
- Person person = new Person();
- person.setFirstName("Fred");
- person.setLastName("Bloggs");
- assertEquals("Hello Fred Bloggs", helloWorldService.getPersonGreetings(person));
- }
-
- @After
- public void end() {
- if (node != null) {
- node.stop();
- }
- }
-}
diff --git a/itest/jms/non-sca-client/pom.xml b/itest/jms/non-sca-client/pom.xml
deleted file mode 100644
index e96c844..0000000
--- a/itest/jms/non-sca-client/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-non-sca-client-broker</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Non SCA Client</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/non-sca-client/src/main/resources/jndi.properties b/itest/jms/non-sca-client/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/non-sca-client/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite b/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
deleted file mode 100644
index 1647486..0000000
--- a/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://itest"
- name="ServiceComposite">
-
- <component name="DefaultService">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
- <service name="OneWayService">
- <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623">
- <tuscany:wireFormat.jmsTextXML/>
- </binding.jms>
- </service>
- </component>
-
- <component name="TextService">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
- <service name="OneWayService">
- <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
- uri="jms:TextDest">
- <tuscany:wireFormat.jmsText/>
- </binding.jms>
- </service>
- </component>
-
- <component name="ObjectService">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayObjectServiceImpl"/>
- <service name="OneWayObjectService">
- <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
- uri="jms:ObjectDest">
- <tuscany:wireFormat.jmsObject /> <!-- test that wrapSingle default works -->
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/noreplyto/pom.xml b/itest/jms/noreplyto/pom.xml
deleted file mode 100644
index 413ed7b..0000000
--- a/itest/jms/noreplyto/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-noreplyto</artifactId>
- <name>Apache Tuscany SCA iTest JMS No replyTo</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/nulls/pom.xml b/itest/jms/nulls/pom.xml
deleted file mode 100644
index 09daa9b..0000000
--- a/itest/jms/nulls/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-nulls</artifactId>
- <name>Apache Tuscany SCA iTest JMS Nulls</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/nulls/src/main/resources/jndi.properties b/itest/jms/nulls/src/main/resources/jndi.properties
deleted file mode 100644
index 7ce468a..0000000
--- a/itest/jms/nulls/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,38 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory, ConnectionFactory2
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-topic.ServiceTopic = ServiceTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/nulls/src/main/resources/nulls.composite b/itest/jms/nulls/src/main/resources/nulls.composite
deleted file mode 100644
index 64fc9f9..0000000
--- a/itest/jms/nulls/src/main/resources/nulls.composite
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://itest"
- name="Nulls">
-
- <component name="Client1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:MyService" />
- </reference>
- </component>
-
- <component name="Service1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
- <service name="MyService">
- <binding.jms />
- </service>
- </component>
-
- <component name="Client2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:MyService2">
- <tuscany:wireFormat.jmsObject/>
- </binding.jms>
- </reference>
- </component>
-
- <component name="Service2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
- <service name="MyService">
- <binding.jms uri="jms:MyService2">
- <tuscany:wireFormat.jmsObject/>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/oneway-nocf/pom.xml b/itest/jms/oneway-nocf/pom.xml
deleted file mode 100644
index b9f7284..0000000
--- a/itest/jms/oneway-nocf/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-jms-oneway-nocf</artifactId>
- <name>Apache Tuscany SCA iTest JMS for a oneway service</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/oneway/pom.xml b/itest/jms/oneway/pom.xml
deleted file mode 100644
index d156522..0000000
--- a/itest/jms/oneway/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-oneway</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Oneway</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/policy-headers/pom.xml b/itest/jms/policy-headers/pom.xml
deleted file mode 100644
index 4f12fb6..0000000
--- a/itest/jms/policy-headers/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-policy-headers</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Policy Headers</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/policy-headers/src/main/resources/jndi.properties b/itest/jms/policy-headers/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/policy-headers/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite b/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
deleted file mode 100644
index c6ea015..0000000
--- a/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="PropertiesClientComposite">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgClientImpl" />
- <reference name="myService" requires="priority.medium">
- <binding.jms uri="jms:ServiceQueue">
- <headers type="myType"
- deliveryMode="persistent"
- timeToLive="4321"
- priority="7">
- <property name="headP1">myHeadP1</property>
- </headers>
- </binding.jms>
- </reference>
- </component>
-
- <component name="ServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgServiceImpl" />
- <service name="MsgService">
- <binding.jms uri="jms:ServiceQueue"/>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/pom.xml b/itest/jms/pom.xml
deleted file mode 100644
index f0b78bf..0000000
--- a/itest/jms/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <packaging>pom</packaging>
- <artifactId>itest-jms</artifactId>
- <name>Apache Tuscany SCA iTest JMS</name>
-
- <modules>
- <module>args</module>
- <module>callbacks</module>
- <module>defaults</module>
- <module>DynamicReplyQ</module>
- <module>exceptions</module>
- <module>exceptions1</module>
- <module>externalBroker</module>
- <module>format-jmsbytes</module>
- <module>format-jmsbytesxml</module>
- <module>format-jmsdefault</module>
- <module>format-jmsmessage</module>
- <module>format-jmsobject</module>
- <module>format-jmstext</module>
- <module>format-jmstextxml</module>
- <module>format-jmstextxmlinjmsobjectout</module>
- <module>non-sca-client</module>
- <module>noreplyto</module>
- <module>nulls</module>
- <module>oneway</module>
- <module>oneway-nocf</module>
- <module>policy-headers</module>
- <module>properties</module>
- <module>responsecf</module>
- <module>rpc</module>
- <module>selectors</module>
- <module>topics</module>
- <module>ttl</module>
- <module>uri-rpc</module>
-
-<!-- still to bring up in 2.x
- <module>definitions</module>
--->
-
- </modules>
-
-</project>
diff --git a/itest/jms/properties/pom.xml b/itest/jms/properties/pom.xml
deleted file mode 100644
index 03ce593..0000000
--- a/itest/jms/properties/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-properties</artifactId>
- <name>Apache Tuscany SCA iTest JMS with Properties</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/properties/src/main/resources/jndi.properties b/itest/jms/properties/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/properties/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/properties/src/main/resources/properties/properties.composite b/itest/jms/properties/src/main/resources/properties/properties.composite
deleted file mode 100644
index 12c2613..0000000
--- a/itest/jms/properties/src/main/resources/properties/properties.composite
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="PropertiesClientComposite">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgClientImpl" />
- <reference name="myService">
- <binding.jms uri="jms:ServiceQueue">
- <headers type="myType"
- deliveryMode="persistent"
- timeToLive="4321"
- priority="7">
- <property name="headP1">myHeadP1</property>
- </headers>
- <operationProperties name="op2" nativeOperation="nativeOp2">
- <headers type="op2Type"
- deliveryMode="nonpersistent"
- timeToLive="6000"
- priority="8">
- <property name="op2P2">foo</property>
- </headers>
- </operationProperties>
- </binding.jms>
- </reference>
- </component>
-
- <component name="ServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgServiceImpl" />
- <service name="MsgService">
- <binding.jms uri="jms:ServiceQueue"/>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/responsecf/pom.xml b/itest/jms/responsecf/pom.xml
deleted file mode 100644
index 560c92e..0000000
--- a/itest/jms/responsecf/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-responsecf</artifactId>
- <name>Apache Tuscany SCA iTest JMS Response ConnectionFactory</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/rpc/pom.xml b/itest/jms/rpc/pom.xml
deleted file mode 100644
index 205798e..0000000
--- a/itest/jms/rpc/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-rpc</artifactId>
- <name>Apache Tuscany SCA iTest JMS with RPC</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/selectors/pom.xml b/itest/jms/selectors/pom.xml
deleted file mode 100644
index dcee5c1..0000000
--- a/itest/jms/selectors/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-selectors</artifactId>
- <name>Apache Tuscany SCA iTest JMS Tests For Selectors</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite b/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite
deleted file mode 100644
index c18534c..0000000
--- a/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:hw="http://helloworld"
- name="helloworld">
-
- <component name="HelloWorldReferenceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldReferenceImpl" />
- <reference name="helloWorldService1" >
- <binding.jms>
- <destination jndiName="HelloWorldService1"/>
- </binding.jms>
- </reference>
- <reference name="helloWorldService2" >
- <binding.jms>
- <destination jndiName="HelloWorldService2"/>
- <operationProperties name="getGreetingsOne" >
- <headers>
- <property name="scaOperationName">getGreetingsThree</property>
- </headers>
- </operationProperties>
- </binding.jms>
- </reference>
- </component>
-
- <component name="HelloWorldServiceComponent1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms>
- <destination jndiName="HelloWorldService1"/>
- <operationProperties name="getGreetingsThree" nativeOperation="getGreetingsFour">
- <headers>
- <property name="blaNotUsed">getGreetingsThree</property>
- </headers>
- </operationProperties>
- </binding.jms>
- </service>
- </component>
-
- <component name="HelloWorldServiceComponent2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms>
- <tuscany:operationSelector.jmsdefault/>
- <destination jndiName="HelloWorldService2"/>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite b/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite
deleted file mode 100644
index 6b86764..0000000
--- a/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:hw="http://helloworld"
- name="helloworldUP">
-
- <component name="HelloWorldReferenceComponent1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsuserprop.HelloWorldReferenceImpl" />
- <reference name="helloWorldService1" >
- <binding.jms>
- <destination jndiName="HelloWorldService4"/>
- <operationProperties name="getGreetingsOne" >
- <headers>
- <property name="myProperty">getGreetingsOne</property>
- </headers>
- </operationProperties>
- <operationProperties name="getGreetingsTwo" >
- <headers>
- <property name="myProperty">getGreetingsThree</property>
- </headers>
- </operationProperties>
- <operationProperties name="getGreetingsThree" >
- <headers>
- <property name="myProperty">getGreetingsTwo</property>
- </headers>
- </operationProperties>
- </binding.jms>
- </reference>
- </component>
-
- <component name="HelloWorldServiceComponent3">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsuserprop.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms>
- <tuscany:operationSelector.jmsUserProp propertyName="myProperty"/>
- <destination jndiName="HelloWorldService4"/>
- <operationProperties name="getGreetingsThree" nativeOperation="getGreetingsFour">
- <headers>
- <property name="blaNotUsed2">getGreetingsThree</property>
- </headers>
- </operationProperties>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/selectors/src/main/resources/selectors/selectors.composite b/itest/jms/selectors/src/main/resources/selectors/selectors.composite
deleted file mode 100644
index 651cbe8..0000000
--- a/itest/jms/selectors/src/main/resources/selectors/selectors.composite
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- xmlns:itest="http://jms"
- name="Selectors">
-
- <component name="Client1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:ServiceTopic" >
- <headers type="type1" />
- </binding.jms>
- </reference>
- </component>
-
- <component name="Client2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:ServiceTopic" >
- <headers type="type2" />
- </binding.jms>
- </reference>
- </component>
-
- <component name="Service1">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl1"/>
- <service name="SelectorService">
- <binding.jms uri="jms:ServiceTopic" />
- </service>
- </component>
-
- <component name="Service2">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl2"/>
- <service name="SelectorService">
- <binding.jms uri="jms:ServiceTopic" >
- <messageSelection selector="JMSType = 'type1'"/>
- </binding.jms>
- </service>
- </component>
-
- <component name="Service3">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl3"/>
- <service name="SelectorService">
- <binding.jms uri="jms:ServiceTopic" >
- <messageSelection selector="JMSType = 'type2'"/>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/topics/pom.xml b/itest/jms/topics/pom.xml
deleted file mode 100644
index 0ca11fc..0000000
--- a/itest/jms/topics/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-topics</artifactId>
- <name>Apache Tuscany SCA iTest JMS Tests for topics</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/ttl/pom.xml b/itest/jms/ttl/pom.xml
deleted file mode 100644
index 6807a38..0000000
--- a/itest/jms/ttl/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-ttl</artifactId>
- <name>Apache Tuscany SCA iTest JMS Time To Live</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/uri-rpc/pom.xml b/itest/jms/uri-rpc/pom.xml
deleted file mode 100644
index a4aa87d..0000000
--- a/itest/jms/uri-rpc/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-jms-uri-rpc</artifactId>
- <name>Apache Tuscany SCA iTest JMS with URI RPC</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
diff --git a/itest/jms/uri-rpc/src/main/resources/jndi.properties b/itest/jms/uri-rpc/src/main/resources/jndi.properties
deleted file mode 100644
index 4d6acc0..0000000
--- a/itest/jms/uri-rpc/src/main/resources/jndi.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# START SNIPPET: jndi
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-
-# use the following property to configure the default connector
-java.naming.provider.url = vm://localhost?broker.persistent=false
-
-# use the following property to specify the JNDI name the connection factory
-# should appear as.
-#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
-connectionFactoryNames = ConnectionFactory
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.RequestQueue = RequestQueue
-queue.ResponseQueue = ResponseQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.MyTopic = example.MyTopic
-
-# END SNIPPET: jndi
diff --git a/itest/jms/uri-rpc/src/main/resources/simple/service.composite b/itest/jms/uri-rpc/src/main/resources/simple/service.composite
deleted file mode 100644
index 33364f6..0000000
--- a/itest/jms/uri-rpc/src/main/resources/simple/service.composite
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="SimpleServiceComposite">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
- <service name="HelloWorldService">
- <binding.jms>
- <destination jndiName="DestQueueA" create="always">
- </destination>
- <response>
- <destination jndiName="RespQueueA" create="always"/>
- </response>
- </binding.jms>
- </service>
- </component>
-
-</composite>
diff --git a/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite b/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite
deleted file mode 100644
index 2e47288..0000000
--- a/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://itest"
- name="URIClientComposite">
-
- <component name="HelloWorldClient">
- <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
- <reference name="serviceA">
- <binding.jms uri="jms:DestQueueA" />
- </reference>
- </component>
-
-</composite>
diff --git a/itest/nodes/binding-sca-hazelcast/pom.xml b/itest/nodes/binding-sca-hazelcast/pom.xml
deleted file mode 100644
index df1bec4..0000000
--- a/itest/nodes/binding-sca-hazelcast/pom.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-binding-sca-hazelcast</artifactId>
- <name>Apache Tuscany SCA iTest Nodes binding.sca Using Hazelcast Registry</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <reportFormat>brief</reportFormat>
- <useFile>true</useFile>
- <forkMode>once</forkMode>
- <argLine>-ea -Xmx256m</argLine>
- <parallel>off</parallel>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/itest/nodes/one-jvm-hazelcast-client/pom.xml b/itest/nodes/one-jvm-hazelcast-client/pom.xml
deleted file mode 100644
index c984844..0000000
--- a/itest/nodes/one-jvm-hazelcast-client/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-one-jvm-hazelcast-client</artifactId>
- <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast and client</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>com.hazelcast</groupId>
- <artifactId>hazelcast-client</artifactId>
- <version>1.8.3</version>
- </dependency>
- </dependencies>
- <build>
- </build>
-</project>
diff --git a/itest/nodes/one-jvm-hazelcast/pom.xml b/itest/nodes/one-jvm-hazelcast/pom.xml
deleted file mode 100644
index 8306a9e..0000000
--- a/itest/nodes/one-jvm-hazelcast/pom.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-one-jvm-hazelcast</artifactId>
- <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast Registry</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-service-and-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml b/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml
deleted file mode 100644
index b925e8c..0000000
--- a/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-two-nodes-two-vms-hazelcast</artifactId>
- <name>Apache Tuscany SCA iTest Nodes Two Nodes Two VMs Test using Hazelcast registry</name>
-
- <dependencies>
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-domain-node</artifactId>
- <version>2.0-Beta1</version>
- </dependency-->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>run-samples</id>
- <phase>test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks unless="maven.test.skip">
- <property name="tuscany.version" value="${version}" />
- <property name="runtime_classpath" refid="maven.runtime.classpath"/>
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/itest/policies/src/main/resources/META-INF/definitions.xml b/itest/policies/src/main/resources/META-INF/definitions.xml
deleted file mode 100644
index dc9deb5..0000000
--- a/itest/policies/src/main/resources/META-INF/definitions.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * 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.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <policySet name="JDKLoggingPolicy"
- provides="tuscany:logging"
- appliesTo="//binding | //implementation">
- <tuscany:jdkLogger name="test.logger">
- <tuscany:logLevel>FINE</tuscany:logLevel>
- <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
- </tuscany:jdkLogger>
-
- </policySet>
-
- <policySet name="JDKLoggingImplPolicy"
- provides="tuscany:logging"
- appliesTo="//implementation.java"
- attachTo="//sca:component[@name='CreditCardPayment']">
- <tuscany:jdkLogger name="test.logger">
- <tuscany:logLevel>INFO</tuscany:logLevel>
- <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
- </tuscany:jdkLogger>
-
- </policySet>
-
- <!-- A set of policy sets introduced just to ensure that intents are resolved -->
-
- <policySet name="SuspendsTransactionPolicy"
- provides="sca:suspendsTransaction"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:suspendsTransaction')"/>
-
- <policySet name="AuthorizationFineGrainPolicy"
- provides="sca:authorization.fineGrain"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:authorization') | IntentRefs('sca:authorization.fineGrain')"/>
-
- <policySet name="ConfidentialityTransportPolicy"
- provides="sca:confidentiality.transport"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:confidentiality.transport')"/>
-
- <policySet name="ConfidentialityMessagePolicy"
- provides="sca:confidentiality.message"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:confidentiality.message')"/>
-
- <policySet name="ClientAuthenticationTransportPolicy"
- provides="sca:clientAuthentication.transport"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:clientAuthentication.transport')"/>
-
- <policySet name="IntegrityTransportPolicy"
- provides="sca:integrity.transport"
- appliesTo="//binding | //implementation"
- attachTo="IntentRefs('sca:integrity.transport')"/>
-</definitions>
\ No newline at end of file
diff --git a/itest/pom.xml b/itest/pom.xml
deleted file mode 100644
index 33f5ca3..0000000
--- a/itest/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?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.
---><project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-itest</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Integration Tests</name>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
- <modules>
- <module>base</module>
- <module>builder</module>
- <module>bpel</module>
- <module>callback-api</module>
- <module>callback-basic</module>
- <module>callback-complex-type</module>
- <module>callback-multiple-wires</module>
- <module>callback-separatethread</module>
- <module>callback-two-composites</module>
- <module>callback-two-nodes</module>
- <module>component-type</module>
- <module>contribution-folder</module>
- <module>contribution-zip</module>
-<!-- why commented out?
- <module>definitions-multiple</module>
--->
- <module>databindings</module>
- <module>distribution</module>
- <module>exceptions</module>
- <module>implementation-spring</module>
- <module>import-export</module>
- <module>interfaces</module>
- <module>jms</module>
- <module>nodes</module>
- <module>node-launcher-equinox</module>
- <module>oneway</module>
-<!-- why commented out?
- <module>operation-overloading</module>
--->
- <module>policy</module>
- <module>policies</module>
- <module>policy-transaction</module>
-<!-- wait until databinding-sdo is in
- <module>properties</module>
--->
- <module>recursive-multi-level</module>
- <module>references</module>
- <module>scaclient-api</module>
-<!-- TUSCANY-3424 - SCAClient in JSE with OSGi runtime not yet supported
- <module>scaclient-api-jse-osgi</module>
--->
- <module>scaclient-api-osgi</module>
- <module>scaclient-api-remote</module>
- <module>scopes</module>
- <module>scdl</module>
- <module>services</module>
- <module>service-reference</module>
- <module>wires</module>
- <module>ws</module>
- <module>ws-jaxws</module>
- </modules>
-
- <!-- We don't want to deploy any of the test modules -->
- <properties>
- <maven.deploy.skip>true</maven.deploy.skip>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/itest/scaclient-api-remote/pom.xml b/itest/scaclient-api-remote/pom.xml
deleted file mode 100644
index 2320903..0000000
--- a/itest/scaclient-api-remote/pom.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-scaclient-api-remote</artifactId>
- <name>Apache Tuscany SCA iTest SCAClient API with Hazelcast client</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java b/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java
deleted file mode 100644
index 0ae70d6..0000000
--- a/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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 test.scaclient;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import itest.HelloworldService;
-
-import java.net.URI;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-/**
- * Test SCADomain.newInstance and invocation of a service.
- *
- * @version $Rev: 904064 $ $Date: 2010-01-28 12:31:36 +0000 (Thu, 28 Jan 2010) $
- */
-public class SCAClientTestCase {
-
- private Node node;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- @Test
- public void testDefault() throws Exception {
-
- node = NodeFactory.newInstance().createNode((String)null, new String[] {"target/classes"});
- node.start();
-
- HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Test
- public void testURIconfig() throws Exception {
-
- node = NodeFactory.newInstance("uri:somedomain").createNode((String)null, new String[] {"target/classes"});
- node.start();
-
- HelloworldService service = SCAClientFactory.newInstance(URI.create("somedomain")).getService(HelloworldService.class, "HelloworldComponent");
- assertEquals("Hello petra", service.sayHello("petra"));
- try {
- service = SCAClientFactory.newInstance(URI.create("nosuchdomain")).getService(HelloworldService.class, "HelloworldComponent");
- service.sayHello("petra");
- fail();
- } catch (Exception e) {
- if (!(e.getCause() instanceof NoSuchDomainException)) {
- throw e;
- }
- }
- }
-
- @Test
- public void testExplicit() throws Exception {
- node = NodeFactory.newInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
- node.start();
-
- HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Test
- public void testExplicitRemote() throws Exception {
- node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
- node.start();
-
- HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Test
- public void testExplicitRemote2() throws Exception {
- node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
- node.start();
-
- HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java b/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
deleted file mode 100644
index 6a63966..0000000
--- a/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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 test.scaclient;
-
-import itest.HelloworldService;
-import itest.RemoteHelloworldService;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-/**
- * Test SCADomain.newInstance and invocation of a service.
- *
- * @version $Rev$ $Date$
- */
-public class SCAClientTestCase extends TestCase {
-
- private Node node;
-
- @Test
- public void testDefault() throws Exception {
-
- node = NodeFactory.getInstance().createNode((String)null, new String[] {"target/classes"});
- node.start();
-
- SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
- HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
- assertEquals("Hello petra", service.sayHello("petra"));
-
- RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
- assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
-
- }
-
- @Test
- public void testExplicit() throws Exception {
- node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
- node.start();
-
- SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
- HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
- assertEquals("Hello petra", service.sayHello("petra"));
-
- RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
- assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
-// @Test
-// public void testWithoutServiceName() throws Exception {
-// node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
-// node.start();
-//
-// SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
-// HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent");
-// assertEquals("Hello petra", service.sayHello("petra"));
-// }
-
- @Test
- public void testWithBadServiceName() throws Exception {
- node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
- node.start();
-
- SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
- try {
- clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
- fail();
- } catch (NoSuchServiceException e) {
- // expected
- }
- }
-
- @Test
- public void testWithBadDomainName() throws Exception {
- node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
- node.start();
-
- SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
- try {
- HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
- service.sayHello("petra");
- fail();
- } catch (Exception e) {
- if (!(e.getCause() instanceof NoSuchDomainException)) {
- throw e;
- }
- }
- }
-
- // @Test @Ignore
-// public void testHTTPURI() throws Exception {
-// node = NodeFactory.getInstance().createNode(URI.create("http://defaultDomain"), new String[] {"target/classes"});
-// node.start();
-//
-// HelloworldService service = SCAClientFactory.newInstance(URI.create("http://defaultDomain")).getService(HelloworldService.class, "HelloworldComponent");
-// assertEquals("Hello petra", service.sayHello("petra"));
-// }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java b/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java
deleted file mode 100644
index 97fdb53..0000000
--- a/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.sca.itest.scdl;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.deployment.DefaultDeployer;
-import org.apache.tuscany.sca.deployment.Deployer;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test case for reading and writing SCDL
- */
-public class ContributionTestCase {
-
- @Test
- public void testRead() throws Exception {
- Deployer deployer = new DefaultDeployer();
- File file = new File("../../samples/binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar");
- URL url = file.toURI().toURL();
- Monitor monitor = deployer.createMonitor();
- Contribution contribution = deployer.loadContribution(url.toURI(), url, monitor);
- deployer.build(Arrays.asList(contribution), Arrays.asList(contribution), null, monitor);
-
- // Ferkle around in the contribution verifying it looks as expected
- Assert.assertNotNull(contribution);
- List<Composite> deployables = contribution.getDeployables();
- Assert.assertEquals(2, deployables.size());
- Composite calculatorComposte = deployables.get(0);
- Assert.assertEquals("Calculator", calculatorComposte.getName().getLocalPart());
- Assert.assertEquals(5, calculatorComposte.getComponents().size());
- Component calcComp = calculatorComposte.getComponent("CalculatorServiceComponent");
- Assert.assertNotNull(calcComp);
- Assert.assertEquals(4, calcComp.getReferences().size());
- Reference ref = calcComp.getReference("addService");
- Assert.assertEquals("AddServiceComponent", ref.getTargets().get(0).getName());
- Implementation impl = calcComp.getImplementation();
- Assert.assertTrue(impl instanceof JavaImplementation);
- Assert.assertEquals("calculator.CalculatorServiceImpl", ((JavaImplementation)impl).getJavaClass().getName());
- }
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
-}
diff --git a/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java b/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java
deleted file mode 100644
index 475586f..0000000
--- a/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.sca.itest.scdl;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-
-/**
- * Test case for verifying only SCDL jars are needed
- *
- * Uses maven-dependency-plugin config in the pom.xml
- *
- * Current required jars are:
- * geronimo-stax-api_1.0_spec-1.0.1.jar
- * jsr181-api-1.0-MR1.jar
- * junit-4.8.1.jar
- * tuscany-assembly-2.0-SNAPSHOT.jar
- * tuscany-assembly-xml-2.0-SNAPSHOT.jar
- * tuscany-assembly-xsd-2.0-SNAPSHOT.jar
- * tuscany-binding-jms-2.0-SNAPSHOT.jar
- * tuscany-binding-jsonp-2.0-SNAPSHOT.jar
- * tuscany-binding-rmi-2.0-SNAPSHOT.jar
- * tuscany-builder-2.0-SNAPSHOT.jar
- * tuscany-common-java-2.0-SNAPSHOT.jar
- * tuscany-common-xml-2.0-SNAPSHOT.jar
- * tuscany-contribution-2.0-SNAPSHOT.jar
- * tuscany-deployment-2.0-SNAPSHOT.jar
- * tuscany-extensibility-2.0-SNAPSHOT.jar
- * tuscany-implementation-java-2.0-SNAPSHOT.jar
- * tuscany-interface-java-2.0-SNAPSHOT.jar
- * tuscany-monitor-2.0-SNAPSHOT.jar
- * tuscany-sca-api-2.0-SNAPSHOT.jar
- * wstx-asl-3.2.4.jar
- *
- * TODO: WS binding drags in all runtime
- */
-public class ValidateDependenciesTestCase {
-
- @Test
- public void countDependencies() {
-
- File dependenciesDir = new File("target/dependency");
- Assert.assertTrue(dependenciesDir.exists());
-
- File[] dependencyFiles = dependenciesDir.listFiles();
- Assert.assertEquals(28, dependencyFiles.length);
- }
-}
diff --git a/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java b/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java
deleted file mode 100644
index ef307f5..0000000
--- a/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.sca.binding.ws.axis2;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public class HelloworldTestCase extends TestCase {
-
- private Node node;
- private HelloWorld helloWorld;
-
- public void testCalculator() throws Exception {
- assertEquals("Hello fred myname", helloWorld.getGreetings("fred"));
- }
-
- @Override
- protected void setUp() throws Exception {
- node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes"));
- node.start();
- helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/ws/contribution-wsdl-first/pom.xml b/itest/ws/contribution-wsdl-first/pom.xml
deleted file mode 100644
index d08f274..0000000
--- a/itest/ws/contribution-wsdl-first/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-ws-contribution-wsdl-first</artifactId>
- <name>Apache Tuscany SCA iTest WS Contribution WSDL First</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/jaxws-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxws-maven-plugin</artifactId>
- <version>1.12</version>
- <!-- Explicitly add the transitive dependencies for jaxws-api
- http://jira.codehaus.org/browse/MEV-498
- -->
- <dependencies>
- <dependency>
- <groupId>javax.jws</groupId>
- <artifactId>jsr181-api</artifactId>
- <version>1.0-MR1</version>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>wsimport1</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsimport</goal>
- </goals>
- <configuration>
- <packageName>org.apache.tuscany.sca.binding.ws.sca</packageName>
- <wsdlDirectory>${basedir}/target/classes</wsdlDirectory>
- <wsdlFiles>
- <wsdlFile>HelloWorldImplService.wsdl</wsdlFile>
- </wsdlFiles>
- <staleFile>${project.build.directory}/jaxws/stale/.wsimport1StaleFlag</staleFile>
- </configuration>
- </execution>
- <execution>
- <id>wsimport2</id>
- <phase>process-resources</phase>
- <goals>
- <goal>wsimport</goal>
- </goals>
- <configuration>
- <packageName>org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface</packageName>
- <wsdlDirectory>${basedir}/target/classes</wsdlDirectory>
- <wsdlFiles>
- <wsdlFile>helloworld-external-service.wsdl</wsdlFile>
- </wsdlFiles>
- <staleFile>${project.build.directory}/jaxws/stale/.wsimport2StaleFlag</staleFile>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <target>2.1</target>
- <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
- <verbose>true</verbose>
- <xnocompile>true</xnocompile>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
deleted file mode 100644
index 6bc67db..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.sca.binding.ws;
-
-import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.Foo;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorld {
-
- String getGreetings(String s);
- String getGreetingsException(String s) throws ServiceRuntimeException;
- Foo getGreetingsComplex(Foo foo);
-}
diff --git a/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
deleted file mode 100644
index b279e7f..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.sca.binding.ws;
-
-import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.HelloWorldService;
-import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.Foo;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.annotation.Reference;
-
-public class HelloWorldImpl implements HelloWorld {
-
- @Reference
- public HelloWorldService helloWorldExternal;
-
- public String getGreetings(String s) {
- System.out.println("Entering SCA HelloWorld.getGreetings: " + s);
- String response = helloWorldExternal.getGreetings(s);
- System.out.println("Leaving SCA HelloWorld.getGreetings: " + response);
- return response;
- }
-
- public String getGreetingsException(String s) throws ServiceRuntimeException {
- System.out.println("Entering SCA HelloWorld.getGreetingsException: " + s);
- String response = helloWorldExternal.getGreetings(s);
- System.out.println("Leaving SCA HelloWorld.getGreetings: " + response);
- throw new ServiceRuntimeException(response);
- }
-
- public Foo getGreetingsComplex(Foo foo){
- System.out.println("Entering SCA HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
- Foo response = helloWorldExternal.getGreetingsComplex(foo);
- System.out.println("Leaving SCA HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
- return response;
- }
-
-}
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl b/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl
deleted file mode 100644
index f3e9083..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<definitions targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
- name="HelloWorldImplService"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
- <types>
- <xsd:schema>
- <xsd:import namespace="http://ws.binding.sca.tuscany.apache.org/"
- schemaLocation="HelloWorldImplService_schema1.xsd"/>
- </xsd:schema>
- </types>
- <message name="getGreetings">
- <part name="parameters" element="tns:getGreetings"/>
- </message>
- <message name="getGreetingsResponse">
- <part name="parameters" element="tns:getGreetingsResponse"/>
- </message>
- <message name="getGreetingsException">
- <part name="parameters" element="tns:getGreetingsException"/>
- </message>
- <message name="getGreetingsExceptionResponse">
- <part name="parameters" element="tns:getGreetingsExceptionResponse"/>
- </message>
- <message name="Exception">
- <part name="fault" element="tns:Exception"/>
- </message>
- <message name="getGreetingsComplex">
- <part name="parameters" element="tns:getGreetingsComplex"/>
- </message>
- <message name="getGreetingsComplexResponse">
- <part name="parameters" element="tns:getGreetingsComplexResponse"/>
- </message>
- <portType name="HelloWorldImpl">
- <operation name="getGreetings">
- <input message="tns:getGreetings"/>
- <output message="tns:getGreetingsResponse"/>
- </operation>
- <operation name="getGreetingsException">
- <input message="tns:getGreetingsException"/>
- <output message="tns:getGreetingsExceptionResponse"/>
- <fault message="tns:Exception" name="Exception"/>
- </operation>
- <operation name="getGreetingsComplex">
- <input message="tns:getGreetingsComplex"/>
- <output message="tns:getGreetingsComplexResponse"/>
- </operation>
- </portType>
- <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="getGreetings">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="getGreetingsException">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="Exception">
- <soap:fault name="Exception" use="literal"/>
- </fault>
- </operation>
- <operation name="getGreetingsComplex">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="HelloWorldImplService">
- <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
- <soap:address location="http://localhost:8085/HelloWorldService/HelloWorld"/>
- </port>
- </service>
-</definitions>
-
-
-
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd b/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd
deleted file mode 100644
index aee1feb..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<xs:schema version="1.0" targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:tns2="http://helloworld/external"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:import namespace="http://helloworld/external" schemaLocation="./HelloWorldImplService_schema2.xsd"/>
-
- <xs:element name="Exception" type="tns:Exception"/>
-
- <xs:element name="getGreetings" type="tns:getGreetings"/>
-
- <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
-
- <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
-
- <xs:element name="getGreetingsException" type="tns:getGreetingsException"/>
-
- <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/>
-
- <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
-
- <xs:complexType name="getGreetingsException">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsExceptionResponse">
- <xs:sequence>
- <xs:element name="return" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="Exception">
- <xs:sequence>
- <xs:element name="message" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetings">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsResponse">
- <xs:sequence>
- <xs:element name="return" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplex">
- <xs:sequence>
- <xs:element name="arg0" type="tns2:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplexResponse">
- <xs:sequence>
- <xs:element name="return" type="tns2:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd b/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd
deleted file mode 100644
index acdfcaa..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<xs:schema version="1.0" targetNamespace="http://helloworld/external" xmlns:tns="http://helloworld/external" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="getGreetings" type="tns:getGreetings"/>
-
- <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
-
- <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
-
- <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
-
- <xs:complexType name="getGreetings">
- <xs:sequence>
- <xs:element name="name" type="xs:string" form="qualified" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsResponse">
- <xs:sequence>
- <xs:element name="getGreetingsReturn" type="xs:string" form="qualified" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplex">
- <xs:sequence>
- <xs:element name="arg0" type="tns:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="foo">
- <xs:sequence>
- <xs:element name="bars" type="tns:bar" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="bar">
- <xs:sequence>
- <xs:element name="b" type="xs:boolean" minOccurs="0"/>
- <xs:element name="s" type="xs:string" minOccurs="0"/>
- <xs:element name="x" type="xs:int"/>
- <xs:element name="y" type="xs:int" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplexResponse">
- <xs:sequence>
- <xs:element name="return" type="tns:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
-
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl b/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl
deleted file mode 100644
index 0f83f1f..0000000
--- a/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.7-b01-. -->
-<definitions targetNamespace="http://helloworld/external" name="HelloWorldServiceService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://helloworld/external" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
- <types>
- <xsd:schema>
- <xsd:import namespace="http://helloworld/external" schemaLocation="HelloWorldServiceService_schema1.xsd"/>
- </xsd:schema>
- </types>
- <message name="getGreetings">
- <part name="parameters" element="tns:getGreetings"/>
- </message>
- <message name="getGreetingsResponse">
- <part name="parameters" element="tns:getGreetingsResponse"/>
- </message>
- <message name="getGreetingsComplex">
- <part name="parameters" element="tns:getGreetingsComplex"/>
- </message>
- <message name="getGreetingsComplexResponse">
- <part name="parameters" element="tns:getGreetingsComplexResponse"/>
- </message>
- <portType name="HelloWorldService">
- <operation name="getGreetings">
- <input message="tns:getGreetings"/>
- <output message="tns:getGreetingsResponse"/>
- </operation>
- <operation name="getGreetingsComplex">
- <input message="tns:getGreetingsComplex"/>
- <output message="tns:getGreetingsComplexResponse"/>
- </operation>
- </portType>
- <binding name="HelloWorldServicePortBinding" type="tns:HelloWorldService">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="getGreetings">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="getGreetingsComplex">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="HelloWorldServiceService">
- <port name="HelloWorldServicePort" binding="tns:HelloWorldServicePortBinding">
- <soap:address location="http://localhost:8086/External/HelloWorld"/>
- </port>
- </service>
-</definitions>
diff --git a/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java b/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
deleted file mode 100644
index f73a740..0000000
--- a/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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.sca.binding.ws.jaxws.external.client;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import org.apache.tuscany.sca.binding.ws.jaxws.sca.Exception_Exception;
-import org.apache.tuscany.sca.binding.ws.jaxws.sca.Foo;
-import org.apache.tuscany.sca.binding.ws.jaxws.sca.HelloWorldImpl;
-
-public class HelloWorldClientLauncher {
-
- public HelloWorldImpl wsProxy;
-
- public HelloWorldClientLauncher(){
- }
-
- public void createClient() throws Exception{
- System.out.println(">>> Starting external JAXWS client ");
-
- // default JVM JAXWS support
- QName serviceName = new QName("http://ws.binding.sca.tuscany.apache.org/", "HelloWorldImplService");
- QName portName = new QName("http://ws.binding.sca.tuscany.apache.org/", "HelloWorldImplPort");
- //URL wsdlLocation = new File("../external-client/target/classes/helloworld-sca.wsdl").toURL();
- URL wsdlLocation = new File("../external-client/target/classes/HelloWorldImplService.wsdl").toURL();
- javax.xml.ws.Service webService = Service.create(wsdlLocation, serviceName);
- wsProxy = (HelloWorldImpl) webService.getPort(portName, HelloWorldImpl.class);
- }
-
- public void destroyClient(){
- System.out.println(">>> Stopping external JAXWS client: ");
- // TODO
- }
-
- public String getGreetings(String name){
- System.out.println("Entering External Client HelloWorld.getGreetings: " + name);
- String response = wsProxy.getGreetings(name);
- System.out.println("Leaving External Client HelloWorld.getGreetings: " + response);
- return response;
- }
-
- public String getGreetingsException(String name) throws Exception_Exception {
- System.out.println("Entering External Client HelloWorld.getGreetingsException: " + name);
- String response = wsProxy.getGreetingsException(name);
- System.out.println("Leaving External Client HelloWorld.getGreetingsException: " + response);
- return response;
- }
-
- public Foo getGreetingsComplex(Foo f) throws Exception_Exception {
- System.out.println("Entering External Client HelloWorld.getGreetingsComplex: " + f.getBars().get(0).getS());
- Foo response = wsProxy.getGreetingsComplex(f);
- System.out.println("Leaving External Client HelloWorld.getGreetingsComplex: " + response.getBars().get(0).getS());
- return response;
- }
-
- public static void main(String[] args) throws Exception {
- HelloWorldClientLauncher launcher = new HelloWorldClientLauncher();
- launcher.createClient();
- launcher.getGreetings("Fred");
- launcher.destroyClient();
- }
-
-}
diff --git a/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl b/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl
deleted file mode 100644
index f3e9083..0000000
--- a/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<definitions targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
- name="HelloWorldImplService"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
- <types>
- <xsd:schema>
- <xsd:import namespace="http://ws.binding.sca.tuscany.apache.org/"
- schemaLocation="HelloWorldImplService_schema1.xsd"/>
- </xsd:schema>
- </types>
- <message name="getGreetings">
- <part name="parameters" element="tns:getGreetings"/>
- </message>
- <message name="getGreetingsResponse">
- <part name="parameters" element="tns:getGreetingsResponse"/>
- </message>
- <message name="getGreetingsException">
- <part name="parameters" element="tns:getGreetingsException"/>
- </message>
- <message name="getGreetingsExceptionResponse">
- <part name="parameters" element="tns:getGreetingsExceptionResponse"/>
- </message>
- <message name="Exception">
- <part name="fault" element="tns:Exception"/>
- </message>
- <message name="getGreetingsComplex">
- <part name="parameters" element="tns:getGreetingsComplex"/>
- </message>
- <message name="getGreetingsComplexResponse">
- <part name="parameters" element="tns:getGreetingsComplexResponse"/>
- </message>
- <portType name="HelloWorldImpl">
- <operation name="getGreetings">
- <input message="tns:getGreetings"/>
- <output message="tns:getGreetingsResponse"/>
- </operation>
- <operation name="getGreetingsException">
- <input message="tns:getGreetingsException"/>
- <output message="tns:getGreetingsExceptionResponse"/>
- <fault message="tns:Exception" name="Exception"/>
- </operation>
- <operation name="getGreetingsComplex">
- <input message="tns:getGreetingsComplex"/>
- <output message="tns:getGreetingsComplexResponse"/>
- </operation>
- </portType>
- <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
- <operation name="getGreetings">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- <operation name="getGreetingsException">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- <fault name="Exception">
- <soap:fault name="Exception" use="literal"/>
- </fault>
- </operation>
- <operation name="getGreetingsComplex">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal"/>
- </input>
- <output>
- <soap:body use="literal"/>
- </output>
- </operation>
- </binding>
- <service name="HelloWorldImplService">
- <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
- <soap:address location="http://localhost:8085/HelloWorldService/HelloWorld"/>
- </port>
- </service>
-</definitions>
-
-
-
diff --git a/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd b/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
deleted file mode 100644
index f579909..0000000
--- a/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- * 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.
--->
-<xs:schema version="1.0" targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <xs:element name="Exception" type="tns:Exception"/>
-
- <xs:element name="getGreetings" type="tns:getGreetings"/>
-
- <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
-
- <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
-
- <xs:element name="getGreetingsException" type="tns:getGreetingsException"/>
-
- <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/>
-
- <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
-
- <xs:complexType name="getGreetingsException">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsExceptionResponse">
- <xs:sequence>
- <xs:element name="return" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="Exception">
- <xs:sequence>
- <xs:element name="message" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetings">
- <xs:sequence>
- <xs:element name="arg0" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsResponse">
- <xs:sequence>
- <xs:element name="return" type="xs:string" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplex">
- <xs:sequence>
- <xs:element name="arg0" type="tns:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="foo">
- <xs:sequence>
- <xs:element name="bars" type="tns:bar" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="bar">
- <xs:sequence>
- <xs:element name="b" type="xs:boolean" minOccurs="0"/>
- <xs:element name="s" type="xs:string" minOccurs="0"/>
- <xs:element name="x" type="xs:int"/>
- <xs:element name="y" type="xs:int" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="getGreetingsComplexResponse">
- <xs:sequence>
- <xs:element name="return" type="tns:foo" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
-</xs:schema>
-
diff --git a/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java b/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
deleted file mode 100644
index be44ce7..0000000
--- a/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.sca.binding.ws.jaxws.external.service;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-
-@WebService(name = "HelloWorldService", targetNamespace = "http://helloworld/external")
-public class HelloWorldService {
-
- @WebMethod
- @WebResult(name = "getGreetingsReturn", targetNamespace = "http://helloworld/external")
- @RequestWrapper(localName = "getGreetings", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetings")
- @ResponseWrapper(localName = "getGreetingsResponse", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetingsResponse")
- public String getGreetings( @WebParam(name = "name", targetNamespace = "http://helloworld/external")
- String name) {
- System.out.println("Entering External Service HelloWorld.getGreetings: " + name);
- String response = "Hello " + name;
- System.out.println("Leaving External Service HelloWorld.getGreetings: " + response);
- return response;
- }
-
- public Foo getGreetingsComplex(Foo foo){
- System.out.println("Entering External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
- Foo response = foo;
- Bar b3 = new Bar();
- b3.setS("simon");
- b3.setX(7);
- b3.setY(new Integer(8));
- b3.setB(Boolean.TRUE);
- response.getBars().add(b3);
- System.out.println("Leaving External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
- return response;
- }
-
-}
diff --git a/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java b/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java
deleted file mode 100644
index 2fc448a..0000000
--- a/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.sca.binding.ws.axis2;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public class HTTPSTestCase extends TestCase {
-
- private Node node;
- private HelloWorld helloWorld;
- private HelloWorld helloWorld2;
- private HelloWorld helloWorld3;
-
- @Override
- protected void setUp() throws Exception {
- node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes"));
- node.start();
- helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
- helloWorld2 = node.getService(HelloWorld.class, "HelloWorldClient2");
- helloWorld3 = node.getService(HelloWorld.class, "HelloWorldClient3");
- }
-
- public void testCalculator() throws Exception {
- assertEquals("Hello petra", helloWorld.getGreetings("petra"));
- assertEquals("Hello petra", helloWorld2.getGreetings("petra"));
- // TODO - check policy matching for unconfigure reference
- //assertEquals("Hello petra", helloWorld3.getGreetings("petra"));
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java b/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java
deleted file mode 100644
index 8763f08..0000000
--- a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.sca.binding.ws.launcher.axis2;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.binding.ws.jaxws.external.client.HelloWorldClientLauncher;
-import org.apache.tuscany.sca.binding.ws.jaxws.external.service.HelloWorldServiceLauncher;
-import org.apache.tuscany.sca.binding.ws.jaxws.sca.Bar;
-import org.apache.tuscany.sca.binding.ws.jaxws.sca.Foo;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class WSDLFirstTestCase extends TestCase {
-
- private Node node;
- private HelloWorldServiceLauncher externalService;
- private HelloWorldClientLauncher externalClient;
-
- @Before
- public void setUp() throws Exception {
- // Start the external service
- externalService = new HelloWorldServiceLauncher();
- externalService.createService();
-
- // Start the SCA contribution
- node = NodeFactory.newInstance().createNode(new Contribution("wsdl-first", "../contribution-wsdl-first/target/itest-ws-contribution-wsdl-first.jar"));
- node.start();
-
- // start the external client
- try {
- externalClient = new HelloWorldClientLauncher();
- externalClient.createClient();
- } catch (Exception ex) {
- ex.printStackTrace();
- throw ex;
- }
- }
-
-/*
- @Test
- public void testWait() throws Exception {
- System.out.println("Press a key");
- System.in.read();
- }
-*/
-
- @Test
- public void testGetGreetings() throws Exception {
- assertEquals("Hello Fred", externalClient.getGreetings("Fred"));
- }
-
- @Test
- @Ignore
- public void testGetGreetingsException() throws Exception {
- try {
- externalClient.getGreetingsException("Fred");
- } catch (Exception ex) {
- return;
- }
-
- fail("expecting exception");
- }
-
- @Test
- public void testGetGreetingsComplex() throws Exception {
- Foo f = new Foo();
- Bar b1 = new Bar();
- b1.setS("petra");
- b1.setX(1);
- b1.setY(new Integer(2));
- b1.setB(Boolean.TRUE);
- Bar b2 = new Bar();
- b2.setS("beate");
- b2.setX(3);
- b2.setY(new Integer(4));
- b2.setB(Boolean.FALSE);
- f.getBars().add(b1);
- f.getBars().add(b2);
-
- Foo f2 = externalClient.getGreetingsComplex(f);
-
- assertEquals("petra", f2.getBars().get(0).getS());
- assertEquals(1, f2.getBars().get(0).getX());
- assertEquals(2, f2.getBars().get(0).getY().intValue());
- assertTrue(f2.getBars().get(0).isB());
- assertEquals("simon", f2.getBars().get(2).getS());
- assertEquals(7, f2.getBars().get(2).getX());
- assertEquals(8, f2.getBars().get(2).getY().intValue());
- assertTrue(f2.getBars().get(2).isB().booleanValue());
- }
-
- @After
- public void tearDown() throws Exception {
- node.stop();
- externalClient.destroyClient();
- externalService.destoryService();
- }
-
-}
diff --git a/itest/ws/launcher-base/pom.xml b/itest/ws/launcher-base/pom.xml
deleted file mode 100644
index d175f38..0000000
--- a/itest/ws/launcher-base/pom.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>itest-ws-launcher-base</artifactId>
- <name>Apache Tuscany SCA iTest WS Launcher Base</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Test resources -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-ws-external-client</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-ws-external-service</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- </build>
-
-</project>
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java b/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java
deleted file mode 100644
index 370f7bd..0000000
--- a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java
+++ /dev/null
@@ -1,2 +0,0 @@
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://accounts")
-package org.apache.tuscany.sca.binding.ws.axis2;
diff --git a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java b/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java
deleted file mode 100644
index 76ea536..0000000
--- a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.sca.binding.ws.axis2;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLImportTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLImportPortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
- wsdlReader.setFeature("javax.wsdl.importDocuments", true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://account2/AccountService/Account", "AccountService"));
- Port port = service.getPort("AccountPort");
-
- String endpoint = getEndpoint(port);
- // String ip = HttpUtils.getIpAddress();
- assertEquals("http://localhost:8086/AccountService", endpoint);
- }
-
- private String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = "target/classes";
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java b/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java
deleted file mode 100644
index 54a40af..0000000
--- a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.sca.binding.ws.axis2;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLIncludeTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLIncludePortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
- wsdlReader.setFeature("javax.wsdl.importDocuments", true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://accounts/AccountService/Account", "AccountService"));
- Port port = service.getPort("AccountPort");
-
- String endpoint = getEndpoint(port);
- assertEquals("http://localhost:8085/AccountService", endpoint);
- }
-
- private String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = "target/classes";
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java b/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java
deleted file mode 100644
index 0148460..0000000
--- a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.sca.binding.ws.axis2;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLPortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/services/HelloWorldWebService2?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService2?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://helloworld/HelloWorldService/HelloWorld",
- "HelloWorldService"));
- Port port = service.getPort("HelloWorldPort");
-
- String endpoint = getEndpoint(port);
- assertEquals("http://localhost:8085/services/HelloWorldWebService2", endpoint);
- }
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI
- */
- public void testCustomEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/foo/bar?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose",false);
- wsdlReader.setFeature("javax.wsdl.importDocuments",true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl");
- assertNotNull(definition);
- Service service = definition.getService(new QName("http://axis2.ws.binding.sca.tuscany.apache.org/",
- "HelloWorldService"));
- Port port = service.getPort("HelloWorldPort");
-
- String endpoint = getEndpoint(port);
- // TODO - used to get the real host here but WSDL seems to have localhost in it atm?
- assertEquals("http://localhost:8085/foo/bar", endpoint);
- }
-
- protected String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = "target/classes";
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
diff --git a/maven/archetypes/binding/pom.xml b/maven/archetypes/binding/pom.xml
new file mode 100644
index 0000000..68f7bf2
--- /dev/null
+++ b/maven/archetypes/binding/pom.xml
@@ -0,0 +1,54 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-binding-archetype</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a Tuscany binding extension project</name>
+ <description>Create a Tuscany binding extension project</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-5</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-5</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/maven/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..4038035
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="tuscany-binding-foo-runtime"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <requiredProperties>
+ <requiredProperty key="bindingName">
+ </requiredProperty>
+ </requiredProperties>
+
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>META-INF</directory>
+ <includes>
+ <include>MANIFEST.MF</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF b/maven/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..2985b8c
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA ${bindingName} Binding
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA ${bindingName} Binding
+Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.${artifactId}
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/binding/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..b9ba98b
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,94 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>binding-${artifactId}</artifactId>
+ <groupId>${groupId}</groupId>
+ <version>${version}</version>
+ <name>Apache Tuscany SCA ${bindingName} Binding Extension</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java
new file mode 100644
index 0000000..d9cbdb9
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java
@@ -0,0 +1,52 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package};
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.provider.BaseBindingImpl;
+
+/**
+ * Represents a binding to a ${bindingName} service.
+ */
+public class ${bindingName}Binding extends BaseBindingImpl {
+
+ public static final QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.${artifactId}");
+
+ private String someAttr;
+
+ public ${bindingName}Binding() {
+ }
+
+ public QName getType() {
+ return TYPE;
+ }
+
+ public String getSomeAttr() {
+ return someAttr;
+ }
+
+ public void setSomeAttr(String someAttr) {
+ this.someAttr = someAttr;
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java
new file mode 100644
index 0000000..ae1cd88
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java
@@ -0,0 +1,35 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package};
+
+
+/**
+ * Factory implementation to create ${bindingName} Models
+ */
+public class ${bindingName}BindingFactory {
+
+ public ${bindingName}Binding create${bindingName}Binding() {
+ return new ${bindingName}Binding();
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java
new file mode 100644
index 0000000..93c6bf3
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java
@@ -0,0 +1,50 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import ${package}.${bindingName}Binding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+public class ${bindingName}BindingProviderFactory implements BindingProviderFactory<${bindingName}Binding> {
+
+ public ${bindingName}BindingProviderFactory(ExtensionPointRegistry extensionPoints) {
+ }
+
+ public Class<${bindingName}Binding> getModelType() {
+ return ${bindingName}Binding.class;
+ }
+
+ public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) {
+ return new ${bindingName}ReferenceBindingProvider(endpoint);
+ }
+
+ public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
+ return new ${bindingName}ServiceBindingProvider(endpoint);
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java
new file mode 100644
index 0000000..dc29910
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java
@@ -0,0 +1,58 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+
+public class ${bindingName}ReferenceBindingProvider implements ReferenceBindingProvider {
+
+ private EndpointReference endpoint;
+ private InterfaceContract contract;
+
+ public ${bindingName}ReferenceBindingProvider(EndpointReference endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public Invoker createInvoker(Operation operation) {
+ return new ${bindingName}ReferenceInvoker(operation, endpoint);
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public InterfaceContract getBindingInterfaceContract() {
+ return contract;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java
new file mode 100644
index 0000000..d3e2bd1
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java
@@ -0,0 +1,56 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+public class ${bindingName}ReferenceInvoker implements Invoker {
+
+ protected Operation operation;
+ protected EndpointReference endpoint;
+
+ public ${bindingName}ReferenceInvoker(Operation operation, EndpointReference endpoint) {
+ this.operation = operation;
+ this.endpoint = endpoint;
+ }
+
+ public Message invoke(Message msg) {
+ try {
+
+ return doInvoke(msg);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Message doInvoke(Message msg) {
+ // Add some code here to make an invocation over the ${bindingName} binding protocol
+ // For this sample we'll just get it from the static stash
+ ${bindingName}ServiceInvoker fi = ${bindingName}Stash.getService(endpoint.getBinding().getURI());
+ return fi.invokeService(msg);
+ }
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java
new file mode 100644
index 0000000..59d4109
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java
@@ -0,0 +1,60 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import ${package}.${bindingName}Binding;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+public class ${bindingName}ServiceBindingProvider implements ServiceBindingProvider {
+
+ private RuntimeEndpoint endpoint;
+ private InterfaceContract contract;
+
+ public ${bindingName}ServiceBindingProvider(RuntimeEndpoint endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public void start() {
+ // add some code here to start the service
+
+ // For this sample we'll just share it in a static
+ ${bindingName}Stash.addService(endpoint.getBinding().getURI(), new ${bindingName}ServiceInvoker(endpoint));
+
+ System.out.println("someAttr=" + ((${bindingName}Binding)endpoint.getBinding()).getSomeAttr());
+ }
+
+ public void stop() {
+ ${bindingName}Stash.removeService(endpoint.getBinding().getURI());
+ }
+
+ public InterfaceContract getBindingInterfaceContract() {
+ return contract;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java
new file mode 100644
index 0000000..8ea20d4
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java
@@ -0,0 +1,43 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+public class ${bindingName}ServiceInvoker {
+
+ private RuntimeEndpoint wire;
+
+ public ${bindingName}ServiceInvoker(RuntimeEndpoint wire) {
+ this.wire = wire;
+ }
+
+ /**
+ * Send the request down the wire to invoke the service
+ */
+ public Message invokeService(Message msg) {
+ return wire.invoke(msg);
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java
new file mode 100644
index 0000000..416a10e
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Simplistic static Map to share service endpoints with references
+ */
+public class ${bindingName}Stash {
+
+ private static Map<String, ${bindingName}ServiceInvoker> services = new HashMap<String, ${bindingName}ServiceInvoker>();
+
+ public static void addService(String uri, ${bindingName}ServiceInvoker ${bindingName}ServiceInvoker) {
+ services.put(uri, ${bindingName}ServiceInvoker);
+ }
+
+ public static ${bindingName}ServiceInvoker getService(String uri) {
+ return services.get(uri);
+ }
+
+ public static void removeService(String uri) {
+ services.remove(uri);
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory
new file mode 100644
index 0000000..3759b19
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for model factory
+${package}.${bindingName}BindingFactory
+
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..eb49133
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.${artifactId},model=${package}.${bindingName}Binding,factory=${package}.${bindingName}BindingFactory
+
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
new file mode 100644
index 0000000..c33264f
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -0,0 +1,19 @@
+# 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.
+#
+binding-${artifactId}.xsd
+
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
new file mode 100644
index 0000000..3c0cfbc
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the binding extension
+${package}.runtime.${bindingName}BindingProviderFactory;model=${package}.${bindingName}Binding
+
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd
new file mode 100644
index 0000000..74f853e
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd
@@ -0,0 +1,37 @@
+#set( $bindingNameLC = ${bindingName} )<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" />
+
+ <element name="binding.${artifactId}" type="t:${bindingName}Binding" substitutionGroup="sca:binding"/>
+
+ <complexType name="${bindingName}Binding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <attribute name="someAttr" type="string" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldClient.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldClient.java
new file mode 100644
index 0000000..de982ce
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldClient.java
@@ -0,0 +1,36 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 helloworld;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClient implements HelloWorldService {
+
+ @Reference
+ public HelloWorldService ref;
+
+ public String sayHello(String name) {
+ return ref.sayHello(name);
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldImpl.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000..521f682
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldImpl.java
@@ -0,0 +1,31 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 helloworld;
+
+
+public class HelloWorldImpl implements HelloWorldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldService.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldService.java
new file mode 100644
index 0000000..eca0df1
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/helloworld/HelloWorldService.java
@@ -0,0 +1,31 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldService {
+
+ String sayHello(String name);
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/__bindingName__BindingTestCase.java b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/__bindingName__BindingTestCase.java
new file mode 100644
index 0000000..61847e5
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/__bindingName__BindingTestCase.java
@@ -0,0 +1,55 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 test;
+
+import helloworld.HelloWorldService;
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ${bindingName}BindingTestCase {
+
+ private static Node node;
+
+ @Test
+ public void testSayHello() {
+ HelloWorldService service = node.getService(HelloWorldService.class, "HelloWorldClient/HelloWorldService");
+ Assert.assertEquals("Hello boo", service.sayHello("boo"));
+ }
+
+ @BeforeClass
+ public static void init() throws Exception {
+ node = NodeFactory.newInstance().createNode("helloworld.composite").start();
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+}
diff --git a/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite
new file mode 100644
index 0000000..f0e6150
--- /dev/null
+++ b/maven/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite
@@ -0,0 +1,39 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="HelloWorldComposite">
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ <service name="HelloWorldService" >
+ <tuscany:binding.${artifactId} someAttr="bla" />
+ </service>
+ </component>
+
+ <component name="HelloWorldClient">
+ <implementation.java class="helloworld.HelloWorldClient"/>
+ <reference name="ref" >
+ <tuscany:binding.${artifactId} uri="HelloWorldComponent/HelloWorldService"/>
+ </reference>
+ </component>
+
+</composite>
diff --git a/maven/archetypes/binding/src/test/resources/projects/basic/archetype.properties b/maven/archetypes/binding/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..c15305e
--- /dev/null
+++ b/maven/archetypes/binding/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,23 @@
+# 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.
+#Sat Sep 04 08:10:22 BST 2010
+version=0.1-SNAPSHOT
+groupId=archetype.it
+package=archetype.it.basic
+artifactId=basic
+bindingName=Basic
+
diff --git a/maven/archetypes/binding/src/test/resources/projects/basic/goal.txt b/maven/archetypes/binding/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/maven/archetypes/binding/src/test/resources/projects/basic/goal.txt
diff --git a/archetypes/contribution-jar/META-INF/MANIFEST.MF b/maven/archetypes/contribution-jar/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/contribution-jar/META-INF/MANIFEST.MF
rename to maven/archetypes/contribution-jar/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/contribution-jar/pom.xml b/maven/archetypes/contribution-jar/pom.xml
new file mode 100644
index 0000000..148f8ff
--- /dev/null
+++ b/maven/archetypes/contribution-jar/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-contribution-jar</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create an SCA JAR contribution project</name>
+ <description>Create an SCA JAR contribution project</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-3</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-3</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
diff --git a/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..8b2ad3d
--- /dev/null
+++ b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,81 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <name>${artifactId}</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.oasis-open.sca.j</groupId>
+ <artifactId>sca-caa-apis</artifactId>
+ <version>1.1-CD04</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <!-- OASIS SVN repo (for sca-api jar) -->
+ <repositories>
+ <repository>
+ <id>oasis.svn</id>
+ <url>http://tools.oasis-open.org/version-control/svn/sca-j/Release/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+</project>
diff --git a/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
rename to maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
diff --git a/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
rename to maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
diff --git a/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
rename to maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
diff --git a/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite b/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
similarity index 100%
rename from archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
rename to maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
diff --git a/archetypes/contribution-zip-discriptor/pom.xml b/maven/archetypes/contribution-zip-discriptor/pom.xml
similarity index 100%
rename from archetypes/contribution-zip-discriptor/pom.xml
rename to maven/archetypes/contribution-zip-discriptor/pom.xml
diff --git a/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml b/maven/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
similarity index 100%
rename from archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
rename to maven/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
diff --git a/archetypes/contribution-zip/META-INF/MANIFEST.MF b/maven/archetypes/contribution-zip/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/contribution-zip/META-INF/MANIFEST.MF
rename to maven/archetypes/contribution-zip/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/contribution-zip/pom.xml b/maven/archetypes/contribution-zip/pom.xml
new file mode 100644
index 0000000..bb12360
--- /dev/null
+++ b/maven/archetypes/contribution-zip/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-contribution-zip</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create an SCA ZIP contribution project</name>
+ <description>Create an SCA ZIP contribution project</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-3</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-3</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java b/maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
rename to maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
diff --git a/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java b/maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
rename to maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
diff --git a/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml b/maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
rename to maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
diff --git a/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite b/maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
similarity index 100%
rename from archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
rename to maven/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
diff --git a/maven/archetypes/pom.xml b/maven/archetypes/pom.xml
new file mode 100644
index 0000000..9a892b0
--- /dev/null
+++ b/maven/archetypes/pom.xml
@@ -0,0 +1,52 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-archetype</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Maven Archetypes</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <modules>
+ <module>contribution-jar</module>
+ <module>contribution-zip</module>
+ <module>contribution-zip-discriptor</module>
+ <module>quickstart</module>
+ <module>quickstart-jsf</module>
+ <module>quickstart-stripes</module>
+ <module>quickstart-bpel</module>
+ <module>binding</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/archetypes/quickstart-bpel/META-INF/MANIFEST.MF b/maven/archetypes/quickstart-bpel/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/quickstart-bpel/META-INF/MANIFEST.MF
rename to maven/archetypes/quickstart-bpel/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/quickstart-bpel/pom.xml b/maven/archetypes/quickstart-bpel/pom.xml
new file mode 100644
index 0000000..1764913
--- /dev/null
+++ b/maven/archetypes/quickstart-bpel/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-bpel</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create an SCA Webapp project using BPEL</name>
+ <description>Create an SCA Webapp project using BPEL</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-3</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-3</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.bpel b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.bpel
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.bpel
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.bpel
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
diff --git a/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/hello.jsp b/maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
similarity index 100%
rename from archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
rename to maven/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
diff --git a/maven/archetypes/quickstart-jsf/pom.xml b/maven/archetypes/quickstart-jsf/pom.xml
new file mode 100644
index 0000000..3b6c726
--- /dev/null
+++ b/maven/archetypes/quickstart-jsf/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-jsf</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a Tuscany SCA and JSF project</name>
+ <description>Create a Tuscany SCA and JSF project</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/helloWorld.jsp b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/helloWorld.jsp
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/helloWorld.jsp
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/helloWorld.jsp
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/index.jsp
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/index.jsp
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/index.jsp
diff --git a/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/page2.jsp b/maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/page2.jsp
similarity index 100%
rename from archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/page2.jsp
rename to maven/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/page2.jsp
diff --git a/archetypes/quickstart-jsonp/META-INF/MANIFEST.MF b/maven/archetypes/quickstart-jsonp/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/quickstart-jsonp/META-INF/MANIFEST.MF
rename to maven/archetypes/quickstart-jsonp/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/quickstart-jsonp/pom.xml b/maven/archetypes/quickstart-jsonp/pom.xml
new file mode 100644
index 0000000..e768052
--- /dev/null
+++ b/maven/archetypes/quickstart-jsonp/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-jsonp</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a Tuscany SCA webapp project using the JSONP binding</name>
+ <description>Create a Tuscany SCA webapp project using the JSONP binding</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/quickstart-jsonp/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
diff --git a/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/hello.jsp b/maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
similarity index 100%
rename from archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
rename to maven/archetypes/quickstart-jsonp/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
diff --git a/archetypes/quickstart-stripes/META-INF/MANIFEST.MF b/maven/archetypes/quickstart-stripes/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/quickstart-stripes/META-INF/MANIFEST.MF
rename to maven/archetypes/quickstart-stripes/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/quickstart-stripes/pom.xml b/maven/archetypes/quickstart-stripes/pom.xml
new file mode 100644
index 0000000..38c1971
--- /dev/null
+++ b/maven/archetypes/quickstart-stripes/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-stripes</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a simple Apache Tuscany SCA webapp project using the Stripes Web Framework</name>
+ <description>Create a simple Apache Tuscany SCA webapp project using the Stripes Web Framework</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/home.jsp b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/home.jsp
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/home.jsp
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/home.jsp
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/layout.jsp b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/layout.jsp
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/layout.jsp
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/layout.jsp
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/taglibs.jsp b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/taglibs.jsp
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/taglibs.jsp
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/taglibs.jsp
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
diff --git a/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/index.html b/maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/index.html
similarity index 100%
rename from archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/index.html
rename to maven/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/index.html
diff --git a/archetypes/quickstart/META-INF/MANIFEST.MF b/maven/archetypes/quickstart/META-INF/MANIFEST.MF
similarity index 100%
rename from archetypes/quickstart/META-INF/MANIFEST.MF
rename to maven/archetypes/quickstart/META-INF/MANIFEST.MF
diff --git a/maven/archetypes/quickstart/pom.xml b/maven/archetypes/quickstart/pom.xml
new file mode 100644
index 0000000..0df2032
--- /dev/null
+++ b/maven/archetypes/quickstart/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a simple Apache Tuscany SCA webapp project</name>
+ <description>Create a simple Apache Tuscany SCA webapp project</description>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml b/maven/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
similarity index 100%
rename from archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
rename to maven/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
diff --git a/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml b/maven/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
similarity index 100%
rename from archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
rename to maven/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml b/maven/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/hello.jsp b/maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
similarity index 100%
rename from archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
rename to maven/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/hello.jsp
diff --git a/maven/maven-tuscany-plugin/pom.xml b/maven/maven-tuscany-plugin/pom.xml
index 70cd8e9..ac89f17 100644
--- a/maven/maven-tuscany-plugin/pom.xml
+++ b/maven/maven-tuscany-plugin/pom.xml
@@ -50,8 +50,13 @@
</dependency>
<dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
<version>2.0-Beta1</version>
</dependency>
diff --git a/modules/assembly-xml/META-INF/MANIFEST.MF b/modules/assembly-xml/META-INF/MANIFEST.MF
index 57e6930..fe28508 100644
--- a/modules/assembly-xml/META-INF/MANIFEST.MF
+++ b/modules/assembly-xml/META-INF/MANIFEST.MF
@@ -47,6 +47,7 @@
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
org.apache.tuscany.sca.common.java.io;version="2.0.0",
+ org.apache.tuscany.sca.common.xml.stax;version="2.0.0",
org.apache.tuscany.sca.common.xml.xpath;version="2.0.0",
org.apache.tuscany.sca.contribution;version="2.0.0",
org.apache.tuscany.sca.contribution.java;version="2.0.0",
diff --git a/modules/assembly-xml/pom.xml b/modules/assembly-xml/pom.xml
index 3f5bfdd..05df093 100644
--- a/modules/assembly-xml/pom.xml
+++ b/modules/assembly-xml/pom.xml
@@ -45,6 +45,12 @@
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-xsd</artifactId>
<version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-common-xml</artifactId>
+ <version>2.0-Beta1</version>
</dependency>
<!--
@@ -65,7 +71,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
index 641e523..091b3c0 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
@@ -409,7 +409,7 @@
* @param element
* @param type
* @param reader
- * @param context TODO
+ * @param context
* @return
* @throws XMLStreamException
* @throws ContributionReadException
@@ -664,74 +664,6 @@
}
/**
- * Write the value of a property
- * @param document
- * @param element
- * @param type
- * @param writer
- * @throws XMLStreamException
- */
- protected void writePropertyValue(Object propertyValue, QName element, QName type, XMLStreamWriter writer)
- throws XMLStreamException {
-
- if (propertyValue instanceof Document) {
- Document document = (Document)propertyValue;
- NodeList nodeList = document.getDocumentElement().getChildNodes();
-
- for (int item = 0; item < nodeList.getLength(); ++item) {
- Node node = nodeList.item(item);
- int nodeType = node.getNodeType();
- if (nodeType == Node.ELEMENT_NODE) {
- XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new DOMSource(node));
-
- while (reader.hasNext()) {
- switch (reader.next()) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
-
- int namespaces = reader.getNamespaceCount();
- for (int i = 0; i < namespaces; i++) {
- String prefix = reader.getNamespacePrefix(i);
- String ns = reader.getNamespaceURI(i);
- writer.writeNamespace(prefix, ns);
- }
-
- if (!"".equals(name.getNamespaceURI())) {
- writer.writeNamespace(name.getPrefix(), name.getNamespaceURI());
- }
-
- // add the attributes for this element
- namespaces = reader.getAttributeCount();
- for (int i = 0; i < namespaces; i++) {
- String ns = reader.getAttributeNamespace(i);
- String prefix = reader.getAttributePrefix(i);
- String qname = reader.getAttributeLocalName(i);
- String value = reader.getAttributeValue(i);
-
- writer.writeAttribute(prefix, ns, qname, value);
- }
-
- break;
- case XMLStreamConstants.CDATA:
- writer.writeCData(reader.getText());
- break;
- case XMLStreamConstants.CHARACTERS:
- writer.writeCharacters(reader.getText());
- break;
- case XMLStreamConstants.END_ELEMENT:
- writer.writeEndElement();
- break;
- }
- }
- } else {
- writer.writeCharacters(node.getTextContent());
- }
- }
- }
- }
-
- /**
*
* @param reader
* @param elementName
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java
index b402b6e..8f24cc4 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java
@@ -42,6 +42,7 @@
import static org.apache.tuscany.sca.assembly.xml.Constants.EXTENSION_QNAME;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@@ -54,6 +55,7 @@
import org.apache.tuscany.sca.assembly.Property;
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.common.xml.stax.StAXHelper;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
@@ -61,12 +63,15 @@
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.impl.OperationImpl;
import org.apache.tuscany.sca.policy.PolicySubject;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* A componentType processor.
@@ -74,6 +79,8 @@
* @version $Rev$ $Date$
*/
public class ComponentTypeProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<ComponentType> {
+
+ private StAXHelper staxHelper;
/**
* Constructs a new componentType processor.
@@ -83,10 +90,14 @@
* @param extensionAttributeProcessor
* @param monitor
*/
- public ComponentTypeProcessor(FactoryExtensionPoint modelFactories,
+ public ComponentTypeProcessor(ExtensionPointRegistry extensionPoints,
+ //public ComponentTypeProcessor(FactoryExtensionPoint modelFactories,
StAXArtifactProcessor extensionProcessor,
StAXAttributeProcessor extensionAttributeProcessor) {
- super(modelFactories, extensionProcessor);
+ super(modelFactories(extensionPoints), extensionProcessor);
+
+ //
+ staxHelper = StAXHelper.getInstance(extensionPoints);
}
public ComponentType read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException {
@@ -364,6 +375,75 @@
writeEndDocument(writer);
}
+ /**
+ * Write the value of a property - override to use correct method of creating an XMLStreamReader
+ * @param document
+ * @param element
+ * @param type
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void writePropertyValue(Object propertyValue, QName element, QName type, XMLStreamWriter writer)
+ throws XMLStreamException {
+
+ if (propertyValue instanceof Document) {
+ Document document = (Document)propertyValue;
+ NodeList nodeList = document.getDocumentElement().getChildNodes();
+
+ for (int item = 0; item < nodeList.getLength(); ++item) {
+ Node node = nodeList.item(item);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ // Correct way to create a reader for a node object...
+ XMLStreamReader reader = staxHelper.createXMLStreamReader(node);
+
+ while (reader.hasNext()) {
+ switch (reader.next()) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
+
+ int namespaces = reader.getNamespaceCount();
+ for (int i = 0; i < namespaces; i++) {
+ String prefix = reader.getNamespacePrefix(i);
+ String ns = reader.getNamespaceURI(i);
+ writer.writeNamespace(prefix, ns);
+ }
+
+ if (!"".equals(name.getNamespaceURI())) {
+ writer.writeNamespace(name.getPrefix(), name.getNamespaceURI());
+ }
+
+ // add the attributes for this element
+ namespaces = reader.getAttributeCount();
+ for (int i = 0; i < namespaces; i++) {
+ String ns = reader.getAttributeNamespace(i);
+ String prefix = reader.getAttributePrefix(i);
+ String qname = reader.getAttributeLocalName(i);
+ String value = reader.getAttributeValue(i);
+
+ writer.writeAttribute(prefix, ns, qname, value);
+ }
+
+ break;
+ case XMLStreamConstants.CDATA:
+ writer.writeCData(reader.getText());
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ writer.writeCharacters(reader.getText());
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ writer.writeEndElement();
+ break;
+ }
+ }
+ } else {
+ writer.writeCharacters(node.getTextContent());
+ }
+ }
+ }
+ } // end method writePropertyValue
+
public void resolve(ComponentType componentType, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
// Resolve component type services and references
@@ -378,4 +458,14 @@
public Class<ComponentType> getModelType() {
return ComponentType.class;
}
+
+ /**
+ * Returns the model factory extension point to use.
+ *
+ * @param extensionPoints
+ * @return
+ */
+ private static FactoryExtensionPoint modelFactories(ExtensionPointRegistry extensionPoints) {
+ return extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ }
}
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
index 22879c2..eecb07e 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
@@ -66,10 +66,12 @@
import java.util.StringTokenizer;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.xpath.XPathExpressionException;
import org.apache.tuscany.sca.assembly.Binding;
@@ -87,6 +89,7 @@
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.assembly.Wire;
+import org.apache.tuscany.sca.common.xml.stax.StAXHelper;
import org.apache.tuscany.sca.common.xml.xpath.XPathHelper;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.Contribution;
@@ -111,6 +114,8 @@
import org.apache.tuscany.sca.xsd.XSDFactory;
import org.apache.tuscany.sca.xsd.XSDefinition;
import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* A composite processor.
@@ -123,6 +128,8 @@
private StAXAttributeProcessor<Object> extensionAttributeProcessor;
private ContributionFactory contributionFactory;
private XSDFactory xsdFactory;
+
+ private StAXHelper staxHelper;
/**
* Construct a new composite processor
@@ -140,6 +147,9 @@
this.extensionAttributeProcessor = extensionAttributeProcessor;
this.xsdFactory = extensionPoints.getExtensionPoint(XSDFactory.class);
+
+ //
+ staxHelper = StAXHelper.getInstance(extensionPoints);
}
/**
@@ -354,23 +364,11 @@
}
componentProperty.setSource(source);
if (source != null) {
- // $<name>/...
- if (source.charAt(0) == '$') {
- int index = source.indexOf('/');
- if (index == -1) {
- // Tolerating $prop
- source = "";
- } else {
- source = source.substring(index + 1);
- }
- if ("".equals(source)) {
- source = ".";
- }
- }
-
+ String xPath = prepareSourceXPathString( source );
+
try {
componentProperty.setSourceXPathExpression(xpathHelper.compile(reader
- .getNamespaceContext(), source));
+ .getNamespaceContext(), xPath));
} catch (XPathExpressionException e) {
ContributionReadException ce = new ContributionReadException(e);
error(monitor, "ContributionReadException", source, ce);
@@ -648,6 +646,51 @@
return composite;
}
+
+ /**
+ * Prepares the property @source XPath expression
+ *
+ * The form of the @source attribute in the composite file must take one of the forms
+ * $propertyName
+ * $propertyName/expression
+ * $propertyName[n]
+ * $propertyName[n]/expression
+ * Property values are stored as <sca:property> elements with one or more <sca:value> subelements or one or more
+ * global element subelements. The XPath constructed is designed to work against this XML structure and aims to
+ * retrieve one or more of the subelements or subportions of those subelements (eg some text content).
+ * Thus the XPath:
+ * - starts with "*", which means "all the child elements of the root" where root = the <property/> element
+ * - may then be followed by [xxx] (typically [n] to select one of the child elements) if the source string has [xxx]
+ * following the propertyName
+ * - may then be followed by /expression, if the source contains an expression, which will typically select some subportion
+ * of the child element(s)
+ *
+ * @param source - the @source attribute string from a <sca:property> element
+ * @return the XPath string to use for the source property
+ */
+ private String prepareSourceXPathString( String source ) {
+ String output = null;
+ // Expression must begin with '$'
+ if( source.charAt(0) != '$' ) return output;
+
+ int slash = source.indexOf('/');
+ int bracket = source.indexOf('[');
+ if (slash == -1) {
+ // Form is $propertyName or $propertyName[n]
+ output = "*";
+ if( bracket != -1 ) {
+ output = "*" + source.substring(bracket);
+ }
+ } else {
+ // Form is $propertyName/exp or $propertyName[n]/exp
+ output = "*/" + source.substring(slash + 1);
+ if( bracket != -1 && bracket < slash ) {
+ output = "*" + source.substring(bracket);
+ }
+ } // end if
+
+ return output;
+ } // end method prepareSourceXPathString( source )
public void write(Composite composite, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException,
XMLStreamException {
@@ -747,11 +790,11 @@
// Write the component implementation
Implementation implementation = component.getImplementation();
if (implementation instanceof Composite) {
- writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, ((Composite)implementation).getName()));
+ writeStart(writer, IMPLEMENTATION_COMPOSITE, new XAttr(NAME, ((Composite)implementation).getName()), policyProcessor.writePolicies(implementation));
//write extended attributes
this.writeExtendedAttributes(writer, (Composite)implementation, extensionAttributeProcessor, context);
-
+
writeEnd(writer);
} else {
extensionProcessor.write(component.getImplementation(), writer, context);
@@ -1055,8 +1098,20 @@
//now resolve the implementation so that even if there is a shared instance
//for this that is resolved, the specified intents and policysets are safe in the
//component and not lost
+
+ List<PolicySet> policySets = new ArrayList<PolicySet>(implementation.getPolicySets());
+ List<Intent> intents = new ArrayList<Intent>(implementation.getRequiredIntents());
implementation = resolveImplementation(implementation, resolver, context);
+ // If there are any policy sets on the implementation or component we have to
+ // ignore policy sets from the component type (policy spec 4.9)
+ if ( !policySets.isEmpty() || !component.getPolicySets().isEmpty() ) {
+ implementation.getPolicySets().clear();
+ implementation.getPolicySets().addAll(policySets);
+ }
+
+ implementation.getRequiredIntents().addAll(intents);
+
component.setImplementation(implementation);
}
@@ -1088,6 +1143,76 @@
public Class<Composite> getModelType() {
return Composite.class;
}
+
+ /**
+ * Write the value of a property - override to use correct method of creating an XMLStreamReader
+ * @param document
+ * @param element
+ * @param type
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void writePropertyValue(Object propertyValue, QName element, QName type, XMLStreamWriter writer)
+ throws XMLStreamException {
+
+ if (propertyValue instanceof Document) {
+ Document document = (Document)propertyValue;
+ NodeList nodeList = document.getDocumentElement().getChildNodes();
+
+ for (int item = 0; item < nodeList.getLength(); ++item) {
+ Node node = nodeList.item(item);
+ int nodeType = node.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE) {
+ // Correct way to create a reader for a node object...
+ XMLStreamReader reader = staxHelper.createXMLStreamReader(node);
+
+ while (reader.hasNext()) {
+ switch (reader.next()) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ writer.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
+
+ int namespaces = reader.getNamespaceCount();
+ for (int i = 0; i < namespaces; i++) {
+ String prefix = reader.getNamespacePrefix(i);
+ String ns = reader.getNamespaceURI(i);
+ writer.writeNamespace(prefix, ns);
+ }
+
+ if (!"".equals(name.getNamespaceURI())) {
+ writer.writeNamespace(name.getPrefix(), name.getNamespaceURI());
+ }
+
+ // add the attributes for this element
+ namespaces = reader.getAttributeCount();
+ for (int i = 0; i < namespaces; i++) {
+ String ns = reader.getAttributeNamespace(i);
+ String prefix = reader.getAttributePrefix(i);
+ String qname = reader.getAttributeLocalName(i);
+ String value = reader.getAttributeValue(i);
+
+ writer.writeAttribute(prefix, ns, qname, value);
+ }
+
+ break;
+ case XMLStreamConstants.CDATA:
+ writer.writeCData(reader.getText());
+ break;
+ case XMLStreamConstants.CHARACTERS:
+ writer.writeCharacters(reader.getText());
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ writer.writeEndElement();
+ break;
+ }
+ }
+ } else {
+ writer.writeCharacters(node.getTextContent());
+ }
+ }
+ }
+ } // end method writePropertyValue
+
/**
* Returns the model factory extension point to use.
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
index 7965002..0c88a01 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java
@@ -145,7 +145,30 @@
String AUTHORIZATION_FINE_GRAIN = "authorization.fineGrain";
QName AUTHORIZATION_FINE_GRAIN_INTENT = new QName(SCA11_NS, AUTHORIZATION_FINE_GRAIN);
- // TODO - add transaction intent constants
+ String MANAGED_TRANSACTION = "managedTransaction";
+ QName MANAGED_TRANSACTION_INTENT = new QName(SCA11_NS, MANAGED_TRANSACTION);
+
+ String NO_MANAGED_TRANSACTION = "noManagedTransaction";
+ QName NO_MANAGED_TRANSACTION_INTENT = new QName(SCA11_NS, NO_MANAGED_TRANSACTION);
+
+ String MANAGED_TRANSACTION_LOCAL = "managedTransaction.local";
+ QName MANAGED_TRANSACTION_LOCAL_INTENT = new QName(SCA11_NS, MANAGED_TRANSACTION_LOCAL);
+
+ String MANAGED_TRANSACTION_GLOBAL = "managedTransaction.global";
+ QName MANAGED_TRANSACTION_GLOBAL_INTENT = new QName(SCA11_NS, MANAGED_TRANSACTION_GLOBAL);
+
+ String PROPAGATES_TRANSACTION = "propagatesTransaction";
+ QName PROPAGATES_TRANSACTION_INTENT = new QName(SCA11_NS, PROPAGATES_TRANSACTION);
+
+ String SUSPENDS_TRANSACTION = "suspendsTransaction";
+ QName SUSPENDS_TRANSACTION_INTENT = new QName(SCA11_NS, SUSPENDS_TRANSACTION);
+
+ String TRANSACTED_ONE_WAY = "transactedOneWay";
+ QName TRANSACTED_ONE_WAY_INTENT = new QName(SCA11_NS, TRANSACTED_ONE_WAY);
+
+ String IMMEDIATE_ONE_WAY = "immediateOneWay";
+ QName IMMEDIATE_ONE_WAY_INTENT = new QName(SCA11_NS, IMMEDIATE_ONE_WAY);
+
String NOLISTENER = "noListener";
QName NOLISTENER_INTENT = new QName(SCA11_NS, NOLISTENER);
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
index 006b80e..0213713 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
@@ -46,6 +46,7 @@
import org.apache.tuscany.sca.definitions.DefinitionsFactory;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
import org.apache.tuscany.sca.policy.ImplementationType;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.IntentMap;
@@ -118,6 +119,8 @@
definitions.getBindingTypes().add((BindingType)extension);
} else if (extension instanceof ImplementationType) {
definitions.getImplementationTypes().add((ImplementationType)extension);
+ } else if (extension instanceof ExternalAttachment) {
+ definitions.getExternalAttachments().add((ExternalAttachment)extension);
}
}
break;
@@ -250,14 +253,17 @@
// Flat intentMap structure by creating a policySet for each one
List<PolicySet> copy = new ArrayList<PolicySet>(scaDefns.getPolicySets());
for (PolicySet policySet : copy) {
- //[lresende] Do we need to remove the current policySet and just include the flat one based on qualifiers ?
- //If we don't, the policy is being resolved to the one that has intentMap and no direct concrete policies
- boolean remove = false;
+ // Add PolicySets to model based on qualified intents. The policy builder will be responsible for assigning
+ // the correct policy set.
+ // For example, ManagedTransactionPolicySet will result in:
+ // ManagedTransactionPolicySet (original PolicySet, must exist for matching at build time)
+ // ManagedTransactionPolicySet.managedTransaction.global
+ // ManagedTransactionPolicySet.managedTransaction.local
//process intent maps
for(IntentMap intentMap : policySet.getIntentMaps()) {
for(Qualifier qualifier : intentMap.getQualifiers()) {
- remove = true;
+ // remove = true;
PolicySet qualifiedPolicySet = policyFactory.createPolicySet();
qualifiedPolicySet.setAppliesTo(policySet.getAppliesTo());
@@ -265,7 +271,8 @@
qualifiedPolicySet.setAttachTo(policySet.getAttachTo());
qualifiedPolicySet.setAttachToXPathExpression(policySet.getAttachToXPathExpression());
- qualifiedPolicySet.setName(qualifier.getIntent().getName());
+ String qualifiedLocalName = policySet.getName().getLocalPart() + "." + qualifier.getIntent().getName().getLocalPart();
+ qualifiedPolicySet.setName(new QName(policySet.getName().getNamespaceURI(), qualifiedLocalName));
qualifiedPolicySet.getProvidedIntents().clear();
qualifiedPolicySet.getProvidedIntents().add(qualifier.getIntent());
qualifiedPolicySet.getPolicies().clear();
@@ -275,9 +282,9 @@
}
}
- if(remove) {
- scaDefns.getPolicySets().remove(policySet);
- }
+// if(remove) {
+// scaDefns.getPolicySets().remove(policySet);
+// }
}
}
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ExternalAttachmentProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ExternalAttachmentProcessor.java
new file mode 100644
index 0000000..2cf9d02
--- /dev/null
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/ExternalAttachmentProcessor.java
@@ -0,0 +1,296 @@
+/*
+ * 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.sca.policy.xml;
+
+import static org.apache.tuscany.sca.policy.xml.PolicyConstants.SCA11_NS;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.XMLConstants;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.apache.tuscany.sca.common.xml.xpath.XPathHelper;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Processor for handling XML models of ExternalAttachment definitions
+ *
+ * @version $Rev: 961010 $ $Date: 2010-07-06 13:34:54 -0700 (Tue, 06 Jul 2010) $
+ */
+public class ExternalAttachmentProcessor extends BaseStAXArtifactProcessor
+ implements StAXArtifactProcessor<ExternalAttachment>, PolicyConstants {
+
+
+ private PolicyFactory policyFactory;
+ private XPathHelper xpathHelper;
+
+ public ExternalAttachmentProcessor(ExtensionPointRegistry registry) {
+ FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ this.policyFactory = factories.getFactory(PolicyFactory.class);
+ this.xpathHelper = XPathHelper.getInstance(registry);
+ }
+
+ public Class<ExternalAttachment> getModelType() {
+ return ExternalAttachment.class;
+ }
+
+ public void resolve(ExternalAttachment attachment, ModelResolver resolver,
+ ProcessorContext context) throws ContributionResolveException {
+ if (attachment != null && attachment.isUnresolved()) {
+ resolveIntents(attachment, resolver, context);
+ resolvePolicySets(attachment, resolver, context);
+
+ attachment.setUnresolved(false);
+ }
+
+ }
+
+ private void resolvePolicySets(ExternalAttachment attachment,
+ ModelResolver resolver, ProcessorContext context) {
+ List<PolicySet> referredPolicySets = new ArrayList<PolicySet>();
+ for (PolicySet referredPolicySet : attachment.getPolicySets()) {
+ if (referredPolicySet.isUnresolved()) {
+ PolicySet resolved = resolver.resolveModel(PolicySet.class, referredPolicySet, context);
+ if (!resolved.isUnresolved() || resolved != referredPolicySet) {
+ referredPolicySets.add(resolved);
+ } else {
+ error(context.getMonitor(), "ReferredPolicySetNotFound", attachment, referredPolicySet, attachment);
+ return;
+ }
+ } else {
+ referredPolicySets.add(referredPolicySet);
+ }
+ }
+ attachment.getPolicySets().clear();
+ attachment.getPolicySets().addAll(referredPolicySets);
+
+ }
+
+ private void resolveIntents(ExternalAttachment attachment,
+ ModelResolver resolver, ProcessorContext context) {
+ if (attachment != null) {
+ //resolve all provided intents
+ List<Intent> providedIntents = new ArrayList<Intent>();
+ for (Intent providedIntent : attachment.getIntents()) {
+ if (providedIntent.isUnresolved()) {
+ Intent resolved = resolver.resolveModel(Intent.class, providedIntent, context);
+ if (!resolved.isUnresolved() || resolved != providedIntent) {
+ providedIntents.add(resolved);
+ } else {
+ error(context.getMonitor(), "ProvidedIntentNotFound", attachment, providedIntent, attachment);
+ return;
+ }
+ } else {
+ providedIntents.add(providedIntent);
+ }
+ }
+ attachment.getIntents().clear();
+ attachment.getIntents().addAll(providedIntents);
+ }
+
+ }
+
+ public QName getArtifactType() {
+ return EXTERNAL_ATTACHMENT_QNAME;
+ }
+
+ public ExternalAttachment read(XMLStreamReader reader, ProcessorContext context)
+ throws ContributionReadException, XMLStreamException {
+ ExternalAttachment attachment = policyFactory.createExternalAttachment();
+
+ readPolicySets(attachment, reader);
+ readIntents(attachment, reader, context);
+ readAttachTo(attachment, reader, context);
+
+ return attachment;
+ }
+
+ private void readIntents(ExternalAttachment attachment,
+ XMLStreamReader reader, ProcessorContext context) {
+ String value = reader.getAttributeValue(null, INTENTS);
+ if (value != null) {
+ List<Intent> intents = attachment.getIntents();
+ for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
+ QName qname = getQNameValue(reader, tokens.nextToken());
+ Intent intent = policyFactory.createIntent();
+ intent.setName(qname);
+ intents.add(intent);
+ }
+ }
+
+ }
+
+ private void readAttachTo(ExternalAttachment attachment,
+ XMLStreamReader reader, ProcessorContext context) {
+ Monitor monitor = context.getMonitor();
+
+ String attachTo = reader.getAttributeValue(null, ATTACH_TO);
+ if ( attachTo != null ) {
+ try {
+ XPath path = xpathHelper.newXPath();
+ NamespaceContext nsContext = xpathHelper.getNamespaceContext(attachTo, reader.getNamespaceContext());
+ path.setXPathFunctionResolver(new PolicyXPathFunctionResolver(nsContext));
+
+ attachTo = PolicyXPathFunction.normalize(attachTo,getSCAPrefix(nsContext));
+ XPathExpression expression = xpathHelper.compile(path, nsContext, attachTo);
+ attachment.setAttachTo(attachTo);
+ attachment.setAttachToXPathExpression(expression);
+ } catch (XPathExpressionException e) {
+ ContributionReadException ce = new ContributionReadException(e);
+ error(monitor, "ContributionReadException", attachment, ce);
+ }
+ }
+
+ }
+
+ private String getSCAPrefix(NamespaceContext nsContext) {
+
+ Iterator<String> iter = nsContext.getPrefixes(SCA11_NS);
+ while (iter.hasNext()) {
+ String prefix = iter.next();
+ if (!prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+ return prefix;
+ }
+ }
+
+ return "__sca";
+ }
+ /**
+ * Reads policy sets associated with an external attachment element.
+ * @param subject
+ * @param operation
+ * @param reader
+ */
+ private void readPolicySets(ExternalAttachment attachment, XMLStreamReader reader) {
+
+
+ String value = reader.getAttributeValue(null, POLICY_SETS);
+ if (value != null) {
+ List<PolicySet> policySets = attachment.getPolicySets();
+ for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) {
+ QName qname = getQNameValue(reader, tokens.nextToken());
+ PolicySet policySet = policyFactory.createPolicySet();
+ policySet.setName(qname);
+ policySets.add(policySet);
+ }
+ }
+ }
+ public void write(ExternalAttachment attachment, XMLStreamWriter writer,
+ ProcessorContext context) throws ContributionWriteException,
+ XMLStreamException {
+ writePolicySets(attachment, writer, context);
+ writeIntents(attachment, writer, context);
+ writeAttachTo(attachment, writer, context);
+
+ }
+
+ private void writeAttachTo(ExternalAttachment attachment,
+ XMLStreamWriter writer, ProcessorContext context) throws XMLStreamException {
+ if ( attachment.getAttachTo() != null ) {
+ writer.writeAttribute(PolicyConstants.ATTACH_TO, attachment.getAttachTo());
+ }
+
+ }
+
+ private void writeIntents(ExternalAttachment attachment,
+ XMLStreamWriter writer, ProcessorContext context) throws XMLStreamException {
+ if (!attachment.getIntents().isEmpty()) {
+ StringBuffer sb = new StringBuffer();
+ for (Intent intent : attachment.getIntents()) {
+ sb.append(getQualifiedName(intent.getName(), writer));
+ sb.append(" ");
+ }
+ // Remove the last space
+ sb.deleteCharAt(sb.length() - 1);
+ writer.writeAttribute(PolicyConstants.INTENTS, sb.toString());
+ }
+
+ }
+
+ private void writePolicySets(ExternalAttachment attachment,
+ XMLStreamWriter writer, ProcessorContext context) throws XMLStreamException {
+ if ( !attachment.getPolicySets().isEmpty()) {
+ StringBuffer sb = new StringBuffer();
+ for (PolicySet ps : attachment.getPolicySets()) {
+ sb.append(getQualifiedName(ps.getName(), writer));
+ sb.append(" ");
+ }
+ // Remove the last space
+ sb.deleteCharAt(sb.length() - 1);
+ writer.writeAttribute(PolicyConstants.POLICY_SETS, sb.toString());
+ }
+
+ }
+
+ private String getQualifiedName(QName name, XMLStreamWriter writer) throws XMLStreamException {
+ String local = name.getLocalPart();
+ String prefix = writer.getPrefix(name.getNamespaceURI());
+ if (prefix != null && prefix.length() > 0) {
+ return prefix + ':' + local;
+ } else {
+ return local;
+ }
+ }
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ Messages.RESOURCE_BUNDLE,
+ Severity.ERROR,
+ model,
+ message,
+ (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+}
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
index 296677d..c7eb7f4 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/IntentProcessor.java
@@ -125,6 +125,14 @@
readExcludedIntents(intent, reader);
readConstrainedTypes(intent, reader);
+
+ String mutuallyExclusiveString = reader.getAttributeValue(null, MUTUALLY_EXCLUSIVE);
+ if (mutuallyExclusiveString != null &&
+ mutuallyExclusiveString.equals("true")){
+ intent.setMutuallyExclusive(true);
+ } else {
+ intent.setMutuallyExclusive(false);
+ }
Intent current = intent;
int event = reader.getEventType();
@@ -146,6 +154,7 @@
boolean isDefault = defaultQ == null ? false : Boolean.parseBoolean(defaultQ);
String qualifiedIntentName = intentLocalName + QUALIFIER + qualifierName;
Intent qualified = policyFactory.createIntent();
+ qualified.setUnresolved(false);
qualified.setType(intent.getType());
qualified.setName(new QName(qualifiedIntentName));
if (isDefault) {
@@ -198,6 +207,19 @@
if (intent.getQualifiedIntents().size() == 1) {
intent.setDefaultQualifiedIntent(intent.getQualifiedIntents().get(0));
}
+
+ // set all qualified intents as excluding one another if the qualifiable
+ // intent is set to be mutually exclusive
+ if (intent.isMutuallyExclusive()){
+ for (Intent qualifiedIntent : intent.getQualifiedIntents()){
+ for (Intent excludedIntent : intent.getQualifiedIntents()){
+ if (qualifiedIntent != excludedIntent){
+ qualifiedIntent.getExcludedIntents().add(excludedIntent);
+ }
+ }
+ }
+ }
+
return intent;
}
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
index 69c5a11..2498f3d 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
@@ -49,7 +49,11 @@
String REQUIRES = "requires";
String EXCLUDES = "excludes";
String DEFAULT = "default";
-
+ String EXTERNAL_ATTACHMENT = "externalAttachment";
+ String INTENTS = "intents";
+ String POLICY_SETS = "policySets";
+ String MUTUALLY_EXCLUSIVE = "mutuallyExclusive";
+
String ALWAYS_PROVIDES = "alwaysProvides";
String MAY_PROVIDE = "mayProvide";
String INTENT_TYPE = "intentType";
@@ -68,7 +72,7 @@
QName POLICY_INTENT_MAP_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_MAP_QUALIFIER);
QName POLICY_SET_REFERENCE_QNAME = new QName(SCA11_NS, POLICY_SET_REFERENCE);
QName INTENT_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_QUALIFIER);
-
+ QName EXTERNAL_ATTACHMENT_QNAME = new QName(SCA11_NS, EXTERNAL_ATTACHMENT);
String QUALIFIED_INTENT_CONSTRAINS_ERROR = " - Qualified Intents must not specify 'constrains' attribute";
}
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
index 68475a2..6bf797d 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
@@ -359,8 +359,14 @@
writer.writeStartElement(SCA11_NS, POLICY_SET);
writer.writeNamespace(policySet.getName().getPrefix(), policySet.getName().getNamespaceURI());
writer.writeAttribute(NAME, policySet.getName().getPrefix() + COLON + policySet.getName().getLocalPart());
- writer.writeAttribute(APPLIES_TO, policySet.getAppliesTo());
- writer.writeAttribute(ATTACH_TO, policySet.getAttachTo());
+
+ if (policySet.getAppliesTo() != null){
+ writer.writeAttribute(APPLIES_TO, policySet.getAppliesTo());
+ }
+
+ if (policySet.getAttachTo() != null){
+ writer.writeAttribute(ATTACH_TO, policySet.getAttachTo());
+ }
writeProvidedIntents(policySet, writer);
diff --git a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyXPathFunction.java b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyXPathFunction.java
index d0b45b2..8e2d7f9 100644
--- a/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyXPathFunction.java
+++ b/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyXPathFunction.java
@@ -29,6 +29,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathFunction;
@@ -242,7 +243,7 @@
private QName getStringAsQName(String intent) {
int idx = intent.indexOf(':');
if (idx == -1)
- return new QName(intent);
+ return new QName(namespaceContext.getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX), intent);
String prefix = intent.substring(0, idx);
intent = intent.substring(idx + 1);
diff --git a/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
index 7982dc1..250cc1d 100644
--- a/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ b/modules/assembly-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -26,4 +26,4 @@
org.apache.tuscany.sca.policy.xml.ImplementationTypeProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#implementationType,model=org.apache.tuscany.sca.policy.ImplementationType
org.apache.tuscany.sca.policy.xml.IntentProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#intent,model=org.apache.tuscany.sca.policy.Intent
org.apache.tuscany.sca.policy.xml.PolicySetProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#policySet,model=org.apache.tuscany.sca.policy.PolicySet
-
+org.apache.tuscany.sca.policy.xml.ExternalAttachmentProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#externalAttachment,model=org.apache.tuscany.sca.policy.ExternalAttachment
diff --git a/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java b/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
index 231bdfd..b91308c 100644
--- a/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
+++ b/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
@@ -46,6 +46,7 @@
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.policy.BindingType;
import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
import org.apache.tuscany.sca.policy.ImplementationType;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.IntentMap;
@@ -72,6 +73,8 @@
private Map<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
private Map<QName, BindingType> bindingTypesTable = new Hashtable<QName, BindingType>();
private Map<QName, ImplementationType> implTypesTable = new Hashtable<QName, ImplementationType>();
+ private Map<QName, ExternalAttachment> attachmentsTable = new Hashtable<QName, ExternalAttachment>();
+
private static final String scaNamespace = "http://docs.oasis-open.org/ns/opencsa/sca/200912";
private static final String namespace = "http://test";
@@ -86,6 +89,7 @@
private static final QName basicAuthMsgProtSecurity = new QName(namespace, "BasicAuthMsgProtSecurity");
private static final QName wsBinding = new QName(scaNamespace, "binding.ws");
private static final QName javaImpl = new QName(scaNamespace, "implementation.java");
+ private static final QName testPolicySetOne = new QName(namespace, "TestPolicySetOne");
@Before
public void setUp() throws Exception {
@@ -136,6 +140,9 @@
} else if (artifact instanceof ImplementationType) {
ImplementationType implType = (ImplementationType)artifact;
implTypesTable.put(implType.getType(), implType);
+ } else if ( artifact instanceof ExternalAttachment) {
+ ExternalAttachment attachment = (ExternalAttachment)artifact;
+ attachmentsTable.put(attachment.getPolicySets().get(0).getName(), attachment);
}
if (artifact != null) {
@@ -172,6 +179,10 @@
assertNotNull(bindingTypesTable.get(wsBinding));
assertEquals(implTypesTable.size(), 1);
assertNotNull(implTypesTable.get(javaImpl));
+
+ // Test external attachments
+ assertEquals(1, attachmentsTable.size());
+ assertNotNull(attachmentsTable.get(policySetTable.get(testPolicySetOne).getName()));
}
private int getNumberOfQualifiedPolicies(PolicySet policySet) {
@@ -218,6 +229,10 @@
assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
assertNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
+ ExternalAttachment attachment = attachmentsTable.values().iterator().next();
+ PolicySet psOne = policySetTable.get(testPolicySetOne);
+ assertEquals(psOne, attachment.getPolicySets().get(0));
+
List<Intent> intents = new ArrayList<Intent>(intentTable.values());
for (Intent intent : intents) {
@@ -241,6 +256,10 @@
for (ExtensionType implType : implTypesTable.values()) {
staxProcessor.resolve(implType, resolver, context);
}
+
+ for ( ExternalAttachment ea : attachmentsTable.values()) {
+ staxProcessor.resolve(ea, resolver, context);
+ }
//testing if policy intents have been linked have property been linked up
assertNotNull(profileIntent.getRequiredIntents().get(0).getDescription());
@@ -268,6 +287,8 @@
assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
assertNotNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
+
+
}
private boolean isRealizedBy(PolicySet policySet, Intent intent) {
diff --git a/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml b/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
index a262b00..aea941a 100644
--- a/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
+++ b/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
@@ -201,4 +201,6 @@
</description>
</intent>
+ <externalAttachment policySets="test:TestPolicySetOne" attachTo="IntentRefs('test:testIntentOne')"/>
+
</definitions>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
index ad8ef70..ba25c99 100644
--- a/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
+++ b/modules/assembly-xsd/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -16,4 +16,4 @@
# under the License.
#
tuscany-sca-1.1.xsd
-sca-1.1-cd05.xsd
+sca-1.1-cd05-rev1.xsd
diff --git a/modules/assembly-xsd/src/main/resources/sca-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..1e38d38
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-1.1-cd05-rev1.xsd
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <include schemaLocation="sca-interface-java-1.1-cd04-rev1.xsd"/>
+ <include schemaLocation="sca-interface-wsdl-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-interface-cpp-1.1-cd04.xsd"/>
+ <include schemaLocation="sca-interface-c-1.1-cd05-rev1.xsd"/>
+
+ <include schemaLocation="sca-implementation-java-1.1-cd02-rev1.xsd"/>
+ <include schemaLocation="sca-implementation-composite-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-implementation-cpp-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-implementation-c-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-implementation-bpel-1.1-cd03.xsd"/>
+ <include schemaLocation="sca-implementation-spring-1.1-cd01.xsd"/>
+
+ <include schemaLocation="sca-binding-ws-1.1-cd04-rev1.xsd"/>
+ <include schemaLocation="sca-binding-ws-callback-1.1-cd04.xsd"/>
+ <include schemaLocation="sca-binding-jms-1.1-cd04-rev1.xsd"/>
+ <include schemaLocation="sca-binding-jca-1.1-cd04-rev1.xsd"/>
+ <include schemaLocation="sca-binding-sca-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-binding-ejb-1.1-cd02-rev1.xsd"/>
+
+ <include schemaLocation="sca-definitions-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-policy-1.1-cd03-rev1.xsd"/>
+
+ <include schemaLocation="sca-contribution-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-contribution-cpp-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-contribution-c-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-contribution-java-1.1-cd02-rev1.xsd"/>
+
+ <include schemaLocation="sca-jee-1.1-wd03.xsd"/>
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd01.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd01.xsd
deleted file mode 100644
index 4bccf9d..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd01.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <element name="binding.ejb" type="sca:EJBSessionBeanBinding"
- substitutionGroup="sca:binding" />
-
- <simpleType name="VersionValue">
- <restriction base="string">
- <enumeration value="EJB2"/>
- <enumeration value="EJB3"/>
- </restriction>
- </simpleType>
-
- <complexType name="EJBSessionBeanBinding">
- <complexContent>
- <extension base="sca:Binding">
- <!-- sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence-->
- <attribute name="homeInterface" type="NCName" use="optional"/>
- <attribute name="ejb-link-name" type="string" use="optional"/>
- <attribute name="ejb-version" type="sca:VersionValue" use="optional" default="EJB3"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd02-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd02-rev1.xsd
new file mode 100644
index 0000000..0ac63d4
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-ejb-1.1-cd02-rev1.xsd
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <element name="binding.ejb" type="sca:EJBSessionBeanBinding"
+ substitutionGroup="sca:binding" />
+
+ <simpleType name="VersionValue">
+ <restriction base="string">
+ <enumeration value="EJB2"/>
+ <enumeration value="EJB3"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="EJBSessionBeanBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="homeInterface" type="NCName" use="optional"/>
+ <attribute name="ejb-link-name" type="string" use="optional"/>
+ <attribute name="ejb-version" type="sca:VersionValue" use="optional" default="EJB3"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04-rev1.xsd
new file mode 100644
index 0000000..789918f
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04-rev1.xsd
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd" />
+
+ <complexType name="JCABinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <element name="outboundConnection"
+ type="sca:JCAOutboundConnection" minOccurs="0" />
+ <element name="inboundConnection"
+ type="sca:JCAInboundConnection" minOccurs="0" />
+ <element name="outboundInteraction"
+ type="sca:JCAOutboundInteraction" minOccurs="0" />
+ <element name="inboundInteraction"
+ type="sca:JCAInboundInteraction" minOccurs="0" />
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="initialContextFactory" type="anyURI"
+ use="optional"/>
+ <attribute name="jndiURL" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="JCACreateResource">
+ <restriction base="string">
+ <enumeration value="always" />
+ <enumeration value="never" />
+ <enumeration value="ifNotExist" />
+ </restriction>
+ </simpleType>
+ <simpleType name="ResAuth">
+ <restriction base="string">
+ <enumeration value="container" />
+ <enumeration value="application" />
+ </restriction>
+ </simpleType>
+ <complexType name="JCAOutboundConnection">
+ <sequence>
+ <element name="resourceAdapter" type="sca:ResourceAdapter"
+ minOccurs="0" />
+ <element name="connection" type="sca:Connection" />
+ <element name="resAuth" type="sca:ResAuth" minOccurs="0" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="managed" type="boolean" use="optional"
+ default="true" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="JCAInboundConnection">
+ <sequence>
+ <element name="resourceAdapter" type="sca:ResourceAdapter" />
+ <element name="activationSpec" type="sca:ActivationSpec" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="JCAOutboundInteraction">
+ <sequence>
+ <element name="connectionSpec" type="sca:ConnectionSpec"
+ minOccurs="0" />
+ <element name="interactionSpec" type="sca:InteractionSpec"
+ minOccurs="0" />
+ <element name="operation" type="sca:Operation" minOccurs="0" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="JCAInboundInteraction">
+ <sequence>
+ <element name="listener" type="string" minOccurs="0" />
+ <element name="inboundOperation" type="sca:InboundOperation"
+ minOccurs="0" maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="ResourceAdapter">
+ <sequence>
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NMTOKEN" use="optional" />
+ <attribute name="type" type="NMTOKEN" use="required" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="Connection">
+ <sequence>
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="jndiName" type="anyURI" use="optional" />
+ <attribute name="type" type="NMTOKEN" use="required" />
+ <attribute name="create" type="sca:JCACreateResource" use="optional"
+ default="ifNotExist" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="ActivationSpec">
+ <sequence>
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="jndiName" type="anyURI" use="optional" />
+ <attribute name="type" type="NMTOKEN" use="required" />
+ <attribute name="create" type="sca:JCACreateResource" use="optional"
+ default="ifNotExist"/>
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="Operation">
+ <sequence>
+ <element name="interactionSpec" type="sca:InteractionSpec"
+ minOccurs="0" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NMTOKEN" use="required" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="InboundOperation">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NMTOKEN" use="required" />
+ <attribute name="selectedOperation" type="string" use="required" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="ConnectionSpec">
+ <sequence>
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="type" type="NMTOKEN" use="required" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+ <complexType name="InteractionSpec">
+ <sequence>
+ <element name="property" type="sca:Property" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="type" type="NMTOKEN" use="required" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+
+ <element name="binding.jca" type="sca:JCABinding"
+ substitutionGroup="sca:binding" />
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04.xsd
deleted file mode 100644
index 824ba95..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-binding-jca-1.1-cd04.xsd
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <complexType name="JCABinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <element name="outboundConnection"
- type="sca:JCAOutboundConnection" minOccurs="0" />
- <element name="inboundConnection"
- type="sca:JCAInboundConnection" minOccurs="0" />
- <element name="outboundInteraction"
- type="sca:JCAOutboundInteraction" minOccurs="0" />
- <element name="inboundInteraction"
- type="sca:JCAInboundInteraction" minOccurs="0" />
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <!-- any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" /-->
- </sequence>
- <attribute name="connectionInfo" type="anyURI" use="optional" />
- <attribute name="initialContextFactory" type="anyURI"
- use="optional"/>
- <attribute name="jndiURL" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="JCACreateResource">
- <restriction base="string">
- <enumeration value="always" />
- <enumeration value="never" />
- <enumeration value="ifNotExist" />
- </restriction>
- </simpleType>
- <simpleType name="ResAuth">
- <restriction base="string">
- <enumeration value="container" />
- <enumeration value="application" />
- </restriction>
- </simpleType>
- <complexType name="JCAOutboundConnection">
- <sequence>
- <element name="resourceAdapter" type="sca:ResourceAdapter"
- minOccurs="0" />
- <element name="connection" type="sca:Connection" />
- <element name="resAuth" type="sca:ResAuth" minOccurs="0" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="managed" type="boolean" use="optional"
- default="true" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="JCAInboundConnection">
- <sequence>
- <element name="resourceAdapter" type="sca:ResourceAdapter" />
- <element name="activationSpec" type="sca:ActivationSpec" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="JCAOutboundInteraction">
- <sequence>
- <element name="connectionSpec" type="sca:ConnectionSpec"
- minOccurs="0" />
- <element name="interactionSpec" type="sca:InteractionSpec"
- minOccurs="0" />
- <element name="operation" type="sca:Operation" minOccurs="0" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="JCAInboundInteraction">
- <sequence>
- <element name="listener" type="string" minOccurs="0" />
- <element name="inboundOperation" type="sca:InboundOperation"
- minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="ResourceAdapter">
- <sequence>
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NMTOKEN" use="optional" />
- <attribute name="type" type="NMTOKEN" use="required" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="Connection">
- <sequence>
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NMTOKEN" use="optional" />
- <attribute name="type" type="NMTOKEN" use="required" />
- <attribute name="create" type="sca:JCACreateResource" use="optional"
- default="ifNotExist" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="ActivationSpec">
- <sequence>
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NMTOKEN" use="optional" />
- <attribute name="type" type="NMTOKEN" use="required" />
- <attribute name="create" type="sca:JCACreateResource" use="optional"
- default="ifNotExist"/>
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="Operation">
- <sequence>
- <element name="interactionSpec" type="sca:InteractionSpec"
- minOccurs="0" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NMTOKEN" use="required" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="InboundOperation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NMTOKEN" use="required" />
- <attribute name="nativeOperation" type="string" use="required" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="ConnectionSpec">
- <sequence>
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="type" type="NMTOKEN" use="required" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
- <complexType name="InteractionSpec">
- <sequence>
- <element name="property" type="sca:Property" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="type" type="NMTOKEN" use="required" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
-
- <element name="binding.jca" type="sca:JCABinding"
- substitutionGroup="sca:binding" />
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04-rev1.xsd
new file mode 100644
index 0000000..35b706a
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04-rev1.xsd
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <complexType name="JMSBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <element name="destination" type="sca:JMSDestination"
+ minOccurs="0"/>
+ <choice minOccurs="0" maxOccurs="1">
+ <element name="connectionFactory"
+ type="sca:JMSConnectionFactory"/>
+ <element name="activationSpec" type="sca:JMSActivationSpec"/>
+ </choice>
+ <element name="response" type="sca:JMSResponse" minOccurs="0"/>
+ <element name="headers" type="sca:JMSHeaders" minOccurs="0"/>
+ <element name="messageSelection" type="sca:JMSMessageSelection"
+ minOccurs="0"/>
+ <element name="resourceAdapter" type="sca:JMSResourceAdapter"
+ minOccurs="0"/>
+ <element name="operationProperties"
+ type="sca:JMSOperationProperties"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="correlationScheme" type="QName"
+ default="sca:messageID"/>
+ <attribute name="initialContextFactory" type="anyURI"/>
+ <attribute name="jndiURL" type="anyURI"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="JMSCreateResource">
+ <restriction base="string">
+ <enumeration value="always"/>
+ <enumeration value="never"/>
+ <enumeration value="ifNotExist"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="JMSDestination">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="jndiName" type="anyURI"/>
+ <attribute name="type" use="optional" default="queue">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="queue"/>
+ <enumeration value="topic"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="create" type="sca:JMSCreateResource"
+ use="optional" default="ifNotExist"/>
+ </complexType>
+
+ <complexType name="JMSConnectionFactory">
+ <sequence> <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="jndiName" type="anyURI"/>
+ <attribute name="create" type="sca:JMSCreateResource"
+ use="optional" default="ifNotExist"/>
+ </complexType>
+
+ <complexType name="JMSActivationSpec">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="jndiName" type="anyURI"/>
+ <attribute name="create" type="sca:JMSCreateResource"
+ use="optional" default="ifNotExist"/>
+ </complexType>
+
+ <complexType name="JMSResponse">
+ <sequence>
+ <element ref="sca:wireFormat" minOccurs="0" maxOccurs="1"/>
+ <element name="destination" type="sca:JMSDestination" minOccurs="0"/>
+ <choice minOccurs="0">
+ <element name="connectionFactory" type="sca:JMSConnectionFactory"/>
+ <element name="activationSpec" type="sca:JMSActivationSpec"/>
+ </choice>
+ </sequence>
+ </complexType>
+
+ <complexType name="JMSHeaders">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="type" type="string"/>
+ <attribute name="deliveryMode" default="persistent">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="persistent"/>
+ <enumeration value="nonpersistent"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="timeToLive" type="long" default="0"/>
+ <attribute name="priority" default="4">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="0"/>
+ <enumeration value="1"/>
+ <enumeration value="2"/>
+ <enumeration value="3"/>
+ <enumeration value="4"/>
+ <enumeration value="5"/>
+ <enumeration value="6"/>
+ <enumeration value="7"/>
+ <enumeration value="8"/>
+ <enumeration value="9"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+
+ <complexType name="JMSMessageSelection">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="selector" type="string"/>
+ </complexType>
+
+ <complexType name="JMSResourceAdapter">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="string" use="required"/>
+ </complexType>
+
+ <complexType name="JMSOperationProperties">
+ <sequence>
+ <element name="property" type="sca:BindingProperty"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <element name="headers" type="sca:JMSHeaders" minOccurs="0"/>
+ </sequence>
+ <attribute name="name" type="string" use="required"/>
+ <attribute name="selectedOperation" type="string"/>
+ </complexType>
+
+ <complexType name="BindingProperty">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="name" type="NMTOKEN" use="required"/>
+ <attribute name="type" type="string" use="optional"
+ default="xs:string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <element name="binding.jms" type="sca:JMSBinding"
+ substitutionGroup="sca:binding"/>
+
+ <complexType name="JMSDefaultWireFormatType">
+ <complexContent>
+ <extension base="sca:WireFormatType"/>
+ </complexContent>
+ </complexType>
+
+ <complexType name="JMSDefaultOperationSelectorType">
+ <complexContent>
+ <extension base="sca:OperationSelectorType"/>
+ </complexContent>
+ </complexType>
+
+ <element name="wireFormat.jmsDefault" type="sca:JMSDefaultWireFormatType"
+ substitutionGroup="sca:wireFormat"/>
+
+ <element name="operationSelector.jmsDefault" type="sca:JMSDefaultOperationSelectorType"
+ substitutionGroup="sca:operationSelector"/>
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04.xsd
deleted file mode 100644
index 50e6aa6..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-binding-jms-1.1-cd04.xsd
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <complexType name="JMSBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <element name="destination" type="sca:JMSDestination"
- minOccurs="0"/>
- <choice minOccurs="0" maxOccurs="1">
- <element name="connectionFactory"
- type="sca:JMSConnectionFactory"/>
- <element name="activationSpec" type="sca:JMSActivationSpec"/>
- </choice>
- <element name="response" type="sca:JMSResponse" minOccurs="0"/>
- <element name="headers" type="sca:JMSHeaders" minOccurs="0"/>
- <element name="messageSelection" type="sca:JMSMessageSelection"
- minOccurs="0"/>
- <element name="resourceAdapter" type="sca:JMSResourceAdapter"
- minOccurs="0"/>
- <element name="operationProperties"
- type="sca:JMSOperationProperties"
- minOccurs="0" maxOccurs="unbounded"/>
- <!-- any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/ -->
- </sequence>
- <attribute name="correlationScheme" type="QName"
- default="sca:messageId"/>
- <attribute name="initialContextFactory" type="anyURI"/>
- <attribute name="jndiURL" type="anyURI"/>
- <attribute name="requestConnection" type="QName"/>
- <attribute name="responseConnection" type="QName"/>
- <attribute name="operationProperties" type="QName"/>
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="JMSCreateResource">
- <restriction base="string">
- <enumeration value="always"/>
- <enumeration value="never"/>
- <enumeration value="ifNotExist"/>
- </restriction>
- </simpleType>
-
- <complexType name="JMSDestination">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="jndiName" type="anyURI" use="required"/>
- <attribute name="type" use="optional" default="queue">
- <simpleType>
- <restriction base="string">
- <enumeration value="queue"/>
- <enumeration value="topic"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="create" type="sca:JMSCreateResource"
- use="optional" default="ifNotExist"/>
- </complexType>
-
- <complexType name="JMSConnectionFactory">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="jndiName" type="anyURI" use="required"/>
- <attribute name="create" type="sca:JMSCreateResource"
- use="optional" default="ifNotExist"/>
- </complexType>
-
- <complexType name="JMSActivationSpec">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="jndiName" type="anyURI" use="required"/>
- <attribute name="create" type="sca:JMSCreateResource"
- use="optional" default="ifNotExist"/>
- </complexType>
-
- <complexType name="JMSResponse">
- <sequence>
- <element ref="sca:wireFormat" minOccurs="0" />
- <element name="destination" type="sca:JMSDestination" minOccurs="0"/>
- <choice minOccurs="0">
- <element name="connectionFactory" type="sca:JMSConnectionFactory"/>
- <element name="activationSpec" type="sca:JMSActivationSpec"/>
- </choice>
- </sequence>
- </complexType>
-
- <complexType name="JMSHeaders">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="type" type="string"/>
- <attribute name="deliveryMode">
- <simpleType>
- <restriction base="string">
- <enumeration value="persistent"/>
- <enumeration value="nonpersistent"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="timeToLive" type="long"/>
- <attribute name="priority">
- <simpleType>
- <restriction base="string">
- <enumeration value="0"/>
- <enumeration value="1"/>
- <enumeration value="2"/>
- <enumeration value="3"/>
- <enumeration value="4"/>
- <enumeration value="5"/>
- <enumeration value="6"/>
- <enumeration value="7"/>
- <enumeration value="8"/>
- <enumeration value="9"/>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
-
- <complexType name="JMSMessageSelection">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="selector" type="string"/>
- </complexType>
-
- <complexType name="JMSResourceAdapter">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- </complexType>
-
- <complexType name="JMSOperationProperties">
- <sequence>
- <element name="property" type="sca:BindingProperty"
- minOccurs="0" maxOccurs="unbounded"/>
- <element name="headers" type="sca:JMSHeaders"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- <attribute name="nativeOperation" type="string"/>
- </complexType>
-
- <complexType name="BindingProperty">
- <simpleContent>
- <extension base="string">
- <attribute name="name" type="NMTOKEN"/>
- <attribute name="type" type="string" use="optional"
- default="xs:string"/>
- </extension>
- </simpleContent>
- </complexType>
-
- <element name="binding.jms" type="sca:JMSBinding"
- substitutionGroup="sca:binding"/>
-
- <element name="wireFormat.jmsDefault" type="sca:WireFormatType"
- substitutionGroup="sca:wireFormat"/>
-
- <element name="operationSelector.jmsDefault" type="sca:OperationSelectorType"
- substitutionGroup="sca:operationSelector"/>
-</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..6cdbf16
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05-rev1.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- SCA Binding -->
+ <element name="binding.sca" type="sca:SCABinding"
+ substitutionGroup="sca:binding"/>
+ <complexType name="SCABinding">
+ <complexContent>
+ <extension base="sca:Binding"/>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05.xsd
deleted file mode 100644
index a337296..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-binding-sca-1.1-cd05.xsd
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- SCA Binding -->
- <element name="binding.sca" type="sca:SCABinding"
- substitutionGroup="sca:binding"/>
- <complexType name="SCABinding">
- <complexContent>
- <extension base="sca:Binding"/>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04-rev1.xsd
new file mode 100644
index 0000000..9d6d97e
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04-rev1.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/ns/wsdl-instance"
+ xmlns:wsa="http://www.w3.org/2005/08/addressing"
+ elementFormDefault="qualified">
+
+ <import namespace="http://www.w3.org/ns/wsdl-instance"
+ schemaLocation="http://www.w3.org/2007/05/wsdl/wsdl20-instance.xsd"/>
+ <import namespace="http://www.w3.org/2005/08/addressing"
+ schemaLocation="http://www.w3.org/2006/03/addressing/ws-addr.xsd"/>
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <element name="binding.ws" type="sca:WebServiceBinding"
+ substitutionGroup="sca:binding"/>
+
+ <complexType name="WebServiceBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <element ref="wsa:EndpointReference"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="wsdlElement" type="anyURI" use="optional"/>
+ <attribute ref="wsdli:wsdlLocation" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04.xsd
deleted file mode 100644
index 65e200b..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-binding-ws-1.1-cd04.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:wsdli="http://www.w3.org/ns/wsdl-instance"
- xmlns:wsa="http://www.w3.org/2005/08/addressing"
- elementFormDefault="qualified">
-
- <import namespace="http://www.w3.org/ns/wsdl-instance"
- schemaLocation="http://www.w3.org/2007/05/wsdl/wsdl20-instance.xsd"/>
- <import namespace="http://www.w3.org/2005/08/addressing"
- schemaLocation="http://www.w3.org/2006/03/addressing/ws-addr.xsd"/>
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <element name="binding.ws" type="sca:WebServiceBinding"
- substitutionGroup="sca:binding"/>
-
- <complexType name="WebServiceBinding">
- <complexContent>
- <extension base="sca:Binding">
- <sequence>
- <element ref="wsa:EndpointReference"
- minOccurs="0" maxOccurs="unbounded"/>
- <!-- any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/-->
- </sequence>
- <attribute name="wsdlElement" type="anyURI" use="optional"/>
- <attribute ref="wsdli:wsdlLocation" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-binding-ws-callback-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-binding-ws-callback-1.1-cd04.xsd
index 874e36b..72d84b3 100644
--- a/modules/assembly-xsd/src/main/resources/sca-binding-ws-callback-1.1-cd04.xsd
+++ b/modules/assembly-xsd/src/main/resources/sca-binding-ws-callback-1.1-cd04.xsd
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- (c) Copyright OASIS 2005, 2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply -->
+<!-- (c) Copyright OASIS 2005, 2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
@@ -9,10 +9,12 @@
<element name="WSCallback">
<complexType>
<sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
</sequence>
- <anyAttribute namespace="##other" processContents="lax"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+
</complexType>
</element>
-</schema>
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..346bfe4
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05-rev1.xsd
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- Contribution -->
+ <element name="contribution" type="sca:ContributionType"/>
+ <complexType name="ContributionType">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element name="deployable" type="sca:DeployableType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <element ref="sca:importBase" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:exportBase" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Deployable -->
+ <complexType name="DeployableType">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="composite" type="QName" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Import -->
+ <element name="importBase" type="sca:Import" abstract="true" />
+ <complexType name="Import" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="import" type="sca:ImportType"
+ substitutionGroup="sca:importBase"/>
+ <complexType name="ImportType">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="namespace" type="string" use="required"/>
+ <attribute name="location" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Export -->
+ <element name="exportBase" type="sca:Export" abstract="true" />
+ <complexType name="Export" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="export" type="sca:ExportType"
+ substitutionGroup="sca:exportBase"/>
+ <complexType name="ExportType">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="namespace" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05.xsd
deleted file mode 100644
index da391a9..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-contribution-1.1-cd05.xsd
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- Contribution -->
- <element name="contribution" type="sca:ContributionType"/>
- <complexType name="ContributionType">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element name="deployable" type="sca:DeployableType"
- minOccurs="0" maxOccurs="unbounded"/>
- <element ref="sca:importBase" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:exportBase" minOccurs="0"
- maxOccurs="unbounded"/>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Deployable -->
- <complexType name="DeployableType">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="composite" type="QName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Import -->
- <element name="importBase" type="sca:Import" abstract="true" />
- <complexType name="Import" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="import" type="sca:ImportType"
- substitutionGroup="sca:importBase"/>
- <complexType name="ImportType">
- <complexContent>
- <extension base="sca:Import">
- <attribute name="namespace" type="string" use="required"/>
- <attribute name="location" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Export -->
- <element name="exportBase" type="sca:Export" abstract="true" />
- <complexType name="Export" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="export" type="sca:ExportType"
- substitutionGroup="sca:exportBase"/>
- <complexType name="ExportType">
- <complexContent>
- <extension base="sca:Export">
- <attribute name="namespace" type="string" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd04.xsd
deleted file mode 100644
index a93c4c5..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd04.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2007,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-contribution-1.1-cd05.xsd" />
-
- <element name="export.c" type="sca:CExport"
- substitutionGroup="sca:exportBase" />
-
- <complexType name="CExport">
- <complexContent>
- <extension base="sca:Export">
- <attribute name="name" type="QName" use="required" />
- <attribute name="path" type="string" use="optional" />
- </extension>
- </complexContent>
- </complexType>
-
- <element name="import.c" type="sca:CImport"
- substitutionGroup="sca:importBase" />
-
- <complexType name="CImport">
- <complexContent>
- <extension base="sca:Import">
- <attribute name="name" type="QName" use="required" />
- <attribute name="location" type="string" use="required" />
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..9e29607
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-contribution-c-1.1-cd05-rev1.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2007,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-contribution-1.1-cd05-rev1.xsd" />
+
+ <element name="export.c" type="sca:CExport"
+ substitutionGroup="sca:exportBase" />
+
+ <complexType name="CExport">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="name" type="QName" use="required" />
+ <attribute name="path" type="string" use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="import.c" type="sca:CImport"
+ substitutionGroup="sca:importBase" />
+
+ <complexType name="CImport">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="name" type="QName" use="required" />
+ <attribute name="location" type="string" use="required" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd04.xsd
deleted file mode 100644
index 98fffa2..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd04.xsd
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2006,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-contribution-1.1-cd05.xsd" />
-
- <element name="export.cpp" type="sca:CPPExport"
- substitutionGroup="sca:exportBase" />
-
- <complexType name="CPPExport">
- <complexContent>
- <extension base="sca:Export">
- <attribute name="name" type="QName" use="required" />
- <attribute name="path" type="string" use="optional" />
- </extension>
- </complexContent>
- </complexType>
-
- <element name="import.cpp" type="sca:CPPImport"
- substitutionGroup="sca:importBase" />
-
- <complexType name="CPPImport">
- <complexContent>
- <extension base="sca:Import">
- <attribute name="name" type="QName" use="required" />
- <attribute name="location" type="string" use="required" />
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..94813bf
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-contribution-cpp-1.1-cd05-rev1.xsd
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2006,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-contribution-1.1-cd05-rev1.xsd" />
+
+ <element name="export.cpp" type="sca:CPPExport"
+ substitutionGroup="sca:exportBase" />
+
+ <complexType name="CPPExport">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="name" type="QName" use="required" />
+ <attribute name="path" type="string" use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="import.cpp" type="sca:CPPImport"
+ substitutionGroup="sca:importBase" />
+
+ <complexType name="CPPImport">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="name" type="QName" use="required" />
+ <attribute name="location" type="string" use="required" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02-rev1.xsd
new file mode 100644
index 0000000..9264259
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02-rev1.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-contribution-1.1-cd05-rev1.xsd"/>
+
+ <!-- Import.java -->
+ <element name="import.java" type="sca:JavaImportType"
+ substitutionGroup="sca:importBase" />
+ <complexType name="JavaImportType">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="package" type="string" use="required"/>
+ <attribute name="location" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Export.java -->
+ <element name="export.java" type="sca:JavaExportType"
+ substitutionGroup="sca:exportBase" />
+ <complexType name="JavaExportType">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="package" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02.xsd b/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02.xsd
deleted file mode 100644
index 6131804..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd02.xsd
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-contribution-1.1-cd05.xsd"/>
-
- <!-- Import.java -->
- <element name="import.java" type="sca:JavaImportType"
- substitutionGroup="sca:importBase" />
- <complexType name="JavaImportType">
- <complexContent>
- <extension base="sca:Import">
- <attribute name="package" type="string" use="required"/>
- <attribute name="location" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Export.java -->
- <element name="export.java" type="sca:JavaExportType"
- substitutionGroup="sca:exportBase" />
- <complexType name="JavaExportType">
- <complexContent>
- <extension base="sca:Export">
- <attribute name="package" type="string" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..541a5c3
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05-rev1.xsd
@@ -0,0 +1,468 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-policy-1.1-cd03-rev1.xsd"/>
+ <import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+ <!-- Common extension base for SCA definitions -->
+ <complexType name="CommonExtensionBase">
+ <sequence>
+ <element ref="sca:documentation" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <element name="documentation" type="sca:Documentation"/>
+ <complexType name="Documentation" mixed="true">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute ref="xml:lang"/>
+ </complexType>
+
+ <!-- Component Type -->
+ <element name="componentType" type="sca:ComponentType"/>
+ <complexType name="ComponentType">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element ref="sca:implementation" minOccurs="0"/>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="service" type="sca:ComponentService"/>
+ <element name="reference"
+ type="sca:ComponentTypeReference"/>
+ <element name="property" type="sca:Property"/>
+ </choice>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Composite -->
+ <element name="composite" type="sca:Composite"/>
+ <complexType name="Composite">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element ref="sca:include" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ <element name="service" type="sca:Service"/>
+ <element name="property" type="sca:Property"/>
+ <element name="component" type="sca:Component"/>
+ <element name="reference" type="sca:Reference"/>
+ <element name="wire" type="sca:Wire"/>
+ </choice>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="targetNamespace" type="anyURI" use="required"/>
+ <attribute name="local" type="boolean" use="optional"
+ default="false"/>
+ <attribute name="autowire" type="boolean" use="optional"
+ default="false"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Contract base type for Service, Reference -->
+ <complexType name="Contract" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
+ <element ref="sca:binding" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
+ <element ref="sca:requires" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:policySetAttachment" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required" />
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional" />
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Service -->
+ <complexType name="Service">
+ <complexContent>
+ <extension base="sca:Contract">
+ <attribute name="promote" type="anyURI" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Interface -->
+ <element name="interface" type="sca:Interface" abstract="true"/>
+ <complexType name="Interface" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <attribute name="remotable" type="boolean" use="optional"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Reference -->
+ <complexType name="Reference">
+ <complexContent>
+ <extension base="sca:Contract">
+ <attribute name="target" type="sca:listOfAnyURIs"
+ use="optional"/>
+ <attribute name="wiredByImpl" type="boolean" use="optional"
+ default="false"/>
+ <attribute name="multiplicity" type="sca:Multiplicity"
+ use="required"/>
+ <attribute name="promote" type="sca:listOfAnyURIs"
+ use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Property -->
+ <complexType name="SCAPropertyBase" mixed="true">
+ <sequence>
+ <any namespace="##any" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <!-- NOT an extension point; This any exists to accept
+ the element-based or complex type property
+ i.e. no element-based extension point under "sca:property" -->
+ </sequence>
+ <!-- mixed="true" to handle simple type -->
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="type" type="QName" use="optional"/>
+ <attribute name="element" type="QName" use="optional"/>
+ <attribute name="many" type="boolean" use="optional" default="false"/>
+ <attribute name="value" type="anySimpleType" use="optional"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Property" mixed="true">
+ <complexContent mixed="true">
+ <extension base="sca:SCAPropertyBase">
+ <attribute name="mustSupply" type="boolean" use="optional"
+ default="false"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="PropertyValue" mixed="true">
+ <complexContent mixed="true">
+ <extension base="sca:SCAPropertyBase">
+ <attribute name="source" type="string" use="optional"/>
+ <attribute name="file" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Binding -->
+ <element name="binding" type="sca:Binding" abstract="true"/>
+ <complexType name="Binding" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element ref="sca:wireFormat" minOccurs="0" maxOccurs="1" />
+ <element ref="sca:operationSelector" minOccurs="0"
+ maxOccurs="1" />
+ <element ref="sca:requires" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:policySetAttachment" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="uri" type="anyURI" use="optional"/>
+ <attribute name="name" type="NCName" use="optional"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Binding Type -->
+ <element name="bindingType" type="sca:BindingType"/>
+ <complexType name="BindingType">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="type" type="QName" use="required"/>
+ <attribute name="alwaysProvides" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="mayProvide" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- WireFormat Type -->
+ <element name="wireFormat" type="sca:WireFormatType" abstract="true"/>
+ <complexType name="WireFormatType" abstract="true">
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <!-- OperationSelector Type -->
+ <element name="operationSelector" type="sca:OperationSelectorType"
+ abstract="true"/>
+ <complexType name="OperationSelectorType" abstract="true">
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <!-- Callback -->
+ <element name="callback" type="sca:Callback"/>
+ <complexType name="Callback">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:binding"/>
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </choice>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Component -->
+ <complexType name="Component">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <element ref="sca:implementation" minOccurs="1"
+ maxOccurs="1"/>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="service" type="sca:ComponentService"/>
+ <element name="reference" type="sca:ComponentReference"/>
+ <element name="property" type="sca:PropertyValue"/>
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="autowire" type="boolean" use="optional"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Component Service -->
+ <complexType name="ComponentService">
+ <complexContent>
+ <extension base="sca:Contract">
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Component Reference -->
+ <complexType name="ComponentReference">
+ <complexContent>
+ <extension base="sca:Contract">
+ <attribute name="autowire" type="boolean" use="optional"/>
+ <attribute name="target" type="sca:listOfAnyURIs"
+ use="optional"/>
+ <attribute name="wiredByImpl" type="boolean" use="optional"
+ default="false"/>
+ <attribute name="multiplicity" type="sca:Multiplicity"
+ use="optional" default="1..1"/>
+ <attribute name="nonOverridable" type="boolean" use="optional"
+ default="false"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Component Type Reference -->
+ <complexType name="ComponentTypeReference">
+ <complexContent>
+ <restriction base="sca:ComponentReference">
+ <sequence>
+ <element ref="sca:documentation" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:interface" minOccurs="0"/>
+ <element ref="sca:binding" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:callback" minOccurs="0"/>
+ <element ref="sca:requires" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:policySetAttachment" minOccurs="0"
+ maxOccurs="unbounded"/>
+ <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="autowire" type="boolean" use="optional"/>
+ <attribute name="wiredByImpl" type="boolean" use="optional"
+ default="false"/>
+ <attribute name="multiplicity" type="sca:Multiplicity"
+ use="optional" default="1..1"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+
+
+ <!-- Implementation -->
+ <element name="implementation" type="sca:Implementation" abstract="true"/>
+ <complexType name="Implementation" abstract="true">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Implementation Type -->
+ <element name="implementationType" type="sca:ImplementationType"/>
+ <complexType name="ImplementationType">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="type" type="QName" use="required"/>
+ <attribute name="alwaysProvides" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="mayProvide" type="sca:listOfQNames"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Wire -->
+ <complexType name="Wire">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="source" type="anyURI" use="required"/>
+ <attribute name="target" type="anyURI" use="required"/>
+ <attribute name="replace" type="boolean" use="optional"
+ default="false"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Include -->
+ <element name="include" type="sca:Include"/>
+ <complexType name="Include">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <attribute name="name" type="QName"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Extensions element -->
+ <element name="extensions">
+ <complexType>
+ <sequence>
+ <any namespace="##other" processContents="lax"
+ minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Intents within WSDL documents -->
+ <attribute name="requires" type="sca:listOfQNames"/>
+
+ <!-- Global attribute definition for @callback to mark a WSDL port type
+ as having a callback interface defined in terms of a second port
+ type. -->
+ <attribute name="callback" type="anyURI"/>
+
+ <!-- Value type definition for property values -->
+ <element name="value" type="sca:ValueType"/>
+ <complexType name="ValueType" mixed="true">
+ <sequence>
+ <any namespace="##any" processContents="lax" minOccurs="0"
+ maxOccurs='unbounded'/>
+ </sequence>
+ <!-- mixed="true" to handle simple type -->
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <!-- Miscellaneous simple type definitions -->
+ <simpleType name="Multiplicity">
+ <restriction base="string">
+ <enumeration value="0..1"/>
+ <enumeration value="1..1"/>
+ <enumeration value="0..n"/>
+ <enumeration value="1..n"/>
+ </restriction>
+ </simpleType>
+
+ <simpleType name="OverrideOptions">
+ <restriction base="string">
+ <enumeration value="no"/>
+ <enumeration value="may"/>
+ <enumeration value="must"/>
+ </restriction>
+ </simpleType>
+
+ <simpleType name="listOfQNames">
+ <list itemType="QName"/>
+ </simpleType>
+
+ <simpleType name="listOfAnyURIs">
+ <list itemType="anyURI"/>
+ </simpleType>
+
+ <simpleType name="CreateResource">
+ <restriction base="string">
+ <enumeration value="always" />
+ <enumeration value="never" />
+ <enumeration value="ifnotexist" />
+ </restriction>
+ </simpleType>
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05.xsd
deleted file mode 100644
index ab0fce9..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-core-1.1-cd05.xsd
+++ /dev/null
@@ -1,478 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-policy-1.1-cd03.xsd"/>
- <import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
-
- <!-- Common extension base for SCA definitions -->
- <complexType name="CommonExtensionBase">
- <sequence>
- <element ref="sca:documentation" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <element name="documentation" type="sca:Documentation"/>
- <complexType name="Documentation" mixed="true">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute ref="xml:lang"/>
- </complexType>
-
- <!-- Component Type -->
- <element name="componentType" type="sca:ComponentType"/>
- <complexType name="ComponentType">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element ref="sca:implementation" minOccurs="0"/>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference"
- type="sca:ComponentTypeReference"/>
- <element name="property" type="sca:Property"/>
- </choice>
- <!-- any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/ -->
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Composite -->
- <element name="composite" type="sca:Composite"/>
- <complexType name="Composite">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element ref="sca:include" minOccurs="0"
- maxOccurs="unbounded"/>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- <element name="service" type="sca:Service"/>
- <element name="property" type="sca:Property"/>
- <element name="component" type="sca:Component"/>
- <element name="reference" type="sca:Reference"/>
- <element name="wire" type="sca:Wire"/>
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="targetNamespace" type="anyURI" use="required"/>
- <attribute name="local" type="boolean" use="optional"
- default="false"/>
- <attribute name="autowire" type="boolean" use="optional"
- default="false"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Contract base type for Service, Reference -->
- <complexType name="Contract" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element ref="sca:interface" minOccurs="0" maxOccurs="1" />
- <element ref="sca:binding" minOccurs="0"
- maxOccurs="unbounded" />
- <element ref="sca:callback" minOccurs="0" maxOccurs="1" />
- <element ref="sca:requires" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:policySetAttachment" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="requires" type="sca:listOfQNames"
- use="optional" />
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Service -->
- <complexType name="Service">
- <complexContent>
- <extension base="sca:Contract">
- <attribute name="promote" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Interface -->
- <element name="interface" type="sca:Interface" abstract="true"/>
- <complexType name="Interface" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <attribute name="remotable" type="boolean" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Reference -->
- <complexType name="Reference">
- <complexContent>
- <extension base="sca:Contract">
- <attribute name="target" type="sca:listOfAnyURIs"
- use="optional"/>
- <attribute name="wiredByImpl" type="boolean" use="optional"
- default="false"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="required"/>
- <attribute name="promote" type="sca:listOfAnyURIs"
- use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Property -->
- <complexType name="SCAPropertyBase" mixed="true">
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- <!-- NOT an extension point; This any exists to accept
- the element-based or complex type property
- i.e. no element-based extension point under "sca:property" -->
- </sequence>
- <!-- mixed="true" to handle simple type -->
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="type" type="QName" use="optional"/>
- <attribute name="element" type="QName" use="optional"/>
- <attribute name="many" type="boolean" use="optional" default="false"/>
- <attribute name="value" type="anySimpleType" use="optional"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <complexType name="Property" mixed="true">
- <complexContent mixed="true">
- <extension base="sca:SCAPropertyBase">
- <attribute name="mustSupply" type="boolean" use="optional"
- default="false"/>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="PropertyValue" mixed="true">
- <complexContent mixed="true">
- <extension base="sca:SCAPropertyBase">
- <attribute name="source" type="string" use="optional"/>
- <attribute name="file" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Binding -->
- <element name="binding" type="sca:Binding" abstract="true"/>
- <complexType name="Binding" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element ref="sca:wireFormat" minOccurs="0" maxOccurs="1" />
- <element ref="sca:operationSelector" minOccurs="0"
- maxOccurs="1" />
- <element ref="sca:requires" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:policySetAttachment" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="uri" type="anyURI" use="optional"/>
- <attribute name="name" type="NCName" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Binding Type -->
- <element name="bindingType" type="sca:BindingType"/>
- <complexType name="BindingType">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <!-- any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/-->
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- WireFormat Type -->
- <element name="wireFormat" type="sca:WireFormatType" abstract="true"/>
- <complexType name="WireFormatType" abstract="true">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <!-- OperationSelector Type -->
- <element name="operationSelector" type="sca:OperationSelectorType"
- abstract="true"/>
- <complexType name="OperationSelectorType" abstract="true">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <!-- Callback -->
- <element name="callback" type="sca:Callback"/>
- <complexType name="Callback">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:binding"/>
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- <!-- any namespace="##other" processContents="lax"/ -->
- </choice>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Component -->
- <complexType name="Component">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <element ref="sca:implementation" minOccurs="1"
- maxOccurs="1"/>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="service" type="sca:ComponentService"/>
- <element name="reference" type="sca:ComponentReference"/>
- <element name="property" type="sca:PropertyValue"/>
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="autowire" type="boolean" use="optional"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Component Service -->
- <complexType name="ComponentService">
- <complexContent>
- <extension base="sca:Contract">
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Component Reference -->
- <complexType name="ComponentReference">
- <complexContent>
- <extension base="sca:Contract">
- <attribute name="autowire" type="boolean" use="optional"/>
- <attribute name="target" type="sca:listOfAnyURIs"
- use="optional"/>
- <attribute name="wiredByImpl" type="boolean" use="optional"
- default="false"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1"/>
- <attribute name="nonOverridable" type="boolean" use="optional"
- default="false"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Component Type Reference -->
- <complexType name="ComponentTypeReference">
- <complexContent>
- <restriction base="sca:ComponentReference">
- <sequence>
- <element ref="sca:documentation" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:interface" minOccurs="0"/>
- <element ref="sca:binding" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:callback" minOccurs="0"/>
- <element ref="sca:requires" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:policySetAttachment" minOccurs="0"
- maxOccurs="unbounded"/>
- <element ref="sca:extensions" minOccurs="0" maxOccurs="1" />
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="autowire" type="boolean" use="optional"/>
- <attribute name="wiredByImpl" type="boolean" use="optional"
- default="false"/>
- <attribute name="multiplicity" type="sca:Multiplicity"
- use="optional" default="1..1"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </restriction>
- </complexContent>
- </complexType>
-
-
- <!-- Implementation -->
- <element name="implementation" type="sca:Implementation" abstract="true"/>
- <complexType name="Implementation" abstract="true">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="policySets" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Implementation Type -->
- <element name="implementationType" type="sca:ImplementationType"/>
- <complexType name="ImplementationType">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="type" type="QName" use="required"/>
- <attribute name="alwaysProvides" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="mayProvide" type="sca:listOfQNames"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Wire -->
- <complexType name="Wire">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="source" type="anyURI" use="required"/>
- <attribute name="target" type="anyURI" use="required"/>
- <attribute name="replace" type="boolean" use="optional"
- default="false"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Include -->
- <element name="include" type="sca:Include"/>
- <complexType name="Include">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <attribute name="name" type="QName"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Extensions element -->
- <element name="extensions">
- <complexType>
- <sequence>
- <any namespace="##other" processContents="lax"
- minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element>
-
- <!-- Intents within WSDL documents -->
- <attribute name="requires" type="sca:listOfQNames"/>
-
- <!-- Global attribute definition for @callback to mark a WSDL port type
- as having a callback interface defined in terms of a second port
- type. -->
- <attribute name="callback" type="anyURI"/>
-
- <!-- Value type definition for property values -->
- <element name="value" type="sca:ValueType"/>
- <complexType name="ValueType" mixed="true">
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="0"
- maxOccurs='unbounded'/>
- </sequence>
- <!-- mixed="true" to handle simple type -->
- <anyAttribute namespace="##any" processContents="lax"/>
- </complexType>
-
- <!-- Miscellaneous simple type definitions -->
- <simpleType name="Multiplicity">
- <restriction base="string">
- <enumeration value="0..1"/>
- <enumeration value="1..1"/>
- <enumeration value="0..n"/>
- <enumeration value="1..n"/>
- </restriction>
- </simpleType>
-
- <simpleType name="OverrideOptions">
- <restriction base="string">
- <enumeration value="no"/>
- <enumeration value="may"/>
- <enumeration value="must"/>
- </restriction>
- </simpleType>
-
- <simpleType name="listOfQNames">
- <list itemType="QName"/>
- </simpleType>
-
- <simpleType name="listOfAnyURIs">
- <list itemType="anyURI"/>
- </simpleType>
-
- <simpleType name="CreateResource">
- <restriction base="string">
- <enumeration value="always" />
- <enumeration value="never" />
- <enumeration value="ifnotexist" />
- </restriction>
- </simpleType>
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..fcd3cc0
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05-rev1.xsd
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,20010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+ <include schemaLocation="sca-policy-1.1-cd03-rev1.xsd"/>
+
+ <!-- Definitions -->
+ <element name="definitions" type="sca:tDefinitions"/>
+ <complexType name="tDefinitions">
+ <complexContent>
+ <extension base="sca:CommonExtensionBase">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:intent"/>
+ <element ref="sca:policySet"/>
+ <element ref="sca:bindingType"/>
+ <element ref="sca:implementationType"/>
+ <element ref="sca:externalAttachment"/>
+ <any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </choice>
+ <attribute name="targetNamespace" type="anyURI" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05.xsd
deleted file mode 100644
index 8f2f20d..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-definitions-1.1-cd05.xsd
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
- <include schemaLocation="sca-policy-1.1-cd03.xsd"/>
-
- <!-- Definitions -->
- <element name="definitions" type="sca:tDefinitions"/>
- <complexType name="tDefinitions">
- <complexContent>
- <extension base="sca:CommonExtensionBase">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:intent"/>
- <element ref="sca:policySet"/>
- <element ref="sca:bindingType"/>
- <element ref="sca:implementationType"/>
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </choice>
- <attribute name="targetNamespace" type="anyURI" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd04.xsd
deleted file mode 100644
index ee4b313..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd04.xsd
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Copyright(C) OASIS(R) 2007,2010. All Rights Reserved. OASIS trademark,
- IPR and other policies apply.
- -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd" />
-
- <element name="implementation.c" type="sca:CImplementation"
- substitutionGroup="sca:implementation" />
-
- <complexType name="CImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <element name="operation" type="sca:CImplementationFunction"
- minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="module" type="NCName" use="required" />
- <attribute name="path" type="string" use="optional" />
- <attribute name="library" type="boolean" use="optional" />
- <attribute name="componentType" type="string" use="required" />
- <attribute name="eagerInit" type="boolean" use="optional" />
- <attribute name="init" type="boolean" use="optional" />
- <attribute name="destoy" type="boolean" use="optional" />
- <attribute name="allowsPassByReference" type="boolean"
- use="optional" />
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="CImplementationFunction">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional" />
- <attribute name="allowsPassByReference" type="boolean" use="optional" />
- <attribute name="init" type="boolean" use="optional" />
- <attribute name="destoy" type="boolean" use="optional" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..2f394bc
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-implementation-c-1.1-cd05-rev1.xsd
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Copyright(C) OASIS(R) 2007,2010. All Rights Reserved. OASIS trademark,
+ IPR and other policies apply.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd" />
+
+ <element name="implementation.c" type="sca:CImplementation"
+ substitutionGroup="sca:implementation" />
+
+ <complexType name="CImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <element name="operation" type="sca:CImplementationFunction"
+ minOccurs="0" maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="module" type="NCName" use="required" />
+ <attribute name="path" type="string" use="optional" />
+ <attribute name="library" type="boolean" use="optional" />
+ <attribute name="componentType" type="string" use="required" />
+ <attribute name="eagerInit" type="boolean" use="optional" />
+ <attribute name="init" type="boolean" use="optional" />
+ <attribute name="destoy" type="boolean" use="optional" />
+ <attribute name="allowsPassByReference" type="boolean"
+ use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="CImplementationFunction">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required" />
+ <attribute name="requires" type="sca:listOfQNames" use="optional" />
+ <attribute name="policySets" type="sca:listOfQNames" use="optional" />
+ <attribute name="allowsPassByReference" type="boolean" use="optional" />
+ <attribute name="init" type="boolean" use="optional" />
+ <attribute name="destoy" type="boolean" use="optional" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..5ca0e59
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05-rev1.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- Composite Implementation -->
+ <element name="implementation.composite" type="sca:SCAImplementation"
+ substitutionGroup="sca:implementation"/>
+ <complexType name="SCAImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="QName" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05.xsd
deleted file mode 100644
index f2780f9..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-implementation-composite-1.1-cd05.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- Composite Implementation -->
- <element name="implementation.composite" type="sca:SCAImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="SCAImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd04.xsd
deleted file mode 100644
index b54ced4..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd04.xsd
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2006,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd" />
-
- <element name="implementation.cpp" type="sca:CPPImplementation"
- substitutionGroup="sca:implementation" />
- <complexType name="CPPImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <element name="function"
- type="sca:CPPImplementationFunction" minOccurs="0"
- maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded" />
- </sequence>
- <attribute name="library" type="NCName" use="required" />
- <attribute name="header" type="NCName" use="required" />
- <attribute name="path" type="string" use="optional" />
- <attribute name="class" type="Name" use="optional" />
- <attribute name="componentType" type="string"
- use="optional" />
- <attribute name="scope"
- type="sca:CPPImplementationScope" use="optional" />
- <attribute name="eagerInit" type="boolean"
- use="optional" />
- <attribute name="allowsPassByReference" type="boolean"
- use="optional" />
- </extension>
- </complexContent>
- </complexType>
-
- <simpleType name="CPPImplementationScope">
- <restriction base="string">
- <enumeration value="stateless" />
- <enumeration value="composite" />
- </restriction>
- </simpleType>
-
- <complexType name="CPPImplementationFunction">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional" />
- <attribute name="allowsPassByReference" type="boolean"
- use="optional" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..93f3c85
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-implementation-cpp-1.1-cd05-rev1.xsd
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2006,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd" />
+
+ <element name="implementation.cpp" type="sca:CPPImplementation"
+ substitutionGroup="sca:implementation" />
+ <complexType name="CPPImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <element name="function"
+ type="sca:CPPImplementationFunction" minOccurs="0"
+ maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="library" type="NCName" use="required" />
+ <attribute name="header" type="NCName" use="required" />
+ <attribute name="path" type="string" use="optional" />
+ <attribute name="class" type="Name" use="optional" />
+ <attribute name="componentType" type="string"
+ use="optional" />
+ <attribute name="scope"
+ type="sca:CPPImplementationScope" use="optional" />
+ <attribute name="eagerInit" type="boolean"
+ use="optional" />
+ <attribute name="allowsPassByReference" type="boolean"
+ use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <simpleType name="CPPImplementationScope">
+ <restriction base="string">
+ <enumeration value="stateless" />
+ <enumeration value="composite" />
+ </restriction>
+ </simpleType>
+
+ <complexType name="CPPImplementationFunction">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required" />
+ <attribute name="requires" type="sca:listOfQNames" use="optional" />
+ <attribute name="policySets" type="sca:listOfQNames" use="optional" />
+ <attribute name="allowsPassByReference" type="boolean"
+ use="optional" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02-rev1.xsd
new file mode 100644
index 0000000..90fe13c
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02-rev1.xsd
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- Java Implementation -->
+ <element name="implementation.java" type="sca:JavaImplementation"
+ substitutionGroup="sca:implementation"/>
+ <complexType name="JavaImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="NCName" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02.xsd b/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02.xsd
deleted file mode 100644
index 2856a51..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-implementation-java-1.1-cd02.xsd
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- Java Implementation -->
- <element name="implementation.java" type="sca:JavaImplementation"
- substitutionGroup="sca:implementation"/>
- <complexType name="JavaImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="class" type="NCName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd04.xsd
deleted file mode 100644
index 518f074..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd04.xsd
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- Copyright(C) OASIS(R) 2007,2010. All Rights Reserved. OASIS trademark,
- IPR and other policies apply.
- -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd" />
-
- <element name="interface.c" type="sca:CInterface"
- substitutionGroup="sca:interface" />
-
- <complexType name="CInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <element name="function" type="sca:CFunction" minOccurs="0"
- maxOccurs="unbounded" />
- <element name="callbackFunction" type="sca:CFunction"
- minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="header" type="string" use="required" />
- <attribute name="callbackHeader" type="string" use="optional" />
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="CFunction">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="sca:requires"/>
- <element ref="sca:policySetAttachment"/>
- </choice>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded" />
- </sequence>
- <attribute name="name" type="NCName" use="required" />
- <attribute name="requires" type="sca:listOfQNames" use="optional" />
- <attribute name="policySets" type="sca:listOfQNames" use="optional" />
- <attribute name="oneWay" type="boolean" use="optional" />
- <attribute name="exclude" type="boolean" use="optional" />
- <attribute name="input" type="NCName" use="optional" />
- <attribute name="output" type="NCName" use="optional" />
- <anyAttribute namespace="##other" processContents="lax" />
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..0dca94a
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-interface-c-1.1-cd05-rev1.xsd
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Copyright(C) OASIS(R) 2007,2010. All Rights Reserved. OASIS trademark,
+ IPR and other policies apply.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd" />
+
+ <element name="interface.c" type="sca:CInterface"
+ substitutionGroup="sca:interface" />
+
+ <complexType name="CInterface">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <element name="function" type="sca:CFunction" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="callbackFunction" type="sca:CFunction"
+ minOccurs="0" maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="header" type="string" use="required" />
+ <attribute name="callbackHeader" type="string" use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="CFunction">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required" />
+ <attribute name="requires" type="sca:listOfQNames" use="optional" />
+ <attribute name="policySets" type="sca:listOfQNames" use="optional" />
+ <attribute name="oneWay" type="boolean" use="optional" />
+ <attribute name="exclude" type="boolean" use="optional" />
+ <attribute name="input" type="NCName" use="optional" />
+ <attribute name="output" type="NCName" use="optional" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-cpp-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-cpp-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..0dee25b
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-interface-cpp-1.1-cd05-rev1.xsd
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ Copyright(C) OASIS(R) 2006,2010. All Rights Reserved. OASIS trademark,
+ IPR and other policies apply.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd" />
+
+ <element name="interface.cpp" type="sca:CPPInterface"
+ substitutionGroup="sca:interface" />
+
+ <complexType name="CPPInterface">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <element name="function" type="sca:CPPFunction" minOccurs="0"
+ maxOccurs="unbounded" />
+ <element name="callbackFunction" type="sca:CPPFunction"
+ minOccurs="0" maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="header" type="string" use="required" />
+ <attribute name="class" type="Name" use="required" />
+ <attribute name="callbackHeader" type="string" use="optional" />
+ <attribute name="callbackClass" type="Name" use="optional" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="CPPFunction">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="sca:requires"/>
+ <element ref="sca:policySetAttachment"/>
+ </choice>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded" />
+ </sequence>
+ <attribute name="name" type="NCName" use="required" />
+ <attribute name="requires" type="sca:listOfQNames" use="optional" />
+ <attribute name="policySets" type="sca:listOfQNames" use="optional" />
+ <attribute name="oneWay" type="boolean" use="optional" />
+ <attribute name="exclude" type="boolean" use="optional" />
+ <anyAttribute namespace="##other" processContents="lax" />
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04-rev1.xsd
new file mode 100644
index 0000000..7dcf79a
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04-rev1.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- Java Interface -->
+ <element name="interface.java" type="sca:JavaInterface"
+ substitutionGroup="sca:interface"/>
+ <complexType name="JavaInterface">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="interface" type="NCName" use="required"/>
+ <attribute name="callbackInterface" type="NCName"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04.xsd
deleted file mode 100644
index 7b78e13..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-interface-java-1.1-cd04.xsd
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- Java Interface -->
- <element name="interface.java" type="sca:JavaInterface"
- substitutionGroup="sca:interface"/>
- <complexType name="JavaInterface">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="NCName" use="required"/>
- <attribute name="callbackInterface" type="NCName"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05-rev1.xsd
new file mode 100644
index 0000000..532c0a6
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05-rev1.xsd
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd05-rev1.xsd"/>
+
+ <!-- WSDL Interface -->
+ <element name="interface.wsdl" type="sca:WSDLPortType"
+ substitutionGroup="sca:interface"/>
+ <complexType name="WSDLPortType">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="interface" type="anyURI" use="required"/>
+ <attribute name="callbackInterface" type="anyURI"
+ use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05.xsd b/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05.xsd
deleted file mode 100644
index 8d3510b..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-interface-wsdl-1.1-cd05.xsd
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
-
- <!-- WSDL Interface -->
- <element name="interface.wsdl" type="sca:WSDLPortType"
- substitutionGroup="sca:interface"/>
- <complexType name="WSDLPortType">
- <complexContent>
- <extension base="sca:Interface">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="interface" type="anyURI" use="required"/>
- <attribute name="callbackInterface" type="anyURI"
- use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
diff --git a/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03-rev1.xsd b/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03-rev1.xsd
new file mode 100644
index 0000000..8de738c
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03-rev1.xsd
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core-1.1-cd06.xsd"/>
+ <import namespace="http://www.w3.org/ns/ws-policy"
+ schemaLocation="http://www.w3.org/2007/02/ws-policy.xsd"/>
+
+ <element name="intent" type="sca:Intent"/>
+ <complexType name="Intent">
+ <sequence>
+ <element name="description" type="string" minOccurs="0"
+ maxOccurs="1" />
+ <element name="qualifier" type="sca:IntentQualifier"
+ minOccurs="0" maxOccurs="unbounded" />
+ <any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="constrains" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="requires" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="excludes" type="sca:listOfQNames"
+ use="optional"/>
+ <attribute name="mutuallyExclusive" type="boolean"
+ use="optional" default="false"/>
+ <attribute name="intentType"
+ type="sca:InteractionOrImplementation"
+ use="optional" default="interaction"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <complexType name="IntentQualifier">
+ <sequence>
+ <element name="description" type="string" minOccurs="0"
+ maxOccurs="1" />
+ <any namespace="##other" processContents="lax" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="default" type="boolean" use="optional"
+ default="false"/>
+ </complexType>
+
+ <element name="requires">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </sequence>
+ <attribute name="intents" type="sca:listOfQNames" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+ </element>
+
+ <element name="externalAttachment">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </sequence>
+ <attribute name="intents" type="sca:listOfQNames" use="optional"/>
+ <attribute name="policySets" type="sca:listOfQNames" use="optional"/>
+ <attribute name="attachTo" type="string" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+ </element>
+
+ <element name="policySet" type="sca:PolicySet"/>
+ <complexType name="PolicySet">
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element name="policySetReference"
+ type="sca:PolicySetReference"/>
+ <element name="intentMap" type="sca:IntentMap"/>
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="provides" type="sca:listOfQNames"/>
+ <attribute name="appliesTo" type="string" use="optional"/>
+ <attribute name="attachTo" type="string" use="optional"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <element name="policySetAttachment">
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </sequence>
+ <attribute name="name" type="QName" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+ </element>
+
+ <complexType name="PolicySetReference">
+ <attribute name="name" type="QName" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <complexType name="IntentMap">
+ <choice minOccurs="1" maxOccurs="unbounded">
+ <element name="qualifier" type="sca:Qualifier"/>
+ <any namespace="##other" processContents="lax"/>
+ </choice>
+ <attribute name="provides" type="QName" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Qualifier">
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <any namespace="##other" processContents="lax"/>
+ </sequence>
+ <attribute name="name" type="string" use="required"/>
+ <anyAttribute namespace="##other" processContents="lax"/>
+ </complexType>
+
+ <simpleType name="listOfNCNames">
+ <list itemType="NCName"/>
+ </simpleType>
+
+ <simpleType name="InteractionOrImplementation">
+ <restriction base="string">
+ <enumeration value="interaction"/>
+ <enumeration value="implementation"/>
+ </restriction>
+ </simpleType>
+
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03.xsd b/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03.xsd
deleted file mode 100644
index 6169304..0000000
--- a/modules/assembly-xsd/src/main/resources/sca-policy-1.1-cd03.xsd
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2010. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-core-1.1-cd05.xsd"/>
- <import namespace="http://www.w3.org/ns/ws-policy"
- schemaLocation="http://www.w3.org/2007/02/ws-policy.xsd"/>
-
- <element name="intent" type="sca:Intent"/>
- <complexType name="Intent">
- <sequence>
- <element name="description" type="string" minOccurs="0"
- maxOccurs="1" />
- <element name="qualifier" type="sca:IntentQualifier"
- minOccurs="0" maxOccurs="unbounded" />
- <any namespace="##other" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="constrains" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="requires" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="excludes" type="sca:listOfQNames"
- use="optional"/>
- <attribute name="mutuallyExclusive" type="boolean"
- use="optional" default="false"/>
- <attribute name="intentType"
- type="sca:InteractionOrImplementation"
- use="optional" default="interaction"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <complexType name="IntentQualifier">
- <sequence>
- <element name="description" type="string" minOccurs="0"
- maxOccurs="1" />
- <any namespace="##other" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="default" type="boolean" use="optional"
- default="false"/>
- </complexType>
-
- <element name="requires">
- <complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax"/>
- </sequence>
- <attribute name="intents" type="sca:listOfQNames" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
- </element>
-
- <element name="policySet" type="sca:PolicySet"/>
- <complexType name="PolicySet">
- <choice minOccurs="0" maxOccurs="unbounded">
- <element name="policySetReference"
- type="sca:PolicySetReference"/>
- <element name="intentMap" type="sca:IntentMap"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="provides" type="sca:listOfQNames"/>
- <attribute name="appliesTo" type="string" use="optional"/>
- <attribute name="attachTo" type="string" use="optional"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <element name="policySetAttachment">
- <complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax"/>
- </sequence>
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
- </element>
-
- <complexType name="PolicySetReference">
- <attribute name="name" type="QName" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <complexType name="IntentMap">
- <choice minOccurs="1" maxOccurs="unbounded">
- <element name="qualifier" type="sca:Qualifier"/>
- <any namespace="##other" processContents="lax"/>
- </choice>
- <attribute name="provides" type="QName" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <complexType name="Qualifier">
- <sequence minOccurs="0" maxOccurs="unbounded">
- <any namespace="##other" processContents="lax"/>
- </sequence>
- <attribute name="name" type="string" use="required"/>
- <anyAttribute namespace="##other" processContents="lax"/>
- </complexType>
-
- <simpleType name="listOfNCNames">
- <list itemType="NCName"/>
- </simpleType>
-
- <simpleType name="InteractionOrImplementation">
- <restriction base="string">
- <enumeration value="interaction"/>
- <enumeration value="implementation"/>
- </restriction>
- </simpleType>
-
-</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-http.xsd b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-http.xsd
index 67feb54..212c8abe 100644
--- a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-http.xsd
+++ b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-http.xsd
@@ -38,4 +38,32 @@
</extension>
</complexContent>
</complexType>
+
+ <complexType name="HTTPDefaultWireFormatType">
+ <complexContent>
+ <extension base="sca:WireFormatType"/>
+ </complexContent>
+ </complexType>
+
+ <complexType name="HTTPXMLWireFormatType">
+ <complexContent>
+ <extension base="sca:WireFormatType"/>
+ </complexContent>
+ </complexType>
+
+ <complexType name="HTTPDefaultOperationSelectorType">
+ <complexContent>
+ <extension base="sca:OperationSelectorType"/>
+ </complexContent>
+ </complexType>
+
+ <element name="wireFormat.httpDefault" type="t:HTTPDefaultWireFormatType"
+ substitutionGroup="sca:wireFormat"/>
+
+ <element name="wireFormat.httpXml" type="t:HTTPXMLWireFormatType"
+ substitutionGroup="sca:wireFormat"/>
+
+ <element name="operationSelector.httpDefault" type="t:HTTPDefaultOperationSelectorType"
+ substitutionGroup="sca:operationSelector"/>
+
</schema>
diff --git a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-jms.xsd b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-jms.xsd
index 200f3e5..e99c086 100644
--- a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-jms.xsd
+++ b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-binding-jms.xsd
@@ -23,9 +23,9 @@
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
elementFormDefault="qualified">
- <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-binding-jms-1.1-cd04.xsd"/>
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-binding-jms-1.1-cd04-rev1.xsd"/>
- <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-1.1-cd05.xsd"/>
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-1.1-cd05-rev1.xsd"/>
<!-- wire formats -->
<!-- -->
diff --git a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-contribution-resource.xsd b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-contribution-resource.xsd
new file mode 100644
index 0000000..0964572
--- /dev/null
+++ b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-contribution-resource.xsd
@@ -0,0 +1,46 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-contribution-1.1-cd05-rev1.xsd"/>
+
+ <element name="import.resource" type="t:ImportResourceType" substitutionGroup="sca:importBase"/>
+ <complexType name="ImportResourceType">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="uri" type="anyURI" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="export.resource" type="t:ExportResourceType" substitutionGroup="sca:exportBase"/>
+ <complexType name="ExportResourceType">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="uri" type="anyURI" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
\ No newline at end of file
diff --git a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1.xsd b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1.xsd
index 4cf8649..0259a17 100644
--- a/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1.xsd
+++ b/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1.xsd
@@ -23,16 +23,20 @@
<!--
<import namespace="http://www.w3.org/ns/wsdl-instance" schemaLocation="wsdli.xsd"/>
-->
- <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-1.1-cd05.xsd"/>
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" schemaLocation="sca-1.1-cd05-rev1.xsd"/>
- <include schemaLocation="tuscany-sca-1.1-binding-atom.xsd"/>
+ <include schemaLocation="tuscany-sca-1.1-binding-atom.xsd"/>
<include schemaLocation="tuscany-sca-1.1-binding-jms.xsd"/>
<include schemaLocation="tuscany-sca-1.1-binding-http.xsd"/>
<include schemaLocation="tuscany-sca-1.1-binding-jsonrpc.xsd"/>
<include schemaLocation="tuscany-sca-1.1-binding-rest.xsd"/>
<include schemaLocation="tuscany-sca-1.1-binding-rmi.xsd"/>
+ <!--
<include schemaLocation="tuscany-sca-1.1-binding-rss.xsd"/>
+ -->
+
+ <include schemaLocation="tuscany-sca-1.1-contribution-resource.xsd"/>
<include schemaLocation="tuscany-sca-1.1-implementation-osgi.xsd"/>
<include schemaLocation="tuscany-sca-1.1-implementation-widget.xsd"/>
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
index 1f3d412..9caa756 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java
@@ -39,4 +39,21 @@
* @return the endpoints implied by this service
*/
List<Endpoint> getEndpoints();
+
+
+ /**
+ * Returns true if this service was defined based on JAXWS annotations
+ * in a Java implementation
+ *
+ * @return
+ */
+ boolean isJAXWSService();
+
+ /**
+ * Allows the JAXWSService flag to be set. It should be set true if the service
+ * configuration has been affected by JAXWS annotations.
+ *
+ * @param isJAXWSService
+ */
+ void setJAXWSService(boolean isJAXWSService);
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
index 677e86c..f943438 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
@@ -36,9 +36,9 @@
* @tuscany.spi.extension.inheritfrom
*/
public abstract class ImplementationImpl extends ComponentTypeImpl implements Implementation, PolicySubject {
- private QName type;
- private ExtensionType extensionType;
- private List<Operation> operations = new ArrayList<Operation>();
+ protected QName type;
+ protected ExtensionType extensionType;
+ protected List<Operation> operations = new ArrayList<Operation>();
protected ImplementationImpl(QName type) {
super();
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
index 62523e5..f8eb0fa 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java
@@ -38,6 +38,7 @@
private boolean overridingBindings;
private Callback callback;
private List<Endpoint> endpoints = new ArrayList<Endpoint>();
+ private boolean isJAXWSService = false;
/**
* Constructs a new service.
@@ -103,4 +104,12 @@
public void setOverridingBindings(boolean overridingBindings) {
this.overridingBindings = overridingBindings;
}
+
+ public boolean isJAXWSService() {
+ return isJAXWSService;
+ }
+
+ public void setJAXWSService(boolean isJAXWSService) {
+ this.isJAXWSService = isJAXWSService;
+ }
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
index 7a63bbe..9ae5e6f 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
@@ -26,6 +26,8 @@
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
+
/**
* Represents SCA Definitions.
@@ -81,4 +83,10 @@
* @return a list of domain wide binding definition objects
*/
List<Binding> getBindings();
+
+ /**
+ * Returns a list of external attachments
+ * @return
+ */
+ List<ExternalAttachment> getExternalAttachments();
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
index 224bc0a..e58261c 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
@@ -25,6 +25,7 @@
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.definitions.Definitions;
import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
import org.apache.tuscany.sca.policy.ImplementationType;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -41,6 +42,7 @@
private List<BindingType> bindingTypes = new CopyOnWriteArrayList<BindingType>();
private List<ImplementationType> implementationTypes = new CopyOnWriteArrayList<ImplementationType>();
private List<Binding> bindings = new CopyOnWriteArrayList<Binding>();
+ private List<ExternalAttachment> externalAttachments = new CopyOnWriteArrayList<ExternalAttachment>();
public List<BindingType> getBindingTypes() {
@@ -70,4 +72,8 @@
public List<Binding> getBindings() {
return bindings;
}
+
+ public List<ExternalAttachment> getExternalAttachments() {
+ return externalAttachments ;
+ }
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
index eb74677..452c3bf 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
@@ -103,6 +103,8 @@
}
target.getBindings().addAll(source.getBindings());
+
+ target.getExternalAttachments().addAll(source.getExternalAttachments());
}
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
index c71225c..71c641f 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java
@@ -201,4 +201,9 @@
*/
Object clone() throws CloneNotSupportedException;
+ /**
+ * Returns the ParameterModes
+ * @return
+ */
+ List<ParameterMode> getParameterModes();
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ParameterMode.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ParameterMode.java
new file mode 100644
index 0000000..c4244a3
--- /dev/null
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/ParameterMode.java
@@ -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 org.apache.tuscany.sca.interfacedef;
+
+/**
+ * Parameter mode
+ * @see http://java.sun.com/javase/6/docs/api/javax/jws/WebParam.Mode.html
+ */
+public enum ParameterMode {
+ IN, OUT, INOUT;
+}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
index 12ea229..572dd7e 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java
@@ -150,11 +150,18 @@
this.dataBinding = dataBinding;
}
+
@Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical);
- return sb.toString();
+ public String toString() {
+ StringBuilder b = new StringBuilder( 256 );
+ b.append( "DataType[" );
+ b.append( "dataBinding=" + ((dataBinding==null) ? "null" : dataBinding) );
+ b.append( ", genericType=" + ((genericType==null) ? "null" : genericType) );
+ b.append( ", physical=" + ((physical==null) ? "null" : physical) );
+ b.append( ", logical=" + ((logical==null) ? "null" : logical) );
+ b.append( ", metaData size=" + ((metaDataMap==null) ? "0" : metaDataMap.size()) );
+ b.append( "]" );
+ return b.toString();
}
@SuppressWarnings("unchecked")
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
index f0f46dd..3dedb5e 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
@@ -216,6 +216,7 @@
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -226,6 +227,7 @@
source.getName() +
" target = " +
target.getName());
+ audit.appendSeperator();
}
return false;
}
@@ -236,6 +238,7 @@
source.isNonBlocking() +
" target = " +
target.isNonBlocking());
+ audit.appendSeperator();
}
return false;
}
@@ -276,6 +279,7 @@
if (!isCompatible(targetOutputType, sourceOutputType, passByValue, audit)) {
if (audit != null){
audit.append(" output types");
+ audit.appendSeperator();
}
return false;
}
@@ -283,6 +287,7 @@
if (sourceInputType.size() != targetInputType.size()) {
if (audit != null){
audit.append("different number of input types");
+ audit.appendSeperator();
}
return false;
}
@@ -292,6 +297,7 @@
if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), passByValue, audit)) {
if (audit != null){
audit.append(" input types");
+ audit.appendSeperator();
}
return false;
}
@@ -313,6 +319,7 @@
if (!found) {
if (audit != null){
audit.append("Fault types incompatible");
+ audit.appendSeperator();
}
return false;
}
@@ -339,14 +346,15 @@
}
/*
- * (non-Javadoc)
- * @see org.apache.tuscany.sca.interfacedef.InterfaceContractMapper#checkCompatibility(org.apache.tuscany.sca.interfacedef.InterfaceContract, org.apache.tuscany.sca.interfacedef.InterfaceContract, org.apache.tuscany.sca.interfacedef.Compatibility, boolean, boolean, java.lang.StringBuffer)
* this variant of the checkCompatibility method is intended to supersede the one without an audit argument
* Presence of both method variants indicates a state of partial development
*/
public boolean checkCompatibility(InterfaceContract source,
- InterfaceContract target, Compatibility compatibility,
- boolean ignoreCallback, boolean silent, Audit audit)
+ InterfaceContract target,
+ Compatibility compatibility,
+ boolean ignoreCallback,
+ boolean silent,
+ Audit audit)
throws IncompatibleInterfaceContractException {
if (source == target) {
@@ -377,8 +385,10 @@
.isRemotable()) {
if (!silent) {
audit.append("Remotable settings do not match: "+ source + "," + target); // TODO see if serialization is sufficient
+ audit.appendSeperator();
throw new IncompatibleInterfaceContractException(
"Remotable settings do not match", source, target);
+
} else {
return false;
}
@@ -388,6 +398,8 @@
Operation targetOperation = map(target.getInterface(), operation);
if (targetOperation == null) {
if (!silent) {
+ audit.append("Operation " + operation.getName()+ " not found on target");
+ audit.appendSeperator();
throw new IncompatibleInterfaceContractException(
"Operation " + operation.getName()
+ " not found on target", source, target);
@@ -401,6 +413,8 @@
audit = new Audit();
if (!isCompatible(operation, targetOperation,
Compatibility.SUBSET, true, audit)) {
+ audit.append("Operations called " + operation.getName()+ " are not compatible");
+ audit.appendSeperator();
throw new IncompatibleInterfaceContractException(
"Operations called " + operation.getName()
+ " are not compatible " + audit, source,
@@ -417,73 +431,27 @@
return ignoreCallback || isCallbackCompatible(source, target, silent);
}
+ /*
+ * The old checkCompatibility operation without auditing. This just delegates to the new one for the time
+ * being while there are still calls that don't provide and audit object. In the medium term when the calls have
+ * been converted to sue the new opetion directly this should be removed.
+ */
public boolean checkCompatibility(InterfaceContract source,
InterfaceContract target,
Compatibility compatibility,
boolean ignoreCallback,
- boolean silent) throws IncompatibleInterfaceContractException {
+ boolean silent)
+ throws IncompatibleInterfaceContractException {
- if (source == target) {
- // Shortcut for performance
- return true;
- }
-
- if (source == null || target == null) {
- return false;
- }
-
- if (source.getInterface() == target.getInterface()) {
- return ignoreCallback || isCallbackCompatible(source, target, silent);
- }
-
- if (source.getInterface() == null || target.getInterface() == null) {
- return false;
- }
-
- if (source.getInterface().isDynamic() || target.getInterface().isDynamic()) {
- return ignoreCallback || isCallbackCompatible(source, target, silent);
- }
-
- if (source.getInterface().isRemotable() != target.getInterface().isRemotable()) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Remotable settings do not match", source, target);
- } else {
- return false;
- }
- }
-
- for (Operation operation : source.getInterface().getOperations()) {
- Operation targetOperation = map(target.getInterface(), operation);
- if (targetOperation == null) {
- if (!silent) {
- throw new IncompatibleInterfaceContractException("Operation " +
- operation.getName() +
- " not found on target",
- source,
- target);
- } else {
- return false;
- }
- }
-
- if (!silent) {
- Audit audit = new Audit();
- if (!isCompatible(operation, targetOperation, Compatibility.SUBSET, true, audit)){
- throw new IncompatibleInterfaceContractException("Operations called " +
- operation.getName() +
- " are not compatible " +
- audit,
- source,
- target);
- }
- } else {
- if (!isCompatible(operation, targetOperation, Compatibility.SUBSET)) {
- return false;
- }
- }
- }
-
- return ignoreCallback || isCallbackCompatible(source, target, silent);
+ // create dummy audit object.
+ Audit audit = new Audit();
+
+ return checkCompatibility(source,
+ target,
+ compatibility,
+ ignoreCallback,
+ silent,
+ audit);
}
@@ -602,30 +570,5 @@
return null;
}
}
-
-
- /**
- * In various places in the process of an SCA application we match one interface against
- * another. Sometimes the two interfaces can be presented using different IDLs, for example
- * Java and WSDL. In this case interfaces are converted so that they are both WSDL1.1 interfaces
- * and they are then compared. The generated WSDL is cached on the interface object for
- * any subsequent matching
- *
- * @param interfaceA
- * @param interfaceB
- */
-/*
- public void normalizeContractsForComparison(InterfaceContract interfaceA, InterfaceContract interfaceB){
- // normalize interfaces
- if (interfaceA.getInterface().getClass() != interfaceB.getInterface().getClass()) {
- this.contractBuilder = builders.getContractBuilder();
- if (interfaceA.getInterface() instanceof Interface){
- contractBuilder.build(interfaceA, null);
- } else {
- contractBuilder.build(interfaceB, null);
- }
- }
- }
-*/
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
index 6067824..21debb6 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java
@@ -29,6 +29,7 @@
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
import org.apache.tuscany.sca.interfacedef.util.XMLType;
import org.apache.tuscany.sca.policy.ExtensionType;
@@ -49,6 +50,7 @@
private DataType<List<DataType>> inputType;
private List<DataType> faultTypes;
private Interface interfaze;
+ private List<ParameterMode> parameterModes = new ArrayList<ParameterMode>();
private boolean nonBlocking;
private boolean wrapperStyle;
private WrapperInfo wrapper;
@@ -279,4 +281,8 @@
return false;
}
+ public List<ParameterMode> getParameterModes() {
+ return this.parameterModes;
+ }
+
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
index 0830860..343d369 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/util/Audit.java
@@ -25,13 +25,19 @@
*
*/
public class Audit {
+
+ public static final String seperator = "|||";
private StringBuffer buf;
public Audit() {
this.buf = new StringBuffer();
}
public void append(String str) {
- buf.append("||| " + str);
+ buf.append(str);
+ }
+
+ public void appendSeperator() {
+ buf.append(seperator);
}
public String toString() {
return buf.toString();
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExternalAttachment.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExternalAttachment.java
new file mode 100644
index 0000000..5bccf51
--- /dev/null
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/ExternalAttachment.java
@@ -0,0 +1,85 @@
+/*
+ * 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.sca.policy;
+
+import java.util.List;
+
+import javax.xml.xpath.XPathExpression;
+
+/*
+ * Represents an external attachment element. See the Policy Framework specification for a
+ * description of this element.
+ *
+ * @version $Rev: 937291 $ $Date: 2010-04-23 06:41:24 -0700 (Fri, 23 Apr 2010) $
+ * @tuscany.spi.extension.asclient
+ */
+
+
+public interface ExternalAttachment {
+
+ /**
+ * Get the attachTo attribute
+ * @return
+ */
+ String getAttachTo();
+
+ /**
+ * Set the attachTo attribute
+ * @param name
+ */
+ void setAttachTo(String name);
+
+ /**
+ * Get the compiled XPath attachTo expression
+ * @return
+ */
+ XPathExpression getAttachToXPathExpression();
+
+ /**
+ * Set the compiled XPath attachTo expression
+ * @param expression
+ */
+ void setAttachToXPathExpression(XPathExpression expression);
+
+ /**
+ * Get the policy sets associated with this ExternalAttachment
+ * @return
+ */
+ List<PolicySet> getPolicySets();
+
+ /**
+ * Get the intents associated with this ExternalAttachment
+ * @return
+ */
+ List<Intent> getIntents();
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java
index b2ac5ca..b23060d 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java
@@ -64,4 +64,9 @@
BindingType createBindingType();
ImplementationType createImplementationType();
+ /**
+ * Create a new ExternalAttachment
+ * @return
+ */
+ ExternalAttachment createExternalAttachment();
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java
index a1ae389..230d635 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java
@@ -144,4 +144,16 @@
*/
void setAppliesToXPathExpression(XPathExpression xpathExpression);
+ /**
+ * Returns true if this PolicySet was attached via external attachment
+ * For unattached and directly attached PolicySets, returns false
+ * @return
+ */
+ boolean isExternalAttachment();
+
+ /**
+ * Sets whether this PolicySet has been attached via external attachment or not
+ * @param value
+ */
+ void setIsExternalAttachment(boolean value);
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExternalAttachmentImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExternalAttachmentImpl.java
new file mode 100644
index 0000000..1e90e26
--- /dev/null
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/ExternalAttachmentImpl.java
@@ -0,0 +1,76 @@
+/*
+ * 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.sca.policy.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.xpath.XPathExpression;
+
+import org.apache.tuscany.sca.policy.ExternalAttachment;
+
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * An implementation of ExternalAttachment
+ *
+ */
+public class ExternalAttachmentImpl implements ExternalAttachment {
+
+ private String attachTo;
+ private List<Intent> intents = new ArrayList<Intent>();
+ private List<PolicySet> policySets = new ArrayList<PolicySet>();
+ private XPathExpression xpath;
+ private boolean isUnresolved;
+
+
+ public String getAttachTo() {
+ return attachTo;
+ }
+
+ public void setAttachTo(String attachTo) {
+ this.attachTo = attachTo;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ return this.policySets;
+ }
+
+ public List<Intent> getIntents() {
+ return this.intents;
+ }
+
+ public XPathExpression getAttachToXPathExpression() {
+ return this.xpath;
+ }
+
+ public void setAttachToXPathExpression(XPathExpression expression) {
+ this.xpath = expression;
+ }
+
+ public boolean isUnresolved() {
+ return this.isUnresolved;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ this.isUnresolved = unresolved;
+ }
+
+}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java
index c67ff1e..f700f7c 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java
@@ -28,6 +28,8 @@
import org.apache.tuscany.sca.policy.PolicySet;
import org.apache.tuscany.sca.policy.Qualifier;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
+
/**
* A factory for the policy model.
*
@@ -66,5 +68,9 @@
public ExtensionType createExtensionType() {
return new ExtensionTypeImpl();
}
+
+ public ExternalAttachment createExternalAttachment() {
+ return new ExternalAttachmentImpl();
+ }
}
diff --git a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java
index 75d1229..22e6e4d 100644
--- a/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java
+++ b/modules/assembly/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java
@@ -48,6 +48,7 @@
private List<IntentMap> intentMaps = new ArrayList<IntentMap>();
private List<PolicyExpression> policies = new ArrayList<PolicyExpression>();
+ private boolean isExternalAttachment;
public QName getName() {
return name;
@@ -142,4 +143,12 @@
return true;
}
+ public boolean isExternalAttachment() {
+ return this.isExternalAttachment;
+ }
+
+ public void setIsExternalAttachment(boolean value) {
+ this.isExternalAttachment = value;
+ }
+
}
diff --git a/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties b/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
index fe92f5e..91b1721 100644
--- a/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
+++ b/modules/assembly/src/main/resources/org/apache/tuscany/sca/assembly/builder/assembly-validation-messages.properties
@@ -81,3 +81,5 @@
PropertyValueDoesNotMatchElement = [ASM50029] The property {0} on component {1} has a value which does not match the element {2} with which it is associated. Validation reported {3}
EPRIncompatibleInterface = [BWS20007] The reference interface is incompatible with the interface of the reference binding {0}
EPIncompatibleInterface = [BWS20007] The service interface is incompatible with the interface of the service binding {0}
+PromotedCallbackReferenceNotFound = For component {0} and service {1} the promoted component {2} does not have a callback reference called {3} which should have been created automatically by Tuscany
+PromotedCallbackServiceNotFound = For component {0} and reference {1} the promoted component {2} does not have a callback service called {3} which should have been created automatically by Tuscany
diff --git a/modules/assembly/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java b/modules/assembly/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java
index 2775c4a..569366a 100644
--- a/modules/assembly/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java
+++ b/modules/assembly/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java
@@ -52,4 +52,22 @@
policySet.setName(new QName("http://test", "reliability"));
assertEquals(policySet.getName(), new QName("http://test", "reliability"));
}
+
+ @Test
+ public void testCreateExternalAttachment() {
+ ExternalAttachment attachment = factory.createExternalAttachment();
+ attachment.setAttachTo("sca:component");
+
+ Intent intent = factory.createIntent();
+ intent.setName(new QName("http://test", "reliability"));
+ attachment.getIntents().add(intent);
+
+ PolicySet policySet = factory.createPolicySet();
+ policySet.setName(new QName("http://test", "reliability"));
+ attachment.getPolicySets().add(policySet);
+
+ assertEquals("sca:component", attachment.getAttachTo());
+ assertEquals(intent, attachment.getIntents().get(0));
+ assertEquals(policySet, attachment.getPolicySets().get(0));
+ }
}
diff --git a/modules/base-runtime-pom/pom.xml b/modules/base-runtime-pom/pom.xml
new file mode 100644
index 0000000..9ad157b
--- /dev/null
+++ b/modules/base-runtime-pom/pom.xml
@@ -0,0 +1,295 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <name>Apache Tuscany SCA Base Runtime POM</name>
+ <packaging>pom</packaging>
+
+ <!--
+ Provides a minimum set of function for running composites using implementation.java
+ and local wiring. Other extensions can be added to this base when required
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-node</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-launcher</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>${pom.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-shell</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-wink</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-jaxws-ri</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-security</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+<!-- All the scdl modules -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-atom</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonp</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <!-- dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-jaxrs</artifactId>
+ <version>${pom.version}</version>
+ </dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-python</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-widget</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+<!-- these remaining dependencies are not required when using JDK6, so use a scope of provided -->
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+ <version>1.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.12</version>
+ <scope>provided</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>1.0-MR1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0-2</version>
+ <scope>provided</scope>
+ </dependency>
+
+
+ </dependencies>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/modules/base-runtime-pom/src/main/resources/LICENSE
similarity index 100%
rename from shades/base-nodep/src/main/resources/LICENSE
rename to modules/base-runtime-pom/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/modules/base-runtime-pom/src/main/resources/NOTICE
similarity index 100%
rename from shades/base-nodep/src/main/resources/NOTICE
rename to modules/base-runtime-pom/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/modules/base-runtime-pom/src/main/resources/README.txt
similarity index 100%
rename from shades/base/src/main/resources/README.txt
rename to modules/base-runtime-pom/src/main/resources/README.txt
diff --git a/modules/binding-atom-js-dojo/src/main/java/org/apache/tuscany/sca/binding/atom/js/dojo/AtomBindingJavascriptProxyFactoryImpl.java b/modules/binding-atom-js-dojo/src/main/java/org/apache/tuscany/sca/binding/atom/js/dojo/AtomBindingJavascriptProxyFactoryImpl.java
index abc3c0c..ca6cff2 100644
--- a/modules/binding-atom-js-dojo/src/main/java/org/apache/tuscany/sca/binding/atom/js/dojo/AtomBindingJavascriptProxyFactoryImpl.java
+++ b/modules/binding-atom-js-dojo/src/main/java/org/apache/tuscany/sca/binding/atom/js/dojo/AtomBindingJavascriptProxyFactoryImpl.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.atom.js.dojo;
@@ -34,8 +34,8 @@
import org.apache.tuscany.sca.web.javascript.JavascriptProxyFactory;
public class AtomBindingJavascriptProxyFactoryImpl implements JavascriptProxyFactory {
- private static final QName NAME = new QName("http://tuscany.apache.org/xmlns/sca/1.1", "binding.atom");
-
+ private static final QName NAME = AtomBinding.TYPE;
+
public Class<?> getModelType() {
return AtomBinding.class;
}
@@ -43,7 +43,7 @@
public QName getQName() {
return NAME;
}
-
+
public String getJavascriptProxyFile() {
return null;
}
@@ -65,13 +65,13 @@
((RuntimeEndpointReference) epr).getInvocationChains();
targetEndpoint = epr.getTargetEndpoint();
}
-
+
Binding binding = targetEndpoint.getBinding();
-
+
URI targetURI = URI.create(binding.getURI());
String targetPath = targetURI.getPath();
-
- return "tuscany.AtomService(\"" + targetPath + "\")";
+
+ return "tuscany.AtomService(\"" + targetPath + "\")";
}
}
diff --git a/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java b/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
index 155d07a..bc8149a 100644
--- a/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
+++ b/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomServiceBindingProvider.java
@@ -95,7 +95,15 @@
bindingURI += "/";
}
- servletHost.addServletMapping(bindingURI, servlet);
+ String mappedURI = servletHost.addServletMapping(bindingURI, servlet);
+ String deployedURI = mappedURI;
+ if (deployedURI.endsWith("*")) {
+ deployedURI = deployedURI.substring(0, deployedURI.length() - 1);
+ }
+ if (deployedURI.endsWith("/")) {
+ deployedURI = deployedURI.substring(0, deployedURI.length() - 1);
+ }
+ binding.setURI(deployedURI);
}
public void stop() {
diff --git a/modules/binding-comet-runtime/LICENSE b/modules/binding-comet-runtime/LICENSE
new file mode 100644
index 0000000..6118ab6
--- /dev/null
+++ b/modules/binding-comet-runtime/LICENSE
@@ -0,0 +1,238 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+===============================================================================================================
+
+Apache Tuscany SCA for Java Subcomponents
+=========================================:
+
+The Tuscany SCA for Java release includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+=================================================================================================================
+
+This module includes files under the following MIT license:
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
diff --git a/modules/binding-comet-runtime/META-INF/MANIFEST.MF b/modules/binding-comet-runtime/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..6193342
--- /dev/null
+++ b/modules/binding-comet-runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Comet Binding Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Comet Binding Model
+Import-Package: javax.servlet;version="2.5.0",
+ javax.servlet.http;version="2.5.0",
+ org.apache.commons.codec,
+ org.apache.commons.codec.net,
+ org.apache.http;version="4.0.1",
+ org.apache.http.client;version="4.0.0",
+ org.apache.http.client.methods;version="4.0.0",
+ org.apache.http.client.utils;version="4.0.0",
+ org.apache.http.conn;version="4.0.0",
+ org.apache.http.impl.client;version="4.0.0",
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.binding.comet;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.host.http;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.codehaus.jackson,
+ org.codehaus.jackson.map
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.comet.runtime
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/samples/dosgi-calculator-operations/NOTICE b/modules/binding-comet-runtime/NOTICE
similarity index 100%
copy from samples/dosgi-calculator-operations/NOTICE
copy to modules/binding-comet-runtime/NOTICE
diff --git a/modules/binding-comet-runtime/pom.xml b/modules/binding-comet-runtime/pom.xml
new file mode 100644
index 0000000..69a3ff4
--- /dev/null
+++ b/modules/binding-comet-runtime/pom.xml
@@ -0,0 +1,86 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet-runtime</artifactId>
+ <name>Apache Tuscany SCA Comet Binding Runtime</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.atmosphere</groupId>
+ <artifactId>atmosphere-commons</artifactId>
+ <version>0.6.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.atmosphere</groupId>
+ <artifactId>atmosphere-runtime</artifactId>
+ <version>0.6.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_3.0_spec</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.1.19</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>gson-googlecode-repository</id>
+ <url>http://google-gson.googlecode.com/svn/mavenrepo</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+</project>
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java
new file mode 100644
index 0000000..fc5fd9f
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java
@@ -0,0 +1,72 @@
+/*
+ * 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.sca.binding.comet.runtime;
+
+import org.apache.tuscany.sca.binding.comet.CometBinding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.host.http.ServletHostHelper;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+/**
+ * Factory for binding providers.
+ */
+public class CometBindingProviderFactory implements BindingProviderFactory<CometBinding> {
+
+ /**
+ * Underlying servlet host. Injected by constructor.
+ */
+ private final ServletHost servletHost;
+
+ /**
+ * Constructor.
+ */
+ public CometBindingProviderFactory(final ExtensionPointRegistry extensionPoints) {
+ this.servletHost = ServletHostHelper.getServletHost(extensionPoints);
+ }
+
+ @Override
+ public Class<CometBinding> getModelType() {
+ return CometBinding.class;
+ }
+
+ /**
+ * Creates a provider for a reference that has comet binding specified in
+ * the scdl.
+ */
+ @Override
+ public ReferenceBindingProvider createReferenceBindingProvider(final RuntimeEndpointReference endpoint) {
+ return new CometReferenceBindingProvider(endpoint);
+ }
+
+ /**
+ * Creates a provider for a service that has comet binding specified in the
+ * scdl.
+ */
+ @Override
+ public ServiceBindingProvider createServiceBindingProvider(final RuntimeEndpoint endpoint) {
+ return new CometServiceBindingProvider(endpoint, this.servletHost);
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java
new file mode 100644
index 0000000..9353571
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java
@@ -0,0 +1,62 @@
+/*
+ * 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.sca.binding.comet.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+/**
+ * Invoker for a service binding. Invoking is made from client Javascript so no
+ * behavior is needed.
+ */
+public class CometInvoker implements Invoker {
+
+ /**
+ * The invoked operation.
+ */
+ protected Operation operation;
+
+ /**
+ * The endpoint to which the operation belongs.
+ */
+ protected EndpointReference endpoint;
+
+ /**
+ * Default constructor.
+ *
+ * @param operation the operation
+ * @param endpoint the endpoint
+ */
+ public CometInvoker(final Operation operation, final EndpointReference endpoint) {
+ this.operation = operation;
+ this.endpoint = endpoint;
+ }
+
+ /**
+ * No behavior.
+ */
+ @Override
+ public Message invoke(final Message msg) {
+ return null;
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java
new file mode 100644
index 0000000..17470e3
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java
@@ -0,0 +1,72 @@
+/*
+ * 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.sca.binding.comet.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+
+/**
+ * Provider for references that have comet binding specified in the scdl. Not
+ * used as comet binding references would occur in client browser's Javascript.
+ */
+public class CometReferenceBindingProvider implements ReferenceBindingProvider {
+
+ /**
+ * Endpoint for which the binding provider is created.
+ */
+ private final EndpointReference endpoint;
+
+ public CometReferenceBindingProvider(final EndpointReference endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ @Override
+ public Invoker createInvoker(final Operation operation) {
+ return new CometInvoker(operation, this.endpoint);
+ }
+
+ /**
+ * No behavior.
+ */
+ @Override
+ public void start() {
+ }
+
+ /**
+ * No behavior.
+ */
+ @Override
+ public void stop() {
+ }
+
+ @Override
+ public InterfaceContract getBindingInterfaceContract() {
+ return null;
+ }
+
+ @Override
+ public boolean supportsOneWayInvocation() {
+ return true;
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java
new file mode 100644
index 0000000..31c0b5b
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java
@@ -0,0 +1,90 @@
+/*
+ * 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.sca.binding.comet.runtime;
+
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.binding.comet.runtime.javascript.JavascriptGenerator;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+/**
+ * Provider for services having comet binding specified in the scdl.
+ */
+public class CometServiceBindingProvider implements ServiceBindingProvider {
+
+ /**
+ * Service's endpoint.
+ */
+ private final RuntimeEndpoint endpoint;
+
+ /**
+ * The underlying servlet host.
+ */
+ private final ServletHost servletHost;
+
+ /**
+ * Constructor.
+ *
+ * @param endpoint the given endpoint
+ * @param servletHost the given servlet host
+ */
+ public CometServiceBindingProvider(final RuntimeEndpoint endpoint, final ServletHost servletHost) {
+ this.endpoint = endpoint;
+ this.servletHost = servletHost;
+ }
+
+ /**
+ * This method is used to start the provider.
+ */
+ @Override
+ public void start() {
+ ServletFactory.registerServlet(this.servletHost);
+ final ComponentService service = this.endpoint.getService();
+ final Interface serviceInterface = service.getInterfaceContract().getInterface();
+ JavascriptGenerator.generateServiceProxy(service);
+ for (final Operation operation : serviceInterface.getOperations()) {
+ JavascriptGenerator.generateMethodProxy(service, operation);
+ ServletFactory.addOperation(this.endpoint, operation);
+ }
+ }
+
+ /**
+ * This method is used to stop the provider.
+ */
+ @Override
+ public void stop() {
+ ServletFactory.unregisterServlet(this.servletHost);
+ }
+
+ @Override
+ public InterfaceContract getBindingInterfaceContract() {
+ return null;
+ }
+
+ @Override
+ public boolean supportsOneWayInvocation() {
+ return true;
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
new file mode 100644
index 0000000..c1244b3
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
@@ -0,0 +1,155 @@
+/*
+ * 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.sca.binding.comet.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.atmosphere.cpr.AtmosphereServlet;
+
+/**
+ * This class is used to create two servlets: one exposing all the comet
+ * services, the other one exposing the javascript toolkit. Exposing all comet
+ * services through a single servlet is needed as the browsers are undergone by
+ * the two http connection limit so all comet services should send their
+ * responses via the same http connection to the same client. Dispatching to the
+ * corresponding endpoint and operation is done internally using Jersey RESTful
+ * Web Services integration with the AtmosphereServlet. The Javascript toolkit
+ * servlet is unique as it is not tied to any of the services - it offers a
+ * global API.
+ */
+public final class ServletFactory {
+
+ /**
+ * Init-param key for the AtmosphereServlet defining where to look for
+ * Jersey classes.
+ */
+ private static final String PACKAGE_KEY = "com.sun.jersey.config.property.packages";
+
+ /**
+ * Package of the class handling dispatching to endpoints.
+ */
+ private static final String PACKAGE_VALUE = "org.apache.tuscany.sca.binding.comet.runtime.handler";
+
+ /**
+ * Package of the class handling Javascript toolkit retrieval.
+ */
+ private static final String JS_PACKAGE_VALUE = "org.apache.tuscany.sca.binding.comet.runtime.javascript";
+
+ /**
+ * Property in the ServletContext where endpoints are added incrementally as
+ * the Tuscany runtime calls the CometServiceBindingProvider for each comet
+ * service.
+ */
+ public static final String ENDPOINTS_KEY = "org.apache.tuscany.sca.binding.comet.endpoints";
+
+ /**
+ * Property in the ServletContext where operations are added incrementally
+ * as the CometServiceBindingProvider is calling the registerServlet method
+ * for each comet service method.
+ */
+ public static final String OPERATIONS_KEY = "org.apache.tuscany.sca.binding.comet.operations";
+
+ /**
+ * Path where services will be exposed.
+ */
+ public static final String PATH = "/tuscany-comet/*";
+
+ /**
+ * Path where Javascript toolkit will be exposed.
+ */
+ public static final String JS_PATH = "/org.apache.tuscany.sca.cometComponentContext.js/*";
+
+ /**
+ * The servlet that is exposing the comet services.
+ */
+ private static AtmosphereServlet cometServlet = null;
+
+ /**
+ * The servlet that is exposing the Javascript toolkit.
+ */
+ private static AtmosphereServlet javascriptServlet = null;
+
+ /**
+ * Private constructor for the singleton class.
+ */
+ private ServletFactory() {
+ }
+
+ /**
+ * Method called by CometServiceBindingProvider for each endpoint in order
+ * to create the two singleton servlets.
+ *
+ * @param servletHost the underlying servlet host
+ */
+ public static synchronized void registerServlet(final ServletHost servletHost) {
+ if (ServletFactory.cometServlet == null) {
+ ServletFactory.cometServlet = new AtmosphereServlet();
+ ServletFactory.cometServlet.addInitParameter(ServletFactory.PACKAGE_KEY, ServletFactory.PACKAGE_VALUE);
+ servletHost.addServletMapping(ServletFactory.PATH, ServletFactory.cometServlet);
+ // store operations and corresponding endpoint in the ServletContext
+ // so that they can be retrieved from inside the web service methods
+ final Map<String, RuntimeEndpoint> endpoints = new HashMap<String, RuntimeEndpoint>();
+ ServletFactory.cometServlet.getServletContext().setAttribute(ServletFactory.ENDPOINTS_KEY, endpoints);
+ final Map<String, Operation> operations = new HashMap<String, Operation>();
+ ServletFactory.cometServlet.getServletContext().setAttribute(ServletFactory.OPERATIONS_KEY, operations);
+ }
+ if (ServletFactory.javascriptServlet == null) {
+ ServletFactory.javascriptServlet = new AtmosphereServlet();
+ ServletFactory.javascriptServlet.addInitParameter(ServletFactory.PACKAGE_KEY,
+ ServletFactory.JS_PACKAGE_VALUE);
+ servletHost.addServletMapping(ServletFactory.JS_PATH, ServletFactory.javascriptServlet);
+ }
+ }
+
+ /**
+ * Method called by CometServiceBindingProvider for each endpoint operation
+ * in order to store all the operations the servlet will serve.
+ *
+ * @param endpoint the endpoint
+ * @param operation the operation
+ */
+ public static synchronized void addOperation(final RuntimeEndpoint endpoint, final Operation operation) {
+ final String url = "/" + endpoint.getService().getName() + "/" + operation.getName();
+ final Map<String, RuntimeEndpoint> endpoints =
+ (Map<String, RuntimeEndpoint>)ServletFactory.cometServlet.getServletContext()
+ .getAttribute(ServletFactory.ENDPOINTS_KEY);
+ endpoints.put(url, endpoint);
+ final Map<String, Operation> operations =
+ (Map<String, Operation>)ServletFactory.cometServlet.getServletContext()
+ .getAttribute(ServletFactory.OPERATIONS_KEY);
+ operations.put(url, operation);
+ }
+
+ /**
+ * Method called by CometServiceBindingProvider for each endpoint operation
+ * in order to remove the two servlets.
+ *
+ * @param servletHost the underlying servlet host
+ */
+ public static synchronized void unregisterServlet(final ServletHost servletHost) {
+ servletHost.removeServletMapping(ServletFactory.PATH);
+ servletHost.removeServletMapping(ServletFactory.JS_PATH);
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
new file mode 100644
index 0000000..512b834
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
@@ -0,0 +1,174 @@
+/*
+ * 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.sca.binding.comet.runtime.handler;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+
+import org.apache.tuscany.sca.binding.comet.runtime.ServletFactory;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.atmosphere.annotation.Broadcast;
+import org.atmosphere.cpr.Broadcaster;
+import org.atmosphere.cpr.DefaultBroadcaster;
+import org.atmosphere.jersey.Broadcastable;
+import org.atmosphere.jersey.SuspendResponse;
+
+import com.google.gson.Gson;
+import com.sun.jersey.spi.container.servlet.PerSession;
+
+/**
+ * Class serving calls coming for comet services and operations.
+ */
+@Path("/")
+@Produces("text/html;charset=ISO-8859-1")
+@PerSession
+public class CometBindingHandler {
+
+ /**
+ * The object used to suspend the response and send async responses back to
+ * client.
+ */
+ private Broadcaster broadcaster;
+
+ /**
+ * The service endpoints corresponding to each operation.
+ */
+ private Map<String, RuntimeEndpoint> endpoints;
+
+ /**
+ * The comet operations.
+ */
+ private Map<String, Operation> operations;
+
+ /**
+ * JSON converter.
+ */
+ private Gson gson;
+
+ /**
+ * The underlying servlet context.
+ */
+ @Context
+ private ServletContext sc;
+
+ /**
+ * Method called at comet connect time. This suspends the response and keeps
+ * the connection opened.
+ *
+ * @return the suspended response
+ */
+ @GET
+ public SuspendResponse<String> connect() {
+ this.broadcaster = new DefaultBroadcaster();
+ this.endpoints = (Map<String, RuntimeEndpoint>)this.sc.getAttribute(ServletFactory.ENDPOINTS_KEY);
+ this.operations = (Map<String, Operation>)this.sc.getAttribute(ServletFactory.OPERATIONS_KEY);
+ this.gson = new Gson();
+ return new SuspendResponse.SuspendResponseBuilder<String>().broadcaster(this.broadcaster).outputComments(true)
+ .build();
+ }
+
+ /**
+ * Method called on service calls.
+ *
+ * @param service service called
+ * @param method operation called
+ * @param callbackMethod the callback method from Javascript
+ * @param jsonData arguments for the method sent as JSON array
+ * @return object used by the Broadcaster to send response through the
+ * persisted connection
+ * @throws InvocationTargetException if problems occur at service invocation
+ */
+ @POST
+ @Path("/{service}/{method}")
+ @Broadcast
+ public Broadcastable callAndRespond(@PathParam("service") final String service,
+ @PathParam("method") final String method,
+ @FormParam("callback") final String callbackMethod,
+ @FormParam("params") final String jsonData) throws InvocationTargetException {
+ final String url = "/" + service + "/" + method;
+ final RuntimeEndpoint wire = this.endpoints.get(url);
+ final Operation operation = this.operations.get(url);
+ final Object[] args = new Object[operation.getInputType().getLogical().size()];
+ final String[] json = this.parseArray(jsonData);
+ int index = 0;
+ // convert each argument to the corresponding class
+ for (final DataType<?> dataType : operation.getInputType().getLogical()) {
+ args[index] = this.gson.fromJson(json[index], dataType.getPhysical());
+ index++;
+ }
+ // invoke the service operation
+ final Object response = wire.invoke(operation, args);
+ return new Broadcastable(callbackMethod + "($.secureEvalJSON('" + this.gson.toJson(response) + "'))", "",
+ this.broadcaster);
+ }
+
+ /**
+ * Parse the JSON array containing the arguments for the method call in
+ * order to avoid converting JSON to Object[]. Converting each object
+ * separately to it's corresponding type avoids type mismatch problems at
+ * service invocation.
+ *
+ * @param jsonArray the JSON array
+ * @return an array of JSON formatted objects
+ */
+ private String[] parseArray(final String jsonArray) {
+ final List<String> objects = new ArrayList<String>();
+ int bracketNum = 0;
+ int parNum = 0;
+ int startPos = 1;
+ for (int i = 0; i < jsonArray.length(); i++) {
+ switch (jsonArray.charAt(i)) {
+ case '{':
+ bracketNum++;
+ break;
+ case '}':
+ bracketNum--;
+ break;
+ case '[':
+ parNum++;
+ break;
+ case ']':
+ parNum--;
+ break;
+ case ',':
+ if ((bracketNum == 0) && (parNum == 1)) {
+ objects.add(jsonArray.substring(startPos, i));
+ startPos = i + 1;
+ }
+ }
+ }
+ // add last object
+ objects.add(jsonArray.substring(startPos, jsonArray.length() - 1));
+ return objects.toArray(new String[] {});
+ }
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptGenerator.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptGenerator.java
new file mode 100644
index 0000000..b120559
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptGenerator.java
@@ -0,0 +1,107 @@
+/*
+ * 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.sca.binding.comet.runtime.javascript;
+
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.interfacedef.Operation;
+
+/**
+ * This class generates proxies for the comet services.
+ */
+public class JavascriptGenerator {
+
+ /**
+ * Namespace for the Tuscany Comet Javascript toolkit.
+ */
+ public static final String JS_NAMESPACE = "SCA";
+
+ /**
+ * Name for the SCA component context.
+ */
+ private static final String COMPONENT_CONTEXT = "this.CometComponentContext";
+
+ /**
+ * Name for the object performing comet specific tasks.
+ */
+ private static final String TUSCANY_COMET = "SCA.TuscanyComet";
+
+ /**
+ * Generated Javascript.
+ */
+ private static StringBuffer javascript = new StringBuffer();
+
+ /**
+ * Default constructor for utility class.
+ */
+ private JavascriptGenerator() {
+ }
+
+ /**
+ * Getter for the generated Javascript.
+ *
+ * @return the generated Javascript
+ */
+ public static StringBuffer getJavascript() {
+ return JavascriptGenerator.javascript;
+ }
+
+ /**
+ * Generates the proxy for a service.
+ *
+ * @param service the service for which generation is performed
+ */
+ public static void generateServiceProxy(final ComponentService service) {
+ JavascriptGenerator.javascript.append(JavascriptGenerator.COMPONENT_CONTEXT + "."
+ + service.getName()
+ + " = new Object();\n");
+ }
+
+ /**
+ * Generates the method inside the service proxy for the specified
+ * operation.
+ *
+ * @param service the service containing the operation
+ * @param operation the operation
+ */
+ public static void generateMethodProxy(final ComponentService service, final Operation operation) {
+ JavascriptGenerator.javascript.append(JavascriptGenerator.COMPONENT_CONTEXT + "."
+ + service.getName()
+ + "."
+ + operation.getName()
+ + " = function(");
+ for (int i = 0; i < operation.getInputType().getLogical().size(); i++) {
+ JavascriptGenerator.javascript.append("p" + i + ", ");
+ }
+ JavascriptGenerator.javascript.append("callbackMethod) {\n");
+ // send method argumets as JSON array
+ JavascriptGenerator.javascript.append(" var params = [];\n");
+ for (int i = 0; i < operation.getInputType().getLogical().size(); i++) {
+ JavascriptGenerator.javascript.append(" params.push(p" + i + ");\n");
+ }
+ JavascriptGenerator.javascript.append(" " + JavascriptGenerator.TUSCANY_COMET
+ + ".callAsync('"
+ + service.getName()
+ + "/"
+ + operation.getName()
+ + "', $.toJSON(params), callbackMethod);\n");
+ JavascriptGenerator.javascript.append("}\n");
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
new file mode 100644
index 0000000..9274009
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.comet.runtime.javascript;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.SequenceInputStream;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * Class serving the calls performed to retrieve the Javascript toolkit.
+ */
+@Path("/")
+@Produces("text/javascript")
+public class JavascriptResource {
+
+ /**
+ * Dependencies for the Tuscany Comet Javascript API.
+ */
+ private static final String[] DEPENDENCIES = {"/jquery.atmosphere.js", "/jquery.json-2.2.min.js",
+ "/cometComponentContext.js"};
+
+ /**
+ * Method called when the Javascript toolkit is requested.
+ *
+ * @return InputStream containing the Javascript code.
+ */
+ @GET
+ public InputStream getJavascript() {
+ InputStream stream = null;
+ // add dependencies in the specified order
+ for (final String dependency : JavascriptResource.DEPENDENCIES) {
+ if (stream == null) {
+ stream = this.getClass().getResourceAsStream(dependency);
+ } else {
+ stream = new SequenceInputStream(stream, this.getClass().getResourceAsStream(dependency));
+ }
+ }
+ // add generated proxies
+ final String generatedJs = JavascriptGenerator.getJavascript().toString() + "\n}";
+ return new SequenceInputStream(stream, new ByteArrayInputStream(generatedJs.getBytes()));
+ }
+}
diff --git a/modules/binding-comet-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/binding-comet-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
new file mode 100644
index 0000000..cb6db39
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the binding extension
+org.apache.tuscany.sca.binding.comet.runtime.CometBindingProviderFactory;model=org.apache.tuscany.sca.binding.comet.CometBinding
+
diff --git a/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js b/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js
new file mode 100644
index 0000000..9d92541
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js
@@ -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.
+ */
+
+var SCA = new function() {
+
+this.TuscanyComet = {
+ appUrl: 'tuscany-comet',
+ connectedEndpoint : null,
+ connect : function(transport) {
+ $.atmosphere.subscribe(document.location.toString() + this.appUrl,
+ this.callback,
+ $.atmosphere.request = {
+ transport : transport
+ });
+ this.connectedEndpoint = $.atmosphere.response;
+ },
+ callAsync : function(url, params, callbackMethod) {
+ this.connectedEndpoint.push(document.location.toString()
+ + this.appUrl + '/' + url,
+ null,
+ $.atmosphere.request = {
+ method : 'POST',
+ data : 'callback=' + callbackMethod.name + '¶ms=' + params
+ });
+ },
+ callback : function(response) {
+ eval(response.responseBody);
+ }
+};
+
+this.CometComponentContext = new Object();
diff --git a/modules/binding-comet-runtime/src/main/resources/jquery.atmosphere.js b/modules/binding-comet-runtime/src/main/resources/jquery.atmosphere.js
new file mode 100644
index 0000000..eb94c9f
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/resources/jquery.atmosphere.js
@@ -0,0 +1,534 @@
+/**
+ * Licensed 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.
+ */
+jQuery.atmosphere = function()
+{
+ var activeRequest;
+ $(window).unload(function()
+ {
+ if (activeRequest)
+ activeRequest.abort();
+ });
+
+ return {
+ version : 0.7,
+ response : {
+ status: 200,
+ responseBody : '',
+ headers : [],
+ state : "messageReceived",
+ transport : "polling",
+ push : [],
+ error: null,
+ id : 0
+ },
+
+ request : {},
+ logLevel : 'info',
+ callbacks: [],
+ activeTransport : null,
+ websocket : null,
+ killHiddenIFrame : null,
+
+ subscribe: function(url, callback, request)
+ {
+ jQuery.atmosphere.request = jQuery.extend({
+ timeout: 300000,
+ method: 'GET',
+ headers: {},
+ contentType : "text/html;charset=ISO-8859-1",
+ cache: true,
+ async: true,
+ ifModified: false,
+ callback: null,
+ dataType: '',
+ url : url,
+ data : '',
+ suspend : true,
+ maxRequest : 60,
+ lastIndex : 0,
+ logLevel : 'info',
+ requestCount : 0,
+ fallbackTransport : 'streaming',
+ transport : 'long-polling'
+
+ }, request);
+
+ logLevel = jQuery.atmosphere.request.logLevel || 'info';
+ if (callback != null) {
+ jQuery.atmosphere.addCallback(callback);
+ jQuery.atmosphere.request.callback = callback;
+ }
+
+ if (jQuery.atmosphere.request.transport != jQuery.atmosphere.activeTransport) {
+ jQuery.atmosphere.closeSuspendedConnection();
+ }
+ jQuery.atmosphere.activeTransport = jQuery.atmosphere.request.transport;
+
+ if (jQuery.atmosphere.request.transport != 'websocket') {
+ jQuery.atmosphere.executeRequest();
+ } else if (jQuery.atmosphere.request.transport == 'websocket') {
+ if (!window.WebSocket) {
+ jQuery.atmosphere.log(logLevel, ["Websocket is not supported, using request.fallbackTransport"]);
+ jQuery.atmosphere.request.transport = jQuery.atmosphere.request.fallbackTransport;
+ jQuery.atmosphere.executeRequest();
+ }
+ else {
+ jQuery.atmosphere.executeWebSocket();
+ }
+ }
+ },
+
+ /**
+ * Always make sure one transport is used, not two at the same time except for Websocket.
+ */
+ closeSuspendedConnection : function () {
+ if (activeRequest != null) {
+ activeRequest.abort();
+ }
+
+ if (jQuery.atmosphere.websocket != null) {
+ jQuery.atmosphere.websocket.close();
+ jQuery.atmosphere.websocket = null;
+ }
+ },
+
+ executeRequest: function()
+ {
+
+ if (jQuery.atmosphere.request.transport == 'streaming') {
+ if ($.browser.msie) {
+ jQuery.atmosphere.ieStreaming();
+ return;
+ } else if ((typeof window.addEventStream) == 'function') {
+ jQuery.atmosphere.operaStreaming();
+ return;
+ }
+ }
+
+ if (jQuery.atmosphere.request.requestCount++ < jQuery.atmosphere.request.maxRequest) {
+ jQuery.atmosphere.response.push = function (url)
+ {
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+ };
+
+ var request = jQuery.atmosphere.request;
+ var response = jQuery.atmosphere.response;
+ if (request.transport != 'polling') {
+ response.transport = request.transport;
+ }
+
+ var ajaxRequest;
+ var error = false;
+ if ($.browser.msie) {
+ var activexmodes = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]
+ for (var i = 0; i < activexmodes.length; i++) {
+ try {
+ ajaxRequest = new ActiveXObject(activexmodes[i])
+ }
+ catch(e) {
+ }
+ }
+ } else if (window.XMLHttpRequest) {
+ ajaxRequest = new XMLHttpRequest();
+ }
+
+ if (request.suspend) {
+ activeRequest = ajaxRequest;
+ }
+
+ ajaxRequest.open(request.method, request.url, true);
+ ajaxRequest.setRequestHeader("X-Atmosphere-Framework", jQuery.atmosphere.version);
+ ajaxRequest.setRequestHeader("X-Atmosphere-Transport", request.transport);
+ ajaxRequest.setRequestHeader("X-Cache-Date", new Date());
+
+ if (!$.browser.msie) {
+ ajaxRequest.onerror = function()
+ {
+ error = true;
+ try {
+ response.status = XMLHttpRequest.status;
+ }
+ catch(e) {
+ response.status = 404;
+ }
+
+ response.state = "error";
+ jQuery.atmosphere.invokeCallback(response);
+ ajaxRequest.abort();
+ activeRequest = null;
+ }
+ }
+
+ ajaxRequest.onreadystatechange = function()
+ {
+ var junkForWebkit = false;
+ var update = false;
+ if (ajaxRequest.readyState == 4) {
+ jQuery.atmosphere.request = request;
+ if (request.suspend && ajaxRequest.status == 200) {
+ jQuery.atmosphere.executeRequest();
+ }
+
+ if ($.browser.msie) {
+ update = true;
+ }
+ } else if (!$.browser.msie && ajaxRequest.readyState == 3 && ajaxRequest.status == 200) {
+ update = true;
+ } else {
+ clearTimeout(request.id);
+ }
+
+ if (update) {
+ if (request.transport == 'streaming') {
+ response.responseBody = ajaxRequest.responseText.substring(request.lastIndex, ajaxRequest.responseText.length);
+ request.lastIndex = ajaxRequest.responseText.length;
+
+ if (response.responseBody.indexOf("<!--") != -1) {
+ junkForWebkit = true;
+ }
+
+ } else {
+ response.responseBody = ajaxRequest.responseText;
+ }
+
+ if (response.responseBody.indexOf("parent.callback") != -1) {
+ var start = response.responseBody.indexOf("('") + 2;
+ var end = response.responseBody.indexOf("')");
+ response.responseBody = response.responseBody.substring(start, end);
+ }
+
+ if (junkForWebkit) return;
+
+ try {
+ response.status = ajaxRequest.status;
+ response.headers = ajaxRequest.getAllResponseHeaders();
+ }
+ catch(e) {
+ response.status = 404;
+ }
+
+ if (request.suspend) {
+ response.state = "messageReceived";
+ } else {
+ response.state = "messagePublished";
+ }
+ jQuery.atmosphere.invokeCallback(response);
+ }
+ }
+ ajaxRequest.send(request.data);
+
+ if (request.suspend) {
+ request.id = setTimeout(function()
+ {
+ ajaxRequest.abort();
+ jQuery.atmosphere.subscribe(request.url, null, request);
+
+ }, request.timeout);
+ }
+ } else {
+ jQuery.atmosphere.log(logLevel, ["Max re-connection reached."]);
+ }
+ },
+
+ operaStreaming: function()
+ {
+
+ var url = jQuery.atmosphere.request.url;
+ var es = document.createElement('event-source');
+ var response = jQuery.atmosphere.response;
+
+ jQuery.atmosphere.response.push = function (url)
+ {
+ jQuery.atmosphere.request.transport = 'polling';
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+ };
+
+ es.setAttribute('src', url);
+ // without this check opera 9.5 would make two connections.
+ if (opera.version() < 9.5) {
+ document.body.appendChild(es);
+ }
+
+ var operaCallback = function (event) {
+ if (event.data) {
+ var junkForWebkit = false;
+
+ response.responseBody = event.data;
+ if (event.data.indexOf("<!--") != -1) {
+ junkForWebkit = true;
+ }
+
+ if (response.responseBody.indexOf("parent.callback") != -1) {
+ var start = response.responseBody.indexOf("('") + 2;
+ var end = response.responseBody.indexOf("')");
+ response.responseBody = response.responseBody.substring(start, end);
+ }
+
+ if (junkForWebkit) return;
+
+ response.state = "messageReceived";
+ jQuery.atmosphere.invokeCallback(response);
+ }
+ };
+
+ es.addEventListener('payload', operaCallback, false);
+
+ },
+
+ ieStreaming : function()
+ {
+ var url = jQuery.atmosphere.request.url;
+ jQuery.atmosphere.response.push = function (url)
+ {
+ jQuery.atmosphere.request.transport = 'polling';
+ jQuery.atmosphere.request.callback = null;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+ };
+
+ transferDoc = new ActiveXObject("htmlfile");
+ transferDoc.open();
+ transferDoc.close();
+ var ifrDiv = transferDoc.createElement("div");
+ transferDoc.body.appendChild(ifrDiv);
+ ifrDiv.innerHTML = "<iframe src='" + url + "'></iframe>";
+ transferDoc.parentWindow.callback = jQuery.atmosphere.streamingCallback;
+ }
+ ,
+
+ streamingCallback : function(args)
+ {
+ var response = jQuery.atmosphere.response;
+ response.transport = "streaming";
+ response.status = 200;
+ response.responseBody = args;
+ response.state = "messageReceived";
+
+ jQuery.atmosphere.invokeCallback(response);
+ }
+ ,
+
+ executeWebSocket : function()
+ {
+ var request = jQuery.atmosphere.request;
+ jQuery.atmosphere.log(logLevel, ["Invoking executeWebSocket"]);
+ jQuery.atmosphere.response.transport = "websocket";
+ var url = jQuery.atmosphere.request.url;
+ var callback = jQuery.atmosphere.request.callback;
+ var location = url.replace('http:', 'ws:').replace('https:', 'wss:');
+
+ var websocket = new WebSocket(location);
+ jQuery.atmosphere.websocket = websocket;
+
+ jQuery.atmosphere.response.push = function (url)
+ {
+ var data;
+ var ws = jQuery.atmosphere.websocket;
+ try {
+ data = jQuery.atmosphere.request.data;
+ ws.send(jQuery.atmosphere.request.data);
+ } catch (e) {
+ jQuery.atmosphere.log(logLevel, ["Websocket failed. Downgrading to Comet and resending " + data]);
+ // Websocket is not supported, reconnect using the fallback transport.
+ request.transport = request.fallbackTransport;
+ jQuery.atmosphere.request = request;
+ jQuery.atmosphere.executeRequest();
+
+ // Repost the data.
+ jQuery.atmosphere.request.suspend = false;
+ jQuery.atmosphere.request.method = 'POST';
+ jQuery.atmosphere.request.data = data;
+ jQuery.atmosphere.response.state = 'messageReceived';
+ jQuery.atmosphere.response.transport = request.fallbackTransport;
+ jQuery.atmosphere.publish(url, null, jQuery.atmosphere.request);
+
+ ws.onclose = function(message) {
+ }
+ ws.close();
+ }
+ };
+
+ websocket.onopen = function(message)
+ {
+ jQuery.atmosphere.response.state = 'openning';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onmessage = function(message)
+ {
+ var data = message.data;
+ if (data.indexOf("parent.callback") != -1) {
+ var start = data.indexOf("('") + 2;
+ var end = data.indexOf("')");
+ jQuery.atmosphere.response.responseBody = data.substring(start, end);
+ }
+ else {
+ jQuery.atmosphere.response.responseBody = data;
+ }
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onerror = function(message)
+ {
+ jQuery.atmosphere.response.state = 'error';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+
+ websocket.onclose = function(message)
+ {
+ jQuery.atmosphere.response.state = 'closed';
+ jQuery.atmosphere.invokeCallback(jQuery.atmosphere.response);
+ };
+ }
+ ,
+
+ addCallback: function(func)
+ {
+ if (jQuery.inArray(func, jQuery.atmosphere.callbacks) == -1) {
+ jQuery.atmosphere.callbacks.push(func);
+ }
+ }
+ ,
+
+ removeCallback: function(func)
+ {
+ if (jQuery.inArray(func, jQuery.atmosphere.callbacks) != -1) {
+ jQuery.atmosphere.callbacks.splice(index);
+ }
+ }
+ ,
+
+ invokeCallback: function(response)
+ {
+ var call = function (index, func)
+ {
+ func(response);
+ };
+
+ jQuery.atmosphere.log(logLevel, ["Invoking " + jQuery.atmosphere.callbacks.length + " callbacks"]);
+ if (jQuery.atmosphere.callbacks.length > 0) {
+ jQuery.each(jQuery.atmosphere.callbacks, call);
+ }
+ }
+ ,
+
+ publish: function(url, callback, request)
+ {
+ jQuery.atmosphere.request = jQuery.extend({
+ connected: false,
+ timeout: 60000,
+ method: 'POST',
+ headers: {},
+ cache: true,
+ async: true,
+ ifModified: false,
+ callback: null,
+ dataType: '',
+ url : url,
+ data : '',
+ suspend : false,
+ maxRequest : 60,
+ logLevel : 'info',
+ requestCount : 0,
+ transport: 'polling'
+ }, request);
+
+ if (callback != null) {
+ jQuery.atmosphere.addCallback(callback);
+ }
+ jQuery.atmosphere.request.transport = 'polling';
+ if (jQuery.atmosphere.request.transport != 'websocket') {
+ jQuery.atmosphere.executeRequest();
+ } else if (jQuery.atmosphere.request.transport == 'websocket') {
+ if (!window.WebSocket) {
+ alert("WebSocket not supported by this browser");
+ }
+ else {
+ jQuery.atmosphere.executeWebSocket();
+ }
+ }
+ }
+ ,
+
+ unload: function (arg) {
+ if (window.addEventListener) {
+ document.addEventListener('unload', arg, false);
+ window.addEventListener('unload', arg, false);
+ } else { // IE
+ document.attachEvent('onunload', arg);
+ window.attachEvent('onunload', arg);
+ }
+ }
+ ,
+
+ kill_load_bar : function() {
+ if (jQuery.atmosphere.killHiddenIFrame == null) {
+ jQuery.atmosphere.killHiddenIFrame = document.createElement('iframe');
+ var ifr = jQuery.atmosphere.killHiddenIFrame;
+ ifr.style.display = 'block';
+ ifr.style.width = '0';
+ ifr.style.height = '0';
+ ifr.style.border = '0';
+ ifr.style.margin = '0';
+ ifr.style.padding = '0';
+ ifr.style.overflow = 'hidden';
+ ifr.style.visibility = 'hidden';
+ }
+ document.body.appendChild(ifr);
+ ifr.src = 'about:blank';
+ document.body.removeChild(ifr);
+ }
+ ,
+
+ log: function (level, args)
+ {
+ if (window.console)
+ {
+ var logger = window.console[level];
+ if (typeof logger == 'function')
+ {
+ logger.apply(window.console, args);
+ }
+ }
+ }
+ ,
+
+ warn: function()
+ {
+ log('warn', arguments);
+ }
+ ,
+
+
+ info :function()
+ {
+ if (logLevel != 'warn')
+ {
+ log('info', arguments);
+ }
+ }
+ ,
+
+ debug: function()
+ {
+ if (logLevel == 'debug')
+ {
+ log('debug', arguments);
+ }
+ }
+ }
+
+}
+ ();
\ No newline at end of file
diff --git a/modules/binding-comet-runtime/src/main/resources/jquery.json-2.2.min.js b/modules/binding-comet-runtime/src/main/resources/jquery.json-2.2.min.js
new file mode 100644
index 0000000..bad4a0a
--- /dev/null
+++ b/modules/binding-comet-runtime/src/main/resources/jquery.json-2.2.min.js
@@ -0,0 +1,31 @@
+
+(function($){$.toJSON=function(o)
+{if(typeof(JSON)=='object'&&JSON.stringify)
+return JSON.stringify(o);var type=typeof(o);if(o===null)
+return"null";if(type=="undefined")
+return undefined;if(type=="number"||type=="boolean")
+return o+"";if(type=="string")
+return $.quoteString(o);if(type=='object')
+{if(typeof o.toJSON=="function")
+return $.toJSON(o.toJSON());if(o.constructor===Date)
+{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
+hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
+if(o.constructor===Array)
+{var ret=[];for(var i=0;i<o.length;i++)
+ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
+var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
+name='"'+k+'"';else if(type=="string")
+name=$.quoteString(k);else
+continue;if(typeof o[k]=="function")
+continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
+return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
+{if(typeof(JSON)=='object'&&JSON.parse)
+return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
+{if(typeof(JSON)=='object'&&JSON.parse)
+return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
+return eval("("+src+")");else
+throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
+{if(string.match(_escapeable))
+{return'"'+string.replace(_escapeable,function(a)
+{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
+return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);
\ No newline at end of file
diff --git a/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java
new file mode 100644
index 0000000..56c6b9f
--- /dev/null
+++ b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTestCase.java
@@ -0,0 +1,55 @@
+/*
+ * 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.sca.test;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.http.jetty.JettyServer;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test case for the comet binding.
+ */
+public class CometTestCase extends TestCase {
+
+ /**
+ * Test consisting in starting up a node containing services exposed via the
+ * comet binding.
+ */
+ public void testComet() {
+ JettyServer.portDefault = 8085;
+ try {
+ final String location = ContributionLocationHelper.getContributionLocation("test.composite");
+ final Node node = NodeFactory.newInstance().createNode("test.composite", new Contribution("c1", location));
+ node.start();
+ // System.out.println("Press any key to stop the node.");
+ // System.in.read();
+ node.stop();
+ } catch (final Exception e) {
+ e.printStackTrace();
+ Assert.fail();
+ }
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
new file mode 100644
index 0000000..6d23479
--- /dev/null
+++ b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockService.java
@@ -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 org.apache.tuscany.sca.test;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface StockService {
+
+ String getQuotes();
+
+}
diff --git a/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
new file mode 100644
index 0000000..359d7de
--- /dev/null
+++ b/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/StockServiceImpl.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sca.test;
+
+import java.text.DecimalFormat;
+import java.util.Date;
+import java.util.Random;
+
+import org.oasisopen.sca.annotation.Service;
+
+@Service(StockService.class)
+public class StockServiceImpl implements StockService {
+
+ public static final int MAX_VALUE = 1000;
+ private final Random random = new Random(new Date().getTime());
+
+ @Override
+ public String getQuotes() {
+ final Double value = Math.abs(this.random.nextDouble() * this.random.nextInt(StockServiceImpl.MAX_VALUE));
+ return "ASF" + "#" + Double.valueOf(new DecimalFormat("#.##").format(value));
+ }
+
+}
diff --git a/modules/binding-comet-runtime/src/test/resources/test.composite b/modules/binding-comet-runtime/src/test/resources/test.composite
new file mode 100644
index 0000000..1502616
--- /dev/null
+++ b/modules/binding-comet-runtime/src/test/resources/test.composite
@@ -0,0 +1,33 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Stock">
+
+ <component name="test">
+ <implementation.java class="org.apache.tuscany.sca.test.StockServiceImpl"/>
+ <service name="StockService">
+ <interface.java interface="org.apache.tuscany.sca.test.StockService"/>
+ <tuscany:binding.comet/>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file
diff --git a/modules/binding-rss/LICENSE b/modules/binding-comet/LICENSE
similarity index 100%
rename from modules/binding-rss/LICENSE
rename to modules/binding-comet/LICENSE
diff --git a/modules/binding-comet/META-INF/MANIFEST.MF b/modules/binding-comet/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..7818717
--- /dev/null
+++ b/modules/binding-comet/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.tuscany.sca.binding.comet;version="2.0.0";uses:="org.apache.tuscany.sca.assembly,javax.xml.namespace"
+Private-Package: org.apache.tuscany.sca.binding.comet.impl;version="2.0.0"
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Comet Binding Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Comet Binding Model
+Import-Package: javax.xml.namespace,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.binding.comet;version="2.0.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.comet
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/samples/dosgi-calculator/NOTICE b/modules/binding-comet/NOTICE
similarity index 100%
copy from samples/dosgi-calculator/NOTICE
copy to modules/binding-comet/NOTICE
diff --git a/modules/binding-comet/pom.xml b/modules/binding-comet/pom.xml
new file mode 100644
index 0000000..f471b2b
--- /dev/null
+++ b/modules/binding-comet/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache Tuscany SCA Comet Binding Model</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBinding.java b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBinding.java
new file mode 100644
index 0000000..33db265
--- /dev/null
+++ b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBinding.java
@@ -0,0 +1,34 @@
+/*
+ * 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.sca.binding.comet;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.assembly.Binding;
+
+/**
+ * Comet Binding model.
+ */
+public interface CometBinding extends Binding {
+
+ QName TYPE = new QName(Base.SCA11_TUSCANY_NS, "binding.comet");
+
+}
diff --git a/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBindingFactory.java b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBindingFactory.java
new file mode 100644
index 0000000..cf90b13
--- /dev/null
+++ b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/CometBindingFactory.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sca.binding.comet;
+
+/**
+ * Factory to create CometBinding instances.
+ */
+public interface CometBindingFactory {
+
+ /**
+ * Create CometBinding model.
+ */
+ CometBinding createCometBinding();
+
+}
diff --git a/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingFactoryImpl.java b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingFactoryImpl.java
new file mode 100644
index 0000000..067020f
--- /dev/null
+++ b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingFactoryImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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.sca.binding.comet.impl;
+
+import org.apache.tuscany.sca.binding.comet.CometBinding;
+import org.apache.tuscany.sca.binding.comet.CometBindingFactory;
+
+/**
+ * Factory implementation to create Comet models.
+ */
+public class CometBindingFactoryImpl implements CometBindingFactory {
+
+ @Override
+ public CometBinding createCometBinding() {
+ return new CometBindingImpl();
+ }
+
+}
diff --git a/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingImpl.java b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingImpl.java
new file mode 100644
index 0000000..65ca2a9
--- /dev/null
+++ b/modules/binding-comet/src/main/java/org/apache/tuscany/sca/binding/comet/impl/CometBindingImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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.sca.binding.comet.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.comet.CometBinding;
+
+/**
+ * Represents a binding through Comet to a service.
+ */
+public class CometBindingImpl implements CometBinding {
+
+ private String name;
+ private String uri;
+
+ @Override
+ public String getName() {
+ return this.name;
+ }
+
+ @Override
+ public String getURI() {
+ return this.uri;
+ }
+
+ @Override
+ public void setURI(final String uri) {
+ this.uri = uri;
+ }
+
+ @Override
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ @Override
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ @Override
+ public void setUnresolved(final boolean unresolved) {
+ }
+
+ @Override
+ public QName getType() {
+ return CometBinding.TYPE;
+ }
+
+ @Override
+ public WireFormat getRequestWireFormat() {
+ return null;
+ }
+
+ @Override
+ public void setRequestWireFormat(final WireFormat wireFormat) {
+ }
+
+ @Override
+ public WireFormat getResponseWireFormat() {
+ return null;
+ }
+
+ @Override
+ public void setResponseWireFormat(final WireFormat wireFormat) {
+ }
+
+ @Override
+ public OperationSelector getOperationSelector() {
+ return null;
+ }
+
+ @Override
+ public void setOperationSelector(final OperationSelector operationSelector) {
+ }
+
+}
diff --git a/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.comet.CometBindingFactory b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.comet.CometBindingFactory
new file mode 100644
index 0000000..cf579de
--- /dev/null
+++ b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.comet.CometBindingFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for model factory
+org.apache.tuscany.sca.binding.comet.impl.CometBindingFactoryImpl
+
diff --git a/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..599a8e8
--- /dev/null
+++ b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.comet,model=org.apache.tuscany.sca.binding.comet.CometBinding,factory=org.apache.tuscany.sca.binding.comet.CometBindingFactory
+
diff --git a/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
new file mode 100644
index 0000000..617af3a
--- /dev/null
+++ b/modules/binding-comet/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -0,0 +1,19 @@
+# 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.
+#
+binding-comet.xsd
+
diff --git a/modules/binding-comet/src/main/resources/binding-comet.xsd b/modules/binding-comet/src/main/resources/binding-comet.xsd
new file mode 100644
index 0000000..8b6e8e1
--- /dev/null
+++ b/modules/binding-comet/src/main/resources/binding-comet.xsd
@@ -0,0 +1,36 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" />
+
+ <element name="binding.comet" type="t:CometBinding" substitutionGroup="sca:binding"/>
+
+ <complexType name="CometBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
index 757beea..0668761 100644
--- a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
+++ b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
@@ -24,6 +24,7 @@
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
@@ -159,5 +160,35 @@
// TODO Auto-generated method stub
}
-
+
+ public String getJAXWSJavaInterfaceName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setJAXWSJavaInterfaceName(String javaInterfaceName) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getJAXWSWSDLLocation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setJAXWSWSDLLocation(String wsdlLocation) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Contribution getContributionContainingClass() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setContributionContainingClass(
+ Contribution contributionContainingClass) {
+ // TODO Auto-generated method stub
+
+ }
}
diff --git a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
index 27278dd6..8cfcf7a 100644
--- a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
+++ b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
@@ -27,6 +27,7 @@
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
import org.apache.tuscany.sca.interfacedef.util.XMLType;
import org.apache.tuscany.sca.policy.ExtensionType;
@@ -174,4 +175,9 @@
return false;
}
+ public List<ParameterMode> getParameterModes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
index bc19b82..d31500c 100644
--- a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
+++ b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
@@ -216,5 +216,11 @@
// TODO Auto-generated method stub
}
-
+
+ public boolean isJAXWSService() {
+ return false;
+ }
+
+ public void setJAXWSService(boolean isJAXWSService) {
+ }
}
diff --git a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
index 616282a..2896114 100644
--- a/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
+++ b/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
@@ -301,5 +301,11 @@
// TODO Auto-generated method stub
}
+
+ public InterfaceContract getGeneratedWSDLContract(
+ InterfaceContract interfaceContract) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java b/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java
index 999a3fc..323fa76 100644
--- a/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java
+++ b/modules/binding-ejb-runtime/src/main/java/org/apache/tuscany/sca/binding/ejb/provider/EJBBindingInvoker.java
@@ -22,6 +22,7 @@
import org.apache.tuscany.sca.binding.ejb.util.EJBHandler;
import org.apache.tuscany.sca.binding.ejb.util.NamingEndpoint;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
@@ -71,7 +72,22 @@
// lookup home and ejb stub
EJBHandler ejbHandler = new EJBHandler(endpoint, serviceInterface);
- String methodName = operation.getName();
+ //
+ // If we really couldn't have anything but a JavaOperation maybe we should
+ // remove the if-block. Assuming we had some other type of operation, if
+ // that is possible, we might still need to map to a Java operation name,
+ // (for example because the WSDL operation name might be set using a JSR-181
+ // annotation to something other than the Java operation name.
+ //
+ // But for now we'll keep the else-block in here.
+ //
+ String methodName = null;
+ if (operation instanceof JavaOperation) {
+ JavaOperation javaOp = (JavaOperation) operation;
+ methodName = javaOp.getJavaMethod().getName();
+ } else {
+ methodName = operation.getName();
+ }
// invoke business method on ejb
Object response = ejbHandler.invoke(methodName, (Object[])payload);
diff --git a/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java b/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java
index 7cefba5..2e79080 100644
--- a/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java
+++ b/modules/binding-ejb-runtime/src/test/java/calculator/AddService.java
@@ -19,9 +19,14 @@
package calculator;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
/**
* @version $Rev$ $Date$
*/
+@WebService
public interface AddService {
+ @WebMethod(operationName = "Add")
double add(double n1, double n2);
}
diff --git a/modules/binding-hazelcast-runtime/META-INF/MANIFEST.MF b/modules/binding-hazelcast-runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index ab90529..0000000
--- a/modules/binding-hazelcast-runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,31 +0,0 @@
-Manifest-Version: 1.0
-SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA Binding Hazelcast Runtime
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Hazelcast Binding
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.hazelcast.runtime
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-Import-Package: javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.assembly.impl;version="2.0.0",
- org.apache.tuscany.sca.binding.ws;version="2.0.0",
- org.apache.tuscany.sca.binding.ws.wsdlgen;version="2.0.0",
- org.apache.tuscany.sca.common.xml.dom;version="2.0.0",
- org.apache.tuscany.sca.context;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.databinding.xml;version="2.0.0",
- org.apache.tuscany.sca.endpoint.hazelcast;version="2.0.0",
- org.apache.tuscany.sca.interfacedef;version="2.0.0",
- org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
- org.apache.tuscany.sca.invocation;version="2.0.0",
- org.apache.tuscany.sca.provider;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0",
- org.oasisopen.sca,
- org.oasisopen.sca.annotation,
- org.w3c.dom,
- org.xml.sax
diff --git a/modules/binding-hazelcast-runtime/pom.xml b/modules/binding-hazelcast-runtime/pom.xml
deleted file mode 100644
index 95512ff..0000000
--- a/modules/binding-hazelcast-runtime/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <name>Apache Tuscany SCA Binding Hazelcast Runtime</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/modules/binding-http-runtime/META-INF/MANIFEST.MF b/modules/binding-http-runtime/META-INF/MANIFEST.MF
index 175d11f..0cadabb 100644
--- a/modules/binding-http-runtime/META-INF/MANIFEST.MF
+++ b/modules/binding-http-runtime/META-INF/MANIFEST.MF
@@ -16,9 +16,11 @@
org.apache.tuscany.sca.core;version="2.0.0",
org.apache.tuscany.sca.host.http;version="2.0.0",
org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.util,
org.apache.tuscany.sca.invocation;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.oasisopen.sca,
org.oasisopen.sca.annotation;version="2.0.0"
Bundle-SymbolicName: org.apache.tuscany.sca.binding.http.runtime
Bundle-DocURL: http://www.apache.org/
diff --git a/modules/binding-http-runtime/pom.xml b/modules/binding-http-runtime/pom.xml
index c4acc41..0e11c82 100644
--- a/modules/binding-http-runtime/pom.xml
+++ b/modules/binding-http-runtime/pom.xml
@@ -50,6 +50,12 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-http</artifactId>
<version>2.0-Beta1</version>
</dependency>
@@ -81,6 +87,13 @@
<version>2.0-Beta1</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultOperationSelectorProviderFactory.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultOperationSelectorProviderFactory.java
new file mode 100644
index 0000000..bf6ad75
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultOperationSelectorProviderFactory.java
@@ -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.sca.binding.http.format;
+
+import org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.provider.OperationSelectorProvider;
+import org.apache.tuscany.sca.provider.OperationSelectorProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+public class HTTPDefaultOperationSelectorProviderFactory implements OperationSelectorProviderFactory<HTTPDefaultOperationSelector>{
+
+ public HTTPDefaultOperationSelectorProviderFactory(ExtensionPointRegistry extensionPoints) {
+ }
+
+ @Override
+ public Class<HTTPDefaultOperationSelector> getModelType() {
+ return null;
+ }
+
+ @Override
+ public OperationSelectorProvider createReferenceOperationSelectorProvider(RuntimeEndpointReference endpointReference) {
+ return null;
+ }
+
+ @Override
+ public OperationSelectorProvider createServiceOperationSelectorProvider(final RuntimeEndpoint endpoint) {
+ return new OperationSelectorProvider(){
+ @Override
+ public Interceptor createInterceptor() {
+ return new HTTPDefaultServiceOperationSelectorInterceptor(endpoint);
+ }
+
+ @Override
+ public String getPhase() {
+ return Phase.SERVICE_BINDING_OPERATION_SELECTOR;
+ }};
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java
new file mode 100644
index 0000000..dc4f37d
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultServiceOperationSelectorInterceptor.java
@@ -0,0 +1,85 @@
+/*
+ * 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.sca.binding.http.format;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.oasisopen.sca.ServiceRuntimeException;
+
+/**
+ * Sets the operation based on the request path.
+ *
+ * From a url: http://localhost:8080/HelloworldComponent/Helloworld/sayHello?name=Petra
+ * where the component is HelloworldComponent and the service is Helloworld
+ * the path will be "/sayHello" so the operation is "sayHello".
+ *
+ * TODO: we could also do something similar to how the JMS binding supports
+ * a single "onMessage" method to get all requests, so perhaps this could
+ * also support impls with method: service(HttpServletRequest, HttpServletResponse)
+ */
+public class HTTPDefaultServiceOperationSelectorInterceptor implements Interceptor {
+
+ private Invoker next;
+ private List<Operation> operations;
+
+ public HTTPDefaultServiceOperationSelectorInterceptor(RuntimeEndpoint endpoint) {
+ Interface serviceInterface = endpoint.getService().getInterfaceContract().getInterface();
+ this.operations = serviceInterface.getOperations();
+ }
+
+ @Override
+ public Message invoke(Message msg) {
+ HTTPContext context = msg.getBindingContext();
+ HttpServletRequest request = context.getRequest();
+ String path = request.getPathInfo();
+ if (path.startsWith("/")) {
+ path = path.substring(1);
+ }
+
+ for (Operation op : operations) {
+ if (op.getName().equals(path)) {
+ msg.setOperation(op);
+ return next.invoke(msg);
+ }
+ }
+
+ throw new ServiceRuntimeException("No matching operation: " + path);
+ }
+
+ @Override
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+ @Override
+ public Invoker getNext() {
+ return next;
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatProviderFactory.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatProviderFactory.java
new file mode 100644
index 0000000..45e74d8
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatProviderFactory.java
@@ -0,0 +1,68 @@
+/*
+ * 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.sca.binding.http.format;
+
+import org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.provider.WireFormatProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+public class HTTPDefaultWireFormatProviderFactory implements WireFormatProviderFactory<HTTPDefaultWireFormat> {
+
+ public HTTPDefaultWireFormatProviderFactory(ExtensionPointRegistry extensionPoints) {
+ }
+
+ @Override
+ public Class<HTTPDefaultWireFormat> getModelType() {
+ return null;
+ }
+
+ @Override
+ public WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference) {
+ return null;
+ }
+
+ @Override
+ public WireFormatProvider createServiceWireFormatProvider(final RuntimeEndpoint endpoint) {
+ return new WireFormatProvider() {
+ @Override
+ public InterfaceContract configureWireFormatInterfaceContract(InterfaceContract interfaceContract) {
+ // TODO: Ideally this wants to set the databinding on a per request basis from the
+ // http content type and accept headers and so support things like json or xml etc,
+ // for now to get started just use json
+ interfaceContract.getInterface().resetDataBinding("JSON");
+ return interfaceContract;
+ }
+ @Override
+ public Interceptor createInterceptor() {
+ return new HTTPDefaultWireFormatServiceInterceptor(endpoint);
+ }
+ @Override
+ public String getPhase() {
+ return Phase.SERVICE_BINDING_WIREFORMAT;
+ }};
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java
new file mode 100644
index 0000000..fcbf801
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPDefaultWireFormatServiceInterceptor.java
@@ -0,0 +1,252 @@
+/*
+ * 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.sca.binding.http.format;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.oasisopen.sca.ServiceRuntimeException;
+
+/**
+ * Handles the default wire format for the http binding
+ *
+ * 1- determine the request and response format (xml, json, etc) from the
+ * binding config or content type header and accept headers
+ * - TODO: need a way to configure the databinding framework based on that format
+ * 2- get the request contents from the HttpServletRequest
+ * - for a post its just the request body
+ * - for a get need to convert the query string into a body based on the format (xml, json, etc)
+ * 3- send the request on down the wire
+ * 4- set the response contents in the HttpServletResponse
+ * (the databinding should already have put it in the correct format)
+ *
+ */
+public class HTTPDefaultWireFormatServiceInterceptor implements Interceptor {
+
+ private Invoker next;
+ private String jsonpCallbackName = "callback";
+
+ public HTTPDefaultWireFormatServiceInterceptor(RuntimeEndpoint endpoint) {
+ }
+
+ @Override
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+ @Override
+ public Invoker getNext() {
+ return next;
+ }
+
+ @Override
+ public Message invoke(Message msg) {
+ try {
+ return invokeResponse(getNext().invoke(invokeRequest(msg)));
+ } catch (IOException e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+ private Message invokeRequest(Message msg) throws IOException {
+ HTTPContext context = msg.getBindingContext();
+ HttpServletRequest servletRequest = context.getRequest();
+ if ("GET".equals(servletRequest.getMethod())) {
+ msg.setBody(getRequestFromQueryString(msg.getOperation(), servletRequest));
+ } else {
+ msg.setBody(getRequestFromPost(msg.getOperation(), servletRequest));
+ }
+ return msg;
+ }
+
+ /**
+ * The data binding seems to be expecting an Object array of json strings so if the
+ * post data is a json array convert that to an array of strings
+ * TODO: should this be being done by the data binding framework?
+ */
+ private Object[] getRequestFromPost(Operation operation, HttpServletRequest servletRequest) throws IOException {
+ List<Object> os = new ArrayList<Object>();
+ String data = read(servletRequest);
+ if (data.length() > 0) {
+ if (data.startsWith("[") && data.endsWith("]")) {
+ data = data.substring(1, data.length()-1);
+ StringTokenizer st = new StringTokenizer(data, ",");
+ while (st.hasMoreElements()) {
+ os.add(st.nextElement());
+ }
+ } else {
+ os.add(data);
+ }
+ }
+ return os.toArray();
+ }
+
+ private Message invokeResponse(Message msg) throws IOException {
+ HTTPContext context = msg.getBindingContext();
+ HttpServletRequest servletRequest = context.getRequest();
+ HttpServletResponse servletResponse = context.getResponse();
+
+ if (msg.isFault()) {
+ servletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, String.valueOf(msg.getBody()));
+ } else {
+ String response = getResponseAsString(servletRequest, servletResponse, msg.getBody());
+ servletResponse.getOutputStream().println(response);
+ }
+
+ return msg;
+ }
+
+ /**
+ * Turn the request into a string array of JSON structures. The data binding
+ * layer will then convert each of the individual parameters into the appropriate
+ * types for the implementation interface
+ *
+ * From ML thread: http://apache.markmail.org/message/ix3vvyomronellmi
+ * 1- if the binding configuration contains a mapping from query parameter name to operation parameter then use that.
+ * 2- if the service interface or impl uses jaxrs annotations to name the parameters then use that mapping
+ * 3- if the query parameters are name arg0, arg1 etc than use those names for the mapping,
+ * 4- otherwise use the order in the query string.
+ */
+ protected Object[] getRequestFromQueryString(Operation operation, ServletRequest servletRequest) {
+
+ List<DataType> types = operation.getInputType().getLogical();
+ int typesIndex = 0;
+
+ List<String> jsonRequestArray = new ArrayList<String>();
+
+ for (String name : getOrderedParameterNames(servletRequest)) {
+ String jsonRequest = "";
+ // quote string parameters so clients work in the usual javascript way
+ if (typesIndex < types.size() && String.class.equals(types.get(typesIndex++).getGenericType())) {
+ String x = servletRequest.getParameter(name);
+ if (x.startsWith("\"") || x.startsWith("'")) {
+ jsonRequest += x;
+ } else {
+ if (x.contains("\"")) {
+ jsonRequest += "'" + x + "'";
+ } else {
+ jsonRequest += "\"" + x + "\"";
+ }
+ }
+ } else {
+ jsonRequest += servletRequest.getParameter(name);
+ }
+ jsonRequestArray.add(jsonRequest);
+ }
+
+ return jsonRequestArray.toArray();
+ }
+
+ /**
+ * Get the request parameter names in the correct order.
+ * Either the query parameters are named arg0, arg1, arg2 etc or else use the order
+ * from the order in the query string. Eg, the url:
+ * http://localhost:8085/HelloWorldService/sayHello2?first=petra&last=arnold&callback=foo"
+ * should invoke:
+ * sayHello2("petra", "arnold")
+ * so the parameter names should be ordered: "first", "last"
+ */
+ protected List<String> getOrderedParameterNames(ServletRequest servletRequest) {
+ List<String> orderedNames = new ArrayList<String>();
+ Set<String> parameterNames = servletRequest.getParameterMap().keySet();
+ if (parameterNames.contains("arg0")) {
+ for (int i=0; i<parameterNames.size(); i++) {
+ String name = "arg" + i;
+ if (parameterNames.contains(name)) {
+ orderedNames.add(name);
+ } else {
+ break;
+ }
+ }
+ } else {
+ final String queryString = ((HttpServletRequest)servletRequest).getQueryString();
+ SortedSet<String> sortedNames = new TreeSet<String>(new Comparator<String>(){
+ public int compare(String o1, String o2) {
+ int i = queryString.indexOf(o1);
+ int j = queryString.indexOf(o2);
+ return i - j;
+ }});
+ for (String name : parameterNames) {
+ // ignore system and jsonpCallbackName parameters
+ if (!name.startsWith("_") && !name.equals(jsonpCallbackName)) {
+ sortedNames.add(name);
+ }
+ }
+ orderedNames.addAll(sortedNames);
+ }
+ return orderedNames;
+ }
+
+ /**
+ * The databinding layer will have converted the return type into a JSON string so simply
+ * add wrap it for return.
+ */
+ protected String getResponseAsString(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Object response) {
+ String jsonResponse = response == null ? "" : response.toString();
+
+ if ("GET".equals(servletRequest.getMethod())) {
+ // handle JSONP callback name padding
+ String callback = servletRequest.getParameter(jsonpCallbackName);
+ if (callback != null && callback.length() > 1) {
+ jsonResponse = callback + "(" + jsonResponse + ");";
+ }
+ }
+
+ return jsonResponse;
+ }
+
+ protected static String read(HttpServletRequest servletRequest) throws IOException {
+ InputStream is = servletRequest.getInputStream();
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString().trim();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatProviderFactory.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatProviderFactory.java
new file mode 100644
index 0000000..cb60101
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatProviderFactory.java
@@ -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 org.apache.tuscany.sca.binding.http.format;
+
+import org.apache.tuscany.sca.binding.http.HTTPXMLWireFormat;
+import org.apache.tuscany.sca.common.xml.dom.DOMHelper;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.provider.WireFormatProvider;
+import org.apache.tuscany.sca.provider.WireFormatProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+public class HTTPXMLWireFormatProviderFactory implements WireFormatProviderFactory<HTTPXMLWireFormat> {
+
+ private DOMHelper domHelper;
+
+ public HTTPXMLWireFormatProviderFactory(ExtensionPointRegistry extensionPoints) {
+ this.domHelper = DOMHelper.getInstance(extensionPoints);
+ }
+
+ @Override
+ public Class<HTTPXMLWireFormat> getModelType() {
+ return null;
+ }
+
+ @Override
+ public WireFormatProvider createReferenceWireFormatProvider(RuntimeEndpointReference endpointReference) {
+ return null;
+ }
+
+ @Override
+ public WireFormatProvider createServiceWireFormatProvider(final RuntimeEndpoint endpoint) {
+ return new WireFormatProvider() {
+ @Override
+ public InterfaceContract configureWireFormatInterfaceContract(InterfaceContract interfaceContract) {
+ interfaceContract.getInterface().resetDataBinding(DOMDataBinding.NAME);
+ return interfaceContract;
+ }
+ @Override
+ public Interceptor createInterceptor() {
+ return new HTTPXMLWireFormatServiceInterceptor(endpoint, domHelper);
+ }
+ @Override
+ public String getPhase() {
+ return Phase.SERVICE_BINDING_WIREFORMAT;
+ }};
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java
new file mode 100644
index 0000000..8bd8b8b
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/format/HTTPXMLWireFormatServiceInterceptor.java
@@ -0,0 +1,182 @@
+/*
+ * 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.sca.binding.http.format;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.sca.binding.http.provider.HTTPContext;
+import org.apache.tuscany.sca.common.xml.dom.DOMHelper;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.util.FaultException;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.oasisopen.sca.ServiceRuntimeException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * Handles the xml wire format for the http binding
+ */
+public class HTTPXMLWireFormatServiceInterceptor implements Interceptor {
+
+ private Invoker next;
+ private DOMHelper domHelper;
+
+ public HTTPXMLWireFormatServiceInterceptor(RuntimeEndpoint endpoint, DOMHelper domHelper) {
+ this.domHelper = domHelper;
+ }
+
+ @Override
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+ @Override
+ public Invoker getNext() {
+ return next;
+ }
+
+ @Override
+ public Message invoke(Message msg) {
+ try {
+ return invokeResponse(getNext().invoke(invokeRequest(msg)));
+ } catch (Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+ private Message invokeRequest(Message msg) throws IOException, SAXException {
+ HTTPContext context = msg.getBindingContext();
+ HttpServletRequest servletRequest = context.getRequest();
+ if ("GET".equals(servletRequest.getMethod())) {
+ msg.setBody(getRequestFromQueryString(msg.getOperation(), servletRequest));
+ } else {
+ msg.setBody(new Object[]{domHelper.load(read(servletRequest))});
+ }
+ return msg;
+ }
+
+ private Message invokeResponse(Message msg) throws IOException {
+ HTTPContext context = msg.getBindingContext();
+ HttpServletResponse servletResponse = context.getResponse();
+
+ servletResponse.setContentType("text/xml");
+
+ Object o = msg.getBody();
+ if (msg.isFault()) {
+ String xml = domHelper.saveAsString((Node)((FaultException)o).getFaultInfo());
+ servletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, xml);
+ } else {
+ String xml = "";
+ if (o instanceof Element) {
+ xml = domHelper.saveAsString((Node)o);
+ } else if ((o instanceof Object[]) && ((Object[])o)[0] instanceof Node) {
+ xml = domHelper.saveAsString((Node)((Object[])o)[0]);
+ } else if (o != null) {
+ throw new IllegalStateException("expecting Node payload: " + o);
+ }
+ servletResponse.getOutputStream().println(xml);
+ }
+
+ return msg;
+ }
+
+ /**
+ * Turn the query request into XML.
+ */
+ protected Object[] getRequestFromQueryString(Operation operation, ServletRequest servletRequest) throws IOException, SAXException {
+ List<Object> xmlRequestArray = new ArrayList<Object>();
+ for (String name : getOrderedParameterNames(servletRequest)) {
+ xmlRequestArray.add(domHelper.load("<" + name + ">" + servletRequest.getParameter(name) + "</" + name + ">"));
+ }
+ return xmlRequestArray.toArray();
+ }
+
+ /**
+ * Get the request parameter names in the correct order.
+ * Either the query parameters are named arg0, arg1, arg2 etc or else use the order
+ * from the order in the query string. Eg, the url:
+ * http://localhost:8085/HelloWorldService/sayHello2?first=petra&last=arnold&callback=foo"
+ * should invoke:
+ * sayHello2("petra", "arnold")
+ * so the parameter names should be ordered: "first", "last"
+ */
+ protected List<String> getOrderedParameterNames(ServletRequest servletRequest) {
+ List<String> orderedNames = new ArrayList<String>();
+ Set<String> parameterNames = servletRequest.getParameterMap().keySet();
+ if (parameterNames.contains("arg0")) {
+ for (int i=0; i<parameterNames.size(); i++) {
+ String name = "arg" + i;
+ if (parameterNames.contains(name)) {
+ orderedNames.add(name);
+ } else {
+ break;
+ }
+ }
+ } else {
+ final String queryString = ((HttpServletRequest)servletRequest).getQueryString();
+ SortedSet<String> sortedNames = new TreeSet<String>(new Comparator<String>(){
+ public int compare(String o1, String o2) {
+ int i = queryString.indexOf(o1);
+ int j = queryString.indexOf(o2);
+ return i - j;
+ }});
+ for (String name : parameterNames) {
+ sortedNames.add(name);
+ }
+ orderedNames.addAll(sortedNames);
+ }
+ return orderedNames;
+ }
+
+ protected static String read(HttpServletRequest servletRequest) throws IOException {
+ InputStream is = servletRequest.getInputStream();
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
index 0fe1333..e2a3a5c 100644
--- a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingListenerServlet.java
@@ -75,13 +75,14 @@
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
+ String pathInfo = request.getPathInfo();
+ if (pathInfo == null || pathInfo.length() == 0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
return;
}
+ String path = URLDecoder.decode(pathInfo, "UTF-8");
// Invoke the get operation on the service implementation
Message requestMessage = messageFactory.createMessage();
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java
new file mode 100644
index 0000000..6860325
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPBindingServiceServlet.java
@@ -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.sca.binding.http.provider;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.invocation.MessageFactory;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+public class HTTPBindingServiceServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ protected transient MessageFactory messageFactory;
+ protected transient RuntimeEndpoint wire;
+
+ public HTTPBindingServiceServlet(RuntimeEndpoint wire, MessageFactory messageFactory) {
+ this.wire = wire;
+ this.messageFactory = messageFactory;
+ }
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ HTTPContext bindingContext = new HTTPContext();
+ bindingContext.setRequest(request);
+ bindingContext.setResponse(response);
+ Message msg = messageFactory.createMessage();
+ msg.setBindingContext(bindingContext);
+ wire.invoke(msg);
+ }
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java
new file mode 100644
index 0000000..0a49823
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPContext.java
@@ -0,0 +1,46 @@
+/*
+ * 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.sca.binding.http.provider;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Holder to pass servlet request and response between the Inteceptors
+ */
+public class HTTPContext {
+
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ public HttpServletRequest getRequest() {
+ return request;
+ }
+ public void setRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+ public HttpServletResponse getResponse() {
+ return response;
+ }
+ public void setResponse(HttpServletResponse response) {
+ this.response = response;
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java
deleted file mode 100644
index e20d420..0000000
--- a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPGetListenerServlet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.sca.binding.http.provider;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URLDecoder;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Servlet responsible for dispatching HTTP GET requests to the
- * target component implementation.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPGetListenerServlet extends HttpServlet {
- private static final long serialVersionUID = 2865466417329430610L;
-
- private MessageFactory messageFactory;
- private Invoker getInvoker;
-
- /**
- * Constructs a new HTTPServiceListenerServlet.
- */
- public HTTPGetListenerServlet(Invoker getInvoker, MessageFactory messageFactory) {
- this.getInvoker = getInvoker;
- this.messageFactory = messageFactory;
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
-
- // Redirect to a URL ending with / to make relative hrefs work
- // relative to the served resource.
- response.sendRedirect(request.getRequestURL().append('/').toString());
- return;
- }
-
- // Invoke the get operation on the service implementation
- Message requestMessage = messageFactory.createMessage();
- String id = path.substring(1);
- requestMessage.setBody(new Object[] {id});
- Message responseMessage = getInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
-
- // Write the response from the service implementation to the response
- // output stream
- InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
- byte[] buffer = new byte[2048];
- for (;;) {
- int n = is.read(buffer);
- if (n <= 0)
- break;
- os.write(buffer, 0, n);
- }
- os.flush();
- os.close();
-
- }
-
-}
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
index 41981d2..e123c28 100644
--- a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
+++ b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceBindingProvider.java
@@ -22,6 +22,8 @@
import javax.servlet.Servlet;
import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
@@ -36,8 +38,6 @@
import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
import org.apache.tuscany.sca.provider.WireFormatProvider;
import org.apache.tuscany.sca.provider.WireFormatProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
/**
@@ -49,17 +49,15 @@
private ExtensionPointRegistry extensionPoints;
private RuntimeEndpoint endpoint;
- private RuntimeComponent component;
- private RuntimeComponentService service;
- private InterfaceContract serviceContract;
private HTTPBinding binding;
private MessageFactory messageFactory;
-
private OperationSelectorProvider osProvider;
private WireFormatProvider wfProvider;
-
private ServletHost servletHost;
private String servletMapping;
+ private InterfaceContract interfaceContract;
+ private boolean widget;
+
private HTTPBindingListenerServlet bindingListenerServlet;
public HTTPServiceBindingProvider(RuntimeEndpoint endpoint,
@@ -68,18 +66,24 @@
ServletHost servletHost) {
this.endpoint = endpoint;
- this.component = (RuntimeComponent)endpoint.getComponent();
- this.service = (RuntimeComponentService)endpoint.getService();
this.binding = (HTTPBinding)endpoint.getBinding();
+ this.widget = "Widget".equals(binding.getName());
this.extensionPoints = extensionPoints;
this.messageFactory = messageFactory;
this.servletHost = servletHost;
- // retrieve operation selector and wire format service providers
+ if (binding.getOperationSelector() == null && !widget) {
+ binding.setOperationSelector(new HTTPDefaultOperationSelector());
+ }
+ if (binding.getRequestWireFormat() == null && !widget) {
+ binding.setRequestWireFormat(new HTTPDefaultWireFormat());
+ }
+ if (binding.getResponseWireFormat() == null && !widget) {
+ binding.setResponseWireFormat(new HTTPDefaultWireFormat());
+ }
ProviderFactoryExtensionPoint providerFactories = extensionPoints.getExtensionPoint(ProviderFactoryExtensionPoint.class);
-
if (binding.getOperationSelector() != null) {
// Configure the interceptors for operation selection
@@ -97,23 +101,36 @@
}
}
-
-
//clone the service contract to avoid databinding issues
try {
- this.serviceContract = (InterfaceContract) service.getInterfaceContract().clone();
+ interfaceContract = (InterfaceContract)endpoint.getComponentServiceInterfaceContract().clone();
// configure data binding
if (this.wfProvider != null) {
- wfProvider.configureWireFormatInterfaceContract(service.getInterfaceContract());
+ wfProvider.configureWireFormatInterfaceContract(interfaceContract);
}
} catch(CloneNotSupportedException e) {
- this.serviceContract = service.getInterfaceContract();
+ // shouldn't happen
}
+ servletMapping = binding.getURI();
+ if (!servletMapping.endsWith("/")) {
+ servletMapping += "/";
+ }
+ if (!servletMapping.endsWith("*")) {
+ servletMapping += "*";
+ }
}
public void start() {
+ if (widget) {
+ start1x();
+ } else {
+ servletHost.addServletMapping(servletMapping, new HTTPBindingServiceServlet(endpoint, messageFactory));
+ }
+ }
+
+ public void start1x() {
// Get the invokers for the supported operations
Servlet servlet = null;
bindingListenerServlet = new HTTPBindingListenerServlet(binding, messageFactory );
@@ -122,39 +139,39 @@
String operationName = operation.getName();
if (operationName.equals("get")) {
Invoker getInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setGetInvoker(getInvoker);
+ bindingListenerServlet.setGetInvoker(getInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("conditionalGet")) {
Invoker conditionalGetInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalGetInvoker(conditionalGetInvoker);
+ bindingListenerServlet.setConditionalGetInvoker(conditionalGetInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("delete")) {
Invoker deleteInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setDeleteInvoker(deleteInvoker);
+ bindingListenerServlet.setDeleteInvoker(deleteInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("conditionalDelete")) {
Invoker conditionalDeleteInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalDeleteInvoker(conditionalDeleteInvoker);
+ bindingListenerServlet.setConditionalDeleteInvoker(conditionalDeleteInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("put")) {
Invoker putInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setPutInvoker(putInvoker);
+ bindingListenerServlet.setPutInvoker(putInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("conditionalPut")) {
Invoker conditionalPutInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalPutInvoker(conditionalPutInvoker);
+ bindingListenerServlet.setConditionalPutInvoker(conditionalPutInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("post")) {
Invoker postInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setPostInvoker(postInvoker);
+ bindingListenerServlet.setPostInvoker(postInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("conditionalPost")) {
Invoker conditionalPostInvoker = invocationChain.getHeadInvoker();
- bindingListenerServlet.setConditionalPostInvoker(conditionalPostInvoker);
+ bindingListenerServlet.setConditionalPostInvoker(conditionalPostInvoker);
servlet = bindingListenerServlet;
} else if (operationName.equals("service")) {
Invoker serviceInvoker = invocationChain.getHeadInvoker();
- servlet = new HTTPServiceListenerServlet(binding, serviceInvoker, messageFactory);
+// servlet = new HTTPServiceListenerServlet(binding, serviceInvoker, messageFactory);
break;
}
}
@@ -174,14 +191,13 @@
servletHost.addServletMapping(servletMapping, servlet);
}
-
+
public void stop() {
- // Unregister the Servlet from the Servlet host
servletHost.removeServletMapping(servletMapping);
}
public InterfaceContract getBindingInterfaceContract() {
- return service.getInterfaceContract();
+ return interfaceContract;
}
public boolean supportsOneWayInvocation() {
@@ -192,6 +208,8 @@
* Add specific http interceptor to invocation chain
*/
public void configure() {
+
+ if (widget) return;
InvocationChain bindingChain = endpoint.getBindingInvocationChain();
diff --git a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java b/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java
deleted file mode 100644
index f752dce..0000000
--- a/modules/binding-http-runtime/src/main/java/org/apache/tuscany/sca/binding/http/provider/HTTPServiceListenerServlet.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.sca.binding.http.provider;
-
-import java.io.IOException;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-
-/**
- * Servlet responsible for dispatching HTTP service requests to the
- * target component implementation.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPServiceListenerServlet implements Servlet {
- transient private Binding binding;
- transient private ServletConfig config;
- transient private MessageFactory messageFactory;
- transient private Invoker serviceInvoker;
-
- /**
- * Constructs a new HTTPServiceListenerServlet.
- */
- public HTTPServiceListenerServlet(Binding binding, Invoker serviceInvoker, MessageFactory messageFactory) {
- this.binding = binding;
- this.serviceInvoker = serviceInvoker;
- this.messageFactory = messageFactory;
- }
-
- public ServletConfig getServletConfig() {
- return config;
- }
-
- public String getServletInfo() {
- return "";
- }
-
- public void init(ServletConfig config) throws ServletException {
- this.config = config;
- }
-
- public void destroy() {
-
- }
-
- public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- // Dispatch the service interaction to the service invoker
- Message requestMessage = messageFactory.createMessage();
- requestMessage.setBody(new Object[]{request, response});
- Message responseMessage = serviceInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- // Turn a fault into an exception
- //throw new ServletException((Throwable)responseMessage.getBody());
- Throwable e = (Throwable)responseMessage.getBody();
- ((HttpServletResponse)response).sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
- }
- }
-}
diff --git a/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
index 15b0e51..4867887 100644
--- a/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -16,5 +16,5 @@
# under the License.
# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.http.provider.HTTPBindingProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPBinding
+org.apache.tuscany.sca.binding.http.provider.HTTPBindingProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPBinding,ranking=100
diff --git a/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory
new file mode 100644
index 0000000..8d9b986
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.OperationSelectorProviderFactory
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.binding.http.format.HTTPDefaultOperationSelectorProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector
diff --git a/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.WireFormatProviderFactory b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.WireFormatProviderFactory
new file mode 100644
index 0000000..88cd59b
--- /dev/null
+++ b/modules/binding-http-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.WireFormatProviderFactory
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.binding.http.format.HTTPDefaultWireFormatProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat
+org.apache.tuscany.sca.binding.http.format.HTTPXMLWireFormatProviderFactory;model=org.apache.tuscany.sca.binding.http.HTTPXMLWireFormat
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/BeanA.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/BeanA.java
new file mode 100644
index 0000000..2c33895
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/BeanA.java
@@ -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.sca.binding.http;
+
+public class BeanA {
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ public Boolean getB() {
+ return b;
+ }
+
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuff.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuff.java
new file mode 100644
index 0000000..cf0d457
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuff.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sca.binding.http;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface ComplexStuff {
+ BeanA echoBeanA(BeanA bean);
+ String multiParams(int x, String s, Boolean b);
+ String noArgs();
+ void voidReturn();
+ String checkedException() throws SomeException;
+ String runtimeException();
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffImpl.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffImpl.java
new file mode 100644
index 0000000..9395024
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffImpl.java
@@ -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.sca.binding.http;
+
+public class ComplexStuffImpl implements ComplexStuff {
+
+ @Override
+ public BeanA echoBeanA(BeanA bean) {
+ return bean;
+ }
+
+ @Override
+ public String multiParams(int x, String s, Boolean b) {
+ return x + s + b;
+ }
+
+ @Override
+ public String noArgs() {
+ return "noArgs";
+ }
+
+ @Override
+ public void voidReturn() {
+ }
+
+ @Override
+ public String checkedException() throws SomeException {
+ throw new SomeException("some msg");
+ }
+
+ @Override
+ public String runtimeException() {
+ throw new RuntimeException("bang");
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java
new file mode 100644
index 0000000..d15f898
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/ComplexStuffTestCase.java
@@ -0,0 +1,123 @@
+/*
+ * 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.sca.binding.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * HTTP binding unit tests for Helloworld service.
+ */
+public class ComplexStuffTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode("complex.composite", new String[] {"target/test-classes"});
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/multiParams?x=1&s=petra&b=true");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"1petratrue\"", read(is));
+ }
+
+ @Test
+ public void testNoArgs() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/noArgs");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"noArgs\"", read(is));
+ }
+
+ @Test
+ public void testEchoBean() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/echoBeanA?x={\"s\":\"petra\",\"b\":true,\"y\":42,\"x\":1}");
+ InputStream is = url.openStream();
+ Assert.assertEquals("{\"s\":\"petra\",\"b\":true,\"y\":42,\"x\":1}", read(is));
+ }
+
+ @Test
+ public void testVoidReturn() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/voidReturn");
+ InputStream is = url.openStream();
+ Assert.assertEquals("", read(is));
+ }
+
+ @Test
+ public void testCheckedException() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/checkedException");
+ try {
+ InputStream is = url.openStream();
+ Assert.fail();
+ } catch (IOException e) {
+ // expected
+ // TODO: what should happen with checked exceptions?
+ }
+ }
+
+ @Test
+ public void testRuntimeException() throws Exception {
+ URL url = new URL("http://localhost:8080/ComplexComponent/ComplexStuff/runtimeException");
+ try {
+ InputStream is = url.openStream();
+ Assert.fail();
+ } catch (IOException e) {
+ Assert.assertTrue(e.getMessage().contains("HTTP response code: 500"));
+ }
+ }
+
+ private static String read(InputStream is) throws IOException {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java
deleted file mode 100644
index eed7975..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingCacheTestCase.java
+++ /dev/null
@@ -1,903 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * HTTP binding unit tests.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingCacheTestCase {
- // RFC 822 date time
- protected static final SimpleDateFormat dateFormat = new SimpleDateFormat(
- "EEE, dd MMM yyyy HH:mm:ss Z");
-
- // Request with no predicates in header.
- private static final String REQUEST1 = "{0} /httpbinding/{1} HTTP/1.0\n"
- + "Host: localhost\n" + "Content-Type: text/xml\n"
- + "Connection: close\n" + "Content-Length: {2}" + "\n\n{3}";
-
- // Request with predicates in header
- private static final String REQUEST2 = "{0} /httpbinding/{1} HTTP/1.0\n"
- + "Host: localhost\n" + "Content-Type: text/xml\n" + "{2}: {3}\n" // predicate (If-Match, If-None-Match, If-Modified-Since, If-NotModified-Since): value (date or ETag)
- + "Connection: close\n" + "Content-Length: {4}" + "\n\n{5}";
-
- private static final int HTTP_PORT = 8085;
-
- private static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- try {
- String contribution = ContributionLocationHelper.getContributionLocation(HTTPBindingCacheTestCase.class);
- node = NodeFactory.newInstance().createNode("testCache.composite", new Contribution("test", contribution));
- node.start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testGet() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST1, "GET", index, content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfModifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfModifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 304 Not Modified.
- Assert.assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfUnmodifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Unmodified-Since", dateFormat.format(new Date()), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfUnmodifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Unmodified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 412 precondition failed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfNoneMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 412 precondition failed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalGetIfNoneMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "GET", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testDelete() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST1, "DELETE", index,
- content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("deleted item=" + index) != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfModifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfModifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 304 Not Modified.
- Assert.assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfUnmodifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Unmodified-Since", dateFormat.format(new Date()), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfUnmodifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Unmodified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 412 precondition failed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfNoneMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 412 precondition failed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalDeleteIfNoneMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "DELETE", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("deleted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testPost() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST1, "POST", index, content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("HTTP/1.1 200 OK") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfModifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-Modified-Since", dateFormat.format(new Date()), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return code 200 OK
- // assertTrue(document.indexOf("posted item=" + index) != -1);
- Assert.assertTrue(document.indexOf("HTTP/1.1 200 OK") != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfModifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("posted item=" + index) != -1);
- // Should return code 304 Not Modified.
- Assert.assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfUnmodifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-Unmodified-Since", dateFormat.format(new Date()), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return code 200 OK
- Assert.assertTrue(document.indexOf("HTTP/1.1 200 OK") != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfUnmodifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-Unmodified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("posted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-Match", "eTagMatch", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return code 200 OK.
- Assert.assertTrue(document.indexOf("HTTP/1.1 200 OK") != -1);
- // Should return code 412 precondition failed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat
- .format(REQUEST2, "POST", index, "If-Match", "eTagNoneMatch",
- content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("posted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfNoneMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-None-Match", "eTagNoneMatch", content.getBytes().length,
- content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return code 200 OK
- Assert.assertTrue(document.indexOf("HTTP/1.1 200 OK") != -1);
- // Should return code 412 precondition failed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPostIfNoneMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "POST", index,
- "If-None-Match", "eTagMatch", content.getBytes().length,
- content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("posted item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testPut() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST1, "PUT", index, content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("updated item=" + index) != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfModifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfModifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Modified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 304 Not Modified.
- Assert.assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfUnmodifiedNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Unmodified-Since", dateFormat.format(new Date()), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 304 Not Modified.
- // assertTrue(document.indexOf("HTTP/1.1 304") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfUnmodifiedPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Unmodified-Since", dateFormat.format(new Date(0)), content
- .getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 412 precondition failed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfNoneMatchNegative() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 1;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- Assert.assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 412 precondition failed.
- // assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Test invoking a conditional method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testConditionalPutIfNoneMatchPositive() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String content = "";
- String request = MessageFormat.format(REQUEST2, "PUT", index,
- "If-None-Match", "eTagXXX", content.getBytes().length, content);
- os.write(request.getBytes());
- os.flush();
-
- String document = read(client);
- // Should return item
- // assertTrue(document.indexOf("updated item=" + index) != -1);
- // Should return code 412 PreconditionFailed.
- Assert.assertTrue(document.indexOf("HTTP/1.1 412") != -1);
- }
-
- /**
- * Read response stream from the given socket.
- * @param socket
- * @return
- * @throws IOException
- */
- private static String read(Socket socket) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(socket
- .getInputStream()));
- StringBuffer sb = new StringBuffer();
- String str;
- while ((str = reader.readLine()) != null) {
- sb.append(str);
- }
- return sb.toString();
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- }
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
deleted file mode 100644
index f314bed..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HTTPBindingTestCase.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.text.MessageFormat;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * HTTP binding unit tests.
- *
- * @version $Rev$ $Date$
- */
-public class HTTPBindingTestCase {
-
- private static final String REQUEST1_HEADER =
- "GET /httpservice/test HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST1_CONTENT = "";
- private static final String REQUEST1 =
- REQUEST1_HEADER + REQUEST1_CONTENT.getBytes().length + "\n\n" + REQUEST1_CONTENT;
-
- private static final String REQUEST2_HEADER =
- "GET /webcontent/test.html HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST2_CONTENT = "";
- private static final String REQUEST2 =
- REQUEST2_HEADER + REQUEST2_CONTENT.getBytes().length + "\n\n" + REQUEST2_CONTENT;
-
- private static final String REQUEST3_HEADER =
- "GET /httpget/{0} HTTP/1.0\n" + "Host: localhost\n"
- + "Content-Type: text/xml\n"
- + "Connection: close\n"
- + "Content-Length: ";
- private static final String REQUEST3_CONTENT = "";
- private static final String REQUEST3 =
- REQUEST3_HEADER + REQUEST3_CONTENT.getBytes().length + "\n\n" + REQUEST3_CONTENT;
-
- private static final int HTTP_PORT = 8085;
-
- private static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- try {
- String contribution = ContributionLocationHelper.getContributionLocation(HTTPBindingCacheTestCase.class);
- node = NodeFactory.newInstance().createNode("test.composite", new Contribution("test", contribution));
- node.start();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- /**
- * Test invoking a POJO service implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testServiceImplementation() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST1.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("<body><p>hey</body>") != -1);
- }
-
- /**
- * Test invoking a POJO get method implementation using the HTTP binding.
- * @throws Exception
- */
- @Test
- public void testGetImplementation() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- int index = 0;
- String request = MessageFormat.format( REQUEST3, index );
- os.write( request.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("<body><p>item=" + index) != -1);
- }
-
- /**
- * Test getting a static resource provided using the HTTP binding.
- * @throws Exception
- */
- @Ignore("Implementation resource not available")
- public void testStaticResourceImplementation() throws Exception {
- Socket client = new Socket("127.0.0.1", HTTP_PORT);
- OutputStream os = client.getOutputStream();
- os.write(REQUEST2.getBytes());
- os.flush();
-
- String document = read(client);
- Assert.assertTrue(document.indexOf("<body><p>hello</body>") != -1);
- }
-
- /**
- * Read response stream from the given socket.
- * @param socket
- * @return
- * @throws IOException
- */
- private static String read(Socket socket) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
- StringBuffer sb = new StringBuffer();
- String str;
- while ((str = reader.readLine()) != null) {
- sb.append(str);
- }
- return sb.toString();
- } finally {
- if (reader != null) {
- reader.close();
- }
- }
- }
-
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/Helloworld.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/Helloworld.java
new file mode 100644
index 0000000..17a0b28
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/Helloworld.java
@@ -0,0 +1,26 @@
+/*
+ * 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.sca.binding.http;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+ String sayHello(String name);
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldImpl.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldImpl.java
new file mode 100644
index 0000000..e245f60
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldImpl.java
@@ -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 org.apache.tuscany.sca.binding.http;
+
+public class HelloworldImpl implements Helloworld {
+
+ @Override
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java
new file mode 100644
index 0000000..89598b9
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/HelloworldTestCase.java
@@ -0,0 +1,93 @@
+/*
+ * 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.sca.binding.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * HTTP binding unit tests for Helloworld service.
+ */
+public class HelloworldTestCase {
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode("helloworld.composite", new String[] {"target/test-classes"});
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldComponent/Helloworld/sayHello?name=Petra");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"Hello Petra\"", read(is));
+ }
+
+ @Test
+ public void testGetArg0() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldComponent/Helloworld/sayHello?arg0=Petra");
+ InputStream is = url.openStream();
+ Assert.assertEquals("\"Hello Petra\"", read(is));
+ }
+
+ @Test
+ public void testXml() throws Exception {
+ URL url = new URL("http://localhost:8080/HelloworldXmlComponent/Helloworld/sayHello?arg0=Petra");
+ InputStream is = url.openStream();
+ Assert.assertTrue(read(is).endsWith(">Hello Petra</return>"));
+ }
+
+ private static String read(InputStream is) throws IOException {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String str;
+ while ((str = reader.readLine()) != null) {
+ sb.append(str);
+ }
+ return sb.toString();
+ } finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/NotModifiedException.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/NotModifiedException.java
deleted file mode 100644
index 1d6efea..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/NotModifiedException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-/**
- * Indicates that a resource was not modified.
- *
- * @version $Rev$ $Date$
- */
-public class NotModifiedException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public NotModifiedException() {
- }
-
- public NotModifiedException(String message) {
- super(message);
- }
-
- public NotModifiedException(Throwable cause) {
- super(cause);
- }
-
- public NotModifiedException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/PreconditionFailedException.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/PreconditionFailedException.java
deleted file mode 100644
index 5728899..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/PreconditionFailedException.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-/**
- * Indicates that a resource was not modified.
- *
- * @version $Rev$ $Date$
- */
-public class PreconditionFailedException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public PreconditionFailedException() {
- }
-
- public PreconditionFailedException(String message) {
- super(message);
- }
-
- public PreconditionFailedException(Throwable cause) {
- super(cause);
- }
-
- public PreconditionFailedException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/SomeException.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/SomeException.java
new file mode 100644
index 0000000..f4ffd19
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/SomeException.java
@@ -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 org.apache.tuscany.sca.binding.http;
+
+public class SomeException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public SomeException(String msg) {
+ super(msg);
+ }
+
+}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestBindingCacheImpl.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestBindingCacheImpl.java
deleted file mode 100644
index 959de14..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestBindingCacheImpl.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Date;
-
-import org.apache.tuscany.sca.common.http.HTTPCacheContext;
-
-/**
- * Test service implementation that implements a various conditional HTTP
- * methods. For testing, the id==0 items are very old (Date(0)), not modified,
- * and always match ETags and the id==1 items are always brand new (Date()),
- * modified, and never match ETags. Using these ids one can test the
- * LastModified and ETag headers of the requests.
- *
- * @version $Rev$ $Date$
- */
-public class TestBindingCacheImpl {
-
- /**
- * Implements the HTTP get method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream get(String id) {
- return new ByteArrayInputStream(
- ("<html><body><p>item=" + id + "</body></html>").getBytes());
- }
-
- /**
- * Implements the HTTP conditional get method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream conditionalGet(String id, HTTPCacheContext cacheContext)
- throws NotModifiedException, PreconditionFailedException {
-
- if (cacheContext != null) {
- if (cacheContext.ifModifiedSince) {
- if ((id.equals("1"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new NotModifiedException("item 1 was modified on "
- + new Date());
- }
- if (cacheContext.ifUnmodifiedSince) {
- if ((id.equals("0"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new PreconditionFailedException(
- "item 0 was modified on " + new Date(0));
- }
- if (cacheContext.ifMatch) {
- if (id.equals("1"))
- throw new PreconditionFailedException(
- "item 1 eTag does not match "
- + cacheContext.getETag());
- }
- if (cacheContext.ifNoneMatch) {
- if (id.equals("0"))
- throw new PreconditionFailedException(
- "item 0 eTag matches " + cacheContext.getETag());
- }
- }
- return new ByteArrayInputStream(
- ("<html><body><p>item=" + id + "</body></html>").getBytes());
- }
-
- /**
- * Implements the HTTP delete method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream delete(String id) {
- return new ByteArrayInputStream(
- ("<html><body><p>deleted item=" + id + "</body></html>")
- .getBytes());
- }
-
- /**
- * Implements the HTTP conditional delete method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream conditionalDelete(String id, HTTPCacheContext cacheContext)
- throws NotModifiedException, PreconditionFailedException {
-
- if (cacheContext != null) {
- if (cacheContext.ifModifiedSince) {
- if ((id.equals("1"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new NotModifiedException("item 1 was modified on "
- + new Date());
- }
- if (cacheContext.ifUnmodifiedSince) {
- if ((id.equals("0"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new PreconditionFailedException(
- "item 0 was modified on " + new Date(0));
- }
- if (cacheContext.ifMatch) {
- if (id.equals("1"))
- throw new PreconditionFailedException(
- "item 1 eTag does not match "
- + cacheContext.getETag());
- }
- if (cacheContext.ifNoneMatch) {
- if (id.equals("0"))
- throw new PreconditionFailedException(
- "item 0 eTag matches " + cacheContext.getETag());
- }
- }
- return new ByteArrayInputStream(
- ("<html><body><p>deleted item=" + id + "</body></html>")
- .getBytes());
- }
-
- /**
- * Implements the HTTP post method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream post() {
- int id = (new java.util.Random()).nextInt(Integer.MAX_VALUE);
- return new ByteArrayInputStream(
- ("<html><body><p>posted item=" + id + "</body></html>")
- .getBytes());
- }
-
- /**
- * Implements the HTTP conditional post method of the collection implementation.
- * @param id
- * @return
- */
- public HTTPCacheContext conditionalPost(HTTPCacheContext cacheContext)
- throws NotModifiedException, PreconditionFailedException {
- String id = "" + (new java.util.Random()).nextInt(Integer.MAX_VALUE);
-
- if (cacheContext != null) {
- if (cacheContext.ifModifiedSince) {
- if (0 >= cacheContext.lastModifiedDate.compareTo(new Date(0)))
- throw new NotModifiedException("item was modified on "
- + new Date());
- }
- if (cacheContext.ifUnmodifiedSince) {
- if ((0 >= cacheContext.lastModifiedDate.compareTo(new Date(0))))
- throw new PreconditionFailedException(
- "item was modified on " + new Date(0));
- }
- if (cacheContext.ifMatch) {
- if (cacheContext.getETag().equalsIgnoreCase("ETagNoneMatch"))
- throw new PreconditionFailedException(
- "item eTag does not match "
- + cacheContext.getETag());
- }
- if (cacheContext.ifNoneMatch) {
- if (cacheContext.getETag().equalsIgnoreCase("ETagMatch"))
- throw new PreconditionFailedException("item eTag matches "
- + cacheContext.getETag());
- }
- }
-
- // Return the ETag and LastModfied fields by serialize to a byte array
- HTTPCacheContext returnContext = new HTTPCacheContext();
- returnContext.setETag( "ETag" + (new java.util.Random()).nextInt(Integer.MAX_VALUE) );
- returnContext.setLastModified( new Date() );
- return returnContext;
- }
-
- /**
- * Implements the HTTP update/put method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream put(String id) {
- return new ByteArrayInputStream(
- ("<html><body><p>updated item=" + id + "</body></html>")
- .getBytes());
- }
-
- /**
- * Implements the HTTP conditional update/put method of the collection implementation.
- * @param id
- * @return
- */
- public InputStream conditionalPut(String id, HTTPCacheContext cacheContext)
- throws NotModifiedException, PreconditionFailedException {
-
- if (cacheContext != null) {
- if (cacheContext.ifModifiedSince) {
- if ((id.equals("1"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new NotModifiedException("item 1 was modified on "
- + new Date());
- }
- if (cacheContext.ifUnmodifiedSince) {
- if ((id.equals("0"))
- && (0 > cacheContext.lastModifiedDate
- .compareTo(new Date())))
- throw new PreconditionFailedException(
- "item 0 was modified on " + new Date(0));
- }
- if (cacheContext.ifMatch) {
- if (id.equals("1"))
- throw new PreconditionFailedException(
- "item 1 eTag does not match "
- + cacheContext.getETag());
- }
- if (cacheContext.ifNoneMatch) {
- if (id.equals("0"))
- throw new PreconditionFailedException(
- "item 0 eTag matches " + cacheContext.getETag());
- }
- }
-
- return new ByteArrayInputStream(
- ("<html><body><p>updated item=" + id + "</body></html>")
- .getBytes());
- }
-
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java
deleted file mode 100644
index 333bacb..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestGetImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-/**
- * Test service implementation that implements a get method.
- *
- * @version $Rev$ $Date$
- */
-public class TestGetImpl {
-
- public InputStream get(String id) {
- return new ByteArrayInputStream(("<html><body><p>item=" + id + "</body></html>").getBytes());
-
- }
-
-}
diff --git a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java b/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
deleted file mode 100644
index b8c1223..0000000
--- a/modules/binding-http-runtime/src/test/java/org/apache/tuscany/sca/binding/http/TestServiceImpl.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.sca.binding.http;
-
-import java.io.IOException;
-
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * Test service implementation.
- *
- * @version $Rev$ $Date$
- */
-
-@Service(Servlet.class)
-public class TestServiceImpl implements Servlet {
-
- public void init(ServletConfig config) throws ServletException {
- }
-
- public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
- //HttpServletResponse httpResponse = (HttpServletResponse)response;
- response.getOutputStream().print("<html><body><p>hey</body></html>");
- }
-
- public void destroy() {
- }
-
- public ServletConfig getServletConfig() {
- return null;
- }
-
- public String getServletInfo() {
- return null;
- }
-
-}
diff --git a/modules/binding-http-runtime/src/test/resources/complex.composite b/modules/binding-http-runtime/src/test/resources/complex.composite
new file mode 100644
index 0000000..7f4cc64
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/resources/complex.composite
@@ -0,0 +1,41 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="ComplexStuff">
+
+ <component name="ComplexComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.http.ComplexStuffImpl"/>
+ <service name="ComplexStuff">
+ <tuscany:binding.http />
+ </service>
+ </component>
+
+ <component name="ComplexXmlComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.http.ComplexStuffImpl"/>
+ <service name="ComplexStuff">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.httpXml />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+</composite>
diff --git a/modules/binding-http-runtime/src/test/resources/content/test.html b/modules/binding-http-runtime/src/test/resources/content/test.html
deleted file mode 100644
index f4b79d7..0000000
--- a/modules/binding-http-runtime/src/test/resources/content/test.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<!--
- * 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.
--->
-<body><p>hello</body>
-</html>
\ No newline at end of file
diff --git a/modules/binding-http-runtime/src/test/resources/helloworld.composite b/modules/binding-http-runtime/src/test/resources/helloworld.composite
new file mode 100644
index 0000000..7497cfc
--- /dev/null
+++ b/modules/binding-http-runtime/src/test/resources/helloworld.composite
@@ -0,0 +1,41 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.http.HelloworldImpl"/>
+ <service name="Helloworld">
+ <tuscany:binding.http />
+ </service>
+ </component>
+
+ <component name="HelloworldXmlComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.http.HelloworldImpl"/>
+ <service name="Helloworld">
+ <tuscany:binding.http>
+ <tuscany:wireFormat.httpXml />
+ </tuscany:binding.http>
+ </service>
+ </component>
+
+</composite>
diff --git a/modules/binding-http-runtime/src/test/resources/test.composite b/modules/binding-http-runtime/src/test/resources/test.composite
deleted file mode 100644
index e3525f4..0000000
--- a/modules/binding-http-runtime/src/test/resources/test.composite
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sr="http://sample/test"
- name="test">
-
- <!-- component name="ResourceServiceComponent">
- <tuscany:implementation.resource location="content"/>
- <service name="Resource">
- <tuscany:binding.http uri="http://localhost:8085/webcontent"/>
- </service>
- </component -->
-
- <component name="HTTPServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestServiceImpl"/>
- <service name="Servlet">
- <tuscany:binding.http uri="http://localhost:8085/httpservice"/>
- </service>
- </component>
-
- <component name="HTTPGetComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestGetImpl"/>
- <service name="TestGetImpl">
- <tuscany:binding.http uri="http://localhost:8085/httpget"/>
- </service>
- </component>
-
-</composite>
diff --git a/modules/binding-http-runtime/src/test/resources/testCache.composite b/modules/binding-http-runtime/src/test/resources/testCache.composite
deleted file mode 100644
index 4923cfa..0000000
--- a/modules/binding-http-runtime/src/test/resources/testCache.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sr="http://sample/test"
- name="testCache">
-
- <component name="HTTPBindingComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestBindingCacheImpl"/>
- <service name="TestBindingCacheImpl">
- <tuscany:binding.http uri="http://localhost:8085/httpbinding"/>
- </service>
- </component>
-
-</composite>
diff --git a/modules/binding-http/META-INF/MANIFEST.MF b/modules/binding-http/META-INF/MANIFEST.MF
index b0a4fc0..861da02 100644
--- a/modules/binding-http/META-INF/MANIFEST.MF
+++ b/modules/binding-http/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.http;version="2.0.0";
- uses:="org.apache.tuscany.sca.assembly,javax.xml.namespace,javax.servlet.http"
+Export-Package: org.apache.tuscany.sca.binding.http;version="2.0.0";uses:="org.apache.tuscany.sca.assembly,javax.xml.namespace,javax.servlet.http",
+ org.apache.tuscany.sca.binding.http.impl;version="2.0.0"
Bundle-Name: Apache Tuscany SCA HTTP Binding Model
Bundle-Vendor: The Apache Software Foundation
Bundle-Version: 2.0.0
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultOperationSelector.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultOperationSelector.java
new file mode 100644
index 0000000..a777743
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultOperationSelector.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sca.binding.http;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+
+public class HTTPDefaultOperationSelector implements OperationSelector {
+ public static final QName OPERATION_SELECTOR_HTTP_DEFAULT_QNAME = new QName(Constants.SCA11_NS, "operationSelector.httpDefault");
+
+ public QName getSchemaName() {
+ return OPERATION_SELECTOR_HTTP_DEFAULT_QNAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+}
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultWireFormat.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultWireFormat.java
new file mode 100644
index 0000000..e3ff891
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPDefaultWireFormat.java
@@ -0,0 +1,45 @@
+/*
+ * 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.sca.binding.http;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+
+/**
+ * Implementation for policies that could be injected as parameter
+ * into the axis2config.
+ *
+ * @version $Rev: 813442 $ $Date: 2009-09-10 14:56:17 +0100 (Thu, 10 Sep 2009) $
+ */
+public class HTTPDefaultWireFormat implements WireFormat {
+ public static final QName WIRE_FORMAT_HTTP_DEFAULT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "wireFormat.httpDefault");
+
+ public QName getSchemaName() {
+ return WIRE_FORMAT_HTTP_DEFAULT_QNAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+}
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPXMLWireFormat.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPXMLWireFormat.java
new file mode 100644
index 0000000..a616c15
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPXMLWireFormat.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sca.binding.http;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+
+public class HTTPXMLWireFormat implements WireFormat {
+ public static final QName WIRE_FORMAT_HTTP_XML_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "wireFormat.httpXml");
+
+ public QName getSchemaName() {
+ return WIRE_FORMAT_HTTP_XML_QNAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+}
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
index 2555799..d83d9b9 100644
--- a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
@@ -31,13 +31,16 @@
*
* @version $Rev$ $Date$
*/
-class HTTPBindingImpl implements HTTPBinding {
+public class HTTPBindingImpl implements HTTPBinding {
private String name;
private String uri;
private WireFormat wireFormat;
private OperationSelector operationSelector;
+
+ public HTTPBindingImpl() {
+ }
public QName getType() {
return TYPE;
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultOperationSelectorProcessor.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultOperationSelectorProcessor.java
new file mode 100644
index 0000000..1e15965
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultOperationSelectorProcessor.java
@@ -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 org.apache.tuscany.sca.binding.http.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
+public class HTTPDefaultOperationSelectorProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPDefaultOperationSelector> {
+
+ public HTTPDefaultOperationSelectorProcessor(FactoryExtensionPoint modelFactories) {
+ }
+
+ public QName getArtifactType() {
+ return HTTPDefaultOperationSelector.OPERATION_SELECTOR_HTTP_DEFAULT_QNAME;
+ }
+
+ public HTTPDefaultOperationSelector read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
+ HTTPDefaultOperationSelector wireFormat = new HTTPDefaultOperationSelector();
+
+ return wireFormat;
+ }
+
+ public void write(HTTPDefaultOperationSelector wireFormat, XMLStreamWriter writer, ProcessorContext context)
+ throws ContributionWriteException, XMLStreamException {
+ writer.writeStartElement("tuscany",
+ getArtifactType().getLocalPart(),
+ getArtifactType().getNamespaceURI());
+ writer.writeNamespace("tuscany", Constants.SCA11_TUSCANY_NS);
+
+ writer.writeEndElement();
+ }
+
+ public Class<HTTPDefaultOperationSelector> getModelType() {
+ return HTTPDefaultOperationSelector.class;
+ }
+
+ public void resolve(HTTPDefaultOperationSelector arg0, ModelResolver arg1, ProcessorContext context) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultWireFormatProcessor.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultWireFormatProcessor.java
new file mode 100644
index 0000000..b5b1827
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPDefaultWireFormatProcessor.java
@@ -0,0 +1,71 @@
+/*
+ * 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.sca.binding.http.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
+public class HTTPDefaultWireFormatProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPDefaultWireFormat> {
+
+ public HTTPDefaultWireFormatProcessor(FactoryExtensionPoint modelFactories) {
+ }
+
+ public QName getArtifactType() {
+ return HTTPDefaultWireFormat.WIRE_FORMAT_HTTP_DEFAULT_QNAME;
+ }
+
+
+ public HTTPDefaultWireFormat read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
+ HTTPDefaultWireFormat wireFormat = new HTTPDefaultWireFormat();
+
+ return wireFormat;
+ }
+
+ public void write(HTTPDefaultWireFormat wireFormat, XMLStreamWriter writer, ProcessorContext context)
+ throws ContributionWriteException, XMLStreamException {
+ writer.writeStartElement("tuscany",
+ getArtifactType().getLocalPart(),
+ getArtifactType().getNamespaceURI());
+ writer.writeNamespace("tuscany", Constants.SCA11_TUSCANY_NS);
+
+ writer.writeEndElement();
+ }
+
+ public Class<HTTPDefaultWireFormat> getModelType() {
+ return HTTPDefaultWireFormat.class;
+ }
+
+ public void resolve(HTTPDefaultWireFormat arg0, ModelResolver arg1, ProcessorContext context) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPXMLWireFormatProcessor.java b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPXMLWireFormatProcessor.java
new file mode 100644
index 0000000..86292cf
--- /dev/null
+++ b/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPXMLWireFormatProcessor.java
@@ -0,0 +1,71 @@
+/*
+ * 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.sca.binding.http.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.http.HTTPXMLWireFormat;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
+public class HTTPXMLWireFormatProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPXMLWireFormat> {
+
+ public HTTPXMLWireFormatProcessor(FactoryExtensionPoint modelFactories) {
+ }
+
+ public QName getArtifactType() {
+ return HTTPXMLWireFormat.WIRE_FORMAT_HTTP_XML_QNAME;
+ }
+
+
+ public HTTPXMLWireFormat read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
+ HTTPXMLWireFormat wireFormat = new HTTPXMLWireFormat();
+
+ return wireFormat;
+ }
+
+ public void write(HTTPXMLWireFormat wireFormat, XMLStreamWriter writer, ProcessorContext context)
+ throws ContributionWriteException, XMLStreamException {
+ writer.writeStartElement("tuscany",
+ getArtifactType().getLocalPart(),
+ getArtifactType().getNamespaceURI());
+ writer.writeNamespace("tuscany", Constants.SCA11_TUSCANY_NS);
+
+ writer.writeEndElement();
+ }
+
+ public Class<HTTPXMLWireFormat> getModelType() {
+ return HTTPXMLWireFormat.class;
+ }
+
+ public void resolve(HTTPXMLWireFormat arg0, ModelResolver arg1, ProcessorContext context) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
index f8c0fd2..9a26611 100644
--- a/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ b/modules/binding-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -17,3 +17,6 @@
# Implementation class for the artifact processor extension
org.apache.tuscany.sca.binding.http.xml.HTTPBindingProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.http,model=org.apache.tuscany.sca.binding.http.HTTPBinding,factory=org.apache.tuscany.sca.binding.http.HTTPBindingFactory
+org.apache.tuscany.sca.binding.http.xml.HTTPDefaultWireFormatProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.httpDefault,model=org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat
+org.apache.tuscany.sca.binding.http.xml.HTTPXMLWireFormatProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.httpXml,model=org.apache.tuscany.sca.binding.http.HTTPXMLWireFormat
+org.apache.tuscany.sca.binding.http.xml.HTTPDefaultOperationSelectorProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#operationSelector.httpDefault,model=org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector
diff --git a/modules/binding-jms-runtime/META-INF/MANIFEST.MF b/modules/binding-jms-runtime/META-INF/MANIFEST.MF
index a25cc85..a16f0c4 100644
--- a/modules/binding-jms-runtime/META-INF/MANIFEST.MF
+++ b/modules/binding-jms-runtime/META-INF/MANIFEST.MF
@@ -8,6 +8,7 @@
Bundle-Description: Apache Tuscany SCA JMS Binding Runtime
Import-Package: javax.jms,
javax.naming,
+ javax.resource.spi,
javax.security.auth,
javax.xml.namespace,
javax.xml.stream,
diff --git a/modules/binding-jms-runtime/pom.xml b/modules/binding-jms-runtime/pom.xml
index d87fed3..206e240 100644
--- a/modules/binding-jms-runtime/pom.xml
+++ b/modules/binding-jms-runtime/pom.xml
@@ -32,57 +32,18 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-jms</artifactId>
<version>2.0-Beta1</version>
+ <scope>provided</scope>
</dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
@@ -91,27 +52,19 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
-
</dependencies>
</project>
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java
index b067b6e..61c5dc8 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderReferenceInterceptor.java
@@ -22,11 +22,13 @@
import java.util.Map;
+import java.util.UUID;
import javax.jms.DeliveryMode;
+import javax.jms.Destination;
import javax.jms.JMSException;
+import javax.naming.NamingException;
-import org.apache.tuscany.sca.assembly.WireFormat;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
@@ -51,22 +53,15 @@
private Invoker next;
private RuntimeEndpointReference runtimeWire;
- private JMSResourceFactory jmsResourceFactory;
private JMSBinding jmsBinding;
private JMSMessageProcessor requestMessageProcessor;
- private JMSMessageProcessor responseMessageProcessor;
- private String correlationScheme;
- private WireFormat requestWireFormat;
- private WireFormat responseWireFormat;
+
public HeaderReferenceInterceptor(ExtensionPointRegistry extensions, JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeEndpointReference runtimeWire) {
super();
this.jmsBinding = jmsBinding;
- this.runtimeWire = runtimeWire;
- this.jmsResourceFactory = jmsResourceFactory;
- this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(extensions, jmsBinding);
- this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(extensions, jmsBinding);
- this.correlationScheme = jmsBinding.getCorrelationScheme();
+ this.runtimeWire = runtimeWire;
+ this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(extensions, jmsBinding);
}
@@ -90,31 +85,43 @@
// @nativeOperation here on the reference side.
requestMessageProcessor.setOperationName(operationName, jmsMsg);
- if (jmsBinding.getOperationJMSDeliveryMode(operationName) != null) {
- if (jmsBinding.getOperationJMSDeliveryMode(operationName)) {
- jmsMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
- } else {
- jmsMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
- }
- }
+
+
+ if (jmsBinding.getEffectiveJMSDeliveryMode(operationName) != null) {
+ if (jmsBinding.getEffectiveJMSDeliveryMode(operationName)) {
+ jmsMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
+ } else {
+ jmsMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
+ }
+ }
+ if (jmsBinding.getEffectiveJMSPriority(operationName) != null) {
+ jmsMsg.setJMSPriority(jmsBinding.getEffectiveJMSPriority(operationName));
+ }
+
+ if ( jmsBinding.getEffectiveJMSType(operationName) != null ) {
+ jmsMsg.setJMSType(jmsBinding.getEffectiveJMSType(operationName));
+ }
+
+ if ( jmsBinding.getEffectiveJMSTimeToLive(operationName) != null ) {
+ jmsMsg.setJMSExpiration(jmsBinding.getEffectiveJMSTimeToLive(operationName));
+ }
+
if (jmsBinding.getOperationJMSCorrelationId(operationName) != null) {
jmsMsg.setJMSCorrelationID(jmsBinding.getOperationJMSCorrelationId(operationName));
- }
-
- if (jmsBinding.getOperationJMSPriority(operationName) != null) {
- jmsMsg.setJMSPriority(jmsBinding.getOperationJMSPriority(operationName));
- }
-
- if (jmsBinding.getOperationJMSType(operationName) != null) {
- jmsMsg.setJMSType(jmsBinding.getOperationJMSType(operationName));
+ } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equals(jmsBinding.getCorrelationScheme())) {
+ jmsMsg.setJMSCorrelationID(UUID.randomUUID().toString());
}
if (tuscanyMsg.getFrom().getCallbackEndpoint() != null) {
String callbackDestName = getCallbackDestinationName(reference);
if (callbackDestName != null) {
- jmsMsg.setStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY, callbackDestName);
+ jmsMsg.setStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY, "jms:jndi:" + callbackDestName);
+ if (operation.isNonBlocking()) {
+ Destination dest = context.getJmsResourceFactory().lookupDestination(callbackDestName);
+ jmsMsg.setJMSReplyTo(dest);
+ }
}
}
@@ -131,16 +138,18 @@
}
}
- if (jmsBinding.getOperationJMSTimeToLive(operationName) != null) {
- context.setTimeToLive(jmsBinding.getOperationJMSTimeToLive(operationName) * 2);
+ if (jmsBinding.getEffectiveJMSTimeToLive(operationName) != null) {
+ context.setTimeToLive(jmsBinding.getEffectiveJMSTimeToLive(operationName) * 2);
} else {
context.setTimeToLive(JMSBindingConstants.DEFAULT_TIME_TO_LIVE);
- }
+ }
return tuscanyMsg;
} catch (JMSException e) {
throw new JMSBindingException(e);
- }
+ } catch (NamingException e) {
+ throw new JMSBindingException(e);
+ }
}
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderServiceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderServiceInterceptor.java
new file mode 100644
index 0000000..178a87a
--- /dev/null
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/headers/HeaderServiceInterceptor.java
@@ -0,0 +1,83 @@
+/*
+ * 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.sca.binding.jms.headers;
+
+import java.util.Map;
+
+import javax.jms.JMSException;
+
+import org.apache.tuscany.sca.binding.jms.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.JMSBindingException;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Interceptor;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+public class HeaderServiceInterceptor implements Interceptor {
+
+ private Invoker next;
+ private JMSBinding jmsBinding;
+
+ public HeaderServiceInterceptor(JMSBinding jmsBinding) {
+ super();
+ this.jmsBinding = jmsBinding;
+ }
+
+ public Message invoke(Message msg) {
+ return invokeResponse(next.invoke(msg));
+ }
+
+ public Message invokeResponse(Message tuscanyMsg) {
+ try {
+
+ javax.jms.Message jmsMsg = tuscanyMsg.getBody();
+
+ Operation operation = tuscanyMsg.getOperation();
+ String operationName = operation.getName();
+
+ for (String propName : jmsBinding.getPropertyNames()) {
+ Object value = jmsBinding.getProperty(propName);
+ jmsMsg.setObjectProperty(propName, value);
+ }
+
+ Map<String, Object> operationProperties = jmsBinding.getOperationProperties(operationName);
+ if (operationProperties != null) {
+ for (String propName : operationProperties.keySet()) {
+ Object value = operationProperties.get(propName);
+ jmsMsg.setObjectProperty(propName, value);
+ }
+ }
+
+ return tuscanyMsg;
+
+ } catch (JMSException e) {
+ throw new JMSBindingException(e);
+ }
+ }
+
+ public Invoker getNext() {
+ return next;
+ }
+
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+
+}
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java
index 3bd7b8c..9472869 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java
@@ -31,6 +31,7 @@
import javax.jms.Session;
import javax.jms.Topic;
import javax.naming.NamingException;
+import javax.resource.spi.ActivationSpec;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
@@ -71,8 +72,9 @@
this.running = true;
try {
- registerListerner();
+ registerListener();
} catch (Exception e) {
+ if (e instanceof JMSBindingException) throw (JMSBindingException)e;
throw new JMSBindingException("Error starting JMSServiceBinding", e);
}
}
@@ -93,9 +95,10 @@
}
}
- private void registerListerner() throws NamingException, JMSException {
+ private void registerListener() throws NamingException, JMSException {
Session session = jmsResourceFactory.createSession();
+ lookupActivationSpec();
destination = lookupDestinationQueue();
if (destination == null) {
destination = session.createTemporaryQueue();
@@ -145,7 +148,33 @@
+ ((destination instanceof Queue) ? ((Queue)destination).getQueueName() : ((Topic)destination).getTopicName()));
}
- /**
+ // Stub code for ActivationSpec support that throws appropriate errors
+ private void lookupActivationSpec() {
+ if ( jmsBinding.getActivationSpecName() != null ) {
+ String createMode = jmsBinding.getActivationSpecCreate();
+ if ( JMSBindingConstants.CREATE_ALWAYS.equals(createMode) ) {
+ ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
+ if ( spec != null ) {
+ throw new JMSBindingException("ActivationSpec specifies create mode of \"always\" but resource already exists.");
+ }
+ throw new JMSBindingException("Can not create ActivationSpec");
+ } else if ( JMSBindingConstants.CREATE_IF_NOT_EXIST.equals(createMode)) {
+ ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
+ if ( spec == null ) {
+ throw new JMSBindingException("Can not create ActivationSpec");
+ }
+ } else if ( JMSBindingConstants.CREATE_NEVER.equals(createMode)) {
+ ActivationSpec spec = jmsResourceFactory.lookupActivationSpec(jmsBinding.getActivationSpecName());
+ if ( spec == null )
+ throw new JMSBindingException("ActivationSpec specifies create mode of \"never\" but resource does not exist at jndiName " + jmsBinding.getActivationSpecName());
+
+ }
+
+
+ }
+ }
+
+ /**
* Looks up the Destination Queue for the JMS Binding.
* <p>
* What happens in the look up will depend on the create mode specified for the JMS Binding:
@@ -167,8 +196,8 @@
if (isCallbackService && (jmsBinding.getDestinationName() == null)) {
// if its a callback service returning null indicates to use a temporary queue
return null;
- }
-
+ }
+
Destination destination = jmsResourceFactory.lookupDestination(jmsBinding.getDestinationName());
String qCreateMode = jmsBinding.getDestinationCreate();
@@ -188,7 +217,8 @@
} else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
// In this mode, the queue may nor may not exist. It will be created if it does not exist
- if (destination == null) {
+ // but don't create when using jms:jndi uri format
+ if (destination == null && !"jndi".equals(jmsBinding.getDestinationType())) {
destination = jmsResourceFactory.createDestination(jmsBinding.getDestinationName());
}
@@ -214,10 +244,29 @@
+ " listener");
}
+ // Make sure its the expected type (queue or topic)
+ String type = (destination instanceof Queue) ? JMSBindingConstants.DESTINATION_TYPE_QUEUE : JMSBindingConstants.DESTINATION_TYPE_TOPIC;
+ if ("jndi".equals(jmsBinding.getDestinationType())) {
+ jmsBinding.setDestinationType(type);
+ } else {
+ if (!type.equals(jmsBinding.getDestinationType())) {
+ throw new JMSBindingException("JMS Destination " + jmsBinding.getDestinationName()
+ + " expecting type of "
+ + jmsBinding.getDestinationType()
+ + " but found "
+ + type
+ + " while registering service "
+ + serviceName
+ + " listener");
+ }
+ }
+
return destination;
}
- public String getDestinationName() {
+
+
+ public String getDestinationName() {
try {
if (destination instanceof Queue) {
return ((Queue)destination).getQueueName();
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java
index 149d1c6..aae81fb 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/runtime/OperationSelectorJMSDefaultServiceInterceptor.java
@@ -107,6 +107,12 @@
if (op.getName().equals(operationName)) {
operation = op;
break;
+ } else {
+ String nativeName = jmsBinding.getNativeOperationName(op.getName());
+ if (( nativeName != null ) && ( nativeName.equals(operationName)) ) {
+ operation = op;
+ break;
+ }
}
}
} else if (jmsBinding.getRequestWireFormat() instanceof WireFormatJMSDefault
@@ -121,11 +127,14 @@
if (xmlPayload != null) {
rootElement = domHelper.load(xmlPayload);
- operationFromPayload = rootElement.getLocalName();
- for (Operation op : serviceOperations) {
- if (op.getName().equals(operationFromPayload)) {
- operation = op;
- break;
+ Node firstChild = rootElement.getFirstChild();
+ if (firstChild != null) {
+ operationFromPayload = firstChild.getLocalName();
+ for (Operation op : serviceOperations) {
+ if (op.getName().equals(operationFromPayload)) {
+ operation = op;
+ break;
+ }
}
}
}
@@ -137,11 +146,14 @@
if (bytes != null) {
rootElement = domHelper.load(new String(bytes));
- operationFromPayload = rootElement.getLocalName();
- for (Operation op : serviceOperations) {
- if (op.getName().equals(operationFromPayload)) {
- operation = op;
- break;
+ Node firstChild = rootElement.getFirstChild();
+ if (firstChild != null) {
+ operationFromPayload = firstChild.getLocalName();
+ for (Operation op : serviceOperations) {
+ if (op.getName().equals(operationFromPayload)) {
+ operation = op;
+ break;
+ }
}
}
}
@@ -169,7 +181,7 @@
}
if (operation == null) {
- throw new JMSBindingException("Can't find operation " + (operationName != null ? operationName : ON_MESSAGE_METHOD_NAME));
+ throw new JMSBindingException("Cannot determine service operation");
}
return operation;
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java
index 8b665c9..6c6339c 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/AbstractMessageProcessor.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.binding.jms.provider;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.logging.Logger;
@@ -114,12 +116,35 @@
try {
ObjectMessage message = session.createObjectMessage();
- String causeMsg;
- if (o instanceof RuntimeException) {
- message.setObject(new RuntimeException(o.getMessage()));
+ if (o instanceof RuntimeException || o instanceof Error) {
+ int recursionKlugeDetector = 20;
+ Throwable rootCause = o;
+ Throwable deepRootCause = rootCause.getCause();
+ do {
+ if (rootCause == deepRootCause) {
+ break;
+ } else if (deepRootCause != null) {
+ rootCause = deepRootCause;
+ }
+
+ if (recursionKlugeDetector-- <= 0) {
+ break;
+ }
+ } while (deepRootCause != null);
+
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
+ pw.print("Message = " + o.getMessage());
+ StackTraceElement[] stackElements = o.getStackTrace();
+ for (int i = 0; i < stackElements.length; i++) {
+ pw.print("\t>> \t at ");
+ pw.println(stackElements[i].toString());
+ }
+ pw.flush();
+
+ message.setObject(new RuntimeException( sw.toString() ));
} else {
- // for a checked exception return the checked exception
- message.setObject(o);
+ message.setObject(o);
}
message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
return message;
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
index 8053ba6..4ee0719 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
@@ -106,6 +106,9 @@
// }
}
+ if ( jmsBinding.getActivationSpecName() != null ) {
+ throw new JMSBindingException("Activation spec can not be specified on an SCA reference binding.");
+ }
Invoker invoker = null;
invoker = new RRBJMSBindingInvoker(operation, jmsResourceFactory, endpointReference);
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
index 225d514..8428a45 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
@@ -24,6 +24,7 @@
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
+import org.apache.tuscany.sca.binding.jms.headers.HeaderServiceInterceptor;
import org.apache.tuscany.sca.binding.jms.host.JMSServiceListener;
import org.apache.tuscany.sca.binding.jms.host.JMSServiceListenerDetails;
import org.apache.tuscany.sca.binding.jms.host.JMSServiceListenerFactory;
@@ -90,6 +91,10 @@
this.jmsResourceFactory = jmsResourceFactory;
this.registry = registry;
+ if (jmsBinding.getResponseActivationSpecName() != null && jmsBinding.getResponseActivationSpecName().length() > 0) {
+ throw new JMSBindingException("[BJM30023] response/activationSpec element MUST NOT be present when the binding is being used for an SCA service");
+ }
+
// Set the default destination when using a connection factory.
// If an activation spec is being used, do not set the destination
// because the activation spec provides the destination.
@@ -153,6 +158,7 @@
serviceListener.start();
} catch (Exception e) {
+ if (e instanceof JMSBindingException) throw (JMSBindingException)e;
throw new JMSBindingException("Error starting JMSServiceBinding", e);
}
}
@@ -161,6 +167,7 @@
try {
serviceListener.stop();
} catch (Exception e) {
+ if (e instanceof JMSBindingException) throw (JMSBindingException)e;
throw new JMSBindingException("Error stopping JMSServiceBinding", e);
}
}
@@ -194,6 +201,8 @@
bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT,
new CallbackDestinationInterceptor(endpoint));
+ bindingChain.addInterceptor(Phase.SERVICE_BINDING_WIREFORMAT, new HeaderServiceInterceptor(jmsBinding));
+
// add request wire format
bindingChain.addInterceptor(requestWireFormatProvider.getPhase(),
requestWireFormatProvider.createInterceptor());
@@ -203,6 +212,7 @@
bindingChain.addInterceptor(responseWireFormatProvider.getPhase(),
responseWireFormatProvider.createInterceptor());
}
+
}
public RuntimeComponent getComponent() {
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
index cd53857..5aaeca4 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactory.java
@@ -24,6 +24,7 @@
import javax.jms.JMSException;
import javax.jms.Session;
import javax.naming.NamingException;
+import javax.resource.spi.ActivationSpec;
public interface JMSResourceFactory {
@@ -92,4 +93,7 @@
* shared with other users, or where connections cannot be held across transaction boundaries.
*/
public abstract boolean isConnectionClosedAfterUse();
+
+ public abstract ActivationSpec lookupActivationSpec(
+ String activationSpecName);
}
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
index 6108051..9c1a384 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
@@ -28,6 +28,7 @@
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.resource.spi.ActivationSpec;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
@@ -128,10 +129,14 @@
}
protected void createConnection() throws NamingException, JMSException {
- ConnectionFactory connectionFactory = (ConnectionFactory)jndiLookUp(connectionFactoryName);
- if (connectionFactory == null) {
+ Object o = jndiLookUp(connectionFactoryName);
+ if (o == null) {
throw new JMSBindingException("connection factory not found: " + connectionFactoryName);
}
+ if (!(o instanceof ConnectionFactory)) {
+ throw new JMSBindingException("JNDI resource '" + connectionFactoryName +"' is not a JMS ConnectionFactory");
+ }
+ ConnectionFactory connectionFactory = (ConnectionFactory)o;
connection = connectionFactory.createConnection();
}
@@ -214,6 +219,9 @@
* @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#createDestination(java.lang.String)
*/
public Destination createDestination(String jndiName) throws NamingException {
+ if ( jndiName == null )
+ return null;
+
return lookupDestination("dynamicQueues/" + jndiName);
}
@@ -279,4 +287,14 @@
return false;
}
+ public ActivationSpec lookupActivationSpec(String activationSpecName) {
+ Object o = jndiLookUp(activationSpecName);
+ if ( o == null )
+ return null;
+ else if (o instanceof ActivationSpec)
+ return (ActivationSpec) o;
+
+ throw new JMSBindingException("Incorrect resource type for ActivationSpec: " + o.getClass().getName());
+ }
+
}
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java
index 0f4f88d..098bdde 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/RRBJMSBindingInvoker.java
@@ -136,6 +136,11 @@
qCreateMode = jmsBinding.getDestinationCreate();
}
+ // FIXME: [rfeng] A hack to remove jms:jndi: prefix
+ if (queueName.startsWith("jms:jndi:")) {
+ queueName = queueName.substring("jms:jndi:".length());
+ }
+
Destination dest = jmsResourceFactory.lookupDestination(queueName);
if (qCreateMode.equals(JMSBindingConstants.CREATE_ALWAYS)) {
@@ -153,7 +158,8 @@
} else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
// In this mode, the queue may nor may not exist. It will be created if it does not exist
- if (dest == null) {
+ // but don't create when using jms:jndi uri format
+ if (dest == null && !"jndi".equals(jmsBinding.getDestinationType())) {
dest = jmsResourceFactory.createDestination(queueName);
}
@@ -246,7 +252,9 @@
protected Destination getReplyToDestination(Session session) throws JMSException, JMSBindingException, NamingException {
Destination replyToDest;
- if (operation.isNonBlocking()) {
+ // [rfeng] If the oneway operation is part of bi-directional interface, the JMSReplyTo should be set
+ if (operation.isNonBlocking() && endpointReference.getComponentReferenceInterfaceContract()
+ .getCallbackInterface() == null) {
replyToDest = null;
} else {
if (bindingReplyDest != null) {
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
index 9668333..3ed8021 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportReferenceInterceptor.java
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.sca.binding.jms.transport;
+import javax.jms.DeliveryMode;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@@ -25,6 +26,7 @@
import javax.naming.NamingException;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
@@ -41,15 +43,13 @@
*/
public class TransportReferenceInterceptor implements Interceptor {
- private Invoker next;
- private RuntimeEndpointReference runtimeWire;
+ private Invoker next;
private JMSResourceFactory jmsResourceFactory;
private JMSBinding jmsBinding;
public TransportReferenceInterceptor(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeEndpointReference runtimeWire) {
super();
- this.jmsBinding = jmsBinding;
- this.runtimeWire = runtimeWire;
+ this.jmsBinding = jmsBinding;
this.jmsResourceFactory = jmsResourceFactory;
}
@@ -59,7 +59,8 @@
// get the jms context
JMSBindingContext context = msg.getBindingContext();
- if (context.getReplyToDestination() == null) {
+ // [rfeng] For oneway operation as part of the bi-directional interface, the JMSReplyTo is present
+ if (context.getReplyToDestination() == null || msg.getOperation().isNonBlocking()) {
responseMsg.setBody(null);
} else {
responseMsg = invokeResponse(msg);
@@ -78,20 +79,20 @@
// Set JMS header attributes in producer, not message.
String opName = msg.getOperation().getName();
- if (jmsBinding.getOperationJMSTimeToLive(msg.getOperation().getName()) != null) {
- producer.setTimeToLive(jmsBinding.getOperationJMSTimeToLive(msg.getOperation().getName()));
- }
- Integer priority = jmsBinding.getOperationJMSPriority( opName );
+ if (jmsBinding.getEffectiveJMSTimeToLive(opName) != null) {
+ producer.setTimeToLive(jmsBinding.getEffectiveJMSTimeToLive(msg.getOperation().getName()).longValue());
+ }
+
+ Integer priority = jmsBinding.getEffectiveJMSPriority(opName);
if (priority != null) {
- producer.setPriority(priority.intValue());
+ producer.setPriority(priority.intValue());
}
- Boolean deliveryModePersistent = jmsBinding.getOperationJMSDeliveryMode(opName);
+
+ Boolean deliveryModePersistent = jmsBinding.getEffectiveJMSDeliveryMode(opName);
if (deliveryModePersistent != null) {
- if (deliveryModePersistent.booleanValue())
- producer.setDeliveryMode(javax.jms.DeliveryMode.PERSISTENT);
- else
- producer.setDeliveryMode(javax.jms.DeliveryMode.NON_PERSISTENT);
- }
+ producer.setDeliveryMode( deliveryModePersistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+ }
+
try {
producer.send((javax.jms.Message)msg.getBody());
@@ -111,10 +112,20 @@
javax.jms.Message requestMessage = (javax.jms.Message)msg.getBody();
- String msgSelector = "JMSCorrelationID = '" +
- requestMessage.getJMSMessageID() +
- "'";
- MessageConsumer consumer = session.createConsumer(context.getReplyToDestination(), msgSelector);
+ String msgSelector = null;
+ String correlationScheme = jmsBinding.getCorrelationScheme();
+ if (correlationScheme == null || JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
+ msgSelector = "JMSCorrelationID = '" + requestMessage.getJMSMessageID() + "'";
+ } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
+ msgSelector = "JMSCorrelationID = '" + requestMessage.getJMSCorrelationID() + "'";
+ }
+
+ MessageConsumer consumer;
+ if (msgSelector != null) {
+ consumer = session.createConsumer(context.getReplyToDestination(), msgSelector);
+ } else {
+ consumer = session.createConsumer(context.getReplyToDestination());
+ }
javax.jms.Message replyMsg;
try {
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
index 1a175ce..d371bbb 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/transport/TransportServiceInterceptor.java
@@ -21,6 +21,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
@@ -53,11 +54,9 @@
public class TransportServiceInterceptor implements Interceptor {
private static final Logger logger = Logger.getLogger(TransportServiceInterceptor.class.getName());
- private Invoker next;
- private RuntimeEndpoint endpoint;
+ private Invoker next;
private JMSResourceFactory jmsResourceFactory;
- private JMSBinding jmsBinding;
- private JMSMessageProcessor requestMessageProcessor;
+ private JMSBinding jmsBinding;
private JMSMessageProcessor responseMessageProcessor;
private RuntimeComponentService service;
private String correlationScheme;
@@ -66,10 +65,8 @@
public TransportServiceInterceptor(ExtensionPointRegistry registry, JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeEndpoint endpoint) {
super();
- this.jmsBinding = jmsBinding;
- this.endpoint = endpoint;
- this.jmsResourceFactory = jmsResourceFactory;
- this.requestMessageProcessor = JMSMessageProcessorUtil.getRequestMessageProcessor(registry, jmsBinding);
+ this.jmsBinding = jmsBinding;
+ this.jmsResourceFactory = jmsResourceFactory;
this.responseMessageProcessor = JMSMessageProcessorUtil.getResponseMessageProcessor(registry, jmsBinding);
this.service = (RuntimeComponentService)endpoint.getService();
this.correlationScheme = jmsBinding.getCorrelationScheme();
@@ -99,9 +96,7 @@
}
public Message invokeRequest(Message msg) {
-// try {
- JMSBindingContext context = msg.getBindingContext();
- javax.jms.Message requestJMSMsg = context.getJmsMsg();
+// try {
EndpointReference from = assemblyFactory.createEndpointReference();
Endpoint fromEndpoint = assemblyFactory.createEndpoint();
@@ -120,6 +115,7 @@
}
public Message invokeResponse(Message msg) {
+ JMSBindingContext context = msg.getBindingContext();
try {
//if operation is oneway, return back.
@@ -128,7 +124,6 @@
return msg;
}
- JMSBindingContext context = msg.getBindingContext();
Session session = context.getJmsResponseSession();
javax.jms.Message requestJMSMsg = context.getJmsMsg();
javax.jms.Message responseJMSMsg = msg.getBody();
@@ -151,9 +146,25 @@
}
return msg;
}
-
- responseJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
- responseJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
+
+ if ((msg.getOperation() != null)) {
+ String operationName = msg.getOperation().getName();
+ if (jmsBinding.getEffectiveJMSPriority(operationName) != null) {
+ responseJMSMsg.setJMSPriority(jmsBinding.getEffectiveJMSPriority(operationName));
+ }
+
+ if ( jmsBinding.getEffectiveJMSType(operationName) != null) {
+ responseJMSMsg.setJMSType(jmsBinding.getEffectiveJMSType(operationName));
+ }
+
+ if ((jmsBinding.getEffectiveJMSDeliveryMode(operationName) != null)) {
+ responseJMSMsg.setJMSDeliveryMode(jmsBinding.getEffectiveJMSDeliveryMode(operationName) ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+ }
+
+ if ((jmsBinding.getEffectiveJMSTimeToLive(operationName) != null)) {
+ responseJMSMsg.setJMSExpiration(jmsBinding.getEffectiveJMSTimeToLive(operationName).longValue());
+ }
+ }
if (correlationScheme == null ||
JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
@@ -169,16 +180,19 @@
producer.setDeliveryMode(deliveryMode);
int deliveryPriority = requestJMSMsg.getJMSPriority();
producer.setPriority(deliveryPriority);
+ long timeToLive = requestJMSMsg.getJMSExpiration();
+ producer.setTimeToLive(timeToLive);
producer.send((javax.jms.Message)msg.getBody());
producer.close();
- context.closeJmsResponseSession();
return msg;
} catch (JMSException e) {
throw new JMSBindingException(e);
+ } finally {
+ context.closeJmsResponseSession();
}
}
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
index 2245f61..0678f1e 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wire/CallbackDestinationInterceptor.java
@@ -18,11 +18,15 @@
*/
package org.apache.tuscany.sca.binding.jms.wire;
+import java.util.List;
+
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.Topic;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.binding.jms.JMSBinding;
import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
import org.apache.tuscany.sca.binding.jms.JMSBindingException;
import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
@@ -35,10 +39,12 @@
public class CallbackDestinationInterceptor implements Interceptor {
private Invoker next;
private RuntimeComponentService service;
+ private RuntimeEndpoint endpoint;
public CallbackDestinationInterceptor(RuntimeEndpoint endpoint) {
super();
this.service = (RuntimeComponentService) endpoint.getService();
+ this.endpoint = endpoint;
}
public Invoker getNext() {
@@ -57,27 +63,36 @@
try {
// get the jms context
JMSBindingContext context = msg.getBindingContext();
- javax.jms.Message jmsMsg = context.getJmsMsg();
-
- //ReferenceParameters parameters = msg.getFrom().getReferenceParameters(); TODO: 2.x migration, are these needed?
-
+ javax.jms.Message jmsMsg = context.getJmsMsg();
+
+
if (service.getInterfaceContract().getCallbackInterface() != null) {
String callbackdestName = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY);
- if (callbackdestName == null && msg.getOperation().isNonBlocking()) {
- // if the request has a replyTo but this service operation is oneway but the service uses callbacks
- // then use the replyTo as the callback destination
- Destination replyTo = jmsMsg.getJMSReplyTo();
- if (replyTo != null) {
- callbackdestName = (replyTo instanceof Queue) ? ((Queue) replyTo).getQueueName() : ((Topic) replyTo).getTopicName();
+ if (( callbackdestName == null) && ( jmsMsg.getJMSReplyTo() != null ) && msg.getOperation().isNonBlocking() ) {
+ Destination replyTo = jmsMsg.getJMSReplyTo();
+ if (replyTo != null) {
+ callbackdestName = (replyTo instanceof Queue) ? ((Queue) replyTo).getQueueName() : ((Topic) replyTo).getTopicName();
+ }
+ } else {
+ if (callbackdestName != null) {
+ if (!callbackdestName.startsWith("jms:jndi:")) {
+ throw new JMSBindingException("message property " + JMSBindingConstants.CALLBACK_Q_PROPERTY + " does not start with 'jms:jndi:' found: " + callbackdestName);
+ } else {
+ callbackdestName = callbackdestName.substring(9);
+ }
}
}
-
+
if (callbackdestName != null) {
- // append "jms:" to make it an absolute uri so the invoker can determine it came in on the request
- // as otherwise the invoker should use the uri from the service callback binding
-// parameters.setCallbackReference(new EndpointReferenceImpl("jms:" + callbackdestName));
- }
+ List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
+ for (EndpointReference ref : refs ) {
+ if (ref.getBinding() instanceof JMSBinding ) {
+ JMSBinding callbackBinding = (JMSBinding) ref.getBinding();
+ callbackBinding.setDestinationName(callbackdestName);
+ }
+ }
+ }
String callbackID = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
if (callbackID != null) {
diff --git a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/runtime/WireFormatJMSDefaultServiceInterceptor.java b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/runtime/WireFormatJMSDefaultServiceInterceptor.java
index 731de78..da6f283 100644
--- a/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/runtime/WireFormatJMSDefaultServiceInterceptor.java
+++ b/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/jmsdefault/runtime/WireFormatJMSDefaultServiceInterceptor.java
@@ -22,9 +22,12 @@
import java.util.List;
import javax.jms.BytesMessage;
+import javax.jms.JMSException;
import javax.jms.Session;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
+import org.apache.tuscany.sca.binding.jms.JMSBindingConstants;
+import org.apache.tuscany.sca.binding.jms.JMSBindingException;
import org.apache.tuscany.sca.binding.jms.context.JMSBindingContext;
import org.apache.tuscany.sca.binding.jms.provider.DefaultMessageProcessor;
import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
@@ -160,6 +163,15 @@
}
}
+
+ try {
+ responseJMSMsg.setStringProperty(JMSBindingConstants.DEFAULT_OPERATION_PROP_NAME, msg.getOperation().getName());
+ } catch (JMSException e) {
+ // Not sure what to do at this point.. it doesn't make sense to create a fault message.
+ // Throwing a runtime exception for now.
+ throw new JMSBindingException(e);
+ }
+
msg.setBody(responseJMSMsg);
return msg;
diff --git a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
index 7480d8f..4539ad2 100644
--- a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
+++ b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBinding.java
@@ -88,14 +88,14 @@
private Map<String, BindingProperty> connectionFactoryProperties = new HashMap<String, BindingProperty>();
private String activationSpecName = null;
- private String activationSpecCreate = null;
+ private String activationSpecCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
private Map<String, BindingProperty> activationSpecProperties = new HashMap<String, BindingProperty>();
private String resourceAdapterName;;
private Map<String, BindingProperty> resourceAdapterProperties = new HashMap<String, BindingProperty>();
private String responseActivationSpecName = null;
- private String responseActivationSpecCreate = null;
+ private String responseActivationSpecCreate = JMSBindingConstants.CREATE_IF_NOT_EXIST;
private Map<String, BindingProperty> responseActivationSpecProperties = new HashMap<String, BindingProperty>();
private String responseDestinationName = null;
@@ -122,11 +122,7 @@
private boolean containsHeaders = false;
private String replyTo;
- private String jmsType;
private String jmsCorrelationId;
- private Boolean deliveryModePersistent;
- private Long timeToLive;
- private Integer jmsPriority;
private Map<String, Object> properties = new HashMap<String, Object>();
private Map<String, Map<String, Object>> operationProperties = new HashMap<String, Map<String,Object>>();
@@ -138,7 +134,8 @@
private Map<String, Integer> operationJMSPriorities = new HashMap<String, Integer>();
private Map<String, Map<String, BindingProperty>> operationPropertiesProperties = new HashMap<String, Map<String,BindingProperty>>();
- private String jmsSelector;
+ private String jmsSelector = null;
+ private String uriJmsSelector = null;
private QName requestConnectionName;
private QName responseConnectionName;
private QName operationPropertiesName;
@@ -150,6 +147,22 @@
private WireFormat responseWireFormat;
private OperationSelector operationSelector;
private ExtensionType extensionType;
+ private String jmsURI;
+
+ private String uriType;
+ private Boolean uriDeliveryMode;
+ private Integer uriJMSPriority;
+ private Long uriJMSTimeToLive;
+
+ private String headerType;
+ private Boolean headerDeliveryMode;
+ private Integer headerPriority;
+ private Long headerTimeToLive;
+
+ private final Integer defaultPriority = Integer.valueOf(4);
+ private final Boolean defaultDeliveryMode = true;
+ private final Long defaultJMSTimeToLive =Long.valueOf(0);
+ private boolean isDestinationSpecified = false;
public JMSBinding() {
super();
@@ -467,14 +480,74 @@
this.replyTo = replyTo;
}
- public String getJMSType() {
- return jmsType;
+ // getEffective...() will return values based on the following priority
+ // 1. The value specified in the URI attribute
+ // 2. The value specified in the operationProperties/headers
+ // 3. The value specified in the headers element
+ // 4. The default value from the headers element
+ public String getEffectiveJMSType(String opName) {
+ if ( getJMSURIType() != null ) return getJMSURIType();
+ else if ( getOperationJMSType(opName) != null ) return getOperationJMSType(opName);
+ else if ( getJMSHeaderType() != null ) return getJMSHeaderType();
+ else return null;
}
- public void setJMSType(String jmsType) {
- setHeaders( true );
- this.jmsType = jmsType;
+
+ public Boolean getEffectiveJMSDeliveryMode(String opName) {
+ if ( getURIJMSDeliveryMode() != null ) return getURIJMSDeliveryMode();
+ else if ( getOperationJMSDeliveryMode(opName) != null) return getOperationJMSDeliveryMode(opName);
+ else if ( getHeaderJMSDeliveryMode() != null) return getHeaderJMSDeliveryMode();
+ else return getDefaultDeliveryMode();
+ }
+
+ public Long getEffectiveJMSTimeToLive(String opName) {
+ if ( getURIJMSTimeToLive() != null ) return getURIJMSTimeToLive();
+ else if ( getOperationJMSTimeToLive(opName) != null) return getOperationJMSTimeToLive(opName);
+ else if ( getHeaderJMSTimeToLive() != null) return getHeaderJMSTimeToLive();
+ else return getDefaultJMSTimeToLive();
}
+ public Integer getEffectiveJMSPriority(String operationName) {
+ if ( getURIJMSPriority() != null ) return getURIJMSPriority();
+ else if ( getOperationJMSPriority(operationName)!= null) return getOperationJMSPriority(operationName);
+ else if ( getJMSHeaderPriority() != null ) return getJMSHeaderPriority();
+ else return getDefaultJMSPriority();
+ }
+
+
+ private Long getHeaderJMSTimeToLive() {
+ return this.headerTimeToLive;
+ }
+
+ private Long getDefaultJMSTimeToLive() {
+ return this.defaultJMSTimeToLive;
+ }
+
+ private Boolean getDefaultDeliveryMode() {
+ return this.defaultDeliveryMode;
+ }
+
+ private Boolean getHeaderJMSDeliveryMode() {
+ return headerDeliveryMode;
+ }
+
+ private Boolean getURIJMSDeliveryMode() {
+ return this.uriDeliveryMode;
+ }
+
+ public String getJMSURIType() {
+ return uriType;
+ }
+ public void setJMSURIType(String type) {
+ this.uriType = type;
+ }
+ public String getJMSHeaderType() {
+ return headerType;
+ }
+
+ public void setJMSHeaderType(String type) {
+ this.headerType = type;
+ }
+
public String getJMSCorrelationId() {
return jmsCorrelationId;
}
@@ -484,32 +557,6 @@
this.jmsCorrelationId = jmsCorrelationId;
}
- public Boolean isdeliveryModePersistent() {
- return deliveryModePersistent;
- }
- public void setJMSDeliveryMode(boolean persistent) {
- setHeaders( true );
- this.deliveryModePersistent = Boolean.valueOf(persistent);
- }
-
- public Integer getJMSPriority() {
- return jmsPriority;
- }
-
- public void setJMSPriority(int jmsPriority) {
- setHeaders( true );
- this.jmsPriority = Integer.valueOf(jmsPriority);
- }
-
- public Long getJMSTimeToLive() {
- return timeToLive;
- }
-
- public void setJMSTimeToLive(long timeToLive) {
- setHeaders( true );
- this.timeToLive = Long.valueOf(timeToLive);
- }
-
public Set<String> getPropertyNames() {
return properties.keySet();
}
@@ -612,6 +659,10 @@
public void setNativeOperationName(String opName, String nativeOpName) {
this.nativeOperationNames .put(opName, nativeOpName);
}
+
+ public Map<String, String> getNativeOperationNames() {
+ return nativeOperationNames;
+ }
public String getOperationJMSType(String opName) {
if (operationPropertiesBinding != null && operationPropertiesBinding.getOperationJMSType(opName) != null) {
@@ -620,7 +671,7 @@
if (operationJMSTypes.containsKey(opName)) {
return operationJMSTypes.get(opName);
} else {
- return jmsType;
+ return null;
}
}
}
@@ -652,13 +703,13 @@
if (operationPropertiesBinding.getOperationJMSDeliveryMode(opName) != null) {
return operationPropertiesBinding.getOperationJMSDeliveryMode(opName);
} else {
- return deliveryModePersistent;
+ return null;
}
} else {
if (operationJMSDeliveryModes.containsKey(opName)) {
return operationJMSDeliveryModes.get(opName);
} else {
- return deliveryModePersistent;
+ return null;
}
}
}
@@ -671,13 +722,13 @@
if (operationPropertiesBinding.getOperationJMSTimeToLive(opName) != null) {
return operationPropertiesBinding.getOperationJMSTimeToLive(opName);
} else {
- return timeToLive;
+ return null;
}
} else {
if (operationJMSTimeToLives.containsKey(opName)) {
return operationJMSTimeToLives.get(opName);
} else {
- return timeToLive;
+ return null;
}
}
}
@@ -690,13 +741,13 @@
if (operationPropertiesBinding.getOperationJMSPriority(opName) != null) {
return operationPropertiesBinding.getOperationJMSPriority(opName);
} else {
- return jmsPriority;
+ return null;
}
} else {
if (operationJMSPriorities.containsKey(opName)) {
return operationJMSPriorities.get(opName);
} else {
- return jmsPriority;
+ return null;
}
}
}
@@ -705,8 +756,12 @@
}
public String getJMSSelector() {
- return jmsSelector;
+ if ( this.uriJmsSelector != null )
+ return this.uriJmsSelector;
+ else
+ return jmsSelector;
}
+
public void setJMSSelector(String jmsSelector) {
this.jmsSelector = jmsSelector;
}
@@ -971,4 +1026,69 @@
public void setExtensionType(ExtensionType intentAttachPointType) {
this.extensionType = intentAttachPointType;
}
+
+ public String getJMSURI() {
+ return jmsURI;
+ }
+ public void setJMSURI(String jmsURI) {
+ this.jmsURI = jmsURI;
+ }
+
+
+ public void setURIJMSDeliveryMode(boolean equals) {
+ this.uriDeliveryMode = Boolean.valueOf(equals);
+ }
+
+ public Integer getURIJMSPriority() {
+ return this.uriJMSPriority;
+ }
+
+ public void setURIJMSPriority(int parseInt) {
+ this.uriJMSPriority = Integer.valueOf(parseInt);
+ }
+
+ public Long getURIJMSTimeToLive() {
+ return this.uriJMSTimeToLive;
+ }
+ public void setURIJMSTimeToLive(long parseLong) {
+ this.uriJMSTimeToLive = Long.valueOf(parseLong);
+ }
+
+ public Boolean isHeaderDeliveryModePersistent() {
+ return this.headerDeliveryMode;
+ }
+ public void setJMSHeaderDeliveryMode(boolean b) {
+ this.headerDeliveryMode = Boolean.valueOf(b);
+ }
+
+ public Long getJMSHeaderTimeToLive() {
+ return this.headerTimeToLive;
+ }
+ public void setJMSHeaderTimeToLive(long parseLong) {
+ this.headerTimeToLive = Long.valueOf(parseLong);
+ }
+
+ public Integer getJMSHeaderPriority() {
+ return this.headerPriority;
+ }
+ public void setJMSHeaderPriority(int p) {
+ this.headerPriority = Integer.valueOf(p);
+ }
+
+ public Integer getDefaultJMSPriority() {
+ return this.defaultPriority;
+ }
+
+ public void setIsDestinationSpecified(boolean b) {
+ this.isDestinationSpecified = b;
+ }
+
+ public boolean isDestinationSpecified() {
+ return this.isDestinationSpecified ;
+ }
+
+ public void setURIJMSSelector(String selector) {
+ this.uriJmsSelector = selector;
+ }
+
}
diff --git a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java
index 80bc61b..c55fa7f 100644
--- a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java
+++ b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingConstants.java
@@ -36,8 +36,8 @@
// model and for setting up defaults
String BINDING_JMS = "binding.jms";
QName BINDING_JMS_QNAME = new QName(Constants.SCA11_NS, BINDING_JMS);
- String CORRELATE_MSG_ID = "requestmsgidtocorrelid";
- String CORRELATE_CORRELATION_ID = "requestcorrelidtocorrelid";
+ String CORRELATE_MSG_ID = "messageID";
+ String CORRELATE_CORRELATION_ID = "correlationID";
String CORRELATE_NONE = "none";
List<String> VALID_CORRELATION_SCHEMES =
Arrays.asList(new String[] {CORRELATE_MSG_ID, CORRELATE_CORRELATION_ID, CORRELATE_NONE});
@@ -47,7 +47,7 @@
Arrays.asList(new String[] {DESTINATION_TYPE_QUEUE, DESTINATION_TYPE_TOPIC});
String CREATE_ALWAYS = "always";
String CREATE_NEVER = "never";
- String CREATE_IF_NOT_EXIST = "ifnotexist";
+ String CREATE_IF_NOT_EXIST = "ifNotExist";
String DEFAULT_CONTEXT_FACTORY_NAME = "org.apache.activemq.jndi.ActiveMQInitialContextFactory";
String DEFAULT_JNDI_URL = "tcp://localhost:61616";
int DEFAULT_TIME_TO_LIVE = 20000; // in milliseconds
@@ -65,7 +65,7 @@
String FAULT_PROPERTY = "org_apache_tuscany_sca_fault";
String CALLBACK_ID_PROPERTY = "CallbackID";
- String CALLBACK_Q_PROPERTY = "scaCallbackQueue";
+ String CALLBACK_Q_PROPERTY = "scaCallbackDestination";
String CONVERSATION_ID_PROPERTY = "scaConversationId";
// XML element and attribute names
diff --git a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
index 933ef33..97dfd5f 100644
--- a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
+++ b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessor.java
@@ -23,6 +23,7 @@
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -34,6 +35,7 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
+import org.apache.tuscany.sca.assembly.Base;
import org.apache.tuscany.sca.assembly.ConfiguredOperation;
import org.apache.tuscany.sca.assembly.OperationSelector;
import org.apache.tuscany.sca.assembly.OperationsConfigurator;
@@ -46,6 +48,7 @@
import org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSObject;
import org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSText;
import org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSTextXML;
+import org.apache.tuscany.sca.common.xml.stax.StAXHelper;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
@@ -113,7 +116,7 @@
* <property name="NMTOKEN" type="NMTOKEN">*
* </resourceAdapter>?
*
- * <operationProperties name="string" nativeOperation="string"?>
+ * <operationProperties name="string" selectedOperation="string"?>
* <property name="NMTOKEN" type="NMTOKEN">*
* <headers type="string"?
* deliveryMode="string"?
@@ -205,10 +208,10 @@
}
// Read correlation scheme
- String correlationScheme = reader.getAttributeValue(null, "correlationScheme");
- if (correlationScheme != null && correlationScheme.length() > 0) {
- if (JMSBindingConstants.VALID_CORRELATION_SCHEMES.contains(correlationScheme.toLowerCase())) {
- jmsBinding.setCorrelationScheme(correlationScheme);
+ QName correlationScheme = StAXHelper.getAttributeAsQName(reader, "correlationScheme");
+ if (correlationScheme != null) {
+ if (Base.SCA11_NS.equals(correlationScheme.getNamespaceURI()) && JMSBindingConstants.VALID_CORRELATION_SCHEMES.contains(correlationScheme.getLocalPart())) {
+ jmsBinding.setCorrelationScheme(correlationScheme.getLocalPart());
} else {
error(monitor, "InvalidCorrelationScheme", reader, correlationScheme);
}
@@ -356,26 +359,49 @@
}
protected void parseURI(String uri, JMSBinding jmsBinding, Monitor monitor) {
- if (!uri.startsWith("jms:")) {
- error(monitor, "MustStartWithSchema", jmsBinding, uri);
- return;
+ if (!(uri.startsWith("jms:jndi:") || uri.startsWith("jms:queue:") || uri.startsWith("jms:topic:"))) {
+ error(monitor, "MustStartWithSchema", jmsBinding, uri);
+ return;
}
int i = uri.indexOf('?');
if (i >= 0) {
StringTokenizer st = new StringTokenizer(uri.substring(i+1),"&");
while (st.hasMoreTokens()) {
String s = st.nextToken();
- if (s.startsWith("connectionFactoryName=")) {
- jmsBinding.setConnectionFactoryName(s.substring(22));
- } else {
- error(monitor, "UnknownTokenInURI", jmsBinding, s, uri);
- return;
- }
- }
- jmsBinding.setDestinationName(uri.substring(4, i));
+ if (s.startsWith("jndiConnectionFactoryName=")) {
+ jmsBinding.setConnectionFactoryName(s.substring(26));
+ } else if (s.startsWith("deliveryMode=")) {
+ jmsBinding.setURIJMSDeliveryMode("persistent".equals(s.substring(13)));
+ } else if (s.startsWith("priority=")) {
+ jmsBinding.setURIJMSPriority(Integer.parseInt(s.substring(9)));
+ } else if (s.startsWith("timeToLive=")) {
+ jmsBinding.setURIJMSTimeToLive(Long.parseLong(s.substring(11)));
+ } else if (s.startsWith("selector='")) {
+ String selector = s.substring(10);
+ if (selector.startsWith("\"") || selector.startsWith("'")) {
+ selector = selector.substring(1, selector.length());
+ }
+ if (selector.endsWith("\"") || selector.endsWith("'")) {
+ selector = selector.substring(0, selector.length() - 1);
+ }
+ jmsBinding.setURIJMSSelector(selector);
+ } else if (s.startsWith("type")) {
+ String type = s.substring(5);
+ jmsBinding.setJMSURIType(type);
+ } else {
+ error(monitor, "UnknownTokenInURI", jmsBinding, s, uri);
+ return;
+ }
+ }
+ int j=uri.indexOf(':', 4);
+ jmsBinding.setDestinationName(uri.substring(j+1, i));
+ jmsBinding.setDestinationType(uri.substring(4, j));
} else {
- jmsBinding.setDestinationName(uri.substring(4));
+ int j=uri.indexOf(':', 4);
+ jmsBinding.setDestinationName(uri.substring(j+1));
+ jmsBinding.setDestinationType(uri.substring(4, j));
}
+ jmsBinding.setJMSURI(uri);
}
public void resolve(JMSBinding model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
@@ -402,6 +428,7 @@
}
private void parseDestination(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
+ jmsBinding.setIsDestinationSpecified(true);
String name = getURIString(reader, "jndiName");
if (name != null && name.length() > 0) {
jmsBinding.setDestinationName(name);
@@ -420,10 +447,22 @@
String create = reader.getAttributeValue(null, "create");
if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
jmsBinding.setDestinationCreate(create);
}
jmsBinding.getDestinationProperties().putAll(parseBindingProperties(reader, monitor));
+
+ if (jmsBinding.getDestinationCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getDestinationCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
+ }
}
private void parseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
@@ -433,16 +472,48 @@
} else {
error(monitor, "MissingConnectionFactoryName", reader);
}
+
+ String create = reader.getAttributeValue(null, "create");
+ if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
+ jmsBinding.setConnectionFactoryCreate(create);
+ }
+ if (jmsBinding.getConnectionFactoryCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getConnectionFactoryCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
+ }
+
jmsBinding.getConnectionFactoryProperties().putAll(parseBindingProperties(reader, monitor));
}
private void parseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
- String name = reader.getAttributeValue(null, "name");
+ String name = reader.getAttributeValue(null, "jndiName");
if (name != null && name.length() > 0) {
jmsBinding.setActivationSpecName(name);
- } else {
- warning(monitor, "MissingActivationSpecName", reader);
}
+
+ String create = reader.getAttributeValue(null, "create");
+ if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
+ jmsBinding.setActivationSpecCreate(create);
+ }
+ if (jmsBinding.getActivationSpecCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getActivationSpecCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
+ }
+
jmsBinding.getActivationSpecProperties().putAll(parseBindingProperties(reader, monitor));
}
@@ -466,32 +537,84 @@
String create = reader.getAttributeValue(null, "create");
if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
jmsBinding.setResponseDestinationCreate(create);
}
+ if (jmsBinding.getResponseDestinationCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getResponseDestinationCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
+ }
jmsBinding.getResponseDestinationProperties().putAll(parseBindingProperties(reader, monitor));
}
- private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
+ private void parseResponseConnectionFactory(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
String name = getURIString(reader, "jndiName");
if (name != null && name.length() > 0) {
jmsBinding.setResponseConnectionFactoryName(name);
} else {
warning(monitor, "MissingResponseConnectionFactory", reader);
}
+ String create = reader.getAttributeValue(null, "create");
+ if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
+ jmsBinding.setResponseConnectionFactoryCreate(create);
+ }
+ if (jmsBinding.getResponseConnectionFactoryCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getResponseConnectionFactoryCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
+ }
jmsBinding.getResponseConnectionFactoryProperties().putAll(parseBindingProperties(reader, monitor));
}
private void parseResponseActivationSpec(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
- String name = reader.getAttributeValue(null, "name");
+ String name = reader.getAttributeValue(null, "jndiName");
if (name != null && name.length() > 0) {
jmsBinding.setResponseActivationSpecName(name);
- } else {
- warning(monitor, "MissingResponseActivationSpec", reader);
+ }
+ String create = reader.getAttributeValue(null, "create");
+ if (create != null && create.length() > 0) {
+ validateCreate(create, reader, monitor);
+ jmsBinding.setResponseActivationSpecCreate(create);
+ }
+ if (jmsBinding.getResponseActivationSpecCreate().equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_IF_NOT_EXIST", reader);
+ }
+ }
+ if (jmsBinding.getResponseActivationSpecCreate().equals(JMSBindingConstants.CREATE_NEVER)) {
+ if (name == null || name.length() < 1) {
+ error(monitor, "MissingNameForCREATE_NEVER", reader);
+ }
}
jmsBinding.getResponseActivationSpecProperties().putAll(parseBindingProperties(reader, monitor));
}
+ private void validateCreate(String create, XMLStreamReader reader, Monitor monitor) {
+ if (JMSBindingConstants.CREATE_ALWAYS.equals(create)) {
+ return;
+ }
+ if (JMSBindingConstants.CREATE_NEVER.equals(create)) {
+ return;
+ }
+ if (JMSBindingConstants.CREATE_IF_NOT_EXIST.equals(create)) {
+ return;
+ }
+ error(monitor, "InvalidCreate", reader, create);
+ }
+
private void parseResponse(XMLStreamReader reader, JMSBinding jmsBinding, ProcessorContext context) throws ContributionReadException, XMLStreamException {
// Read sub-elements of response
Monitor monitor = context.getMonitor();
@@ -555,15 +678,15 @@
private void parseHeaders(XMLStreamReader reader, JMSBinding jmsBinding, Monitor monitor) throws XMLStreamException {
String jmsType = reader.getAttributeValue(null, "type");
if (jmsType != null && jmsType.length() > 0) {
- jmsBinding.setJMSType(jmsType);
+ jmsBinding.setJMSHeaderType(jmsType);
}
String jmsDeliveryMode = reader.getAttributeValue(null, "deliveryMode");
if (jmsDeliveryMode != null && jmsDeliveryMode.length() > 0) {
if ("persistent".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setJMSDeliveryMode(true);
+ jmsBinding.setJMSHeaderDeliveryMode(true);
} else if ("nonpersistent".equalsIgnoreCase(jmsDeliveryMode)) {
- jmsBinding.setJMSDeliveryMode(false);
+ jmsBinding.setJMSHeaderDeliveryMode(false);
} else {
error(monitor, "InvalidJMSDeliveryMode", jmsBinding, jmsDeliveryMode);
}
@@ -571,7 +694,7 @@
String jmsTimeToLive = reader.getAttributeValue(null, "timeToLive");
if (jmsTimeToLive != null && jmsTimeToLive.length() > 0) {
- jmsBinding.setJMSTimeToLive(Long.parseLong(jmsTimeToLive));
+ jmsBinding.setJMSHeaderTimeToLive(Long.parseLong(jmsTimeToLive));
}
String jmsPriority = reader.getAttributeValue(null, "priority");
@@ -579,7 +702,7 @@
try {
int p = Integer.parseInt(jmsPriority);
if (p >= 0 && p <= 9) {
- jmsBinding.setJMSPriority(p);
+ jmsBinding.setJMSHeaderPriority(p);
} else {
warning(monitor, "InvalidJMSPriority", jmsBinding, jmsPriority);
}
@@ -609,9 +732,12 @@
private void parseProperty(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
jmsBinding.setHeaders( true );
String name = reader.getAttributeValue(null, "name");
- String type = reader.getAttributeValue(null, "type");
+ QName typeName = StAXHelper.getAttributeAsQName(reader, "type");
+ String type = typeName == null ? null : typeName.getLocalPart();
+
if (name != null && name.length() > 0) {
Object value = reader.getElementText();
+
if ("boolean".equalsIgnoreCase(type)) {
value = Boolean.parseBoolean((String)value);
} else if ("byte".equalsIgnoreCase(type)) {
@@ -634,7 +760,7 @@
}
/**
- * <operationProperties name="string" nativeOperation="string"?>
+ * <operationProperties name="string" selectedOperation="string"?>
* <property name="NMTOKEN" type="NMTOKEN"?>*
* <headers JMSType="string"?
* JMSCorrelationID="string"?
@@ -653,12 +779,12 @@
String opName = reader.getAttributeValue(null, "name");
if (opName == null || opName.length() < 1) {
- warning(monitor, "MissingJMSOperationPropertyName", jmsBinding);
+ error(monitor, "MissingJMSOperationPropertyName", jmsBinding);
return;
}
// Since nativeOpName, headers, and property elements are optional, must add opName.
jmsBinding.addOperationName(opName);
- String nativeOpName = reader.getAttributeValue(null, "nativeOperation"); // optional
+ String nativeOpName = reader.getAttributeValue(null, "selectedOperation"); // optional
if (nativeOpName != null && nativeOpName.length() > 0) {
jmsBinding.setNativeOperationName(opName, nativeOpName);
}
@@ -749,7 +875,8 @@
private void parseOperationPropertyProperties(XMLStreamReader reader, JMSBinding jmsBinding, String opName) throws XMLStreamException {
String propName = reader.getAttributeValue(null, "name");
- String type = reader.getAttributeValue(null, "type");
+ QName typeName = StAXHelper.getAttributeAsQName(reader, "type");
+ String type = typeName == null ? null : typeName.getLocalPart();
if (propName != null && propName.length() > 0) {
Object value = reader.getElementText();
if ("boolean".equalsIgnoreCase(type)) {
@@ -775,7 +902,7 @@
private void parseSubscriptionHeaders(XMLStreamReader reader, JMSBinding jmsBinding) throws XMLStreamException {
String jmsSelector = reader.getAttributeValue(null, "selector");
- if (jmsSelector != null && jmsSelector.length() > 0) {
+ if (jmsSelector != null && jmsSelector.length() > 0 && jmsBinding.getJMSSelector() == null) {
jmsBinding.setJMSSelector(jmsSelector);
}
@@ -871,6 +998,39 @@
error(monitor, "ConnectionFactoryActivationSpecContradiction", jmsBinding, connectionFactoryName, activationSpecName );
}
}
+
+ // If URI is specified, destination should not be present
+ if ( ( jmsBinding.getJMSURI() != null ) && ( jmsBinding.getJMSURI().length() > 0) &&
+ (jmsBinding.isDestinationSpecified())) {
+ error(monitor, "DestinationURIContradiction", jmsBinding, jmsBinding.getJMSURI(), jmsBinding.getDestinationName());
+ }
+
+ // If activation spec and destination are both specified, they have to match
+ if ( ( jmsBinding.getActivationSpecName() != null ) && (jmsBinding.getActivationSpecName().length() > 0 ) &&
+ (jmsBinding.getDestinationName() != null) && (jmsBinding.getDestinationName().length() > 0 ) ) {
+ if ( !jmsBinding.getActivationSpecName().equals(jmsBinding.getDestinationName())) {
+ error(monitor, "ActivationSpecAndDestinationMismatch", jmsBinding, jmsBinding.getActivationSpecName(), jmsBinding.getDestinationName());
+ }
+ }
+
+ if ( ( jmsBinding.getResponseActivationSpecName() != null ) && (jmsBinding.getResponseActivationSpecName().length() > 0 ) &&
+ (jmsBinding.getResponseDestinationName() != null ) && (jmsBinding.getResponseDestinationName().length() > 0 ) ) {
+ if ( !jmsBinding.getResponseActivationSpecName().equals(jmsBinding.getResponseDestinationName())) {
+ error(monitor, "ActivationSpecAndDestinationMismatch", jmsBinding, jmsBinding.getResponseActivationSpecName(), jmsBinding.getResponseDestinationName());
+ }
+ }
+ // If activation spec exists with create=always, a jndiName must be specified
+ if (JMSBindingConstants.CREATE_ALWAYS.equals(jmsBinding.getActivationSpecCreate()) &&
+ (jmsBinding.getActivationSpecName() == null)) {
+ error(monitor, "ActivationSpecNameRequiredForCreateAlways", jmsBinding);
+ }
+ // If Connection factory specified then destination name must also be
+ if (( connectionFactoryName != null ) && ( connectionFactoryName.length() > 0 )) {
+ String destinationName = jmsBinding.getDestinationName();
+ if ((destinationName == null) || (destinationName.length() < 1 )) {
+ error(monitor, "ConnectionFactoryDestinationContradiction", jmsBinding, connectionFactoryName);
+ }
+ }
// Given a response connection name attribute, there must not be a response element.
// 156 /binding.jms/@responseConnection - identifies a binding.jms element that is present in a
@@ -884,6 +1044,13 @@
}
}
+ // [BJM30029] The value of the operationProperties/@selectedOperation attribute MUST be unique across the containing binding.jms element
+ Set<String> ops = new HashSet<String>(jmsBinding.getNativeOperationNames().values());
+ if (ops.size() != jmsBinding.getNativeOperationNames().values().size()) {
+ error(monitor, "BJM30029", jmsBinding);
+ }
+
+
// Other jmsBinding model validation may be added here.
}
@@ -916,8 +1083,10 @@
writer.writeAttribute("name", jmsBinding.getName());
}
- if (jmsBinding.getURI() != null) {
- writer.writeAttribute("uri", jmsBinding.getURI());
+ if (jmsBinding.getJMSURI() != null) {
+ writer.writeAttribute("uri", jmsBinding.getJMSURI());
+ writeEnd(writer);
+ return;
}
//String dest = jmsBinding.getDestinationName();
@@ -1010,12 +1179,12 @@
writer.writeStartElement(Constants.SCA11_NS, JMSBindingConstants.HEADERS);
- String jmsType = jmsBinding.getJMSType();
+ String jmsType = jmsBinding.getJMSHeaderType();
if (jmsType != null && jmsType.length() > 0) {
writer.writeAttribute("type", jmsType);
}
- Boolean jmsDeliveryMode = jmsBinding.isdeliveryModePersistent();
+ Boolean jmsDeliveryMode = jmsBinding.isHeaderDeliveryModePersistent();
if (jmsDeliveryMode != null) {
if ( jmsDeliveryMode.booleanValue() )
writer.writeAttribute("deliveryMode", "persistent");
@@ -1023,12 +1192,12 @@
writer.writeAttribute("deliveryMode", "nonpersistent");
}
- Long jmsTimeToLive = jmsBinding.getJMSTimeToLive();
+ Long jmsTimeToLive = jmsBinding.getJMSHeaderTimeToLive();
if (jmsTimeToLive != null) {
writer.writeAttribute("timeToLive", jmsTimeToLive.toString());
}
- Integer jmsPriority = jmsBinding.getJMSPriority();
+ Integer jmsPriority = jmsBinding.getJMSHeaderPriority();
if (jmsPriority != null) {
writer.writeAttribute("priority", jmsPriority.toString());
}
@@ -1104,7 +1273,7 @@
/**
* Writes operation properties if there are any.
*
- * <operationProperties name="string" nativeOperation="string"?>
+ * <operationProperties name="string" selectedOperation="string"?>
* <property name="NMTOKEN" type="NMTOKEN">*
* <headers JMSType="string"?
* JMSCorrelationID="string"?
@@ -1134,7 +1303,7 @@
String nativeOperation = jmsBinding.getNativeOperationName(opName);
if (nativeOperation != null && nativeOperation.length() > 0) {
if ( !nativeOperation.equals( opName )) {
- writer.writeAttribute("nativeOperation", nativeOperation);
+ writer.writeAttribute("selectedOperation", nativeOperation);
}
}
diff --git a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/OperationSelectorJMSDefault.java b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/OperationSelectorJMSDefault.java
index a02decd..9573ddf 100644
--- a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/OperationSelectorJMSDefault.java
+++ b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/OperationSelectorJMSDefault.java
@@ -30,7 +30,7 @@
* @version $Rev$ $Date$
*/
public class OperationSelectorJMSDefault implements OperationSelector {
- public static final QName OPERATION_SELECTOR_JMS_DEFAULT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "operationSelector.jmsdefault");
+ public static final QName OPERATION_SELECTOR_JMS_DEFAULT_QNAME = new QName(Constants.SCA11_NS, "operationSelector.jmsDefault");
public QName getSchemaName() {
return OPERATION_SELECTOR_JMS_DEFAULT_QNAME;
diff --git a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/WireFormatJMSDefault.java b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/WireFormatJMSDefault.java
index 5c33a3e..3b429e5 100644
--- a/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/WireFormatJMSDefault.java
+++ b/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/wireformat/WireFormatJMSDefault.java
@@ -28,7 +28,7 @@
* @version $Rev$ $Date$
*/
public class WireFormatJMSDefault implements WireFormat {
- public static final QName WIRE_FORMAT_JMS_DEFAULT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, "wireFormat.jmsdefault");
+ public static final QName WIRE_FORMAT_JMS_DEFAULT_QNAME = new QName(Constants.SCA11_NS, "wireFormat.jmsDefault");
public static final String WIRE_FORMAT_JMS_DEFAULT_FORMAT_ATTR = "sendFormat";
diff --git a/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
index 3e6b2d8..8e984c5 100644
--- a/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ b/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -17,13 +17,13 @@
# Implementation class for the artifact processor extension
org.apache.tuscany.sca.binding.jms.JMSBindingProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#binding.jms,model=org.apache.tuscany.sca.binding.jms.JMSBinding
-org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSDefaultProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsdefault,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSDefault
+org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSDefaultProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#wireFormat.jmsDefault,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSDefault
org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSTextXMLProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsTextXML,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSTextXML
org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSBytesProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsBytes,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSBytes
org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSBytesXMLProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsBytesXML,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSBytesXML
org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSTextProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsText,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSText
org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSObjectProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#wireFormat.jmsObject,model=org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSObject
-org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSDefaultProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#operationSelector.jmsdefault,model=org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSDefault
+org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSDefaultProcessor;qname=http://docs.oasis-open.org/ns/opencsa/sca/200912#operationSelector.jmsDefault,model=org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSDefault
org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSUserPropProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#operationSelector.jmsUserProp,model=org.apache.tuscany.sca.binding.jms.operationselector.OperationSelectorJMSUserProp
org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#jmsTokenAuthentication,model=org.apache.tuscany.sca.binding.jms.policy.authentication.token.JMSTokenAuthenticationPolicy
org.apache.tuscany.sca.binding.jms.policy.header.JMSHeaderPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#jmsHeader,model=org.apache.tuscany.sca.binding.jms.policy.header.JMSHeaderPolicy
diff --git a/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
new file mode 100644
index 0000000..01b45bf
--- /dev/null
+++ b/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org/apache/tuscany/sca/binding/jms/policy/definitions.xml
diff --git a/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider b/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
deleted file mode 100644
index f30da64..0000000
--- a/modules/binding-jms/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# Implementation class for SCA Definitions Providers
-org.apache.tuscany.sca.binding.jms.policy.JMSBindingDefinitionsProvider
diff --git a/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties b/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
index 33d6a9d..6fe55f1 100644
--- a/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
+++ b/modules/binding-jms/src/main/resources/binding-jms-validation-messages.properties
@@ -33,7 +33,7 @@
MissingActivationSpecName = Missing ActivationSpec Name
MissingResponseActivationSpec = Missing response ActivationSpec name
UnknownTokenInURI = Unknown token {0} in uri: {1}
-MustStartWithSchema = URI must start with the scheme 'jms:' for uri: {0}
+MustStartWithSchema = URI must start with the scheme 'jms:jndi:' or 'jms:queue:' or 'jms:topic:' for uri: {0}
InvalidCorrelationScheme = Invalid correlationScheme: {0}
UnexpectedElement = Incomplete binding.jms definition found unexpected element: {0}
UnexpectedResponseElement = Incomplete binding.jms/response definition found unexpected element: {0}
@@ -44,10 +44,18 @@
InvalidOPJMSPriority = Invalid OPJMSPriority: {0}
DestinationQueueContradiction = Destination type queue contradicts connection factory name: {0}
DestinationTopicContradiction = Destination type topic contradicts connection factory name: {0}
+DestinationURIContradiction = Destination {1} can not be specified when URI {0} is present
ConnectionFactoryActivationSpecContradiction = Connection factory \"{0}\" and activation specification \"{0}\" are mutually exclusive
+ConnectionFactoryDestinationContradiction = When connection factory \"{0}\" element is present then a destination name must also be defined
ResponseAttrElement = Response connection \"{0}\" and response element \"{1}\" are mutually exclusive
BindingNotFound = {0} refers to a binding definition {1} which is not found
DuplicateOperationProperties = Must not use both operationProperties attribute and operationProperties element
WireFormatAlreadyDefined = The request wireformat has already been defined. Only one request wire format can be specified.
OpSelectorAlreadyDefined = More than one operation selector has been specified. Only one operation selector can be specified.
ResponseWireformatAlreadyDefined = The response wireformat has already been defined. Only one response wire format can be specified.
+MissingNameForCREATE_NEVER = Must specify jndiName attribute when create mode is "never"
+MissingNameForCREATE_IF_NOT_EXIST = Must specify jndiName attribute when create mode is "ifNotExist"
+InvalidCreate = Attribute create {0} invalid, must be 'always', 'never', or 'ifNotExist'
+ActivationSpecAndDestinationMismatch = Activation spec name {0} must match destination name {1}
+ActivationSpecNameRequiredForCreateAlways = A JNDI name must be specified when an ActivationSpec has a create mode of "always"
+BJM30029 = the selectedOperation attribute MUST be unique across the containing binding.jms element
diff --git a/modules/binding-jms/src/main/resources/org/apache/tuscany/sca/binding/jms/policy/definitions.xml b/modules/binding-jms/src/main/resources/org/apache/tuscany/sca/binding/jms/policy/definitions.xml
index 1b94f13..343b4fc 100644
--- a/modules/binding-jms/src/main/resources/org/apache/tuscany/sca/binding/jms/policy/definitions.xml
+++ b/modules/binding-jms/src/main/resources/org/apache/tuscany/sca/binding/jms/policy/definitions.xml
@@ -17,73 +17,13 @@
* specific language governing permissions and limitations
* under the License.
-->
-<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0">
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- intents not yet enabled -->
- <!--sca:bindingType type="sca:binding.jms"
- alwaysProvides="JMS"
- mayProvide="atLeastOnce atMostOnce ordered conversation" /-->
-
- <!-- MJE 22/06/2010 - add asyncInvocation to the @mayProvide list, for async services support -->
<sca:bindingType type="sca:binding.jms"
- alwaysProvides=""
- mayProvide="sca:asyncInvocation" />
+ alwaysProvides="sca:JMS"
+ mayProvide="sca:atLeastOnce sca:atMostOnce sca:ordered sca:asyncInvocation" />
- <!-- PolicyIntents defined by the SCA Runtime Extension for JMS Binding -->
-
- <sca:intent name="JMS" constrains="sca:binding.jms">
- <sca:description>
- Communication through this binding requires JMS
- </sca:description>
- </sca:intent>
-
- <!-- delivery mode -->
- <intent name="deliveryMode"
- constrains="sca:binding.jms">
- <description>
- This intent is used to indicate the deliver mode
- of the sent message
- </description>
- </intent>
-
- <intent name="deliveryMode.persistent">
- <description>
- Message are sent persistently
- </description>
- </intent>
-
- <intent name="deliveryMode.nonPersistent">
- <description>
- Message are sent non-persistently
- </description>
- </intent>
-
- <!-- priority -->
- <intent name="priority"
- constrains="sca:binding.jms">
- <description>
- This intent is used to indicate the priority of the
- sent message
- </description>
- </intent>
-
- <intent name="priority.high">
- <description>
- Messages are high priority
- </description>
- </intent>
-
- <intent name="priority.medium">
- <description>
- Messages are medium priority
- </description>
- </intent>
-
- <intent name="priority.low">
- <description>
- Messages are low priority
- </description>
- </intent>
-</definitions>
\ No newline at end of file
+</sca:definitions>
\ No newline at end of file
diff --git a/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java b/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
index 67a1406..c1fb89d 100644
--- a/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
+++ b/modules/binding-jms/src/test/java/org/apache/tuscany/sca/binding/jms/JMSBindingProcessorTestCase.java
@@ -53,7 +53,7 @@
+ " <component name=\"HelloWorldComponent\">"
+ " <implementation.java class=\"services.HelloWorld\"/>"
+ " <service name=\"HelloWorldService\">"
- + " <binding.jms uri=\"jms:testQueue\" />"
+ + " <binding.jms uri=\"jms:jndi:testQueue\" />"
+ " </service>"
+ " </component>"
+ "</composite>";
@@ -426,10 +426,10 @@
JMSBinding binding = (JMSBinding) composite.getComponents().get(0).getServices().get(0).getBindings().get(0);
assertNotNull(binding);
- assertEquals("myType", binding.getJMSType());
- assertTrue(binding.isdeliveryModePersistent());
- assertEquals(54321, binding.getJMSTimeToLive().longValue());
- assertEquals(5, binding.getJMSPriority().intValue());
+ assertEquals("myType", binding.getJMSHeaderType());
+ assertTrue(binding.isHeaderDeliveryModePersistent());
+ assertEquals(54321, binding.getJMSHeaderTimeToLive().longValue());
+ assertEquals(5, binding.getJMSHeaderPriority().intValue());
}
public void testProperties1() throws Exception {
diff --git a/modules/binding-jsonp-runtime/pom.xml b/modules/binding-jsonp-runtime/pom.xml
index d2652bb..52175db 100644
--- a/modules/binding-jsonp-runtime/pom.xml
+++ b/modules/binding-jsonp-runtime/pom.xml
@@ -36,20 +36,28 @@
<version>2.0-Beta1</version>
</dependency>
+ <!-- dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-http-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency-->
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-http</artifactId>
<version>2.0-Beta1</version>
- </dependency>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
- <version>1.5.4</version>
+ <version>1.6.0</version>
</dependency>
+
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
- <version>1.5.4</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
@@ -57,6 +65,13 @@
<artifactId>httpclient</artifactId>
<version>4.0</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -84,7 +99,7 @@
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
diff --git a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPInvoker.java b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPInvoker.java
index e68d8e6..6b0bfec 100644
--- a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPInvoker.java
+++ b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPInvoker.java
@@ -66,12 +66,13 @@
public Message doInvoke(Message msg) throws JsonGenerationException, JsonMappingException, IOException, EncoderException {
String uri = endpoint.getBinding().getURI() + "/" + operation.getName();
- String[] jsonArgs = objectsToJSON((Object[])msg.getBody());
+ //String[] jsonArgs = objectsToJSON((Object[])msg.getBody());
+ String[] jsonArgs = objectsToJSONStrings((Object[])msg.getBody());
String responseJSON = invokeHTTPRequest(uri, jsonArgs);
- Object response = jsonToObjects(responseJSON)[0];
- msg.setBody(response);
+ //Object response = jsonToObjects(responseJSON)[0];
+ msg.setBody(responseJSON);
return msg;
}
@@ -142,6 +143,7 @@
return responseJSON.toString();
}
+/* Not required now JSON conversion is delegated to databinding
protected String[] objectsToJSON(Object[] msgArgs) throws JsonGenerationException, JsonMappingException, IOException {
String[] jsonArgs = new String[msgArgs.length];
for (int i=0; i<msgArgs.length; i++) {
@@ -151,11 +153,22 @@
}
return jsonArgs;
}
+*/
+
+ protected String[] objectsToJSONStrings(Object[] msgArgs) throws JsonGenerationException, JsonMappingException, IOException {
+ String[] jsonArgs = new String[msgArgs.length];
+ for (int i=0; i<msgArgs.length; i++) {
+ jsonArgs[i] = msgArgs[i].toString();
+ }
+ return jsonArgs;
+ }
+/* Not required now JSON conversion is delegated to databinding
protected Object[] jsonToObjects(String jsonRequest) throws JsonParseException, JsonMappingException, IOException {
Class<?> c = new Object[0].getClass();
Object[] args = (Object[])mapper.readValue("[" + jsonRequest +"]", c);
return args;
}
+*/
}
diff --git a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPReferenceBindingProvider.java b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPReferenceBindingProvider.java
index 9682b33..eda70e2 100644
--- a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPReferenceBindingProvider.java
+++ b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPReferenceBindingProvider.java
@@ -28,9 +28,17 @@
public class JSONPReferenceBindingProvider implements ReferenceBindingProvider {
private EndpointReference endpoint;
+ private InterfaceContract contract;
public JSONPReferenceBindingProvider(EndpointReference endpoint) {
this.endpoint = endpoint;
+
+ try {
+ contract = (InterfaceContract)endpoint.getComponentReferenceInterfaceContract().clone();
+ } catch (Exception ex){
+ // we know this supports clone
+ }
+ contract.getInterface().resetDataBinding("JSON");
}
public Invoker createInvoker(Operation operation) {
return new JSONPInvoker(operation, endpoint);
@@ -43,7 +51,7 @@
}
public InterfaceContract getBindingInterfaceContract() {
- return null;
+ return contract;
}
public boolean supportsOneWayInvocation() {
diff --git a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
index 4e3f732..991aeb3 100644
--- a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
+++ b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
@@ -31,10 +31,18 @@
private RuntimeEndpoint endpoint;
private ServletHost servletHost;
+ private InterfaceContract contract;
public JSONPServiceBindingProvider(RuntimeEndpoint endpoint, ServletHost servletHost) {
this.endpoint = endpoint;
this.servletHost = servletHost;
+
+ try {
+ contract = (InterfaceContract)endpoint.getComponentServiceInterfaceContract().clone();
+ } catch (Exception ex){
+ // we know this supports clone
+ }
+ contract.getInterface().resetDataBinding("JSON");
}
public void start() {
@@ -58,7 +66,7 @@
// TODO: Why are these two still on the ServiceBindingProvider interface?
public InterfaceContract getBindingInterfaceContract() {
- return null;
+ return contract;
}
public boolean supportsOneWayInvocation() {
diff --git a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
index b782875..320481a 100644
--- a/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
+++ b/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
@@ -22,6 +22,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
@@ -56,16 +57,19 @@
@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
- String jsonRequest = getJSONRequest(servletRequest);
- Object[] args = jsonToObjects(jsonRequest);
+ //String jsonRequest = getJSONRequest(servletRequest);
+ //Object[] args = jsonToObjects(jsonRequest);
+ Object[] args = getJSONRequestStringArray(servletRequest);
Object response = invokeService(args);
- String jsonResponse = getJSONResponse(servletRequest, response);
+ //String jsonResponse = getJSONResponse(servletRequest, response);
+ String jsonResponse = getJSONResponseAsString(servletRequest, response);
servletResponse.getOutputStream().println(jsonResponse);
}
/**
* Turn the request into JSON
*/
+/* Not required now JSON conversion is delegated to databinding
protected String getJSONRequest(ServletRequest servletRequest) throws IOException, JsonParseException, JsonMappingException {
List<DataType> types = operation.getInputType().getLogical();
@@ -96,6 +100,43 @@
return "[" + jsonRequest + "]";
}
+*/
+
+ /**
+ * Turn the request into a string array of JSON structures. The Databinding
+ * layer will then convert each of the individual parameters into the appropriate
+ * types for the implementation interface
+ *
+ */
+ protected Object[] getJSONRequestStringArray(ServletRequest servletRequest) throws IOException, JsonParseException, JsonMappingException {
+
+ List<DataType> types = operation.getInputType().getLogical();
+ int typesIndex = 0;
+
+ List<String> jsonRequestArray = new ArrayList<String>();
+
+ for (String name : getOrderedParameterNames(servletRequest)) {
+ String jsonRequest = "";
+ if (!name.startsWith("_") && !"callback".equals(name)) {
+
+ // automatically quote string parameters so clients work in the usual javascript way
+ if (typesIndex < types.size() && String.class.equals(types.get(typesIndex++).getGenericType())) {
+ String x = servletRequest.getParameter(name);
+ // TODO: do this more properly
+ if (!x.startsWith("\"")) {
+ jsonRequest += "\"" + x + "\"";
+ } else {
+ jsonRequest += x;
+ }
+ } else {
+ jsonRequest += servletRequest.getParameter(name);
+ }
+ jsonRequestArray.add(jsonRequest);
+ }
+ }
+
+ return jsonRequestArray.toArray();
+ }
/**
* Get the request parameter names in the correct order.
@@ -127,6 +168,7 @@
/**
* Turn the response object into JSON
*/
+/* Not required now JSON conversion is delegated to databinding
protected String getJSONResponse(ServletRequest servletRequest, Object response) throws IOException, JsonParseException {
ByteArrayOutputStream os = new ByteArrayOutputStream();
mapper.writeValue(os , response);
@@ -139,15 +181,34 @@
return jsonResponse;
}
+*/
+
+ /**
+ * The databinding layer will have converterted the return type into a JSON string so simply
+ * add wrap it for return.
+ */
+ protected String getJSONResponseAsString(ServletRequest servletRequest, Object response) throws IOException, JsonParseException {
+ String jsonResponse = response.toString();
+
+ String callback = servletRequest.getParameter("callback");
+ if (callback != null && callback.length() > 1) {
+ jsonResponse = callback + "(" + jsonResponse + ");";
+ }
+
+ return jsonResponse;
+ }
/**
* Turn the request JSON into objects
*/
+/* Not required now JSON conversion is delegated to databinding
protected Object[] jsonToObjects(String jsonRequest) throws IOException, JsonParseException, JsonMappingException {
Class<?> c = new Object[0].getClass();
Object[] args = (Object[])mapper.readValue(jsonRequest, c);
return args;
}
+*/
+
/**
* Send the request down the wire to invoke the service
diff --git a/modules/binding-jsonp-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/binding-jsonp-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
index f5d9de2..da84f1a 100644
--- a/modules/binding-jsonp-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ b/modules/binding-jsonp-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -16,5 +16,5 @@
# under the License.
# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.jsonp.runtime.JSONPBindingProviderFactory;model=org.apache.tuscany.sca.binding.jsonp.JSONPBinding
+org.apache.tuscany.sca.binding.jsonp.runtime.JSONPBindingProviderFactory;model=org.apache.tuscany.sca.binding.jsonp.JSONPBinding,ranking=200
diff --git a/modules/binding-jsonp-runtime/src/test/java/helloworld/BeanA.java b/modules/binding-jsonp-runtime/src/test/java/helloworld/BeanA.java
new file mode 100644
index 0000000..c8fd365
--- /dev/null
+++ b/modules/binding-jsonp-runtime/src/test/java/helloworld/BeanA.java
@@ -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 helloworld;
+
+public class BeanA {
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ public Boolean getB() {
+ return b;
+ }
+
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+}
diff --git a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java
index 97c5084..f4a2023 100644
--- a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java
+++ b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldClient.java
@@ -34,4 +34,11 @@
return ref.sayHello2(firstName, lastName);
}
+ public BeanA sayHello3(BeanA bean) {
+ return ref.sayHello3(bean);
+ }
+
+ public int sayHello4(boolean flag) {
+ return ref.sayHello4(flag);
+ }
}
diff --git a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
index 99f2958..f73b185 100644
--- a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
+++ b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
@@ -29,4 +29,13 @@
return "Hello " + firstName + " " + lastName;
}
+ public BeanA sayHello3(BeanA bean) {
+ bean.setS("XYZ");
+ return bean;
+ }
+
+ public int sayHello4(boolean flag) {
+ return 0;
+ }
+
}
diff --git a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
index b252edd..790fdd7 100644
--- a/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
+++ b/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
@@ -26,5 +26,9 @@
String sayHello(String name);
String sayHello2(String firstName, String lastName);
+
+ BeanA sayHello3(BeanA bean);
+
+ int sayHello4(boolean flag);
}
diff --git a/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java b/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
index efec56b..0259fdf 100644
--- a/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
+++ b/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
@@ -18,6 +18,7 @@
*/
package test;
+import helloworld.BeanA;
import helloworld.HelloWorldService;
import java.io.BufferedReader;
@@ -33,6 +34,7 @@
import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
public class BindingTestCase {
@@ -55,22 +57,52 @@
String response = br.readLine();
Assert.assertEquals("foo(\"Hello petra arnold\");", response);
- }
+ }
@Test
public void testReference() throws MalformedURLException, IOException {
- HelloWorldService client = node.getService(HelloWorldService.class, "HelloWorldClient");
+ HelloWorldService client = node.getService(HelloWorldService.class, "HelloWorldClient/HelloWorldService/sca");
Assert.assertEquals("Hello beate", client.sayHello("beate"));
Assert.assertEquals("Hello beate arnold", client.sayHello2("beate", "arnold"));
+ Assert.assertEquals(0, client.sayHello4(true));
+ }
+
+ @Test
+ public void testComplexParams() throws MalformedURLException, IOException {
+
+ HelloWorldService client = node.getService(HelloWorldService.class, "HelloWorldClient/HelloWorldService/sca");
+ BeanA bean = new BeanA();
+ bean.setB(true);
+ bean.setS("Fred");
+ bean.setX(2);
+ bean.setX(5);
+
+ Assert.assertEquals("XYZ", client.sayHello3(bean).getS());
+ }
+
+ /*
+ * Uncomment to keep the server running so you can ping it manually from a browser
+ * try:
+ * http://localhost:8085/HelloWorldComponent/HelloWorldService/sayHello3?bean={%22b%22:%22true%22,%22s%22:%22a%20string%22,%22x%22:%2227%22,%22y%22:%2213%22}&callback=submitSucess
+ */
+ @Test
+ @Ignore
+ public void waitForInput(){
+ System.out.println("Press a key");
+ try {
+ System.in.read();
+ } catch (Exception ex){
+ // do nothing
+ }
}
@BeforeClass
public static void init() throws Exception {
JettyServer.portDefault = 8085;
- node = NodeFactory.newInstance().createNode("helloworld.composite").start();
+ node = NodeFactory.newInstance().createNode("jsonp/helloworld.composite").start();
}
@AfterClass
diff --git a/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite b/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite
deleted file mode 100644
index 065e888..0000000
--- a/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://itest"
- name="HelloWorldComposite">
-
- <component name="HelloWorldComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- <service name="HelloWorldService" >
- <tuscany:binding.jsonp />
- </service>
- </component>
-
- <component name="HelloWorldClient">
- <implementation.java class="helloworld.HelloWorldClient"/>
- <reference name="ref" >
- <tuscany:binding.jsonp uri="http://localhost:8085/HelloWorldComponent/HelloWorldService"/>
- </reference>
- </component>
-
-</composite>
diff --git a/modules/binding-jsonp-runtime/src/test/resources/jsonp/helloworld.composite b/modules/binding-jsonp-runtime/src/test/resources/jsonp/helloworld.composite
new file mode 100644
index 0000000..c106114
--- /dev/null
+++ b/modules/binding-jsonp-runtime/src/test/resources/jsonp/helloworld.composite
@@ -0,0 +1,41 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="HelloWorldComposite">
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ <service name="HelloWorldService" >
+ <binding.sca name="sca"/>
+ <tuscany:binding.jsonp name="HelloWorldService"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldClient">
+ <implementation.java class="helloworld.HelloWorldClient"/>
+ <reference name="ref" >
+ <binding.sca name="sca"/>
+ <tuscany:binding.jsonp name="HelloWorldService" uri="http://localhost:8085/HelloWorldComponent/HelloWorldService"/>
+ </reference>
+ </component>
+
+</composite>
diff --git a/modules/binding-jsonp/META-INF/MANIFEST.MF b/modules/binding-jsonp/META-INF/MANIFEST.MF
index 019cfda..4fdd920 100644
--- a/modules/binding-jsonp/META-INF/MANIFEST.MF
+++ b/modules/binding-jsonp/META-INF/MANIFEST.MF
@@ -11,7 +11,10 @@
Import-Package: javax.xml.namespace,
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.binding.http;version="2.0.0",
+ org.apache.tuscany.sca.binding.http.impl;version="2.0.0",
org.apache.tuscany.sca.binding.jsonp;version="2.0.0"
Bundle-SymbolicName: org.apache.tuscany.sca.binding.jsonp
Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+
diff --git a/modules/binding-jsonp/pom.xml b/modules/binding-jsonp/pom.xml
index e638cb3..7a21fbe 100644
--- a/modules/binding-jsonp/pom.xml
+++ b/modules/binding-jsonp/pom.xml
@@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <artifactId>tuscany-binding-http</artifactId>
<version>2.0-Beta1</version>
</dependency>
diff --git a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java
index 8872d78..45878f4 100644
--- a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java
+++ b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBinding.java
@@ -19,13 +19,20 @@
package org.apache.tuscany.sca.binding.jsonp;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultOperationSelector;
+import org.apache.tuscany.sca.binding.http.HTTPDefaultWireFormat;
+import org.apache.tuscany.sca.binding.http.impl.HTTPBindingImpl;
/**
* JSONP Binding model
*/
-public interface JSONPBinding extends Binding {
- QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.jsonp");
+public class JSONPBinding extends HTTPBindingImpl {
+ public JSONPBinding() {
+ super();
+
+ // configure the HTTP binding for JSONP (which for the moment is the default wireFormat)
+ setOperationSelector(new HTTPDefaultOperationSelector());
+ setRequestWireFormat(new HTTPDefaultWireFormat());
+ setResponseWireFormat(new HTTPDefaultWireFormat());
+ }
}
diff --git a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
index 2e8bebe..c94a66d 100644
--- a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
+++ b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
@@ -19,13 +19,13 @@
package org.apache.tuscany.sca.binding.jsonp;
+
/**
* Factory to create JSONPBinding instances
*/
-public interface JSONPBindingFactory {
+public class JSONPBindingFactory {
- /**
- * Create JSONPBinding model
- */
- JSONPBinding createJSONPBinding();
+ public JSONPBinding createJSONPBinding() {
+ return new JSONPBinding();
+ }
}
diff --git a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java
deleted file mode 100644
index be74a28..0000000
--- a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.sca.binding.jsonp.impl;
-
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
-import org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory;
-
-/**
- * Factory implementation to create JSONP Models
- */
-public class JSONPBindingFactoryImpl implements JSONPBindingFactory {
-
- public JSONPBinding createJSONPBinding() {
- return new JSONPBindingImpl();
- }
-
-}
diff --git a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java b/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java
deleted file mode 100644
index 4d0f03f..0000000
--- a/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.sca.binding.jsonp.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.OperationSelector;
-import org.apache.tuscany.sca.assembly.WireFormat;
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
-
-/**
- * Represents a binding to an RMI service.
- *
- * @version $Rev$ $Date$
- */
-public class JSONPBindingImpl implements JSONPBinding {
-
- private String name;
- private String uri;
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean arg0) {
- }
-
- public QName getType() {
- return TYPE;
- }
-
- public WireFormat getRequestWireFormat() {
- return null;
- }
-
- public void setRequestWireFormat(WireFormat wireFormat) {
- }
-
- public WireFormat getResponseWireFormat() {
- return null;
- }
-
- public void setResponseWireFormat(WireFormat wireFormat) {
- }
-
- public OperationSelector getOperationSelector() {
- return null;
- }
-
- public void setOperationSelector(OperationSelector operationSelector) {
- }
-
-}
diff --git a/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory b/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
index e1e8c6d..57908b3 100644
--- a/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
+++ b/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
@@ -16,5 +16,6 @@
# under the License.
# Implementation class for model factory
-org.apache.tuscany.sca.binding.jsonp.impl.JSONPBindingFactoryImpl
+org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory
+
diff --git a/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
new file mode 100644
index 0000000..c45809a
--- /dev/null
+++ b/modules/binding-jsonp/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the binding extension
+org.apache.tuscany.sca.binding.http.provider.HTTPBindingProviderFactory;model=org.apache.tuscany.sca.binding.jsonp.JSONPBinding
+
diff --git a/modules/binding-jsonrpc-js-dojo/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/js/dojo/JSONRPCBindingJavascriptProxyFactoryImpl.java b/modules/binding-jsonrpc-js-dojo/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/js/dojo/JSONRPCBindingJavascriptProxyFactoryImpl.java
index 0388c8b..f4c32e8 100644
--- a/modules/binding-jsonrpc-js-dojo/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/js/dojo/JSONRPCBindingJavascriptProxyFactoryImpl.java
+++ b/modules/binding-jsonrpc-js-dojo/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/js/dojo/JSONRPCBindingJavascriptProxyFactoryImpl.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.jsonrpc.js.dojo;
@@ -34,8 +34,8 @@
import org.apache.tuscany.sca.web.javascript.JavascriptProxyFactory;
public class JSONRPCBindingJavascriptProxyFactoryImpl implements JavascriptProxyFactory {
- private static final QName NAME = new QName("http://tuscany.apache.org/xmlns/sca/1.1", "binding.jsonrpc");
-
+ private static final QName NAME = JSONRPCBinding.TYPE;
+
public Class<?> getModelType() {
return JSONRPCBinding.class;
}
@@ -51,11 +51,11 @@
public InputStream getJavascriptProxyFileAsStream() throws IOException {
return null;
}
-
+
public String createJavascriptHeader(ComponentReference componentReference) throws IOException {
return "dojo.require('dojo.rpc.JsonService');";
}
-
+
public String createJavascriptReference(ComponentReference componentReference) throws IOException {
EndpointReference epr = componentReference.getEndpointReferences().get(0);
Endpoint targetEndpoint = epr.getTargetEndpoint();
@@ -65,13 +65,13 @@
((RuntimeEndpointReference) epr).getInvocationChains();
targetEndpoint = epr.getTargetEndpoint();
}
-
+
Binding binding = targetEndpoint.getBinding();
-
+
URI targetURI = URI.create(binding.getURI());
String targetPath = targetURI.getPath();
-
- return "dojo.rpc.JsonService(\"" + targetPath + "?smd\")";
+
+ return "dojo.rpc.JsonService(\"" + targetPath + "?smd\")";
}
}
diff --git a/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF b/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
index 0e52141..7c7b8e1 100644
--- a/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
+++ b/modules/binding-jsonrpc-runtime/META-INF/MANIFEST.MF
@@ -28,6 +28,7 @@
org.apache.tuscany.sca.host.http;version="2.0.0",
org.apache.tuscany.sca.interfacedef;version="2.0.0",
org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
org.apache.tuscany.sca.invocation;version="2.0.0",
org.apache.tuscany.sca.node;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
diff --git a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java
index b5ea6b1..ecca09d 100644
--- a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java
+++ b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java
@@ -27,6 +27,7 @@
import org.apache.http.util.EntityUtils;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding;
+import org.apache.tuscany.sca.databinding.json.JSONDataBinding;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
@@ -57,48 +58,59 @@
HttpPost post = null;
HttpResponse response = null;
try {
-
- JSONObject jsonRequest = null;;
String requestId = "1";
- Object[] args = null;
- try {
- // Extract the method
- jsonRequest = new JSONObject();
- jsonRequest.putOpt("method", "Service" + "." + msg.getOperation().getName());
-
- // Extract the arguments
- args = msg.getBody();
- JSONArray array = new JSONArray();
- for (int i = 0; i < args.length; i++) {
- array.put(args[i]);
- }
- jsonRequest.putOpt("params", array);
- jsonRequest.put("id", requestId);
-
- } catch (Exception e) {
- throw new RuntimeException("Unable to parse JSON parameter", e);
- }
-
post = new HttpPost(uri);
- String req = jsonRequest.toString();
- StringEntity entity = new StringEntity(req, "application/json; charset\"UTF-8\"");
+
+ final String db = msg.getOperation().getWrapper().getDataBinding();
+ String req;
+ if (!db.equals(JSONDataBinding.NAME)) {
+
+
+ JSONObject jsonRequest = null;;
+ Object[] args = null;
+ try {
+ // Extract the method
+ jsonRequest = new JSONObject();
+ jsonRequest.putOpt("method", "Service" + "." + msg.getOperation().getName());
+
+ // Extract the arguments
+ args = msg.getBody();
+ JSONArray array = new JSONArray();
+ for (int i = 0; i < args.length; i++) {
+ array.put(args[i]);
+ }
+ jsonRequest.putOpt("params", array);
+ jsonRequest.put("id", requestId);
+
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to parse JSON parameter", e);
+ }
+ req = jsonRequest.toString();
+ } else {
+ req = (String)((Object[])msg.getBody())[0];
+ }
+ StringEntity entity = new StringEntity(req, "UTF-8");
post.setEntity(entity);
response = httpClient.execute(post);
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
//success
- JSONObject jsonResponse = null;
try {
+ String entityResponse = EntityUtils.toString(response.getEntity());
+ if (!db.equals(JSONDataBinding.NAME)) {
+ JSONObject jsonResponse = new JSONObject(entityResponse);
- jsonResponse = new JSONObject(EntityUtils.toString(response.getEntity()));
+ //check requestId
+ if (! jsonResponse.getString("id").equalsIgnoreCase(requestId)) {
+ throw new RuntimeException("Invalid response id:" + requestId );
+ }
- //check requestId
- if (! jsonResponse.getString("id").equalsIgnoreCase(requestId)) {
- throw new RuntimeException("Invalid response id:" + requestId );
+ msg.setBody(jsonResponse.get("result"));
+ } else {
+ msg.setBody(entityResponse);
}
-
- msg.setBody(jsonResponse.get("result"));
+
} catch (Exception e) {
//FIXME Exceptions are not handled correctly here
// They should be reported to the client JavaScript as proper
diff --git a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java
index 3cdcb32..f9b37f3 100644
--- a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java
+++ b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.binding.jsonrpc.provider;
+import java.math.BigDecimal;
import java.util.List;
import org.apache.tuscany.sca.databinding.javabeans.SimpleJavaDataBinding;
@@ -45,14 +46,16 @@
if (inputType != null) {
List<DataType> logical = inputType.getLogical();
for (DataType inArg : logical) {
- if (!SimpleJavaDataBinding.NAME.equals(inArg.getDataBinding())) {
+ if (!SimpleJavaDataBinding.NAME.equals(inArg.getDataBinding()) ||
+ inArg.getPhysical() == BigDecimal.class) {
inArg.setDataBinding(JSONDataBinding.NAME);
}
}
}
DataType outputType = operation.getOutputType();
if (outputType != null) {
- if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) {
+ if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding()) ||
+ outputType.getPhysical() == BigDecimal.class ) {
outputType.setDataBinding(JSONDataBinding.NAME);
}
}
diff --git a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java
index cd179a0..adc1920 100644
--- a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java
+++ b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.jsonrpc.provider;
@@ -33,6 +33,7 @@
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.HTTP;
import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Invoker;
@@ -41,7 +42,7 @@
/**
* Implementation of the JSONRPC Binding Provider for References
- *
+ *
* @version $Rev$ $Date$
*/
public class JSONRPCReferenceBindingProvider implements ReferenceBindingProvider {
@@ -56,7 +57,7 @@
this.endpointReference = endpointReference;
this.reference = (RuntimeComponentReference) endpointReference.getReference();
-
+
//clone the service contract to avoid databinding issues
/*
try {
@@ -64,20 +65,20 @@
} catch(CloneNotSupportedException e) {
this.referenceContract = reference.getInterfaceContract();
}
-
+
JSONRPCDatabindingHelper.setDataBinding(referenceContract.getInterface());
*/
-
+
// Create an HTTP client
HttpParams defaultParameters = new BasicHttpParams();
//defaultParameters.setIntParameter(HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, 10);
HttpProtocolParams.setContentCharset(defaultParameters, HTTP.UTF_8);
HttpConnectionParams.setConnectionTimeout(defaultParameters, 60000);
HttpConnectionParams.setSoTimeout(defaultParameters, 60000);
-
+
SchemeRegistry supportedSchemes = new SchemeRegistry();
supportedSchemes.register(new Scheme(HttpHost.DEFAULT_SCHEME_NAME, PlainSocketFactory.getSocketFactory(), 80));
-
+
ClientConnectionManager connectionManager = new ThreadSafeClientConnManager(defaultParameters, supportedSchemes);
httpClient = new DefaultHttpClient(connectionManager, defaultParameters);
@@ -89,6 +90,10 @@
}
public Invoker createInvoker(Operation operation) {
+ final Interface intf = reference.getInterfaceContract().getInterface();
+ if (intf.isDynamic()) {
+ return new JSONRPCBindingInvoker(endpointReference, operation, httpClient);
+ }
return new JSONRPCClientInvoker(endpointReference, operation, httpClient);
}
diff --git a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java
index 10e9368..b6dce22 100644
--- a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java
+++ b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java
@@ -22,6 +22,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.servlet.Servlet;
+
import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.interfacedef.Interface;
@@ -80,7 +82,8 @@
public void start() {
// Set default databinding to json
- // serviceContract.getInterface().resetDataBinding(JSONDataBinding.NAME);
+ // replaced by JSONRPCDatabindingHelper.setDataBinding(serviceContract.getInterface()); above
+ //serviceContract.getInterface().resetDataBinding(JSONDataBinding.NAME);
// Determine the service business interface
Class<?> serviceInterface = getTargetJavaClass(serviceContract.getInterface());
@@ -91,18 +94,28 @@
// Create and register a Servlet for this service
JSONRPCServiceServlet serviceServlet =
new JSONRPCServiceServlet(messageFactory, endpoint, serviceInterface, proxy);
- String mapping = binding.getURI();
- if (!mapping.endsWith("/")) {
- mapping += "/";
+ String mapping = registerServlet(serviceServlet);
+ servletMappings.add(mapping);
+ }
+
+ public String registerServlet(Servlet servlet) {
+ // Create our HTTP service listener Servlet and register it with the
+ // Servlet host
+ String servletMapping = binding.getURI();
+ if (!servletMapping.endsWith("/")) {
+ servletMapping += "/";
}
- if (!mapping.endsWith("*")) {
- mapping += "*";
+ if (!servletMapping.endsWith("*")) {
+ servletMapping += "*";
}
- servletHost.addServletMapping(mapping, serviceServlet);
- servletMappings.add(mapping);
- servletHost.addServletMapping(binding.getURI(), serviceServlet);
- servletMappings.add(binding.getURI());
+ String mappedURI = servletHost.addServletMapping(servletMapping, servlet);
+ String deployedURI = mappedURI;
+ if (deployedURI.endsWith("*")) {
+ deployedURI = deployedURI.substring(0, deployedURI.length() - 1);
+ }
+ binding.setURI(deployedURI);
+ return mappedURI;
}
public void stop() {
diff --git a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
index 742a27e..9c379bd 100644
--- a/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
+++ b/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
@@ -37,6 +37,7 @@
import org.apache.commons.codec.binary.Base64;
import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.databinding.json.JSONDataBinding;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.invocation.MessageFactory;
@@ -99,6 +100,8 @@
if (re.getCause() instanceof javax.security.auth.login.LoginException) {
response.setHeader("WWW-Authenticate", "BASIC realm=\"" + "ldap-realm" + "\"");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ } else {
+ re.printStackTrace();
}
} finally {
HttpSession session = request.getSession(false);
@@ -299,7 +302,11 @@
requestMessage.getHeaders().put("RequestMessage", request);
- requestMessage.setBody(args);
+ if (jsonOperation.getWrapper().getDataBinding().equals(JSONDataBinding.NAME)) {
+ requestMessage.setBody(new Object[]{jsonReq.toString()});
+ } else {
+ requestMessage.setBody(args);
+ }
//result = wire.invoke(jsonOperation, args);
Message responseMessage = null;
@@ -317,15 +324,34 @@
if (!responseMessage.isFault()) {
//successful execution of the invocation
- try {
+ if (jsonOperation.getWrapper().getDataBinding().equals(JSONDataBinding.NAME)) {
result = responseMessage.getBody();
- JSONObject jsonResponse = new JSONObject();
- jsonResponse.put("result", result);
- jsonResponse.putOpt("id", id);
- //get response to send to client
- return jsonResponse.toString().getBytes("UTF-8");
- } catch (Exception e) {
- throw new ServiceRuntimeException("Unable to create JSON response", e);
+ return result.toString().getBytes("UTF-8");
+ } else {
+ if (jsonOperation.getOutputType() == null) {
+ // void operation (json-rpc notification)
+ try {
+ JSONObject jsonResponse = new JSONObject();
+ jsonResponse.put("result", "");
+ //get response to send to client
+ return jsonResponse.toString().getBytes("UTF-8");
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("Unable to create JSON response", e);
+ }
+
+ } else {
+ // regular operation returning some value
+ try {
+ result = responseMessage.getBody();
+ JSONObject jsonResponse = new JSONObject();
+ jsonResponse.put("result", result);
+ jsonResponse.putOpt("id", id);
+ //get response to send to client
+ return jsonResponse.toString().getBytes("UTF-8");
+ } catch (Exception e) {
+ throw new ServiceRuntimeException("Unable to create JSON response", e);
+ }
+ }
}
} else {
//exception thrown while executing the invocation
@@ -354,6 +380,8 @@
Operation result = null;
for (Operation o : operations) {
+ if (o.isDynamic())
+ return o;
if (o.getName().equalsIgnoreCase(method)) {
result = o;
break;
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java b/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java
index 322008d..bb47b9e 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/echo/Echo.java
@@ -18,6 +18,7 @@
*/
package echo;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -38,12 +39,16 @@
public interface Echo {
String echo(String msg);
-
+
+ void echoVoid();
+
void echoRuntimeException() throws RuntimeException;
void echoBusinessException() throws EchoBusinessException;
int echoInt(int param);
+
+ double echoDouble(double param);
boolean echoBoolean(boolean param);
@@ -61,4 +66,5 @@
void get\u03a9\u03bb\u03c0();
+ BigDecimal echoBigDecimal(BigDecimal param);
}
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoClientImpl.java b/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoClientImpl.java
index f76ec74..9a2d411 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoClientImpl.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoClientImpl.java
@@ -6,19 +6,20 @@
* 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.
+ * under the License.
*/
package echo;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,6 +38,10 @@
public String echo(String msg) {
return echoReference.echo(msg);
}
+
+ public void echoVoid() {
+ echoReference.echoVoid();
+ }
public int[] echoArrayInt(int[] intArray) {
throw new UnsupportedOperationException("UNsupported !");
@@ -62,6 +67,10 @@
throw new UnsupportedOperationException("UNsupported !");
}
+ public double echoDouble(double param) {
+ throw new UnsupportedOperationException("UNsupported !");
+ }
+
public List echoList(ArrayList list) {
throw new UnsupportedOperationException("UNsupported !");
}
@@ -82,4 +91,7 @@
throw new UnsupportedOperationException("UNsupported !");
}
+ public BigDecimal echoBigDecimal(BigDecimal param) {
+ throw new UnsupportedOperationException("UNsupported !");
+ }
}
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java b/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java
index 08ccb6e..b8b6390 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/echo/EchoComponentImpl.java
@@ -6,18 +6,19 @@
* 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.
+ * under the License.
*/
package echo;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -30,16 +31,21 @@
/**
* A simple client component that uses a reference with an JSONRPC binding.
- *
+ *
* @version $Rev$ $Date$
*/
-public class EchoComponentImpl implements Echo {
+public class EchoComponentImpl implements Echo {
- public String echo(String msg) {
+ public String echo(String msg) {
System.out.println("Echo: "+ msg);
return "echo: " + msg;
}
+
+ public void echoVoid() {
+ System.out.println("Echo: VOID");
+ }
+
public void echoBusinessException() throws EchoBusinessException {
throw new EchoBusinessException("Business Exception");
@@ -54,6 +60,11 @@
return value;
}
+ public double echoDouble(double param) {
+ double value = param;
+ return param;
+ }
+
public boolean echoBoolean(boolean param) {
boolean value = param;
return value;
@@ -96,8 +107,11 @@
}
-
public void get\u03a9\u03bb\u03c0() {
}
+
+ public BigDecimal echoBigDecimal(BigDecimal param) {
+ return param;
+ }
}
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
index 0fd622d..d09bce6 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCDataTypeTestCase.java
@@ -199,4 +199,21 @@
Assert.assertEquals("red", jsonResp.getJSONArray("result").get(0));
}
+
+ @Test
+ public void testBigDecimal() throws Exception {
+ JSONObject jsonRequest = new JSONObject(
+ "{ \"method\": \"echoBigDecimal\", \"params\": [\"12345.67\"], \"id\": 4}");
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new PostMethodWebRequest(SERVICE_URL,
+ new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), "application/json");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+
+ JSONObject jsonResp = new JSONObject(response.getText());
+
+ Assert.assertEquals("12345.67", jsonResp.get("result"));
+ }
}
\ No newline at end of file
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCReferenceTestCase.java b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCReferenceTestCase.java
index efdb0a2..c639d3e 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCReferenceTestCase.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCReferenceTestCase.java
@@ -67,4 +67,20 @@
node.stop();
}
}
+
+ @Test
+ public void testInvokeReferenceVoidOperation() throws Exception {
+ Node node = null;
+
+ String contribution = ContributionLocationHelper.getContributionLocation(JSONRPCReferenceTestCase.class);
+ node = NodeFactory.newInstance().createNode("JSONRPCReference.composite", new Contribution("testClient", contribution));
+ node.start();
+
+ Echo echoComponent = node.getService(Echo.class,"EchoComponentWithReference");
+ echoComponent.echoVoid();
+
+ if (node != null) {
+ node.stop();
+ }
+ }
}
diff --git a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
index 7c6ba6a..8b8d689 100644
--- a/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
+++ b/modules/binding-jsonrpc-runtime/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java
@@ -42,7 +42,7 @@
/**
* @version $Rev$ $Date$
*/
-public class JSONRPCServiceTestCase{
+public class JSONRPCServiceTestCase {
private static final String SERVICE_PATH = "/EchoService";
@@ -67,7 +67,7 @@
}
@Test
- public void testJSONRPCBinding() throws Exception {
+ public void testEchoWithJSONRPCBinding() throws Exception {
JSONObject jsonRequest = new JSONObject("{ \"method\": \"echo\", \"params\": [\"Hello JSON-RPC\"], \"id\": 1}");
WebConversation wc = new WebConversation();
@@ -79,7 +79,7 @@
JSONObject jsonResp = new JSONObject(response.getText());
Assert.assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result"));
}
-
+
@Test
public void testJSONRPCBindingGET() throws Exception {
String params = Base64.encode("[\"Hello JSON-RPC\"]".getBytes());
@@ -95,7 +95,17 @@
Assert.assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result"));
}
-
-
-
+ @Test
+ public void testEchoVoidWithJSONRPCBinding() throws Exception {
+ JSONObject jsonRequest = new JSONObject("{ \"method\": \"echoVoid\", \"params\": [], \"id\": 1}");
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+
+ JSONObject jsonResp = new JSONObject(response.getText());
+ Assert.assertEquals(0, jsonResp.getString("result").length());
+ }
}
\ No newline at end of file
diff --git a/modules/binding-rest-js-dojo/LICENSE b/modules/binding-rest-js-dojo/LICENSE
new file mode 100644
index 0000000..8aa906c
--- /dev/null
+++ b/modules/binding-rest-js-dojo/LICENSE
@@ -0,0 +1,205 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+
+
diff --git a/modules/binding-rest-js-dojo/META-INF/MANIFEST.MF b/modules/binding-rest-js-dojo/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d9fbf2b
--- /dev/null
+++ b/modules/binding-rest-js-dojo/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA REST Binding JavaScript using Dojo
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA REST Binding JavaScript usi
+ ng Dojo
+Import-Package: javax.xml.namespace,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.binding.rest;version="2.0.0",
+ org.apache.tuscany.sca.web.javascript;version="2.0.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.rest-js.dojo
+Bundle-DocURL: http://www.apache.org/
+
diff --git a/modules/binding-rss-runtime/NOTICE b/modules/binding-rest-js-dojo/NOTICE
similarity index 100%
rename from modules/binding-rss-runtime/NOTICE
rename to modules/binding-rest-js-dojo/NOTICE
diff --git a/modules/binding-rest-js-dojo/pom.xml b/modules/binding-rest-js-dojo/pom.xml
new file mode 100644
index 0000000..3f552a8
--- /dev/null
+++ b/modules/binding-rest-js-dojo/pom.xml
@@ -0,0 +1,53 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-binding-rest-js-dojo</artifactId>
+ <name>Apache Tuscany SCA REST Feed Binding JavaScript using Dojo</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-web-javascript</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/modules/binding-rest-runtime/META-INF/MANIFEST.MF b/modules/binding-rest-runtime/META-INF/MANIFEST.MF
index 415357c..4ea6d96 100644
--- a/modules/binding-rest-runtime/META-INF/MANIFEST.MF
+++ b/modules/binding-rest-runtime/META-INF/MANIFEST.MF
@@ -23,29 +23,33 @@
org.apache.tuscany.sca.binding.rest.wireformat.xml;version="2.0.0",
org.apache.tuscany.sca.common.http;version="2.0.0",
org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.core.invocation;version="2.0.0",
org.apache.tuscany.sca.databinding;version="2.0.0",
org.apache.tuscany.sca.databinding.javabeans;version="2.0.0",
org.apache.tuscany.sca.databinding.xml;version="2.0.0",
+ org.apache.tuscany.sca.extensibility;version="2.0.0",
org.apache.tuscany.sca.host.http;version="2.0.0",
org.apache.tuscany.sca.interfacedef;version="2.0.0",
org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java.jaxrs;version="2.0.0",
org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
org.apache.tuscany.sca.invocation;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.wink.client,
- org.apache.wink.client.handlers,
- org.apache.wink.common,
- org.apache.wink.common.internal.registry,
- org.apache.wink.common.internal.registry.metadata,
- org.apache.wink.server.internal,
- org.apache.wink.server.internal.registry,
- org.apache.wink.server.internal.servlet,
- org.apache.wink.server.utils,
+ org.apache.wink.client;version="1.1.1.incubating",
+ org.apache.wink.client.handlers;version="1.1.1.incubating",
+ org.apache.wink.common;version="1.1.1.incubating",
+ org.apache.wink.common.internal.registry;version="1.1.1.incubating",
+ org.apache.wink.common.internal.registry.metadata;version="1.1.1.incubating",
+ org.apache.wink.server.internal;version="1.1.1.incubating",
+ org.apache.wink.server.internal.registry;version="1.1.1.incubating",
+ org.apache.wink.server.internal.servlet;version="1.1.1.incubating",
+ org.apache.wink.server.utils;version="1.1.1.incubating",
org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0"
Bundle-SymbolicName: org.apache.tuscany.sca.binding.rest.runtime
Bundle-DocURL: http://www.apache.org/
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Require-Bundle: org.apache.wink.server
diff --git a/modules/binding-rest-runtime/pom.xml b/modules/binding-rest-runtime/pom.xml
index e98d9e9..97d2595 100644
--- a/modules/binding-rest-runtime/pom.xml
+++ b/modules/binding-rest-runtime/pom.xml
@@ -36,13 +36,6 @@
<version>2.0-Beta1</version>
</dependency>
-
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1</version>
- </dependency>
-
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-data-api</artifactId>
@@ -92,6 +85,36 @@
</dependency>
<dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java-jaxrs</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-server</artifactId>
+ <version>1.1.1-incubating</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-client</artifactId>
+ <version>1.1.1-incubating</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -107,35 +130,16 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxrs</artifactId>
- <version>2.0-Beta1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-java-runtime</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.wink</groupId>
- <artifactId>wink-server</artifactId>
- <version>1.1.1-incubating</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wink</groupId>
- <artifactId>wink-client</artifactId>
- <version>1.1.1-incubating</version>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
</dependency>
<dependency>
diff --git a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
index 4583b11..e0a681e 100644
--- a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
+++ b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.rest.provider;
@@ -66,7 +66,7 @@
private Invoker conditionalPostInvoker;
private Invoker deleteInvoker;
private Invoker conditionalDeleteInvoker;
-
+
/**
* Constructs a new RESTServiceListenerServlet.
*/
@@ -92,7 +92,7 @@
Message responseMessage = bindingInvoker.invoke(requestMessage);
// return response to client
- if (responseMessage.isFault()) {
+ if (responseMessage.isFault()) {
// Turn a fault into an exception
Throwable e = (Throwable)responseMessage.getBody();
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
@@ -117,25 +117,26 @@
//handle void operations
write(response.getOutputStream(), responseMessage.getBody());
response.getOutputStream().flush();
- response.getOutputStream().close();
- }
+ response.getOutputStream().close();
+ }
} else {
super.service(request, response);
}
- }
-
+ }
+
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
+ String pathInfo = request.getPathInfo();
+ if (pathInfo == null || pathInfo.length() == 0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
return;
}
+ String path = URLDecoder.decode(pathInfo, "UTF-8");
// Invoke the get operation on the service implementation
Message requestMessage = messageFactory.createMessage();
@@ -144,9 +145,9 @@
Message responseMessage = null;
HTTPCacheContext cacheContext = null;
- try {
+ try {
cacheContext = HTTPCacheContext.createCacheContextFromRequest(request);
- } catch (ParseException e) {
+ } catch (ParseException e) {
}
@@ -185,12 +186,12 @@
}
return;
} else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 ) {
+ if ( index > -1 ) {
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
} else {
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
}
- return;
+ return;
}
throw new ServletException((Throwable)responseMessage.getBody());
@@ -207,7 +208,7 @@
// Write the response from the service implementation to the response
// output stream
InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
+ OutputStream os = response.getOutputStream();
byte[] buffer = new byte[2048];
for (;;) {
int n = is.read(buffer);
@@ -216,14 +217,14 @@
os.write(buffer, 0, n);
}
os.flush();
- os.close();
+ os.close();
}
@Override
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
+ if (path.length() ==0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
@@ -236,13 +237,13 @@
Message responseMessage = null;
HTTPCacheContext cacheContext = null;
- try {
+ try {
cacheContext = HTTPCacheContext.createCacheContextFromRequest(request);
- } catch (ParseException e) {
+ } catch (ParseException e) {
}
// Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalDeleteInvoker != null )) {
+ if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalDeleteInvoker != null )) {
requestMessage.setBody(new Object[] {id, cacheContext});
responseMessage = conditionalDeleteInvoker.invoke(requestMessage);
} else {
@@ -266,8 +267,8 @@
} else {
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
}
- return;
- }
+ return;
+ }
throw new ServletException((Throwable)responseMessage.getBody());
}
@@ -275,7 +276,7 @@
// Write the response from the service implementation to the response
// output stream
InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
+ OutputStream os = response.getOutputStream();
byte[] buffer = new byte[2048];
for (;;) {
int n = is.read(buffer);
@@ -284,14 +285,14 @@
os.write(buffer, 0, n);
}
os.flush();
- os.close();
+ os.close();
}
@Override
protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
+ if (path.length() ==0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
@@ -304,13 +305,13 @@
Message responseMessage = null;
HTTPCacheContext cacheContext = null;
- try {
+ try {
cacheContext = HTTPCacheContext.createCacheContextFromRequest(request);
- } catch (ParseException e) {
+ } catch (ParseException e) {
}
// Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPutInvoker != null )) {
+ if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPutInvoker != null )) {
requestMessage.setBody(new Object[] {id, cacheContext});
responseMessage = conditionalPutInvoker.invoke(requestMessage);
} else {
@@ -329,13 +330,13 @@
}
return;
} else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 ) {
+ if ( index > -1 ) {
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
} else {
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
}
- return;
- }
+ return;
+ }
throw new ServletException((Throwable)responseMessage.getBody());
}
@@ -343,7 +344,7 @@
// Write the response from the service implementation to the response
// output stream
InputStream is = (InputStream)responseMessage.getBody();
- OutputStream os = response.getOutputStream();
+ OutputStream os = response.getOutputStream();
byte[] buffer = new byte[2048];
for (;;) {
int n = is.read(buffer);
@@ -352,14 +353,14 @@
os.write(buffer, 0, n);
}
os.flush();
- os.close();
+ os.close();
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
- if (path.length() ==0) {
+ if (path.length() ==0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
@@ -369,16 +370,16 @@
// Invoke the get operation on the service implementation
Message requestMessage = messageFactory.createMessage();
// String id = path.substring(1);
-
+
Message responseMessage = null;
HTTPCacheContext cacheContext = null;
- try {
+ try {
cacheContext = HTTPCacheContext.createCacheContextFromRequest(request);
- } catch (ParseException e) {
+ } catch (ParseException e) {
}
-
+
// Route message based on availability of cache info and cache methods
- if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPostInvoker != null )) {
+ if (( cacheContext != null ) && (cacheContext.isEnabled()) && (conditionalPostInvoker != null )) {
requestMessage.setBody(new Object[] {cacheContext});
responseMessage = conditionalPostInvoker.invoke(requestMessage);
} else {
@@ -387,22 +388,22 @@
}
if (responseMessage.isFault()) {
Object body = responseMessage.getBody();
-
+
int index = -1;
if ( -1 < (index = body.getClass().getName().indexOf( "NotModifiedException")) ) {
- if ( index > -1 )
+ if ( index > -1 )
response.sendError( HttpServletResponse.SC_NOT_MODIFIED, body.toString().substring( index ));
else
response.sendError( HttpServletResponse.SC_NOT_MODIFIED );
return;
} else if ( -1 < (index = body.getClass().getName().indexOf( "PreconditionFailedException")) ) {
- if ( index > -1 )
+ if ( index > -1 )
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED, body.toString().substring( index ));
else
response.sendError( HttpServletResponse.SC_PRECONDITION_FAILED );
- return;
- }
-
+ return;
+ }
+
throw new ServletException((Throwable)responseMessage.getBody());
}
@@ -425,15 +426,15 @@
}
}
-
+
public void setInvoker(Invoker invoker) {
this.invoker = invoker;
}
-
+
public Invoker getInvoker() {
return invoker;
}
-
+
/**
* @return the getInvoker
@@ -548,13 +549,13 @@
}
/**
- *
+ *
* Utility methods
- *
+ *
*/
-
-
-
+
+
+
private void write(OutputStream out, Object obj) throws IOException {
if (obj == null) {
return;
@@ -577,6 +578,6 @@
out.write(obj.toString().getBytes("UTF-8"));
}
}
-
+
}
diff --git a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
index 9a9e5a1..ec607e9 100644
--- a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
+++ b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTServiceBindingProvider.java
@@ -211,9 +211,13 @@
throw new IllegalStateException("No get or service method found on the service");
}
+ servletMapping = registerServlet(servlet);
+ }
+
+ public String registerServlet(Servlet servlet) {
// Create our HTTP service listener Servlet and register it with the
// Servlet host
- servletMapping = binding.getURI();
+ String servletMapping = binding.getURI();
if (!servletMapping.endsWith("/")) {
servletMapping += "/";
}
@@ -221,7 +225,13 @@
servletMapping += "*";
}
- servletHost.addServletMapping(servletMapping, servlet);
+ String mappedURI = servletHost.addServletMapping(servletMapping, servlet);
+ String deployedURI = mappedURI;
+ if (deployedURI.endsWith("*")) {
+ deployedURI = deployedURI.substring(0, deployedURI.length() - 1);
+ }
+ binding.setURI(deployedURI);
+ return mappedURI;
}
public void stop() {
@@ -256,19 +266,10 @@
if (isJAXRS) {
application = new SimpleApplication(interfaze);
- TuscanyRESTServlet restServlet = new TuscanyRESTServlet(extensionPoints, application.resourceClass);
+ TuscanyRESTServlet restServlet = new TuscanyRESTServlet(extensionPoints, binding, application.resourceClass);
- // Create our HTTP service listener Servlet and register it with the
- // Servlet host
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
-
- servletHost.addServletMapping(servletMapping, restServlet);
+ servletMapping = registerServlet(restServlet);
+
RegistrationUtils.registerApplication(application, restServlet.getServletContext());
return application;
} else {
diff --git a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
index 23b951c..fb9c245 100644
--- a/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
+++ b/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java
@@ -6,54 +6,125 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.rest.provider;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
import java.util.Enumeration;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.HttpMethod;
+import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.rest.RESTBinding;
+import org.apache.tuscany.sca.common.http.HTTPCacheContext;
+import org.apache.tuscany.sca.common.http.HTTPHeader;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.extensibility.ClassLoaderContext;
import org.apache.wink.common.internal.registry.ProvidersRegistry;
import org.apache.wink.common.internal.registry.metadata.MethodMetadata;
+import org.apache.wink.server.handlers.HandlersChain;
+import org.apache.wink.server.handlers.HandlersFactory;
+import org.apache.wink.server.handlers.MessageContext;
+import org.apache.wink.server.handlers.RequestHandler;
+import org.apache.wink.server.handlers.ResponseHandler;
import org.apache.wink.server.internal.DeploymentConfiguration;
import org.apache.wink.server.internal.RequestProcessor;
+import org.apache.wink.server.internal.handlers.CheckLocationHeaderHandler;
import org.apache.wink.server.internal.registry.ResourceRecord;
import org.apache.wink.server.internal.servlet.RestServlet;
/**
- *
+ *
*/
public class TuscanyRESTServlet extends RestServlet {
+ private static final Logger logger = Logger.getLogger(TuscanyRESTServlet.class.getName());
+
private static final long serialVersionUID = 89997233133964915L;
private ExtensionPointRegistry registry;
+ private RESTBinding binding;
private Class<?> resourceClass;
private boolean fixed;
- public TuscanyRESTServlet(ExtensionPointRegistry registry, Class<?> resourceClass) {
+ public TuscanyRESTServlet(ExtensionPointRegistry registry, Binding binding, Class<?> resourceClass) {
super();
this.registry = registry;
+ this.binding = (RESTBinding) binding;
this.resourceClass = resourceClass;
}
+
+ public void init() throws ServletException {
+ ClassLoader cl =
+ ClassLoaderContext.setContextClassLoader(Thread.currentThread().getContextClassLoader(),
+ registry.getServiceDiscovery(),
+ "/META-INF/server/wink-providers");
+ try {
+ super.init();
+ } finally {
+ if (cl != null) {
+ // return previous classLoader
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+ }
+
+ /**
+ * Create Tuscany own DeploymentConfiguration in order to be able to
+ * add ResponseHandler to the Wink HandlerChain
+ */
+ public DeploymentConfiguration createDeploymentConfiguration() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+ return new TuscanyDeploymentConfiguration();
+ }
+ @SuppressWarnings({"unchecked", "rawtypes"})
@Override
public DeploymentConfiguration getDeploymentConfiguration() throws ClassNotFoundException, InstantiationException,
IllegalAccessException, IOException {
- DeploymentConfiguration config = super.getDeploymentConfiguration();
+
+
+ // setup proper classLoader to work on OSGi environment
+ ClassLoader cl =
+ ClassLoaderContext.setContextClassLoader(Thread.currentThread().getContextClassLoader(),
+ registry.getServiceDiscovery(),
+ "javax.ws.rs.ext.RuntimeDelegate",
+ "/META-INF/wink-alternate-shortcuts.properties",
+ "/META-INF/server/wink-providers");
+
+ DeploymentConfiguration config = null;
+ try {
+ config = super.getDeploymentConfiguration();
+ } finally {
+ if (cl != null) {
+ // return previous classLoader
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
// [rfeng] FIXME: This is a hack to fool Apache wink to not remove the servlet path
config.setFilterConfig(new FilterConfig() {
@@ -78,7 +149,7 @@
ProvidersRegistry providers = config.getProvidersRegistry();
providers.addProvider(new DataBindingJAXRSReader(registry), 0.001, true);
providers.addProvider(new DataBindingJAXRSWriter(registry), 0.001, true);
-
+
return config;
}
@@ -123,5 +194,59 @@
}
return processor;
}
+
+ /**
+ * TuscanyDeploymentConfiguration
+ *
+ * Required to inject TuscanyResponseHandler to the HandlerChain
+ */
+ class TuscanyDeploymentConfiguration extends DeploymentConfiguration {
+
+ @Override
+ protected List<ResponseHandler> initResponseUserHandlers() {
+ List<ResponseHandler> list = super.initResponseUserHandlers();
+ list.add(new TuscanyResponseHandler());
+ return list;
+ }
+ }
+
+ /**
+ * TuscanyResponseHandler
+ *
+ * Required to support declartive HTTP Headers
+ */
+ class TuscanyResponseHandler implements ResponseHandler {
+ public void handleResponse(MessageContext context, HandlersChain chain) throws Throwable {
+
+ // assert response is not committed
+ final HttpServletResponse httpResponse = context.getAttribute(HttpServletResponse.class);
+ if (httpResponse.isCommitted()) {
+ logger.log(Level.FINE, "The response is already committed. Nothing to do.");
+ return;
+ }
+
+ //process declarative headers
+ for(HTTPHeader header : binding.getHttpHeaders()) {
+ //treat special headers that need to be calculated
+ if(header.getName().equalsIgnoreCase("Expires")) {
+ GregorianCalendar calendar = new GregorianCalendar();
+ calendar.setTime(new Date());
+
+ calendar.add(Calendar.HOUR, Integer.parseInt(header.getValue()));
+
+ httpResponse.setHeader("Expires", HTTPCacheContext.RFC822DateFormat.format( calendar.getTime() ));
+ } else {
+ //default behaviour to pass the header value to HTTP response
+ httpResponse.setHeader(header.getName(), header.getValue());
+ }
+ }
+
+ chain.doChain(context);
+ }
+
+ public void init(Properties props) {
+
+ }
+ }
}
diff --git a/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java b/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
index a7cbda2..c6e4875 100644
--- a/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
+++ b/modules/binding-rest-runtime/src/test/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/CustomerServiceTestCase.java
@@ -88,8 +88,8 @@
//System.out.println(">>>" + response.getText());
Assert.assertEquals(200, response.getResponseCode());
-// Assert.assertEquals("no-cache", response.getHeaderField("Cache-Control"));
-// Assert.assertEquals("tuscany", response.getHeaderField("X-Tuscany"));
+ Assert.assertEquals("no-cache", response.getHeaderField("Cache-Control"));
+ Assert.assertEquals("tuscany", response.getHeaderField("X-Tuscany"));
Assert.assertEquals(GET_RESPONSE, response.getText());
}
diff --git a/modules/binding-rest/META-INF/MANIFEST.MF b/modules/binding-rest/META-INF/MANIFEST.MF
index 767844f..2594e00 100644
--- a/modules/binding-rest/META-INF/MANIFEST.MF
+++ b/modules/binding-rest/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@
javax.xml.namespace,
javax.xml.stream,
org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
org.apache.tuscany.sca.binding.rest;version="2.0.0",
org.apache.tuscany.sca.common.http;version="2.0.0",
org.apache.tuscany.sca.contribution.processor;version="2.0.0",
diff --git a/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java b/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java
index 2ce3b95..0588477 100644
--- a/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java
+++ b/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/impl/JSONWireFormatImpl.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.rest.wireformat.json.impl;
@@ -25,7 +25,7 @@
/**
* JSON Wireformat implementation for REST Binding
- *
+ *
* @version $Rev$ $Date$
*/
public class JSONWireFormatImpl implements JSONWireFormat {
@@ -41,4 +41,8 @@
public void setUnresolved(boolean unresolved) {
// no op
}
+
+ public String toString() {
+ return "application/json";
+ }
}
diff --git a/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java b/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java
index 3f51fb8..c419908 100644
--- a/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java
+++ b/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/impl/XMLWireFormatImpl.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.binding.rest.wireformat.xml.impl;
@@ -25,7 +25,7 @@
/**
* XML Wireformat implementation for REST Binding
- *
+ *
* @version $Rev$ $Date$
*/
public class XMLWireFormatImpl implements XMLWireFormat {
@@ -41,4 +41,8 @@
public void setUnresolved(boolean unresolved) {
// no op
}
+
+ public String toString() {
+ return "application/xml";
+ }
}
diff --git a/modules/binding-rmi-runtime/pom.xml b/modules/binding-rmi-runtime/pom.xml
index 572952f..47b5970 100644
--- a/modules/binding-rmi-runtime/pom.xml
+++ b/modules/binding-rmi-runtime/pom.xml
@@ -32,13 +32,15 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
+ <artifactId>tuscany-binding-rmi</artifactId>
<version>2.0-Beta1</version>
</dependency>
@@ -47,30 +49,12 @@
<artifactId>tuscany-host-rmi</artifactId>
<version>2.0-Beta1</version>
</dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>2.2</version>
- </dependency>
-
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
+
+ <dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
<version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
+ <type>pom</type>
<scope>test</scope>
</dependency>
diff --git a/modules/binding-rmi/pom.xml b/modules/binding-rmi/pom.xml
index 23997e2..3e3f85b 100644
--- a/modules/binding-rmi/pom.xml
+++ b/modules/binding-rmi/pom.xml
@@ -32,8 +32,10 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/modules/binding-rss-runtime/META-INF/MANIFEST.MF b/modules/binding-rss-runtime/META-INF/MANIFEST.MF
deleted file mode 100644
index c78875e..0000000
--- a/modules/binding-rss-runtime/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.rss.collection
-SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA RSS Feed Binding Extension
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA RSS Feed Binding Extension
-Import-Package: javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.binding.rss;version="2.0.0",
- org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.interfacedef,
- org.apache.tuscany.sca.interfacedef.impl,
- org.apache.tuscany.sca.interfacedef.util,
- org.apache.tuscany.sca.monitor
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.rss.runtime
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/modules/binding-rss-runtime/pom.xml b/modules/binding-rss-runtime/pom.xml
deleted file mode 100644
index fc3f84e..0000000
--- a/modules/binding-rss-runtime/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-rss-runtime</artifactId>
- <name>Apache Tuscany SCA RSS Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rss</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
-
- <dependency>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>avalon-framework</groupId>
- <artifactId>avalon-framework</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.0.1</version>
- <configuration>
- <instructions>
- <Bundle-Version>${tuscany.version}</Bundle-Version>
- <Bundle-SymbolicName>org.apache.tuscany.sca.binding.rss.rome</Bundle-SymbolicName>
- <Bundle-Description>${pom.name}</Bundle-Description>
- <Export-Package>org.apache.tuscany.sca.binding.rss*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java
deleted file mode 100644
index 581ae59..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/Collection.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.sca.binding.rss.collection;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndFeed;
-
-
-/**
- * Provides access to a collection of resources using RSS.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Collection {
-
- /**
- * Get an RSS feed for a collection of resources.
- *
- * @return the RSS feed
- */
- SyndFeed getFeed();
-
- /**
- * Get an RSS feed for a collection of resources resulting from a query.
- *
- * @param queryString the query string
- * @return the RSS feed
- */
- SyndFeed query(String queryString);
-
- /**
- * Retrieves an RSS entry.
- *
- * @param id The entry ID
- * @return The requested entry
- * @throws NotFoundException No entry found with the given ID
- */
- SyndEntry get(String id) throws NotFoundException;
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java
deleted file mode 100644
index a2b8346..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/MediaCollection.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.sca.binding.rss.collection;
-
-import java.io.InputStream;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-import com.sun.syndication.feed.atom.Entry;
-
-/**
- * Provides access to a collection of resources using Atom.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface MediaCollection extends Collection {
-
- /**
- * Creates a new media entry
- *
- * @param title
- * @param slug
- * @param contentType
- * @param media
- */
- Entry postMedia(String title, String slug, String contentType, InputStream media);
-
- /**
- * Update a media entry.
- *
- * @param id
- * @param contentType
- * @param media
- * @return
- */
- void putMedia(String id, String contentType, InputStream media) throws NotFoundException;
-
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java
deleted file mode 100644
index 0912878..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/collection/NotFoundException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.sca.binding.rss.collection;
-
-/**
- * Indicates that a resource could not be found.
- *
- * @version $Rev$ $Date$
- */
-public class NotFoundException extends Exception {
- private static final long serialVersionUID = -5046027674128627383L;
-
- public NotFoundException() {
- }
-
- public NotFoundException(String message) {
- super(message);
- }
-
- public NotFoundException(Throwable cause) {
- super(cause);
- }
-
- public NotFoundException(String message, Throwable cause) {
- super(message, cause);
- }
-
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java
deleted file mode 100644
index e3a1771..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingInvoker.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.sca.binding.rss.provider;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.SyndFeedInput;
-import com.sun.syndication.io.XmlReader;
-
-/**
- * Invoker for the RSS binding.
- *
- * @version $Rev$ $Date$
- */
-class RSSBindingInvoker implements Invoker , DataExchangeSemantics {
- private static final Logger logger = Logger.getLogger(RSSBindingInvoker.class.getName());
-
- private String uri;
-
- RSSBindingInvoker(String uri, String feedType) {
- this.uri = uri;
- }
-
- public Message invoke(Message msg) {
- try {
- logger.fine("invoke " + uri);
-
- // Read an RSS feed into a Synd feed
- SyndFeedInput input = new SyndFeedInput();
- SyndFeed feed = input.build(new XmlReader(new URL(uri)));
-
- //FIXME Support conversion to data-api entries
-
- msg.setBody(feed);
-
- } catch (MalformedURLException e) {
- msg.setFaultBody(e);
- } catch (IllegalArgumentException e) {
- msg.setFaultBody(e);
- } catch (FeedException e) {
- msg.setFaultBody(e);
- } catch (IOException e) {
- msg.setFaultBody(e);
- }
- return msg;
- }
-
- public boolean allowsPassByReference() {
- return true;
- }
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java
deleted file mode 100644
index 44c84ce..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingListenerServlet.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * 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.sca.binding.rss.provider;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.net.URLDecoder;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.tuscany.sca.data.collection.Item;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.runtime.Invocable;
-
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndContentImpl;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndFeedImpl;
-import com.sun.syndication.feed.synd.SyndLink;
-import com.sun.syndication.feed.synd.SyndLinkImpl;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.SyndFeedOutput;
-
-/**
- * An RSS binding listener, implemented as a Servlet and
- * registered in a Servlet host provided by the SCA hosting runtime.
- *
- * @version $Rev$ $Date$
- */
-class RSSBindingListenerServlet extends HttpServlet {
- private static final Logger logger = Logger.getLogger(RSSBindingListenerServlet.class.getName());
- private static final long serialVersionUID = 1L;
-
- private Invocable wire;
- private Invoker getFeedInvoker;
- private Invoker getAllInvoker;
- private Invoker queryInvoker;
- private MessageFactory messageFactory;
- private Mediator mediator;
- private DataType<?> itemClassType;
- private DataType<?> itemXMLType;
- private boolean supportsFeedEntries;
-
- /**
- * Constructs a new binding listener.
- *
- * @param wire
- * @param messageFactory
- */
- RSSBindingListenerServlet(Invocable wire, MessageFactory messageFactory, Mediator mediator) {
- this.wire = wire;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
-
- // Get the invokers for the supported operations
- Operation getOperation = null;
- for (InvocationChain invocationChain : this.wire.getInvocationChains()) {
- invocationChain.setAllowsPassByReference(true);
- Operation operation = invocationChain.getTargetOperation();
- String operationName = operation.getName();
- if (operationName.equals("getFeed")) {
- getFeedInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("getAll")) {
- getAllInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("query")) {
- queryInvoker = invocationChain.getHeadInvoker();
- } else if (operationName.equals("get")) {
- getOperation = operation;
- }
- }
-
- // Determine the collection item type
- if (getOperation != null) {
- itemXMLType = new DataTypeImpl<Class<?>>(String.class.getName(), String.class, String.class);
- Class<?> itemClass = getOperation.getOutputType().getPhysical();
- if (itemClass == SyndEntry.class) {
- supportsFeedEntries = true;
- }
- DataType<XMLType> outputType = getOperation.getOutputType();
- QName qname = outputType.getLogical().getElementName();
- qname = new QName(qname.getNamespaceURI(), itemClass.getSimpleName());
- itemClassType = new DataTypeImpl<XMLType>("java:complexType", itemClass, new XMLType(qname, null));
- }
- }
-
- @Override
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-
- // No authentication required for a get request
-
- // Get the request path
- String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8");
-
- logger.fine("get " + request.getRequestURI());
-
- // Handle an RSS request
- if (path == null || path.length() == 0 || path.equals("/")) {
-
- // Return an RSS feed containing the entries in the collection
- SyndFeed feed = null;
- if (supportsFeedEntries) {
-
- // The service implementation supports feed entries, invoke its getFeed operation
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage = getFeedInvoker.invoke(requestMessage);
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- feed = (SyndFeed)responseMessage.getBody();
-
- } else {
-
- // The service implementation does not support feed entries, invoke its
- // getAll operation to get the data item collection. then create feed entries
- // from the data items
- Message requestMessage = messageFactory.createMessage();
- Message responseMessage;
- if (request.getQueryString() != null) {
- requestMessage.setBody(new Object[] {request.getQueryString()});
- responseMessage = queryInvoker.invoke(requestMessage);
- } else {
- responseMessage = getAllInvoker.invoke(requestMessage);
- }
- if (responseMessage.isFault()) {
- throw new ServletException((Throwable)responseMessage.getBody());
- }
- org.apache.tuscany.sca.data.collection.Entry<Object, Object>[] collection =
- (org.apache.tuscany.sca.data.collection.Entry<Object, Object>[])responseMessage.getBody();
- if (collection != null) {
- // Create the feed
- feed = new SyndFeedImpl();
- feed.setTitle("Feed");
- feed.setDescription("Feed description");
-
- for (org.apache.tuscany.sca.data.collection.Entry<Object, Object> entry: collection) {
- SyndEntry feedEntry = createFeedEntry(entry);
- feed.getEntries().add(feedEntry);
- }
- }
- }
-
- // Convert to an RSS feed
- if (feed != null) {
- response.setContentType("application/rss+xml; charset=utf-8");
- feed.setFeedType("rss_2.0");
- feed.setLink(path);
- SyndFeedOutput syndOutput = new SyndFeedOutput();
- try {
- syndOutput.output(feed, getWriter(response));
- } catch (FeedException e) {
- throw new ServletException(e);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
- } else {
- response.sendError(HttpServletResponse.SC_NOT_FOUND);
- }
-
- }
-
- /**
- * Create an RSS entry from a data collection entry.
- * @param entry
- * @return
- */
- private SyndEntry createFeedEntry(org.apache.tuscany.sca.data.collection.Entry<Object, Object> entry) {
- Object key = entry.getKey();
- Object data = entry.getData();
- if (data instanceof Item) {
- Item item = (Item)data;
-
- SyndEntry feedEntry = new SyndEntryImpl();
- feedEntry.setUri(key.toString());
- feedEntry.setTitle(item.getTitle());
-
- String value = item.getContents();
- if (value != null) {
- SyndContent content = new SyndContentImpl();
- content.setType("text/xml");
- content.setValue(value);
- List<SyndContent> contents = new ArrayList<SyndContent>();
- contents.add(content);
- feedEntry.setContents(contents);
- }
-
- String href = item.getLink();
- if (href == null) {
- href = key.toString();
- }
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref(href);
- feedEntry.getLinks().add(link);
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref(href);
- feedEntry.getLinks().add(link);
- feedEntry.setLink(href);
-
- Date date = item.getDate();
- if (date == null) {
- date = new Date();
- }
- feedEntry.setPublishedDate(date);
- return feedEntry;
-
- } else if (data != null) {
- SyndEntry feedEntry = new SyndEntryImpl();
- feedEntry.setUri(key.toString());
- feedEntry.setTitle("item");
-
- // Convert the item to XML
- String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
-
- SyndContent content = new SyndContentImpl();
- content.setType("text/xml");
- content.setValue(value);
- List<SyndContent> contents = new ArrayList<SyndContent>();
- contents.add(content);
- feedEntry.setContents(contents);
-
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref(key.toString());
- feedEntry.getLinks().add(link);
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref(key.toString());
- feedEntry.getLinks().add(link);
-
- feedEntry.setPublishedDate(new Date());
- return feedEntry;
- } else {
- return null;
- }
- }
-
- /**
- * Create a data collection entry from an RSS entry.
- * @param feedEntry
- * @return
- */
- private org.apache.tuscany.sca.data.collection.Entry<Object, Object> createEntry(SyndEntry feedEntry) {
- if (feedEntry != null) {
- if (itemClassType.getPhysical() == Item.class) {
- String key = feedEntry.getUri();
-
- Item item = new Item();
- item.setTitle(feedEntry.getTitle());
-
- List<?> contents = feedEntry.getContents();
- if (!contents.isEmpty()) {
- SyndContent content = (SyndContent)contents.get(0);
- String value = content.getValue();
- item.setContents(value);
- }
-
- for (Object l : feedEntry.getLinks()) {
- SyndLink link = (SyndLink)l;
- if (link.getRel() == null || "edit".equals(link.getRel())) {
- String href = link.getHref();
- if (href.startsWith("null/")) {
- href = href.substring(5);
- }
- item.setLink(href);
- break;
- }
- }
-
- item.setDate(feedEntry.getPublishedDate());
-
- return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, item);
-
- } else {
- String key = feedEntry.getUri();
-
- // Create the item from XML
- List<?> contents = feedEntry.getContents();
- if (contents.isEmpty()) {
- return null;
- }
- SyndContent content = (SyndContent)contents.get(0);
- String value = content.getValue();
- Object data = mediator.mediate(value, itemXMLType, itemClassType, null);
-
- return new org.apache.tuscany.sca.data.collection.Entry<Object, Object>(key, data);
- }
- } else {
- return null;
- }
- }
-
-
- private Writer getWriter(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
- Writer writer = new OutputStreamWriter(response.getOutputStream(), "UTF-8");
- return writer;
- }
-
- /**
- * Process the authorization header
- *
- * @param request
- * @return
- * @throws ServletException
- */
- private String processAuthorizationHeader(HttpServletRequest request) throws ServletException {
- try {
- String authorization = request.getHeader("Authorization");
- if (authorization != null) {
- StringTokenizer tokens = new StringTokenizer(authorization);
- if (tokens.hasMoreTokens()) {
- String basic = tokens.nextToken();
- if (basic.equalsIgnoreCase("Basic")) {
- String credentials = tokens.nextToken();
- String userAndPassword = new String(Base64.decodeBase64(credentials.getBytes()));
- int colon = userAndPassword.indexOf(":");
- if (colon != -1) {
- String user = userAndPassword.substring(0, colon);
- String password = userAndPassword.substring(colon + 1);
-
- // Authenticate the User.
- if (authenticate(user, password)) {
- return user;
- }
- }
- }
- }
- }
- } catch (Exception e) {
- throw new ServletException(e);
- }
- return null;
- }
-
- /**
- * Authenticate a user.
- *
- * @param user
- * @param password
- * @return
- */
- private boolean authenticate(String user, String password) {
-
- // TODO Handle this using SCA security policies
- //FIXME Why are we using endsWith instead of equals here??
- return ("admin".endsWith(user) && "admin".equals(password));
- }
-
- /**
- * Reject an unauthorized request.
- *
- * @param response
- */
- private void unauthorized(HttpServletResponse response) throws IOException {
- response.setHeader("WWW-Authenticate", "BASIC realm=\"Tuscany\"");
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
- }
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java
deleted file mode 100644
index e1bafdd..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSBindingProviderFactory.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.sca.binding.rss.provider;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
-
-/**
- * Implementation of the RSS binding provider factory.
- *
- * @version $Rev$ $Date$
- */
-public class RSSBindingProviderFactory implements BindingProviderFactory<RSSBinding> {
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- public RSSBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- this.servletHost = servletHosts.getServletHosts().get(0);
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- this.mediator = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Mediator.class);
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpointReference) {
- return new RSSReferenceBindingProvider(endpointReference, mediator);
- }
-
- public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
- return new RSSServiceBindingProvider(endpoint, messageFactory, mediator, servletHost);
- }
-
- public Class<RSSBinding> getModelType() {
- return RSSBinding.class;
- }
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java
deleted file mode 100644
index d234a0c..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSReferenceBindingProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.sca.binding.rss.provider;
-
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-
-/**
- * Implementation of the RSS binding provider.
- *
- * @version $Rev$ $Date$
- */
-class RSSReferenceBindingProvider implements ReferenceBindingProvider {
-
- private EndpointReference endpointReference;
-
- private RuntimeComponentReference reference;
- private RSSBinding binding;
-
- RSSReferenceBindingProvider(EndpointReference endpointReference,
- Mediator mediator) {
- this.endpointReference = endpointReference;
- this.reference = (RuntimeComponentReference) endpointReference.getReference();
- this.binding = (RSSBinding) endpointReference.getBinding();
- }
-
- public Invoker createInvoker(Operation operation) {
- return new RSSBindingInvoker(binding.getURI(), "rss_2.0");
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return reference.getInterfaceContract();
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
diff --git a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java b/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java
deleted file mode 100644
index 25ab939..0000000
--- a/modules/binding-rss-runtime/src/main/java/org/apache/tuscany/sca/binding/rss/provider/RSSServiceBindingProvider.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.sca.binding.rss.provider;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.Invocable;
-import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-
-/**
- * Implementation of the RSS binding provider.
- *
- * @version $Rev$ $Date$
- */
-class RSSServiceBindingProvider implements ServiceBindingProvider {
-
- private RuntimeEndpoint endpoint;
-
- //private RuntimeComponentService service;
- private RSSBinding binding;
-
- private MessageFactory messageFactory;
- private Mediator mediator;
- private ServletHost servletHost;
-
- private String servletMapping;
-
- RSSServiceBindingProvider(RuntimeEndpoint endpoint,
- MessageFactory messageFactory,
- Mediator mediator,
- ServletHost servletHost) {
- this.endpoint = endpoint;
-
- //this.service = (RuntimeComponentService)endpoint.getService();
- this.binding = (RSSBinding) endpoint.getBinding();
- this.servletHost = servletHost;
- this.messageFactory = messageFactory;
- this.mediator = mediator;
- }
-
- public InterfaceContract getBindingInterfaceContract() {
- return endpoint.getComponentTypeServiceInterfaceContract();
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- public void start() {
- Invocable wire = (RuntimeEndpoint) endpoint;
-
- RSSBindingListenerServlet servlet =
- new RSSBindingListenerServlet(wire, messageFactory, mediator);
-
- servletMapping = binding.getURI();
- if (!servletMapping.endsWith("/")) {
- servletMapping += "/";
- }
- if (!servletMapping.endsWith("*")) {
- servletMapping += "*";
- }
- servletHost.addServletMapping(servletMapping, servlet);
-
- // Save the actual binding URI in the binding
- //binding.setURI(servletHost.getURLMapping(binding.getURI()).toString());
- }
-
- public void stop() {
- servletHost.removeServletMapping(servletMapping);
- }
-
-}
diff --git a/modules/binding-rss-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/binding-rss-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
deleted file mode 100644
index e60dc28..0000000
--- a/modules/binding-rss-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# Implementation class for the binding extension
-org.apache.tuscany.sca.binding.rss.provider.RSSBindingProviderFactory;model=org.apache.tuscany.sca.binding.rss.RSSBinding
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
deleted file mode 100644
index 1ae4515..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Consumer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-
-public class Consumer {
-
- public static void main(String[] args) throws Exception {
-
- String contribution = ContributionLocationHelper.getContributionLocation(Consumer.class);
- Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/feed/Consumer.composite", new Contribution("consumer", contribution));
-
- node.start();
-
- CustomerClient testService = node.getService(CustomerClient.class, "CustomerClient");
- testService.testCustomerCollection();
-
- node.stop();
- }
-}
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java
deleted file mode 100644
index af87155..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClient.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-public interface CustomerClient {
-
- void testCustomerCollection() throws Exception;
-}
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
deleted file mode 100644
index a80f721..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerClientImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import org.apache.tuscany.sca.binding.rss.collection.Collection;
-import org.oasisopen.sca.annotation.Reference;
-
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndFeed;
-
-
-public class CustomerClientImpl implements CustomerClient {
-
- @Reference
- public Collection resourceCollection;
-
- public void testCustomerCollection() throws Exception {
-
- System.out.println(">>> get collection");
- SyndFeed feed = resourceCollection.getFeed();
- System.out.println("<<< get collection");
- for (Object o : feed.getEntries()) {
- SyndEntry e = (SyndEntry)o;
- System.out.println("id = " + e.getUri() + " entry = " + e.getTitle());
- }
- }
-
-}
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
deleted file mode 100644
index 4b5bf37..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/CustomerCollectionImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.tuscany.sca.binding.rss.collection.Collection;
-import org.apache.tuscany.sca.binding.rss.collection.NotFoundException;
-import org.oasisopen.sca.annotation.Scope;
-
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndContentImpl;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndFeedImpl;
-import com.sun.syndication.feed.synd.SyndLink;
-import com.sun.syndication.feed.synd.SyndLinkImpl;
-
-@Scope("COMPOSITE")
-public class CustomerCollectionImpl implements Collection {
-
- private Map<String, SyndEntry> entries = new HashMap<String, SyndEntry>();
-
- public CustomerCollectionImpl() {
-
- for (int i = 0; i < 4; i++) {
- String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
-
- SyndEntry entry = new SyndEntryImpl();
- entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
- entry.setUri(id);
-
- SyndContent content = new SyndContentImpl();
- content.setValue("Jane Doe_" + String.valueOf(i));
- content.setType("text");
- entry.setContents(Collections.singletonList(content));
-
- List<SyndLink> links = new ArrayList<SyndLink>();
- SyndLink link = new SyndLinkImpl();
- link.setRel("edit");
- link.setHref("" + id);
- links.add(link);
- entry.setLinks(links);
-
- links = new ArrayList<SyndLink>();
- link = new SyndLinkImpl();
- link.setRel("alternate");
- link.setHref("" + id);
- links.add(link);
- entry.setLinks(links);
-
- entry.setPublishedDate(new Date());
-
- entries.put(id, entry);
- System.out.println(">>> id=" + id);
- }
- }
-
- public SyndFeed getFeed() {
- System.out.println(">>> CustomerCollectionImpl.getFeed");
-
- SyndFeed feed = new SyndFeedImpl();
- feed.setTitle("customers");
- feed.setDescription("This is a sample feed");
- feed.getEntries().addAll(entries.values());
- return feed;
- }
-
- public SyndFeed query(String queryString) {
- System.out.println(">>> CustomerCollectionImpl.query");
-
- SyndFeed feed = new SyndFeedImpl();
- feed.setTitle("customers");
- feed.setDescription("This is a sample feed");
- feed.getEntries().addAll(entries.values());
- return feed;
- }
-
- /**
- * {@inheritDoc}
- */
- public SyndEntry get(String id) throws NotFoundException {
- final SyndEntry entry = entries.get(id);
- if (id == null) {
- throw new NotFoundException("No entry found with ID " + id);
- }
-
- return entry;
- }
-}
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
deleted file mode 100644
index 6dc23ac..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/Provider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public class Provider {
-
- public static void main(String[] args) {
-
-
- String contribution = ContributionLocationHelper.getContributionLocation(Provider.class);
- Node node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/feed/Provider.composite", new Contribution("provider", contribution));
-
- node.start();
-
- System.out.println("Provider.composite ready...");
-
- try {
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- node.stop();
- }
-}
diff --git a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java b/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java
deleted file mode 100644
index 5a786f3..0000000
--- a/modules/binding-rss-runtime/src/test/java/org/apache/tuscany/sca/binding/rss/RSSGetTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Basic test case that will get the feed entries from an RSS feed.
- */
-public class RSSGetTestCase {
- protected static Node scaConsumerNode;
- protected static Node scaProviderNode;
- protected static CustomerClient testService;
-
- @BeforeClass
- public static void init() throws Exception {
- System.out.println(">>>RSSGetTestCase.init entry");
- String contribution = ContributionLocationHelper.getContributionLocation(RSSGetTestCase.class);
-
- scaProviderNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/rss/Provider.composite", new Contribution("provider", contribution));
- scaProviderNode.start();
-
- scaConsumerNode = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/rss/Consumer.composite", new Contribution("consumer", contribution));
- scaConsumerNode.start();
-
- testService = scaConsumerNode.getService(CustomerClient.class, "CustomerClient");
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- // System.out.println(">>>RSSGetTestCase.destroy entry");
- if (scaConsumerNode != null) {
- scaConsumerNode.stop();
- }
- if (scaProviderNode != null) {
- scaProviderNode.stop();
- }
- }
-
- @Test
- public void testPrelim() throws Exception {
- Assert.assertNotNull(scaProviderNode);
- Assert.assertNotNull(scaConsumerNode);
- Assert.assertNotNull(testService);
- }
-
- @Test
- @Ignore("TUSCANY-3537")
- public void testRSSGet() throws Exception {
- testService.testCustomerCollection();
- }
-}
diff --git a/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Consumer.composite b/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Consumer.composite
deleted file mode 100644
index 2214180..0000000
--- a/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Consumer.composite
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://customer"
- name="Consumer">
-
- <component name="CustomerClient">
- <implementation.java class="org.apache.tuscany.sca.binding.rss.CustomerClientImpl"/>
- <reference name="resourceCollection">
- <tuscany:binding.rss uri="http://localhost:8084/customer"/>
- </reference>
- </component>
-
-</composite>
diff --git a/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Provider.composite b/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Provider.composite
deleted file mode 100644
index b2b1f3d..0000000
--- a/modules/binding-rss-runtime/src/test/resources/org/apache/tuscany/sca/binding/rss/Provider.composite
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace = "http://customer"
- name="Provider">
-
- <service name="customer" promote="CustomerCollection">
- <tuscany:binding.rss uri = "http://localhost:8084/customer"/>
- </service>
-
- <component name="CustomerCollection">
- <implementation.java class="org.apache.tuscany.sca.binding.rss.CustomerCollectionImpl"/>
- </component>
-
-</composite>
diff --git a/modules/binding-rss/META-INF/MANIFEST.MF b/modules/binding-rss/META-INF/MANIFEST.MF
deleted file mode 100644
index a088601..0000000
--- a/modules/binding-rss/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Export-Package: org.apache.tuscany.sca.binding.rss;
- uses:="org.apache.tuscany.sca.assembly";version="2.0.0"
-SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA RSS Feed Binding Extension
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA RSS Feed Binding Extension
-Import-Package: javax.xml.namespace,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.assembly.xml;version="2.0.0",
- org.apache.tuscany.sca.binding.rss;version="2.0.0",
- org.apache.tuscany.sca.core,
- org.apache.tuscany.sca.monitor
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.rss
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-
diff --git a/modules/binding-rss/NOTICE b/modules/binding-rss/NOTICE
deleted file mode 100644
index ad2ba40..0000000
--- a/modules/binding-rss/NOTICE
+++ /dev/null
@@ -1,6 +0,0 @@
-${pom.name}
-Copyright (c) 2005 - 2010 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/modules/binding-rss/pom.xml b/modules/binding-rss/pom.xml
deleted file mode 100644
index f321d51..0000000
--- a/modules/binding-rss/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-binding-rss</artifactId>
- <name>Apache Tuscany SCA RSS Feed Binding Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java b/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java
deleted file mode 100644
index bda3210..0000000
--- a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBinding.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * RSS Feed binding model.
- *
- * @version $Rev$ $Date$
- */
-public interface RSSBinding extends Binding {
- QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.rss");
-}
diff --git a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java b/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java
deleted file mode 100644
index 3e691e6..0000000
--- a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/RSSBindingFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.sca.binding.rss;
-
-/**
- * Factory for the RSS binding
- *
- * @version $Rev$ $Date$
- */
-public interface RSSBindingFactory {
-
- /**
- * Creates a new RSS binding.
- * @return the new RSS binding
- */
- RSSBinding createRSSBinding();
-
-}
diff --git a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java b/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java
deleted file mode 100644
index a4e6a82..0000000
--- a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingFactoryImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.sca.binding.rss.impl;
-
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-import org.apache.tuscany.sca.binding.rss.RSSBindingFactory;
-
-/**
- * Factory for the RSS binding model.
- *
- * @version $Rev$ $Date$
- */
-public class RSSBindingFactoryImpl implements RSSBindingFactory {
-
- public RSSBinding createRSSBinding() {
- return new RSSBindingImpl();
- }
-
-}
diff --git a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java b/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java
deleted file mode 100644
index 00abffa..0000000
--- a/modules/binding-rss/src/main/java/org/apache/tuscany/sca/binding/rss/impl/RSSBindingImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * 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.sca.binding.rss.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.OperationSelector;
-import org.apache.tuscany.sca.assembly.WireFormat;
-import org.apache.tuscany.sca.binding.rss.RSSBinding;
-
-/**
- * Implementation of the RSS Feed binding model.
- *
- * @version $Rev$ $Date$
- */
-class RSSBindingImpl implements RSSBinding {
-
- private String name;
- private String uri;
-
- public QName getType() {
- return RSSBinding.TYPE;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- // The binding is always resolved
- }
-
- public WireFormat getRequestWireFormat() {
- return null;
- }
-
- public void setRequestWireFormat(WireFormat wireFormat) {
- }
-
- public WireFormat getResponseWireFormat() {
- return null;
- }
-
- public void setResponseWireFormat(WireFormat wireFormat) {
- }
-
- public OperationSelector getOperationSelector() {
- return null;
- }
-
- public void setOperationSelector(OperationSelector operationSelector) {
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-}
diff --git a/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory b/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory
deleted file mode 100644
index 73c47a3..0000000
--- a/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.rss.RSSBindingFactory
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# Implementation class for the model factory
-org.apache.tuscany.sca.binding.rss.impl.RSSBindingFactoryImpl
\ No newline at end of file
diff --git a/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index d298c16..0000000
--- a/modules/binding-rss/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.rss,model=org.apache.tuscany.sca.binding.rss.RSSBinding,factory=org.apache.tuscany.sca.binding.rss.RSSBindingFactory
diff --git a/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java b/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
index 88c6888..08f2bee 100644
--- a/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
+++ b/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RuntimeSCAReferenceBindingProvider.java
@@ -154,7 +154,7 @@
// it turns out that the chain source and target operations are the same, and are the operation
// from the target, not sure if thats by design or a bug. The SCA binding invoker needs to know
// the source and target class loaders so pass in the real source operation in the constructor
- return chain == null ? null : new SCABindingInvoker(chain, operation, mediator, passByValue);
+ return chain == null ? null : new SCABindingInvoker(chain, operation, mediator, passByValue, epr);
}
}
return null;
diff --git a/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java b/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java
index a0b976c..c2a9038 100644
--- a/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java
+++ b/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/SCABindingInvoker.java
@@ -26,6 +26,8 @@
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
/**
* @version $Rev$ $Date$
@@ -36,17 +38,21 @@
private Operation sourceOperation;
private Operation targetOperation;
private boolean passByValue;
+ private RuntimeEndpointReference epr;
+ private RuntimeEndpoint ep;
/**
* Construct a SCABindingInvoker that delegates to the service invocaiton chain
*/
- public SCABindingInvoker(InvocationChain chain, Operation sourceOperation, Mediator mediator, boolean passByValue) {
+ public SCABindingInvoker(InvocationChain chain, Operation sourceOperation, Mediator mediator, boolean passByValue, RuntimeEndpointReference epr) {
super();
this.chain = chain;
this.mediator = mediator;
this.sourceOperation = sourceOperation;
this.targetOperation = chain.getTargetOperation();
this.passByValue = passByValue;
+ this.epr = epr;
+ this.ep = (RuntimeEndpoint)epr.getTargetEndpoint();
}
/**
@@ -71,6 +77,13 @@
if (passByValue) {
msg.setBody(mediator.copyInput(msg.getBody(), sourceOperation, targetOperation));
}
+
+ ep.getInvocationChains();
+ if ( !ep.getCallbackEndpointReferences().isEmpty() ) {
+ RuntimeEndpointReference asyncEPR = (RuntimeEndpointReference) ep.getCallbackEndpointReferences().get(0);
+ // Place a link to the callback EPR into the message headers...
+ msg.getHeaders().put("ASYNC_CALLBACK", asyncEPR );
+ }
Message resultMsg = getNext().invoke(msg);
diff --git a/modules/binding-ws-runtime-axis2/pom.xml b/modules/binding-ws-runtime-axis2/pom.xml
index fba3e79..cad86ff 100644
--- a/modules/binding-ws-runtime-axis2/pom.xml
+++ b/modules/binding-ws-runtime-axis2/pom.xml
@@ -29,92 +29,29 @@
<artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
<name>Apache Tuscany SCA Axis2-1.5-based WS Binding Runtime</name>
- <repositories>
- <repository>
- <id>apache.ws</id>
- <name>Apache WebServices Repository</name>
- <url>http://ws.zones.apache.org/repository/</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
<dependencies>
<!-- Compile dependencies -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-ws-wsdlgen</artifactId>
<version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
+ </dependency>
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-policy-security</artifactId>
<version>2.0-Beta1</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
@@ -301,6 +238,10 @@
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -365,6 +306,10 @@
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -400,36 +345,46 @@
</exclusion>
</exclusions>
</dependency>
+
+ <!-- Runtime dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-axiom</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
<!-- Test dependencies -->
-
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-jetty</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
+ </dependency>
+
+<!--
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
+-->
</dependencies>
diff --git a/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingProvider.java b/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingProvider.java
index d93f4ed..20f5e00 100644
--- a/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingProvider.java
+++ b/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ReferenceBindingProvider.java
@@ -146,7 +146,7 @@
// Validate that the WSDL is not using SOAP v1.2 if requires="SOAP.v1_1" has been specified
if ( isSOAP11Required ) {
Definition def = wsBinding.getGeneratedWSDLDocument();
- Binding binding = def.getBinding(wsBinding.getBindingName());
+ Binding binding = def.getBinding(wsBinding.getBinding().getQName());
for ( Object ext : binding.getExtensibilityElements() ) {
if ( ext instanceof SOAP12Binding )
throw new ServiceRuntimeException("WSDL document is using SOAP v1.2 but SOAP v1.1 " +
@@ -157,7 +157,7 @@
// Validate that the WSDL is not using SOAP v1.1 if requires="SOAP.v1_2" has been specified
if ( isSOAP12Required ) {
Definition def = wsBinding.getGeneratedWSDLDocument();
- Binding binding = def.getBinding(wsBinding.getBindingName());
+ Binding binding = def.getBinding(wsBinding.getBinding().getQName());
for ( Object ext : binding.getExtensibilityElements() ) {
if ( ext instanceof SOAPBinding )
throw new ServiceRuntimeException("WSDL document is using SOAP v1.1 but SOAP v1.2 " +
diff --git a/modules/binding-ws-runtime-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/modules/binding-ws-runtime-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
deleted file mode 100644
index 090b255..0000000
--- a/modules/binding-ws-runtime-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
diff --git a/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java b/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java
index 516ca62..91d4bca 100644
--- a/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java
+++ b/modules/binding-ws-runtime-jaxws-ri/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/ri/JAXWSServiceBindingProvider.java
@@ -112,17 +112,21 @@
wsBinding.getPort().getName());
properties.put(Endpoint.WSDL_PORT, portName);
+ QName bindingServiceName = wsBinding.getServiceName() == null ? wsBinding.getService().getQName() : wsBinding.getServiceName();
QName serviceName = new QName(targetNamespace,
- wsBinding.getService().getQName().getLocalPart());
+ bindingServiceName.getLocalPart());
properties.put(Endpoint.WSDL_SERVICE, serviceName);
-
+
wsEndpoint.setMetadata(metadata);
wsEndpoint.setProperties(properties);
// Start up the endpoint
+
wsEndpoint.publish(wsBinding.getURI());
-
+
+
jaxwsBindingProvider.start();
+
}
public void stop() {
diff --git a/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
deleted file mode 100644
index 452c9f2..0000000
--- a/modules/binding-ws-runtime-jaxws-ri/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
diff --git a/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml b/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
deleted file mode 100644
index 74a3563..0000000
--- a/modules/binding-ws-runtime-jaxws-ri/src/main/resources/org/apache/tuscany/sca/binding/ws/jaxws/ri/definitions.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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.
--->
-
-<!-- $Rev: 907636 $ $Date: 2010-02-09 01:39:16 +1300 (Tue, 09 Feb 2010) $ -->
-
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <sca:bindingType type="sca:binding.ws" mayProvide="sca:SOAP sca:SOAP.v1_1 sca:SOAP.v1_2 tuscany:MTOM" alwaysProvides=""/>
-
- <!-- see the file sca-policy-1.1-intents-definitions.xml in the -->
- <!-- assembly-xsd module for spec defined intents -->
-
- <!-- PolicyIntents defined by the SCA Runtime Extension for WS Binding Axis 2 -->
-
- <sca:intent name="MTOM" constrains="sca:binding.ws">
- <sca:description>
- Communication through this binding requires MTOM support
- </sca:description>
- </sca:intent>
-
- </sca:definitions>
diff --git a/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java b/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
index 56fd02a..5308b3c 100644
--- a/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
+++ b/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
@@ -51,6 +51,7 @@
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
import org.w3c.dom.Element;
/**
@@ -81,10 +82,16 @@
private QName soapBody;
private QName soapFault;
private QName soapOperation;
-
- public WSDLDefinitionGenerator(boolean requiresSOAP12) {
+ private String wsBindingName;
+
+ public WSDLDefinitionGenerator(WebServiceBinding wsBinding) {
+ this(BindingWSDLGenerator.requiresSOAP12(wsBinding));
+ wsBindingName = wsBinding.getName();
+ }
+
+ public WSDLDefinitionGenerator(boolean isSOAP12) {
super();
- this.requiresSOAP12 = requiresSOAP12;
+ this.requiresSOAP12 = isSOAP12;
soapAddress = requiresSOAP12 ? SOAP12_ADDRESS : SOAP_ADDRESS;
soapBinding = requiresSOAP12 ? SOAP12_BINDING : SOAP_BINDING;
soapBody = requiresSOAP12 ? SOAP12_BODY : SOAP_BODY;
@@ -127,6 +134,14 @@
}
protected void configureBinding(Definition definition, Binding binding, PortType portType) throws WSDLException {
+ if ( wsBindingName != null ) {
+ QName name = new QName(definition.getTargetNamespace(), wsBindingName + getSOAPVersionString() + BINDING_SUFFIX);
+ if ( definition.getBinding(name) == null ) {
+ binding.setQName(name);
+ return;
+ }
+ }
+
QName portTypeName = portType.getQName();
if (portTypeName != null) {
// Choose <porttype>Binding if available. If this name is in use, insert
@@ -235,11 +250,10 @@
}
}
- public Service createService(Definition definition, PortType portType) {
+ public Service createService(Definition definition, PortType portType, String serviceName) {
try {
Service service = definition.createService();
- configureService(definition, service, portType);
- // createPort(definition, binding, service);
+ configureService(definition, service, portType, serviceName);
definition.addService(service);
return service;
} catch (WSDLException e) {
@@ -247,11 +261,10 @@
}
}
- public Service createService(Definition definition, Binding binding) {
+ public Service createService(Definition definition, Binding binding, String serviceName) {
try {
Service service = definition.createService();
- configureService(definition, service, binding.getPortType());
- // createPort(definition, binding, service);
+ configureService(definition, service, binding.getPortType(), serviceName);
definition.addService(service);
return service;
} catch (WSDLException e) {
@@ -259,7 +272,15 @@
}
}
- protected void configureService(Definition definition, Service service, PortType portType) throws WSDLException {
+ protected void configureService(Definition definition, Service service, PortType portType, String serviceName) throws WSDLException {
+ if ( serviceName != null ) {
+ QName name = new QName(definition.getTargetNamespace(), serviceName);
+ if ( definition.getService(name) == null ) {
+ service.setQName(name);
+ return;
+ }
+ }
+
QName portTypeName = portType.getQName();
if (portTypeName != null) {
// Choose <porttype>Service if available. If this name is in use, insert
@@ -297,9 +318,19 @@
}
protected void configurePort(Port port, Binding binding) throws WSDLException {
- if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
+ if ( wsBindingName != null ) {
+ port.setName(wsBindingName + getSOAPVersionString() + PORT_SUFFIX);
+ } else if (binding.getPortType() != null && binding.getPortType().getQName() != null) {
port.setName(binding.getPortType().getQName().getLocalPart() + PORT_SUFFIX);
}
}
+
+ private String getSOAPVersionString() {
+ if ( requiresSOAP12 ) {
+ return "SOAP12";
+ } else {
+ return "SOAP11";
+ }
+ }
}
diff --git a/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java b/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
index 3bc7844..c6f1db4 100644
--- a/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
+++ b/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLServiceGenerator.java
@@ -249,10 +249,10 @@
// add a service and ports to the generated definition
WSDLDefinitionGenerator helper =
- new WSDLDefinitionGenerator(BindingWSDLGenerator.requiresSOAP12(wsBinding));
+ new WSDLDefinitionGenerator(wsBinding);
WSDLInterface wi = (WSDLInterface)wsBinding.getBindingInterfaceContract().getInterface();
PortType portType = wi.getPortType();
- Service service = helper.createService(def, portType);
+ Service service = helper.createService(def, portType, contract.getName());
if (wsBinding.getBinding() == null && ports.size() == 0) {
Binding binding = helper.createBinding(def, portType);
if (BindingWSDLGenerator.requiresSOAP12(wsBinding)) {
diff --git a/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java b/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
index d147d85..f905c10 100644
--- a/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
+++ b/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java
@@ -58,7 +58,7 @@
JavaInterface iface = factory.createJavaInterface(HelloWorld.class);
DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(registry);
JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface);
+ new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface);
new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface);
javaIC.setInterface(iface);
WSDLInterfaceContract wsdlIC = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
@@ -71,7 +71,7 @@
JavaInterfaceContract javaIC2 = factory.createJavaInterfaceContract();
JavaInterface iface2 = factory.createJavaInterface(TestJavaInterface.class);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface2);
+ new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface2);
new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface2);
javaIC2.setInterface(iface2);
WSDLInterfaceContract wsdlIC2 = BindingWSDLGenerator.createWSDLInterfaceContract(javaIC2, false, new XSDModelResolver(null, null), dataBindings, wsdlFactory, xsdFactory, documentBuilderFactory, null);
diff --git a/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java b/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
index 33d5bea..c80a929 100644
--- a/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
+++ b/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java
@@ -55,7 +55,7 @@
JavaInterface iface = iFactory.createJavaInterface(TestJavaInterface.class);
DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(new DefaultExtensionPointRegistry());
JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null);
- new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface);
+ new JAXWSJavaInterfaceProcessor(registry).visitInterface(iface);
new DataBindingJavaInterfaceProcessor(registry).visitInterface(iface);
DefaultFactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(registry);
WSDLFactory wFactory = new DefaultWSDLFactory(registry);
diff --git a/modules/binding-ws/META-INF/MANIFEST.MF b/modules/binding-ws/META-INF/MANIFEST.MF
index 2df0f0f..0672cae 100644
--- a/modules/binding-ws/META-INF/MANIFEST.MF
+++ b/modules/binding-ws/META-INF/MANIFEST.MF
@@ -7,7 +7,8 @@
org.w3c.dom,
javax.wsdl,
javax.xml.namespace",
- org.apache.tuscany.sca.binding.ws.addressing;version="2.0.0";uses:="javax.xml.namespace"
+ org.apache.tuscany.sca.binding.ws.addressing;version="2.0.0";uses:="javax.xml.namespace",
+ org.apache.tuscany.sca.binding.ws.xml
Private-Package: org.apache.tuscany.sca.binding.ws.impl;version="2.0.0"
SCA-Version: 1.1
Bundle-Name: Apache Tuscany SCA WS Binding Model
diff --git a/modules/binding-ws/pom.xml b/modules/binding-ws/pom.xml
index b9747d2..168045d 100644
--- a/modules/binding-ws/pom.xml
+++ b/modules/binding-ws/pom.xml
@@ -52,28 +52,7 @@
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-builder</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
diff --git a/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
new file mode 100644
index 0000000..3817fca
--- /dev/null
+++ b/modules/binding-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org/apache/tuscany/sca/binding/ws/definitions.xml
diff --git a/modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml b/modules/binding-ws/src/main/resources/org/apache/tuscany/sca/binding/ws/definitions.xml
similarity index 100%
rename from modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
rename to modules/binding-ws/src/main/resources/org/apache/tuscany/sca/binding/ws/definitions.xml
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
index 694ece2..c98001d 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java
@@ -18,6 +18,7 @@
*/
package org.apache.tuscany.sca.builder.impl;
+import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.net.URI;
@@ -181,6 +182,8 @@
configureReferences(component, context);
// NOTE: configureServices/configureReferences may add callback references and services
+
+ // inherit the intents and policy sets from the component type
policyBuilder.configure(component, context);
} finally {
@@ -266,10 +269,10 @@
calculateServiceInterfaceContract(component, componentService, componentTypeService, monitor);
// bindings
- calculateBindings(component, componentService, componentTypeService, monitor);
+ calculateBindings(component, componentService, componentTypeService, context);
// add callback reference model objects
- createCallbackReference(component, componentService);
+ createCallbackReference(component, componentService, monitor);
}
}
@@ -311,7 +314,7 @@
calculateBindings(componentReference, componentTypeReference);
// add callback service model objects
- createCallbackService(component, componentReference);
+ createCallbackService(component, componentReference, monitor);
// Propagate autowire setting from the component down the structural
// hierarchy
@@ -807,138 +810,257 @@
Monitor monitor) {
String source = componentProperty.getSource();
- if (source != null) {
- // $<name>/...
- int index = source.indexOf('/');
- if (index == -1) {
- // Tolerating $prop
- source = source + "/";
- index = source.length() - 1;
- }
- if (source.charAt(0) == '$') {
- String name = source.substring(1, index);
- Property sourceProp = null;
- if (outerComponent != null) {
- sourceProp = outerComponent.getProperty(name);
- } else {
- sourceProp = parentComposite.getProperty(name);
- }
- if (sourceProp == null) {
- Monitor.error(monitor,
- this,
- Messages.ASSEMBLY_VALIDATION,
- "PropertySourceNotFound",
- source,
- componentProperty.getName(),
- component.getName());
- }
+ if (source == null) return;
+
+ try {
+ String sourceName = extractSourcePropertyName( source );
- Document sourcePropValue = (Document)sourceProp.getValue();
-
- try {
- // FIXME: How to deal with namespaces?
- Document node =
- evaluateXPath(sourcePropValue,
- componentProperty.getSourceXPathExpression(),
- documentBuilderFactory);
-
- if (node != null) {
- componentProperty.setValue(node);
- } else {
- Monitor.warning(monitor,
- this,
- Messages.ASSEMBLY_VALIDATION,
- "PropertyXpathExpressionReturnedNull",
- component.getName(),
- componentProperty.getName(),
- componentProperty.getSource());
- }
- } catch (Exception ex) {
- Monitor.error(monitor,
- this,
- Messages.ASSEMBLY_VALIDATION,
- "PropertySourceXpathInvalid",
- source,
- componentProperty.getName(),
- component.getName(),
- ex);
- }
+ Property sourceProp = null;
+ if (outerComponent != null) {
+ sourceProp = outerComponent.getProperty(sourceName);
} else {
+ sourceProp = parentComposite.getProperty(sourceName);
+ }
+ if (sourceProp == null) {
Monitor.error(monitor,
this,
Messages.ASSEMBLY_VALIDATION,
- "PropertySourceValueInvalid",
+ "PropertySourceNotFound",
source,
componentProperty.getName(),
component.getName());
- }
- }
- }
+ } else {
+
+ Document sourcePropValue = (Document)sourceProp.getValue();
+
+ try {
+ // FIXME: How to deal with namespaces?
+ Document node =
+ evaluateXPath2(sourcePropValue,
+ componentProperty.getSourceXPathExpression(),
+ documentBuilderFactory);
+
+ if (node != null) {
+ componentProperty.setValue(node);
+ } else {
+ Monitor.warning(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PropertyXpathExpressionReturnedNull",
+ component.getName(),
+ componentProperty.getName(),
+ componentProperty.getSource());
+ } // end if
+
+ } catch (Exception ex) {
+ Monitor.error(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PropertySourceXpathInvalid",
+ source,
+ componentProperty.getName(),
+ component.getName(),
+ ex);
+ } // end try
+ } // end if
+ } catch (IllegalArgumentException e ) {
+ Monitor.error(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PropertySourceValueInvalid",
+ source,
+ componentProperty.getName(),
+ component.getName());
+ } // end try
+ } // end method
+
+ /**
+ * Extracts the name of the source property from the value of an @source attribute string
+ * @param source - the value of the @source attribute
+ * @return - the source property name as a String
+ */
+ private String extractSourcePropertyName( String source ) throws IllegalArgumentException {
+ String propertyName = null;
+
+ // Possible values for the source string:
+ // a) $name
+ // b) $name/expression
+ // c) $name[xx]
+ // d) $name[xx]/expression
+ // ...and note that the expression MAY contain '/' and '[' characters
+ if( source.charAt(0) != '$' ) throw new IllegalArgumentException("Source value does not start with '$'");
+
+ int index = source.indexOf('/');
+ int bracket = source.indexOf('[');
+
+ if( index == -1 && bracket == -1 ) {
+ // Format a) - simply remove the '$'
+ propertyName = source.substring(1);
+ } else if ( bracket == -1 ) {
+ // Format b) - remove the '$' and the '/' and everything following it
+ propertyName = source.substring(1, index);
+ } else if ( index == -1 ) {
+ // Format c) - remove the '$' and the '[' and everything following it
+ propertyName = source.substring(1, bracket);
+ } else {
+ // Format d) - but need to ensure that the '[' is BEFORE the '/'
+ if( bracket < index ) {
+ // Format d) - remove the '$' and the '[' and everything following it
+ propertyName = source.substring(1, bracket);
+ } else {
+ // Format b) variant where there is a '[' in the expression...
+ propertyName = source.substring(1, index);
+ } // end if
+ } // end if
+
+ return propertyName;
+ } // end method extractSourcePropertyName( source, monitor )
/**
- * If the property has a file attribute use this to retrieve the value from a
- * local file
-
+ * If the property has a file attribute use this to retrieve the property value from a local file
+ * Format of the property value file is defined in the SCA Assembly specification in ASM50046
*
- * @param parentCompoent the composite that contains the component
- * @param component
+ * @param component the component holding the property
+ * @param componentProperty - the property
+ * @param monitor - a Monitor object for reporting problems
+ */
+ /**
+ * Property file format:
+ * MUST contain a <sca:values/> element
+ * - either contains one or more <sca:value/> subelements (mandatory for property with a simple XML type)
+ * - or contains one or more global elements of the type of the property
+ *
+ * eg.
+ * <?xml version="1.0" encoding="UTF-8"?>
+ * <values>
+ * <value>MyValue</value>
+ * </values>
+ *
+ * <?xml version="1.0" encoding="UTF-8"?>
+ * <values>
+ * <foo:fooElement>
+ * <foo:a>AValue</foo:a>
+ * <foo:b>InterestingURI</foo:b>
+ * </foo:fooElement>
+ * </values/>
*/
private void processPropertyFileAttribute(Component component, ComponentProperty componentProperty, Monitor monitor) {
String file = componentProperty.getFile();
- if (file != null) {
+ if (file == null) return;
+ try {
+/*
+ URI uri = URI.create(file);
+ // URI resolution for relative URIs is done when the composite is resolved.
+ URL url = uri.toURL();
+ URLConnection connection = url.openConnection();
+ connection.setUseCaches(false);
+ InputStream is = null;
try {
- URI uri = URI.create(file);
- // URI resolution for relative URIs is done when the composite is resolved.
- URL url = uri.toURL();
- URLConnection connection = url.openConnection();
- connection.setUseCaches(false);
- InputStream is = null;
- try {
- is = connection.getInputStream();
- Source streamSource = new SAXSource(new InputSource(is));
- DOMResult result = new DOMResult();
- javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
- transformer.transform(streamSource, result);
+ is = connection.getInputStream();
- Document document = (Document)result.getNode();
+ Source streamSource = new SAXSource(new InputSource(is));
+ DOMResult result = new DOMResult();
+ javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
+ transformer.transform(streamSource, result);
- // TUSCANY-2377, Add a fake value element so it's consistent with
- // the DOM tree loaded from inside SCDL
- if (!document.getDocumentElement().getLocalName().equals("value")){
- Element root = document.createElementNS(null, "value");
- root.appendChild(document.getDocumentElement());
-
- // remove all the child nodes as they will be replaced by
- // the "value" node
- NodeList children = document.getChildNodes();
- for (int i=0; i < children.getLength(); i++){
- document.removeChild(children.item(i));
- }
-
- // add the value node back in
- document.appendChild(root);
+ Document document = (Document)result.getNode();
+*/
+ Document document = readPropertyFileData( file );
+
+ Element docElement = document.getDocumentElement();
+ if( docElement == null ) throw new Exception("Property File has no XML document element");
+
+ if( !"values".equals( docElement.getLocalName() ) ) {
+ throw new Exception("Property File does not start with <values/> element");
+ } // end if
+
+ // The property value is the subelement(s) of the <values/> element
+ NodeList values = docElement.getChildNodes();
+
+ Document newdoc = documentBuilderFactory.newDocumentBuilder().newDocument();
+ Element newProperty = newdoc.createElementNS(SCA11_NS, "property");
+ newdoc.appendChild( newProperty );
+
+ int count = 0;
+
+ // Copy the property values under the new <property/> element
+ for( int i = 0 ; i < values.getLength() ; i++ ) {
+ Node valueNode = values.item(i);
+ // Only <value/> elements or global elements are valid values...
+ if( valueNode.getNodeType() == Node.ELEMENT_NODE ) {
+ newProperty.appendChild(newdoc.importNode(values.item(i), true));
+ count++;
+ } // end if
+ } // end for
+
+ if( count == 0 ) {
+ throw new Exception("Property File has no property values");
+ } // end if
+
+ componentProperty.setValue(newdoc);
+
+/*
+ // TUSCANY-2377, Add a fake value element so it's consistent with
+ // the DOM tree loaded from inside SCDL
+ if (!document.getDocumentElement().getLocalName().equals("value")){
+ Element root = document.createElementNS(null, "value");
+ root.appendChild(document.getDocumentElement());
+
+ // remove all the child nodes as they will be replaced by the "value" node
+ NodeList children = document.getChildNodes();
+ for (int i=0; i < children.getLength(); i++){
+ document.removeChild(children.item(i));
}
- componentProperty.setValue(document);
- } finally {
- if (is != null) {
- is.close();
- }
- }
- } catch (Exception ex) {
- Monitor.error(monitor,
- this,
- Messages.ASSEMBLY_VALIDATION,
- "PropertyFileValueInvalid",
- file,
- componentProperty.getName(),
- component.getName(),
- ex);
+ // add the value node back in
+ document.appendChild(root);
+ }
+ componentProperty.setValue(document);
+ } finally {
+ if (is != null) {
+ is.close();
+ }
+ } // end try
+*/
+ } catch (Exception ex) {
+ Monitor.error(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PropertyFileValueInvalid",
+ file,
+ componentProperty.getName(),
+ component.getName(),
+ ex);
+ } // end try
+ } // end method processPropertyFileAttribute
+
+ private Document readPropertyFileData( String file ) throws Exception {
+ Document doc = null;
+
+ URI uri = URI.create(file);
+ // URI resolution for relative URIs is done when the composite is resolved.
+ URL url = uri.toURL();
+ URLConnection connection = url.openConnection();
+ connection.setUseCaches(false);
+ InputStream is = null;
+ try {
+ is = connection.getInputStream();
+
+ Source streamSource = new SAXSource(new InputSource(is));
+ DOMResult result = new DOMResult();
+ javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
+ transformer.transform(streamSource, result);
+
+ doc = (Document)result.getNode();
+ } finally {
+ if (is != null) {
+ is.close();
}
- }
+ } // end try
- }
+ return doc;
+ } // end method readPropertyFileData
/**
* Evaluate an XPath expression against a Property value, returning the result as a Property value
@@ -984,6 +1106,51 @@
return document;
}
}
+
+ /**
+ * Evaluate an XPath expression against a Property value, returning the result as a Property value
+ * - deals with multi-valued input property values and with multi-valued output property values
+ * @param node - the document root element of a Property value
+ * @param expression - the XPath expression
+ * @param documentBuilderFactory - a DOM document builder factory
+ * @return - a DOM Document representing the result of the evaluation as a Property value
+ * @throws XPathExpressionException
+ * @throws ParserConfigurationException
+ */
+ private Document evaluateXPath2(Document node,
+ XPathExpression expression,
+ DocumentBuilderFactory documentBuilderFactory) throws XPathExpressionException,
+ ParserConfigurationException {
+
+ // The document element is a <sca:property/> element
+ Element property = node.getDocumentElement();
+
+ NodeList result = (NodeList)expression.evaluate(property, XPathConstants.NODESET);
+ if (result == null || result.getLength() == 0) return null;
+
+ if (result instanceof Document) {
+ return (Document)result;
+ } else {
+ Document document = documentBuilderFactory.newDocumentBuilder().newDocument();
+ Element newProperty = document.createElementNS(SCA11_NS, "property");
+
+ for( int i = 0 ; i < result.getLength() ; i++ ) {
+ if (result.item(i).getNodeType() == Node.ELEMENT_NODE) {
+ // If the result is an element, use it directly in the result
+ newProperty.appendChild(document.importNode(result.item(i), true));
+ } else {
+ // If the result is not an element, create a <value/> element to contain the result
+ Element newValue = document.createElementNS(SCA11_NS, "value");
+ newValue.appendChild(document.importNode(result.item(i), true));
+ newProperty.appendChild(newValue);
+ } // end if
+ } // end for
+
+ document.appendChild(newProperty);
+
+ return document;
+ } // end if
+ } // end method
/**
* Create a callback reference for a component service
@@ -991,12 +1158,12 @@
* @param component
* @param service
*/
- private void createCallbackReference(Component component, ComponentService service) {
+ private void createCallbackReference(Component component, ComponentService service, Monitor monitor) {
// if the service has a callback interface create a reference
// to represent the callback
if (service.getInterfaceContract() != null && // can be null in unit tests
- service.getInterfaceContract().getCallbackInterface() != null) {
+ service.getInterfaceContract().getCallbackInterface() != null) {
ComponentReference callbackReference = assemblyFactory.createComponentReference();
callbackReference.setForCallback(true);
@@ -1032,7 +1199,19 @@
if (((CompositeService)implService).getPromotedService().isUnresolved() == false){
String referenceName = ((CompositeService)implService).getPromotedService().getName();
ComponentReference promotedReference = ((CompositeService)implService).getPromotedComponent().getReference(referenceName);
- implCompReference.getPromotedReferences().add(promotedReference);
+
+ if (promotedReference != null){
+ implCompReference.getPromotedReferences().add(promotedReference);
+ } else {
+ Monitor.error(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PromotedCallbackReferenceNotFound",
+ component.getName(),
+ service.getName(),
+ ((CompositeService)implService).getPromotedComponent().getName(),
+ referenceName);
+ }
}
implReference = implCompReference;
@@ -1098,7 +1277,7 @@
* @param component
* @param service
*/
- private void createCallbackService(Component component, ComponentReference reference) {
+ private void createCallbackService(Component component, ComponentReference reference, Monitor monitor) {
if (reference.getInterfaceContract() != null && // can be null in unit tests
reference.getInterfaceContract().getCallbackInterface() != null) {
ComponentService callbackService = assemblyFactory.createComponentService();
@@ -1134,7 +1313,19 @@
if (((CompositeReference)implReference).getPromotedReferences().get(0).isUnresolved() == false){
String serviceName = ((CompositeReference)implReference).getPromotedReferences().get(0).getName();
ComponentService promotedService = ((CompositeReference)implReference).getPromotedComponents().get(0).getService(serviceName);
- implCompService.setPromotedService(promotedService);
+
+ if (promotedService != null){
+ implCompService.setPromotedService(promotedService);
+ } else {
+ Monitor.error(monitor,
+ this,
+ Messages.ASSEMBLY_VALIDATION,
+ "PromotedCallbackServiceNotFound",
+ component.getName(),
+ reference.getName(),
+ ((CompositeReference)implReference).getPromotedComponents().get(0).getName(),
+ serviceName);
+ }
}
implService = implCompService;
@@ -1320,7 +1511,7 @@
}
// TODO - there is an issue with the following code if the
- // contracts of of different types. Need to use the
+ // contracts are of different types. Need to use the
// normalized form
// fix up the forward interface based on the promoted component
@@ -1404,14 +1595,16 @@
* @param componentService the top service
* @param componentTypeService the bottom service
*/
- private void calculateBindings(Component component, Service componentService, Service componentTypeService, Monitor monitor) {
+ private void calculateBindings(Component component, Service componentService, Service componentTypeService, BuilderContext context) {
+ Monitor monitor = context.getMonitor();
+
// forward bindings
if (componentService.getBindings().isEmpty()) {
componentService.getBindings().addAll(componentTypeService.getBindings());
}
if (componentService.getBindings().isEmpty()) {
- createSCABinding(componentService, null);
+ createSCABinding(componentService, context.getDefinitions());
}
// callback bindings
@@ -1465,7 +1658,7 @@
}
/**
- * A local wrapper for the interace contract mapper as we need to normalize the
+ * A local wrapper for the interface contract mapper as we need to normalize the
* interface contracts if appropriate and the mapper doesn't have the right
* dependencies to be able to do it.
*
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
index e908122..6ce0a3a 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentPolicyBuilderImpl.java
@@ -110,7 +110,7 @@
// The intents are merged and the exclusion check will be done after
for (Intent intent : subject.getRequiredIntents()) {
if (!policySubject.getRequiredIntents().contains(intent)){
- if (intentType != null) {
+ if ((intent.getType() != null) && (intentType != null) ) {
if (intent.getType().equals(intentType)){
policySubject.getRequiredIntents().add(intent);
}
@@ -392,7 +392,7 @@
subject.getRequiredIntents().remove(i);
subject.getRequiredIntents().add(i.getDefaultQualifiedIntent());
}
- }
+ }
}
protected void resolveAndNormalize(PolicySubject subject, BuilderContext context) {
Definitions definitions = context.getDefinitions();
@@ -469,9 +469,13 @@
if(extensionType != null){
List<Intent> copy = new ArrayList<Intent>(intents);
for (Intent i : copy) {
- if (i.getConstrainedTypes().size() > 0){
+ List<ExtensionType> constrainedTypes = i.getConstrainedTypes();
+ if (( constrainedTypes.size() == 0 ) && ( i.getQualifiableIntent() != null ) )
+ constrainedTypes = i.getQualifiableIntent().getConstrainedTypes();
+
+ if (constrainedTypes.size() > 0){
boolean constraintFound = false;
- for (ExtensionType constrainedType : i.getConstrainedTypes()){
+ for (ExtensionType constrainedType : constrainedTypes){
if (constrainedType.getType().equals(extensionType.getType()) ||
constrainedType.getType().equals(extensionType.getBaseType())){
constraintFound = true;
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositeComponentTypeBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositeComponentTypeBuilderImpl.java
index 1deec1b..f87854c 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositeComponentTypeBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositeComponentTypeBuilderImpl.java
@@ -657,7 +657,7 @@
}
/**
- * A local wrapper for the interace contract mapper as we need to normalize the
+ * A local wrapper for the interface contract mapper as we need to normalize the
* interface contracts if appropriate and the mapper doesn't have the right
* dependencies to be able to do it.
*
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
index e644472..9c4da51 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/CompositePolicyBuilderImpl.java
@@ -37,7 +37,9 @@
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
import org.apache.tuscany.sca.assembly.builder.PolicyBuilder;
+import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -103,18 +105,20 @@
}
for (Endpoint ep : componentService.getEndpoints()) {
- if (componentService.getInterfaceContract() != null) {
- // Inherit from the component.service.interface
- inherit(ep, Intent.Type.interaction, true, componentService.getInterfaceContract().getInterface());
- }
+
// Inherit from binding
- inherit(ep, Intent.Type.interaction, true, ep.getBinding());
+ inherit(ep, null, true, ep.getBinding());
// Inherit from composite/component/service
- inherit(ep, Intent.Type.interaction, true, ep.getService(), ep.getComponent(), composite );
+ inherit(ep, null, true, ep.getService(), ep.getComponent(), composite );
-
+ if (componentService.getInterfaceContract() != null) {
+ // Inherit from the component.service.interface
+ // Do not check mutual exclusion here.. interfaces do not follow normal rules
+ // of the structural hierarchy (Policy spec 4.10)
+ inherit(ep, null, false, componentService.getInterfaceContract().getInterface());
+ }
// Replace profile intents with their required intents
// Replace unqualified intents if there is a qualified intent in the list
@@ -157,19 +161,19 @@
}
for (EndpointReference epr : componentReference.getEndpointReferences()) {
-
- // Inherit from the component.reference.interface
- if (componentReference.getInterfaceContract() != null) {
- inherit(epr, Intent.Type.interaction, true, componentReference.getInterfaceContract().getInterface());
- }
-
+
// Inherit from binding
- inherit(epr, Intent.Type.interaction, true, epr.getBinding());
+ inherit(epr, null, true, epr.getBinding());
// Inherit from composite/component/reference
- inherit(epr, Intent.Type.interaction, true, epr.getReference(), epr.getComponent(), composite);
+ inherit(epr, null, true, epr.getReference(), epr.getComponent(), composite);
-
+ // Inherit from the component.reference.interface
+ if (componentReference.getInterfaceContract() != null) {
+ // Do not check mutual exclusion here.. interfaces do not follow normal rules
+ // of the structural hierarchy (Policy spec 4.10)
+ inherit(epr, null, true, componentReference.getInterfaceContract().getInterface());
+ }
// Replace profile intents with their required intents
// Replace unqualified intents if there is a qualified intent in the list
@@ -195,14 +199,8 @@
}
}
- if (implementation instanceof Composite) {
-
- // POL-4009 componentType attached policySets are ignored when policySets are
- // attached to the using component definition.
- if ( !component.getPolicySets().isEmpty() || !composite.getPolicySets().isEmpty() ) {
- implementation.getPolicySets().clear();
- }
-
+ if (implementation instanceof Composite) {
+ resolveAndCheck(implementation, context);
inherit(implementation, Intent.Type.implementation, true, component, composite);
computePolicies((Composite)implementation, context);
expandDefaultIntents(implementation,context);
@@ -228,12 +226,133 @@
monitor.popContext();
}
}
+ removeConstrainedIntents(composite, context);
} finally {
monitor.popContext();
}
}
-
- private void checkForNoListenerIntent(Endpoint ep, BuilderContext context) {
+
+ private void validateTransactionIntents(Composite composite, BuilderContext context) {
+
+ for ( Component component : composite.getComponents() ) {
+ if ( component.getImplementation() != null ) {
+ if ( component.getImplementation() instanceof Composite )
+ validateTransactionIntents((Composite) component.getImplementation(), context);
+
+ for ( Intent implIntent : component.getImplementation().getRequiredIntents() ) {
+ if ( Constants.MANAGED_TRANSACTION_LOCAL_INTENT.equals(implIntent.getName() ) ) {
+ for ( ComponentReference reference : component.getReferences() ) {
+ for ( EndpointReference epr : reference.getEndpointReferences() ) {
+ for ( Intent eprIntent : epr.getRequiredIntents() ) {
+ if ( Constants.TRANSACTED_ONE_WAY_INTENT.equals(eprIntent.getName())) {
+ error(context.getMonitor(),
+ "TransactedOneWayWithManagedTransactionLocal",
+ this,
+ "reference",
+ epr.getComponent().getName(),
+ epr.getReference().getName());
+ } else if ( Constants.PROPAGATES_TRANSACTION_INTENT.equals(eprIntent.getName())) {
+ error(context.getMonitor(),
+ "PropagatesTransactionWithLocalTran",
+ this,
+ "reference",
+ epr.getComponent().getName(),
+ epr.getReference().getName());
+ }
+ }
+ }
+ }
+ for ( ComponentService service : component.getServices() ) {
+ for ( Endpoint ep : service.getEndpoints() ) {
+ for ( Intent epIntent : ep.getRequiredIntents() ) {
+ if ( Constants.TRANSACTED_ONE_WAY_INTENT.equals(epIntent.getName())) {
+ error(context.getMonitor(),
+ "TransactedOneWayWithManagedTransactionLocal",
+ this,
+ "service",
+ ep.getComponent().getName(),
+ ep.getService().getName());
+ } else if ( Constants.PROPAGATES_TRANSACTION_INTENT.equals(epIntent.getName())) {
+ error(context.getMonitor(),
+ "PropagatesTransactionWithLocalTran",
+ this,
+ "service",
+ ep.getComponent().getName(),
+ ep.getService().getName());
+ }
+ }
+ }
+ }
+ } else if ( Constants.NO_MANAGED_TRANSACTION_INTENT.equals(implIntent.getName())) {
+ for ( ComponentService service : component.getServices() ) {
+ for ( Endpoint ep : service.getEndpoints() ) {
+ for ( Intent epIntent : ep.getRequiredIntents() ) {
+ if ( Constants.PROPAGATES_TRANSACTION_INTENT.equals(epIntent.getName())) {
+ error(context.getMonitor(),
+ "PropagatesTransactionWithNoManagedTran",
+ this,
+ "service",
+ ep.getComponent().getName(),
+ ep.getService().getName());
+ }
+ }
+ }
+ }
+ for ( ComponentReference reference : component.getReferences() ) {
+ for ( EndpointReference epr : reference.getEndpointReferences() ) {
+ for ( Intent eprIntent : epr.getRequiredIntents() ) {
+ if ( Constants.PROPAGATES_TRANSACTION_INTENT.equals(eprIntent.getName())) {
+ error(context.getMonitor(),
+ "PropagatesTransactionWithNoManagedTran",
+ this,
+ "reference",
+ epr.getComponent().getName(),
+ epr.getReference().getName());
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ for ( ComponentReference reference : component.getReferences()) {
+ for ( EndpointReference epr : reference.getEndpointReferences() ) {
+ for ( Intent eprIntent : epr.getRequiredIntents() ) {
+ if ( Constants.TRANSACTED_ONE_WAY_INTENT.equals(eprIntent.getName()) ) {
+ for ( Operation o : epr.getComponentReferenceInterfaceContract().getInterface().getOperations() ) {
+ if ( !o.isNonBlocking() ) {
+ error(context.getMonitor(),
+ "TransactedOneWayWithTwoWayOp",
+ this,
+ reference.getName(),
+ o.getName());
+ }
+
+ }
+ } else if ( Constants.IMMEDIATE_ONE_WAY_INTENT.equals(eprIntent.getName())) {
+ for ( Operation o : epr.getComponentReferenceInterfaceContract().getInterface().getOperations() ) {
+ if ( !o.isNonBlocking() ) {
+ error(context.getMonitor(),
+ "ImmediateOneWayWithTwoWayOp",
+ this,
+ reference.getName(),
+ o.getName());
+ }
+
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+
+
+ private void checkForNoListenerIntent(Endpoint ep, BuilderContext context) {
PolicyHelper helper = new PolicyHelper();
if ( helper.getIntent(ep, NOLISTENER_INTENT) != null ) {
error(context.getMonitor(),
@@ -248,14 +367,16 @@
BuilderContext context) {
boolean foundExternalPolicySet = false;
for (PolicySet ps : subject.getPolicySets() ) {
- if ( ps.getAttachTo() != null )
+ if ( ps.isExternalAttachment() ) {
foundExternalPolicySet = true;
+ break;
+ }
}
if ( foundExternalPolicySet ) {
List<PolicySet> copy = new ArrayList<PolicySet>(subject.getPolicySets());
for ( PolicySet ps : copy ) {
- if ( ps.getAttachTo() == null ) {
+ if ( !ps.isExternalAttachment() ) {
subject.getPolicySets().remove(ps);
}
}
@@ -272,6 +393,7 @@
*/
protected void checkPolicies(Composite composite, BuilderContext context) throws CompositeBuilderException{
policyAppliesToBuilder.build(composite, context);
+ validateTransactionIntents(composite, context);
}
protected void buildPolicies(Composite composite, BuilderContext context) {
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ModelBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ModelBuilderImpl.java
index 89fdc09..cf1c9cb 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ModelBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ModelBuilderImpl.java
@@ -97,15 +97,14 @@
composite = compositeIncludeBuilder.build(composite, context);
// Set up the structural URIs for components (services/references/bindings)
- // TODO does this need to happen before policy attachment
composite = structuralURIBuilder.build(composite, context);
// Apply policy external attachment. Happens before the composite type
// is created so that suitable promotion and structural processing is
// applied to the attached policies
- // TODO - I don't think this is correct. The policy spec (4.12.1)implies that
- // policy attachment happens independently of implementation or
- // structural inheritance
+ // TODO - Can you attach a policy to a component and have it promoted to the
+ // components services and references. If yes this call is in the
+ // right place
composite = policyAttachmentBuilder.build(composite, context);
// Process the implementation hierarchy by calculating the component type
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
index 2417940..1c958f7 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
@@ -83,44 +83,51 @@
}
}
- private Composite checkAppliesTo(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite composite, BuilderContext context) throws Exception {
- // look at policies recursively
- for (Component component : composite.getComponents()) {
- Implementation implementation = component.getImplementation();
- if (implementation instanceof Composite) {
- checkAppliesTo(document, appliesToSubjects, (Composite)implementation, context);
- }
- }
+ private Composite checkAppliesTo(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite topComposite, BuilderContext context) throws Exception {
+
+ for ( Component component : topComposite.getComponents() ) {
+ if ( component.getImplementation() instanceof Composite ) {
+ Composite nested = (Composite) component.getImplementation();
+ checkAppliesTo(saveAsDOM(nested),new HashMap<PolicySet, List<PolicySubject>>(), nested, context );
+ }
+ }
- for (Component component : composite.getComponents()) {
+ for (Component component : topComposite.getComponents()) {
- for (ComponentService componentService : component.getServices()) {
- for (Endpoint ep : componentService.getEndpoints()) {
- if (ep.getBinding() instanceof PolicySubject) {
- checkAppliesToSubject(document, appliesToSubjects, composite, (PolicySubject)ep.getBinding(), ep.getPolicySets());
- }
- }
- }
+ for (ComponentService componentService : component.getServices()) {
+ for (Endpoint ep : componentService.getEndpoints()) {
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getService(), ep.getService().getPolicySets());
+ ep.getPolicySets().removeAll(policySetsToRemove);
+ if (ep.getBinding() instanceof PolicySubject) {
+ policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
+ ep.getPolicySets().removeAll(policySetsToRemove);
+ }
+ }
+ }
- for (ComponentReference componentReference : component.getReferences()) {
- for (EndpointReference epr : componentReference.getEndpointReferences()) {
- if (epr.getBinding() instanceof PolicySubject) {
- checkAppliesToSubject(document, appliesToSubjects, composite, (PolicySubject)epr.getBinding(), epr.getPolicySets());
- }
- }
- }
+ for (ComponentReference componentReference : component.getReferences()) {
+ for (EndpointReference epr : componentReference.getEndpointReferences()) {
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getReference(), epr.getReference().getPolicySets());
+ epr.getPolicySets().removeAll(policySetsToRemove);
+ if (epr.getBinding() instanceof PolicySubject) {
+ policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
+ epr.getPolicySets().removeAll(policySetsToRemove);
+ }
+ }
+ }
- Implementation implementation = component.getImplementation();
- if (implementation != null &&
- implementation instanceof PolicySubject) {
- checkAppliesToSubject(document, appliesToSubjects, composite, implementation, implementation.getPolicySets());
- }
- }
-
- return composite;
+ Implementation implementation = component.getImplementation();
+ if (implementation != null &&
+ implementation instanceof PolicySubject) {
+ checkAppliesToSubject(document, appliesToSubjects, topComposite, implementation, implementation.getPolicySets());
+ }
+ }
+
+ return topComposite;
}
- /**
+
+ /**
* Checks that all the provided policy sets apply to the provided policy subject
*
* @param document
@@ -130,7 +137,7 @@
* @return
* @throws Exception
*/
- private void checkAppliesToSubject(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite composite, PolicySubject policySubject, List<PolicySet> policySets) throws Exception {
+ private List<PolicySet> checkAppliesToSubject(Document document, Map<PolicySet, List<PolicySubject>> appliesToSubjects, Composite composite, PolicySubject policySubject, List<PolicySet> policySets) throws Exception {
List<PolicySet> policySetsToRemove = new ArrayList<PolicySet>();
for (PolicySet policySet : policySets){
@@ -150,7 +157,8 @@
Node node = nodes.item(i);
String index = getStructuralURI(node);
PolicySubject subject = lookup(composite, index);
- subjects.add(subject);
+ if ( subject != null )
+ subjects.add(subject);
}
}
}
@@ -166,6 +174,7 @@
}
- policySets.removeAll(policySetsToRemove);
+ policySets.removeAll(policySetsToRemove);
+ return policySetsToRemove;
}
}
diff --git a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
index e9a49c8..4d1a7d5 100644
--- a/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
+++ b/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAttachmentBuilderImpl.java
@@ -21,7 +21,8 @@
import java.io.IOException;
import java.io.StringWriter;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
@@ -49,6 +50,7 @@
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.definitions.Definitions;
import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.policy.ExternalAttachment;
import org.apache.tuscany.sca.policy.PolicySet;
import org.apache.tuscany.sca.policy.PolicySubject;
import org.w3c.dom.Document;
@@ -109,80 +111,52 @@
monitor.pushContext("Composite: " + composite.getName().toString());
try {
- if (definitions == null || definitions.getPolicySets().isEmpty()) {
+ if (definitions == null || (definitions.getPolicySets().isEmpty() && definitions.getExternalAttachments().isEmpty()) ) {
return composite;
}
- // Recursively apply the xpath against the composites referenced by <implementation.composite>
- for (Component component : composite.getComponents()) {
- Implementation impl = component.getImplementation();
- if (impl instanceof Composite) {
- Composite patched = applyXPath((Composite)impl, definitions, monitor);
- if (patched != impl) {
- component.setImplementation(patched);
- }
- }
- }
+
+
Document document = null;
for (PolicySet ps : definitions.getPolicySets()) {
- // First calculate the applicable nodes
- Set<Node> applicableNodes = null;
- /*
- XPathExpression appliesTo = ps.getAppliesToXPathExpression();
- if (appliesTo != null) {
- applicableNodes = new HashSet<Node>();
- NodeList nodes = (NodeList)appliesTo.evaluate(document, XPathConstants.NODESET);
- for (int i = 0; i < nodes.getLength(); i++) {
- applicableNodes.add(nodes.item(i));
- }
- }
- */
- XPathExpression exp = ps.getAttachToXPathExpression();
- if (exp != null) {
- if (document == null) {
- document = saveAsDOM(composite);
- }
- NodeList nodes = (NodeList)exp.evaluate(document, XPathConstants.NODESET);
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
-
- // POL_40002 - you can't attach a policy to a property node
- // or one of it's children
- // walk backwards up the node tree looking for an element called property
- // and raise an error if we find one
- Node testNode = node;
- while (testNode != null){
- if ((node.getNodeType() == Node.ELEMENT_NODE) &&
- (node.getLocalName().equals("property"))){
- Monitor.error(monitor,
- this,
- BUILDER_VALIDATION_BUNDLE,
- "PolicyAttachedToProperty",
- ps.getName().toString());
- break;
- }
- testNode = testNode.getParentNode();
- }
-
- if (applicableNodes == null || applicableNodes.contains(node)) {
- // The node can be a component, service, reference or binding
- String index = getStructuralURI(node);
- PolicySubject subject = lookup(composite, index);
- if (subject != null) {
- subject.getPolicySets().add(ps);
- } else {
- // raise a warning that the XPath node didn't match a node in the
- // models
- Monitor.warning(monitor,
- this,
- BUILDER_VALIDATION_BUNDLE,
- "PolicyDOMModelMissmatch",
- ps.getName().toString(),
- index);
- }
- }
- }
- }
+ XPathExpression exp = ps.getAttachToXPathExpression();
+ if ( exp != null ) {
+ if ( document == null ) {
+ document = saveAsDOM(composite);
+ }
+ NodeList nodes = (NodeList) exp.evaluate(document, XPathConstants.NODESET);
+ attachPolicySetToNodes(composite, monitor, nodes, ps);
+ }
+ }
+
+ for ( ExternalAttachment ea : definitions.getExternalAttachments() ) {
+ XPathExpression exp = ea.getAttachToXPathExpression();
+ if ( exp != null ) {
+ if ( document == null ) {
+ document = saveAsDOM(composite);
+ }
+ NodeList nodes = (NodeList) exp.evaluate(document, XPathConstants.NODESET);
+ for ( PolicySet ps : ea.getPolicySets() ) {
+ attachPolicySetToNodes(composite, monitor, nodes, ps);
+ }
+ }
+ }
+
+ // Recursively apply the xpath against the composites referenced by <implementation.composite>
+ // If the composite or component has policy sets attached, we have to ignore policy sets
+ // attached to the inner composite.
+ if ( composite.getPolicySets().isEmpty() ) {
+ for (Component component : composite.getComponents()) {
+ if ( component.getPolicySets().isEmpty() ) {
+ Implementation impl = component.getImplementation();
+ if (impl instanceof Composite) {
+ Composite patched = applyXPath((Composite)impl, definitions, monitor);
+ if (patched != impl) {
+ component.setImplementation(patched);
+ }
+ }
+ }
+ }
}
return composite;
@@ -191,6 +165,69 @@
}
}
+ private void attachPolicySetToNodes(Composite composite,
+ Monitor monitor, NodeList nodes, PolicySet ps) {
+
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+
+ if ( isAttachedToProperty(node) ) {
+ Monitor.error(monitor,
+ this,
+ BUILDER_VALIDATION_BUNDLE,
+ "PolicyAttachedToProperty",
+ ps.getName().toString());
+ }
+
+
+ // The node can be a component, service, reference or binding
+ String index = getStructuralURI(node);
+ PolicySubject subject = lookup(composite, index);
+ if (subject != null) {
+ ps.setIsExternalAttachment(true);
+ // Remove any PolicySets with the same name that may have been added
+ List<PolicySet> subjectPSCopy = new ArrayList<PolicySet>(subject.getPolicySets());
+ for ( PolicySet existingPS : subjectPSCopy ) {
+ if ( existingPS.getName().equals(ps.getName()) ) {
+ subject.getPolicySets().remove(existingPS);
+ }
+ }
+ subject.getPolicySets().add(ps);
+ } else {
+ // raise a warning that the XPath node didn't match a node in the
+ // models
+ Monitor.warning(monitor,
+ this,
+ BUILDER_VALIDATION_BUNDLE,
+ "PolicyDOMModelMissmatch",
+ ps.getName().toString(),
+ index);
+ }
+
+ }
+ }
+
+ /**
+ * POL_40002 - you can't attach a policy to a property node
+ * or one of it's children. walk backwards up the node tree
+ * looking for an element called property and raise an error
+ * if we find one
+ * @param node
+ * @return
+ */
+ private boolean isAttachedToProperty(Node node) {
+
+ Node testNode = node;
+ while (testNode != null){
+ if ((node.getNodeType() == Node.ELEMENT_NODE) &&
+ (node.getLocalName().equals("property"))){
+ return true;
+ }
+ testNode = testNode.getParentNode();
+ }
+ return false;
+ }
+
protected Document saveAsDOM(Composite composite) throws XMLStreamException, ContributionWriteException, IOException,
SAXException {
// First write the composite into a DOM document so that we can apply the xpath
@@ -228,6 +265,8 @@
String uri = component.getAttributeNS(null, "uri");
String reference = ((Element)node).getAttributeNS(null, "name");
return uri + "#reference(" + reference + ")";
+ } else if ( new QName(Base.SCA11_NS, "composite").equals(name)) {
+ return "";
} else {
String localName = node.getLocalName();
if (localName.startsWith("binding.")) {
@@ -241,6 +280,12 @@
Element component = (Element)node.getParentNode();
String uri = component.getAttributeNS(null, "uri");
return uri + "#implementation()";
+ } else if (localName.startsWith("interface.")) {
+ Element contract = (Element)node.getParentNode();
+ String contractName = contract.getAttributeNS(null, "name");
+ Element component = (Element)node.getParentNode().getParentNode();
+ String uri = component.getAttributeNS(null, "uri");
+ return uri + "#" + contractName + "#interface()"; //(" + contractName + "/" + interfaceName + ")"
}
}
}
@@ -259,12 +304,15 @@
protected PolicySubject lookup(Composite composite, String structuralURI) {
if (structuralURI == null) {
return null;
+ } else if ( structuralURI.equals("")) {
+ return composite;
}
int index = structuralURI.indexOf('#');
String componentURI = structuralURI;
String service = null;
String reference = null;
String binding = null;
+ boolean isInterface = false;
boolean impl = false;
if (index != -1) {
@@ -292,6 +340,9 @@
service = path;
} else if ("reference".equals(prefix)) {
reference = path;
+ } else if ( prefix.indexOf("#interface") != -1 ) {
+ service = prefix.substring(0, prefix.indexOf("#interface"));
+ isInterface = true;
}
}
}
@@ -300,7 +351,9 @@
if (component.getURI().equals(componentURI)) {
if (service != null) {
ComponentService componentService = component.getService(service);
- if (binding != null) {
+ if ( isInterface ) {
+ return componentService.getInterfaceContract().getInterface();
+ } else if (binding != null) {
Binding b = getBinding(componentService, binding);
if (b instanceof PolicySubject) {
return (PolicySubject)b;
diff --git a/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties b/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties
index 62280ac..2d519a2 100644
--- a/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties
+++ b/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties
@@ -32,4 +32,8 @@
MutuallyExclusiveIntentsAtBuild = [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {0} and {1} are mutually exclusive
IntentNotFoundAtBuild = Intent {0} is not defined in SCA definitions
NoListenerIntentSpecifiedOnService = The noListener intent may only be specified on a reference.
-
+TransactedOneWayWithManagedTransactionLocal = The Component {0} {2} can not require transactedOneWay because the implementation for Component {1} requires managedTransaction.local
+PropagatesTransactionWithNoManagedTran = The component {0} {2} can not require propagatesTransaction because the implementation for component {1} requires noManagedTransaction
+TransactedOneWayWithTwoWayOp = The component reference {0} can not require transactedOneWay because the operation {1} is a two way operation
+ImmediateOneWayWithTwoWayOp = The component reference {0} can not require immediateOneWay because the operation {1} is a two way operation
+PropagatesTransactionWithLocalTran = The component {0} {2} can not require propagatesTransaction because the implementation for component {1} requires managedTransaction.local
diff --git a/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPHeader.java b/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPHeader.java
index 40691df..63f62d1 100644
--- a/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPHeader.java
+++ b/modules/common-http/src/main/java/org/apache/tuscany/sca/common/http/HTTPHeader.java
@@ -70,4 +70,9 @@
public void setValue(String value) {
this.value = value;
}
+
+ @Override
+ public String toString() {
+ return "HTTPHeader [name=" + name + ", value=" + value + "]";
+ }
}
diff --git a/modules/common-xml/pom.xml b/modules/common-xml/pom.xml
index 5944948..a7a3d85 100644
--- a/modules/common-xml/pom.xml
+++ b/modules/common-xml/pom.xml
@@ -61,7 +61,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
diff --git a/modules/contribution-osgi/pom.xml b/modules/contribution-osgi/pom.xml
index 7fc4406..d1a433d 100644
--- a/modules/contribution-osgi/pom.xml
+++ b/modules/contribution-osgi/pom.xml
@@ -57,7 +57,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
diff --git a/modules/contribution-resource/LICENSE b/modules/contribution-resource/LICENSE
new file mode 100644
index 0000000..8aa906c
--- /dev/null
+++ b/modules/contribution-resource/LICENSE
@@ -0,0 +1,205 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+
+
diff --git a/modules/contribution-resource/META-INF/MANIFEST.MF b/modules/contribution-resource/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..26b3f66
--- /dev/null
+++ b/modules/contribution-resource/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.tuscany.sca.contribution.resource
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Resource Import/Export Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Resource Import/Export Model
+Import-Package: javax.xml.namespace,
+ javax.xml.parsers,
+ javax.xml.stream,
+ javax.xml.stream.events,
+ javax.xml.stream.util,
+ javax.xml.transform,
+ javax.xml.transform.sax,
+ javax.xml.transform.stream,
+ javax.xml.validation,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.impl,
+ org.apache.tuscany.sca.assembly.xsd;version="2.0.0";resolution:=optional,
+ org.apache.tuscany.sca.common.java.io;version="2.0.0",
+ org.apache.tuscany.sca.common.xml;version="2.0.0",
+ org.apache.tuscany.sca.common.xml.stax;version="2.0.0",
+ org.apache.tuscany.sca.contribution;version="2.0.0",
+ org.apache.tuscany.sca.contribution.processor;version="2.0.0",
+ org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.monitor;version="2.0.0",
+ org.w3c.dom,
+ org.w3c.dom.ls,
+ org.xml.sax,
+ org.xml.sax.helpers
+Bundle-SymbolicName: org.apache.tuscany.sca.contribution.resource
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/modules/contribution-resource/NOTICE b/modules/contribution-resource/NOTICE
new file mode 100644
index 0000000..25bb89c
--- /dev/null
+++ b/modules/contribution-resource/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2009 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/modules/contribution-resource/pom.xml b/modules/contribution-resource/pom.xml
new file mode 100644
index 0000000..7ff6003
--- /dev/null
+++ b/modules/contribution-resource/pom.xml
@@ -0,0 +1,57 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-contribution-resource</artifactId>
+ <name>Apache Tuscany SCA Resource Import/Export Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java
new file mode 100644
index 0000000..8165b54
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceExport.java
@@ -0,0 +1,49 @@
+/*
+ * 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.sca.contribution.resource;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.Export;
+
+
+/**
+ * The representation of an resource export.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ResourceExport extends Export {
+ QName TYPE = new QName(SCA11_TUSCANY_NS, "export.resource");
+
+ /**
+ * Get Resource URI that identifies the export.
+ *
+ * @return The exported resource URI
+ */
+ String getURI();
+
+ /**
+ * Set Resource URI that identifies the export.
+ *
+ * @param uri The exported resource URI
+ */
+ void setURI(String uri);
+
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java
new file mode 100644
index 0000000..3bba948
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImport.java
@@ -0,0 +1,62 @@
+/*
+ * 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.sca.contribution.resource;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.Import;
+
+/**
+ * The representation of an resource import.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ResourceImport extends Import {
+ QName TYPE = new QName(SCA11_TUSCANY_NS, "import.resource");
+
+ /**
+ * Get the location used to resolve the definitions for this import
+ *
+ * @return The import location
+ */
+ String getLocation();
+
+ /**
+ * Set the location used to resolve the definitions for this import
+ *
+ * @param location The import location
+ */
+ void setLocation(String location);
+
+ /**
+ * Get URI that identifies the resource import
+ *
+ * @return The URI
+ */
+ String getURI();
+
+ /**
+ * Set URI that identifies the resource import
+ *
+ * @param uri The resource URI
+ */
+ void setURI(String uri);
+
+}
\ No newline at end of file
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java
new file mode 100644
index 0000000..4119c34
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/ResourceImportExportFactory.java
@@ -0,0 +1,42 @@
+/*
+ * 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.sca.contribution.resource;
+
+/**
+ * Base Resource import/export model factory
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ResourceImportExportFactory {
+
+ /**
+ * Create a resource import model object
+ *
+ * @return The new ResourceImport model object
+ */
+ ResourceImport createResourceImport();
+
+ /**
+ * Create a resource export model object
+ *
+ * @return The new ResourceExport model object
+ */
+ ResourceExport createResourceExport();
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java
new file mode 100644
index 0000000..3dcdfd3
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ArtifactModelResolver.java
@@ -0,0 +1,88 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceImport;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
+/**
+ * A Model Resolver for contribution artifacts.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ArtifactModelResolver implements ModelResolver {
+ private Contribution contribution;
+ private Map<String, Artifact> map = new HashMap<String, Artifact>();
+
+ public ArtifactModelResolver(Contribution contribution, FactoryExtensionPoint modelFactories) {
+ this.contribution = contribution;
+ }
+
+ public void addModel(Object resolved, ProcessorContext context) {
+ Artifact artifact = (Artifact)resolved;
+ map.put(artifact.getURI(), artifact);
+ }
+
+ public Object removeModel(Object resolved, ProcessorContext context) {
+ return map.remove(((Artifact)resolved).getURI());
+ }
+
+ public <T> T resolveModel(Class<T> modelClass, T unresolved, ProcessorContext context) {
+
+ // Get the artifact URI
+ String uri = ((Artifact)unresolved).getURI();
+ if (uri == null) {
+ return (T)unresolved;
+ }
+
+ // Lookup the artifact
+ Artifact resolved = (Artifact) map.get(uri);
+ if (resolved != null) {
+ return modelClass.cast(resolved);
+ }
+
+ // If not found, delegate the resolution to the imports (in this case based on the resource imports)
+ for (Import import_ : this.contribution.getImports()) {
+ if (import_ instanceof ResourceImport) {
+ ResourceImport resourceImport = (ResourceImport)import_;
+ //check the import location against the computed package name from the componentType URI
+ if ((resourceImport.getURI().equals(uri)) &&
+ (resourceImport.getModelResolver() != null)){
+ // Delegate the resolution to the import resolver
+ resolved = resourceImport.getModelResolver().resolveModel(Artifact.class, (Artifact)unresolved, context);
+ if (!resolved.isUnresolved()) {
+ return modelClass.cast(resolved);
+ }
+ }
+ }
+ }
+
+ return (T)unresolved;
+ }
+
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java
new file mode 100644
index 0000000..50ba5bc
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportImpl.java
@@ -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.sca.contribution.resource.impl;
+
+import org.apache.tuscany.sca.assembly.impl.ExtensibleImpl;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+
+/**
+ * The representation of an export for the contribution
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceExportImpl extends ExtensibleImpl implements ResourceExport {
+ /**
+ * The resource URI to be exported
+ */
+ private String uri;
+
+ private ModelResolver modelResolver;
+
+ protected ResourceExportImpl() {
+ super();
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public ModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ public void setModelResolver(ModelResolver modelResolver) {
+ this.modelResolver = modelResolver;
+ }
+
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java
new file mode 100644
index 0000000..96ee55e
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportModelResolver.java
@@ -0,0 +1,66 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+
+/**
+ * A model resolver for resource exports.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceExportModelResolver implements ModelResolver {
+
+ private ResourceExport export;
+ private ModelResolver resolver;
+
+ public ResourceExportModelResolver(ResourceExport export, ModelResolver resolver) {
+ this.export = export;
+ this.resolver = resolver;
+ }
+
+ public void addModel(Object resolved, ProcessorContext context) {
+ throw new IllegalStateException();
+ }
+
+ public Object removeModel(Object resolved, ProcessorContext context) {
+ throw new IllegalStateException();
+ }
+
+ public <T> T resolveModel(Class<T> modelClass, T unresolved, ProcessorContext context) {
+
+ // Filter based on the artifact URI
+ Artifact artifact = (Artifact)unresolved;
+ if (export.getURI().equals(artifact.getURI())) {
+
+ // The artifact URI matches the exported URI, delegate to the
+ // contribution's resolver
+ return resolver.resolveModel(modelClass, unresolved, context);
+ } else {
+
+ // The artifact URI is not exported, return the unresolved object
+ return unresolved;
+ }
+ }
+
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java
new file mode 100644
index 0000000..215338c
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessor.java
@@ -0,0 +1,145 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+/**
+ * Artifact processor for Resource export
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceExportProcessor implements StAXArtifactProcessor<ResourceExport> {
+
+ private static final String URI = "uri";
+
+ private final ResourceImportExportFactory factory;
+
+ public ResourceExportProcessor(FactoryExtensionPoint modelFactories) {
+ this.factory = modelFactories.getFactory(ResourceImportExportFactory.class);
+ }
+
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+ public QName getArtifactType() {
+ return ResourceExport.TYPE;
+ }
+
+ public Class<ResourceExport> getModelType() {
+ return ResourceExport.class;
+ }
+
+ /**
+ * Process <export.resource uri=""/>
+ */
+ public ResourceExport read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException {
+ ResourceExport resourceExport = this.factory.createResourceExport();
+ QName element = null;
+
+ try {
+ while (reader.hasNext()) {
+ int event = reader.getEventType();
+ switch (event) {
+ case START_ELEMENT:
+ element = reader.getName();
+
+ // Read <export.resource>
+ if (ResourceExport.TYPE.equals(element)) {
+ String uri = reader.getAttributeValue(null, URI);
+ if (uri == null) {
+ error(context.getMonitor(), "AttributeURIMissing", reader);
+ //throw new ContributionReadException("Attribute 'uri' is missing");
+ } else
+ resourceExport.setURI(uri);
+ }
+
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ if (ResourceExport.TYPE.equals(reader.getName())) {
+ return resourceExport;
+ }
+ break;
+ }
+
+ // Read the next element
+ if (reader.hasNext()) {
+ reader.next();
+ }
+ }
+ }
+ catch (XMLStreamException e) {
+ ContributionReadException ex = new ContributionReadException(e);
+ error(context.getMonitor(), "XMLStreamException", reader, ex);
+ }
+
+ return resourceExport;
+ }
+
+ public void write(ResourceExport resourceExport, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {
+
+ // Write <export.resource>
+ writer.writeStartElement(ResourceExport.TYPE.getNamespaceURI(), ResourceExport.TYPE.getLocalPart());
+
+ if (resourceExport.getURI() != null) {
+ writer.writeAttribute(URI, resourceExport.getURI());
+ }
+
+ writer.writeEndElement();
+ }
+
+ public void resolve(ResourceExport resourceExport, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
+
+ if (resourceExport.getURI() != null)
+ // Initialize the export's model resolver
+ resourceExport.setModelResolver(new ResourceExportModelResolver(resourceExport, resolver));
+ }
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java
new file mode 100644
index 0000000..880f5f5
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportExportFactoryImpl.java
@@ -0,0 +1,41 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+import org.apache.tuscany.sca.contribution.resource.ResourceImport;
+import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
+
+/**
+ * Resource Import/Export model factory implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceImportExportFactoryImpl implements ResourceImportExportFactory {
+
+ public ResourceImport createResourceImport() {
+ return new ResourceImportImpl();
+ }
+
+ public ResourceExport createResourceExport() {
+ return new ResourceExportImpl();
+ }
+
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java
new file mode 100644
index 0000000..6a862a2
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportImpl.java
@@ -0,0 +1,107 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.impl.ExtensibleImpl;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+import org.apache.tuscany.sca.contribution.resource.ResourceImport;
+
+/**
+ * The representation of an import for the contribution
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceImportImpl extends ExtensibleImpl implements ResourceImport {
+ /**
+ * The resource URI to be imported
+ */
+ private String uri;
+
+ private ModelResolver modelResolver;
+ private List<Contribution> exportContributions;
+
+ /**
+ * Optional location URI pointing to a Contribution that exports the resource
+ */
+ private String location;
+
+ protected ResourceImportImpl() {
+ super();
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public ModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ public void setModelResolver(ModelResolver modelResolver) {
+ this.modelResolver = modelResolver;
+ }
+
+ public List<Contribution> getExportContributions() {
+ return exportContributions;
+ }
+
+ public void setExportContributions(List<Contribution> contributions) {
+ this.exportContributions = contributions;
+ }
+
+ /**
+ * Match a ResourceImport to a given ResourceExport based on :
+ * location is not provided
+ * import and export resource URI match
+ */
+ public boolean match(Export export) {
+ if (export instanceof ResourceExport) {
+ if (this.getLocation() == null || this.getLocation().length() == 0) {
+ if (this.getURI().equals(((ResourceExport)export).getURI())) {
+ return true;
+ }
+ }
+
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(uri);
+ }
+}
diff --git a/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java
new file mode 100644
index 0000000..7e341f6
--- /dev/null
+++ b/modules/contribution-resource/src/main/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessor.java
@@ -0,0 +1,148 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resource.ResourceImport;
+import org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+/**
+ * Artifact processor for Namespace import
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceImportProcessor implements StAXArtifactProcessor<ResourceImport> {
+ private static final String URI = "uri";
+ private static final String LOCATION = "location";
+
+ private final ResourceImportExportFactory factory;
+
+ public ResourceImportProcessor(FactoryExtensionPoint modelFactories) {
+ this.factory = modelFactories.getFactory(ResourceImportExportFactory.class);
+ }
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "contribution-resource-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+ public QName getArtifactType() {
+ return ResourceImport.TYPE;
+ }
+
+ public Class<ResourceImport> getModelType() {
+ return ResourceImport.class;
+ }
+
+ /**
+ * Process <import.resource uri="" location=""/>
+ */
+ public ResourceImport read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException {
+ ResourceImport resourceImport = this.factory.createResourceImport();
+ QName element;
+
+ try {
+ while (reader.hasNext()) {
+ int event = reader.getEventType();
+ switch (event) {
+ case START_ELEMENT:
+ element = reader.getName();
+
+ // Read <import>
+ if (ResourceImport.TYPE.equals(element)) {
+ String uri = reader.getAttributeValue(null, URI);
+ if (uri == null) {
+ error(context.getMonitor(), "AttributeURIMissing", reader);
+ //throw new ContributionReadException("Attribute 'uri' is missing");
+ } else
+ resourceImport.setURI(uri);
+
+ String location = reader.getAttributeValue(null, LOCATION);
+ if (location != null) {
+ resourceImport.setLocation(location);
+ }
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ if (ResourceImport.TYPE.equals(reader.getName())) {
+ return resourceImport;
+ }
+ break;
+ }
+
+ // Read the next element
+ if (reader.hasNext()) {
+ reader.next();
+ }
+ }
+ }
+ catch (XMLStreamException e) {
+ ContributionReadException ex = new ContributionReadException(e);
+ error(context.getMonitor(), "XMLStreamException", reader, ex);
+ }
+
+ return resourceImport;
+ }
+
+ public void write(ResourceImport resourceImport, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {
+
+ // Write <import>
+ writer.writeStartElement(ResourceImport.TYPE.getNamespaceURI(), ResourceImport.TYPE.getLocalPart());
+
+ if (resourceImport.getURI() != null) {
+ writer.writeAttribute(URI, resourceImport.getURI());
+ }
+ if (resourceImport.getLocation() != null) {
+ writer.writeAttribute(LOCATION, resourceImport.getLocation());
+ }
+
+ writer.writeEndElement();
+ }
+
+
+ public void resolve(ResourceImport model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
+ }
+}
diff --git a/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..fba50cd
--- /dev/null
+++ b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.contribution.resource.impl.ResourceImportProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#import.resource,model=org.apache.tuscany.sca.contribution.resource.ResourceImport
+org.apache.tuscany.sca.contribution.resource.impl.ResourceExportProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#export.resource,model=org.apache.tuscany.sca.contribution.resource.ResourceExport
\ No newline at end of file
diff --git a/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
new file mode 100644
index 0000000..08d2b1c
--- /dev/null
+++ b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.contribution.resource.impl.ArtifactModelResolver;model=org.apache.tuscany.sca.contribution.Artifact
\ No newline at end of file
diff --git a/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory
new file mode 100644
index 0000000..d39a506
--- /dev/null
+++ b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resource.ResourceImportExportFactory
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.contribution.resource.impl.ResourceImportExportFactoryImpl
diff --git a/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
new file mode 100644
index 0000000..f4751db
--- /dev/null
+++ b/modules/contribution-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.service.ContributionListener
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.apache.tuscany.sca.contribution.resource.impl.ResourceImportExportListener
diff --git a/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties b/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
new file mode 100644
index 0000000..9df66cc
--- /dev/null
+++ b/modules/contribution-resource/src/main/resources/contribution-resource-validation-messages.properties
@@ -0,0 +1,23 @@
+#
+#
+# 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.
+#
+#
+AttributeURIMissing = Attribute 'uri' is missing
+XMLStreamException = XMLStreamException occured due to : {0}
+
diff --git a/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java b/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java
new file mode 100644
index 0000000..98bd460
--- /dev/null
+++ b/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceExportProcessorTestCase.java
@@ -0,0 +1,102 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resource.ResourceExport;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test NamespaceExportProcessorTestCase
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceExportProcessorTestCase {
+
+ private static final String VALID_XML =
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ + "<export.resource xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" xmlns:ns=\"http://ns\" uri=\"helloworld/HelloWorldService.componentType\"/>";
+
+ private static final String INVALID_XML =
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ + "<export.resource xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" xmlns:ns=\"http://ns\"/>";
+
+ private static XMLInputFactory inputFactory;
+ private static StAXArtifactProcessor<Object> staxProcessor;
+ private static Monitor monitor;
+ private static ProcessorContext context;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ context = new ProcessorContext(extensionPoints);
+ monitor = context.getMonitor();
+ inputFactory = XMLInputFactory.newInstance();
+
+ StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+ }
+
+ /**
+ * Test loading a valid export element from a contribution metadata stream
+ * @throws Exception
+ */
+ @Test
+ public void testLoad() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
+ ResourceExport resourceExport = (ResourceExport)staxProcessor.read(reader, context);
+ assertEquals("helloworld/HelloWorldService.componentType", resourceExport.getURI());
+ }
+
+ /**
+ * Test loading an INVALID export element from a contribution metadata stream
+ * @throws Exception
+ */
+ @Test
+ public void testLoadInvalid() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
+ /*try {
+ staxProcessor.read(reader);
+ fail("readerException should have been thrown");
+ } catch (ContributionReadException e) {
+ assertTrue(true);
+ }*/
+ staxProcessor.read(reader, context);
+ Problem problem = monitor.getLastProblem();
+ assertNotNull(problem);
+ assertEquals("AttributeURIMissing", problem.getMessageId());
+ }
+}
diff --git a/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java b/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java
new file mode 100644
index 0000000..4cff032
--- /dev/null
+++ b/modules/contribution-resource/src/test/java/org/apache/tuscany/sca/contribution/resource/impl/ResourceImportProcessorTestCase.java
@@ -0,0 +1,104 @@
+/*
+ * 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.sca.contribution.resource.impl;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resource.ResourceImport;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test NamespaceImportProcessorTestCase
+ *
+ * @version $Rev$ $Date$
+ */
+public class ResourceImportProcessorTestCase {
+
+ private static final String VALID_XML =
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ + "<import.resource xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" xmlns:ns=\"http://ns\" uri=\"helloworld/HelloWorldService.componentType\" location=\"sca://contributions/001\"/>";
+
+ private static final String INVALID_XML =
+ "<?xml version=\"1.0\" encoding=\"ASCII\"?>"
+ + "<import.resource xmlns=\"http://tuscany.apache.org/xmlns/sca/1.1\" xmlns:ns=\"http://ns\" location=\"sca://contributions/001\"/>";
+
+ private static XMLInputFactory inputFactory;
+ private static StAXArtifactProcessor<Object> staxProcessor;
+ private static Monitor monitor;
+ private static ProcessorContext context;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ context = new ProcessorContext(extensionPoints);
+ monitor = context.getMonitor();
+ inputFactory = XMLInputFactory.newInstance();
+
+ StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+ }
+
+ /**
+ * Test loading a valid import element from a contribution metadata stream
+ * @throws Exception
+ */
+ @Test
+ public void testLoad() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(VALID_XML));
+ ResourceImport namespaceImport = (ResourceImport)staxProcessor.read(reader, context);
+ assertEquals("helloworld/HelloWorldService.componentType", namespaceImport.getURI());
+ assertEquals("sca://contributions/001", namespaceImport.getLocation());
+ }
+
+ /**
+ * Test loading a INVALID import element from a contribution metadata stream
+ * @throws Exception
+ */
+ @Test
+ public void testLoadInvalid() throws Exception {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
+ /*try {
+ staxProcessor.read(reader);
+ fail("readerException should have been thrown");
+ } catch (ContributionReadException e) {
+ assertTrue(true);
+ }*/
+ staxProcessor.read(reader, context);
+ Problem problem = monitor.getLastProblem();
+ assertNotNull(problem);
+ assertEquals("AttributeURIMissing", problem.getMessageId());
+ }
+}
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
index f9c8dcb..1ba394d 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassLoaderModelResolver.java
@@ -49,6 +49,10 @@
private WeakReference<Contribution> contribution;
private ProcessorContext context;
private Map<String, ModelResolver> importResolvers = new HashMap<String, ModelResolver>();
+
+ // a space to pass back the contribution that was used to resolve
+ // a class via an import
+ private Contribution contributionContainingClass;
private static ClassLoader parentClassLoader(Contribution contribution) {
if (contribution.getClassLoader() != null) {
@@ -107,10 +111,15 @@
try {
this.context = context;
+ contributionContainingClass = contribution.get();
+
// Load the class and return a class reference for it
String className = ((ClassReference)unresolved).getClassName();
- Class<?> clazz = Class.forName(className, true, this);
- return modelClass.cast(new ClassReference(clazz));
+ Class<?> clazz = Class.forName(className, false, this);
+ ClassReference classReference = new ClassReference(clazz);
+ classReference.setContributionContainingClass(contributionContainingClass);
+ contributionContainingClass = null;
+ return modelClass.cast(classReference);
} catch (ClassNotFoundException e) {
return unresolved;
@@ -160,6 +169,7 @@
if (importResolver != null) {
ClassReference classReference = importResolver.resolveModel(ClassReference.class, new ClassReference(name), context);
if (!classReference.isUnresolved()) {
+ contributionContainingClass = classReference.getContributionContainingClass();
return classReference.getJavaClass();
}
}
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java
index aa159ac..5bf7e88 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXAttributeProcessor.java
@@ -140,7 +140,7 @@
// Delegate to the processor associated with the attribute QName
int event = source.getEventType();
if (event == XMLStreamConstants.START_DOCUMENT) {
- source.nextTag();
+ while (source.next() != XMLStreamReader.START_ELEMENT);
}
StAXAttributeProcessor<?> processor = null;
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ProcessorContext.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ProcessorContext.java
index 75cfab4..d464af4 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ProcessorContext.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ProcessorContext.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.contribution.processor;
+import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
@@ -32,6 +33,7 @@
*/
public class ProcessorContext {
protected Contribution contribution;
+ protected Artifact artifact;
protected Monitor monitor;
protected Object parentModel;
@@ -62,10 +64,19 @@
this.monitor = new DefaultMonitorFactory().createMonitor();
}
+ /**
+ * Get the current contribution
+ * @return The current contribution
+ */
public Contribution getContribution() {
return contribution;
}
+ /**
+ * Set the current contribution
+ * @param contribution
+ * @return
+ */
public Contribution setContribution(Contribution contribution) {
Contribution old = this.contribution;
this.contribution = contribution;
@@ -92,4 +103,25 @@
return old;
}
+ /**
+ * Get the current artifact
+ * @return The current artifact
+ */
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ /**
+ * Set the current artifact. This should be called by URLArtifactProcessor to set the document
+ * context (such as the URI of the composite file).
+ *
+ * @param artifact The new artifact
+ * @return The old artifact
+ */
+ public Artifact setArtifact(Artifact artifact) {
+ Artifact old = this.artifact;
+ this.artifact = artifact;
+ return old;
+ }
+
}
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
index 232bf9c..6e6346f 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
@@ -24,6 +24,7 @@
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
+import java.util.ListIterator;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.contribution.Artifact;
@@ -139,7 +140,7 @@
monitor.pushContext("Artifact: " + artifact.getURI());
- old = context.setContribution(contribution);
+ Artifact oldArtifact = context.setArtifact(artifact);
try {
// Read each artifact
URL artifactLocationURL = null;
@@ -169,7 +170,7 @@
}
} finally {
monitor.popContext();
- context.setContribution(old);
+ context.setArtifact(oldArtifact);
}
}
@@ -191,6 +192,19 @@
contribution.getImports().add(defaultImport);
DefaultExport defaultExport = contributionFactory.createDefaultExport();
contribution.getExports().add(defaultExport);
+ } else {
+ if (contribution.getDeployables().size() > 0) {
+ // Update the deployable Composite objects with the correct Composite object for the artifact
+ for (Artifact a : contribution.getArtifacts()) {
+ if (a.getModel() instanceof Composite) {
+ for (ListIterator<Composite> lit = contribution.getDeployables().listIterator(); lit.hasNext();) {
+ if (lit.next().getName().equals(((Composite)a.getModel()).getName())) {
+ lit.set((Composite)a.getModel());
+ }
+ }
+ }
+ }
+ }
}
} finally {
monitor.popContext();
@@ -252,23 +266,32 @@
for (Artifact artifact : contribution.getArtifacts()) {
Object model = artifact.getModel();
if (model != null) {
+ Artifact oldArtifact = context.setArtifact(artifact);
try {
artifactProcessor.resolve(model, contributionResolver, context);
} catch (Throwable e) {
throw new ContributionResolveException(e);
+ } finally {
+ context.setArtifact(oldArtifact);
}
}
}
- // Resolve deployable composites
- List<Composite> deployables = contribution.getDeployables();
- for (int i = 0, n = deployables.size(); i < n; i++) {
- Composite deployable = deployables.get(i);
- Composite resolved = (Composite)contributionResolver.resolveModel(Composite.class, deployable, context);
- if (resolved != deployable) {
- deployables.set(i, resolved);
- }
- } // end for
+ // Resolve deployable composites
+ List<Composite> deployables = contribution.getDeployables();
+ Artifact oldArtifact = context.setArtifact(contribution);
+ try {
+ for (int i = 0, n = deployables.size(); i < n; i++) {
+ Composite deployable = deployables.get(i);
+ Composite resolved =
+ (Composite)contributionResolver.resolveModel(Composite.class, deployable, context);
+ if (resolved != deployable) {
+ deployables.set(i, resolved);
+ }
+ } // end for
+ } finally {
+ context.setArtifact(oldArtifact);
+ }
} finally {
monitor.popContext();
context.setContribution(old);
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
index fa91784..7d8f2ef 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
@@ -22,6 +22,7 @@
import java.lang.ref.WeakReference;
import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.contribution.Contribution;
/**
* A weak reference to a class, which should be used to register classes
@@ -37,6 +38,7 @@
private WeakReference<Class<?>> clazz;
private String className;
+ private Contribution contributionContainingClass;
/**
* Constructs a new ClassReference.
@@ -104,5 +106,24 @@
}
}
}
+
+ /**
+ * A Java class may reference a WSDL file via a JAXWS annotation. We need to resolve
+ * the WSDL file location in the context of the same contribution that holds the
+ * Java file. In order to do this we need to pass back the actual contribution that
+ * was used to resolve a Java class. It's possible that multiple contributions hold
+ * the same class so just scanning the artifacts in all the contribution is not good
+ * enough
+ *
+ * @return
+ */
+ public Contribution getContributionContainingClass() {
+ return contributionContainingClass;
+ }
+
+ public void setContributionContainingClass(
+ Contribution contributionContainingClass) {
+ this.contributionContainingClass = contributionContainingClass;
+ }
}
diff --git a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/impl/DirectoryContributionScanner.java b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/impl/DirectoryContributionScanner.java
index 4a1a222..4a064c8 100644
--- a/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/impl/DirectoryContributionScanner.java
+++ b/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/scanner/impl/DirectoryContributionScanner.java
@@ -24,8 +24,13 @@
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.security.AccessControlException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.Contribution;
@@ -40,8 +45,10 @@
* @version $Rev$ $Date$
*/
public class DirectoryContributionScanner implements ContributionScanner {
- private ContributionFactory contributionFactory;
-
+ private static final Logger logger = Logger.getLogger(DirectoryContributionScanner.class.getName());
+
+ private ContributionFactory contributionFactory;
+
public DirectoryContributionScanner(ContributionFactory contributionFactory) {
this.contributionFactory = contributionFactory;
}
@@ -61,7 +68,7 @@
Artifact artifact = contributionFactory.createArtifact();
artifact.setURI(uri);
artifact.setLocation(file.toURI().toURL().toString());
-
+
artifacts.add(artifact);
} catch (MalformedURLException e) {
throw new ContributionReadException(e);
@@ -72,10 +79,10 @@
return artifacts;
}
-
+
/**
* Scan the contribution to retrieve all artifact uris
- *
+ *
* @param contribution
* @return
* @throws ContributionReadException
@@ -83,45 +90,63 @@
private List<String> scanContributionArtifacts(Contribution contribution) throws ContributionReadException {
File directory = directory(contribution);
List<String> artifacts = new ArrayList<String>();
+ // [rfeng] There are cases that the folder contains symbolic links that point to the same physical directory
+ Set<File> visited = new HashSet<File>();
try {
- traverse(artifacts, directory, directory);
+ traverse(artifacts, directory, directory, visited);
} catch (IOException e) {
throw new ContributionReadException(e);
}
-
+
return artifacts;
}
-
+
/**
* Recursively traverse a root directory
*
* @param fileList
* @param file
* @param root
+ * @param visited The visited directories
* @throws IOException
*/
- private static void traverse(List<String> fileList, File file, File root) throws IOException {
- if (file.isFile()) {
- fileList.add(root.toURI().relativize(file.toURI()).toString());
- } else if (file.isDirectory()) {
- String uri = root.toURI().relativize(file.toURI()).toString();
- if (uri.endsWith("/")) {
- uri = uri.substring(0, uri.length() - 1);
- }
- fileList.add(uri);
+ private static void traverse(List<String> fileList, File file, File root, Set<File> visited) throws IOException {
- File[] files = file.listFiles();
- for (File f: files) {
- if (!f.getName().startsWith(".")) {
- traverse(fileList, f, root);
+ //TUSCANY-3667 - Google add some private directories when you deploy your application
+ //to GAE and trying to execute file IO operations on it's contents fails with AccessControlException
+ try {
+ if (file.isFile()) {
+ fileList.add(root.toURI().relativize(file.toURI()).toString());
+ } else if (file.isDirectory()) {
+ File dir = file.getCanonicalFile();
+ if (!visited.contains(dir)) {
+ // [rfeng] Add the canonical file into the visited set to avoid duplicate navigation of directories
+ // following the symbolic links
+ visited.add(dir);
+ String uri = root.toURI().relativize(file.toURI()).toString();
+ if (uri.endsWith("/")) {
+ uri = uri.substring(0, uri.length() - 1);
+ }
+ fileList.add(uri);
+
+ File[] files = file.listFiles();
+ for (File f : files) {
+ if (!f.getName().startsWith(".")) {
+ traverse(fileList, f, root, visited);
+ }
+ }
}
}
- }
+ } catch (AccessControlException e) {
+ //TUSCANY-3667 - Log the AccessControlException error and continue without processing the file/directory
+ logger.log(Level.WARNING, "Error traversing file:" + file.getPath());
+ }
+
}
-
+
/**
* Get the contribution location as a file
- *
+ *
* @param contribution
* @return
* @throws ContributionReadException
@@ -143,6 +168,6 @@
}
return file;
}
-
+
}
diff --git a/modules/core-databinding/pom.xml b/modules/core-databinding/pom.xml
index 2b5a75a..c669770 100644
--- a/modules/core-databinding/pom.xml
+++ b/modules/core-databinding/pom.xml
@@ -77,7 +77,7 @@
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<scope>runtime</scope>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<exclusions>
<exclusion>
<groupId>stax</groupId>
diff --git a/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java b/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java
index 01a3c18..23f133b 100644
--- a/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java
+++ b/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/processor/DataBindingJavaInterfaceProcessor.java
@@ -21,9 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
@@ -66,26 +64,17 @@
wrapperStyle = dataBinding.wrapped();
}
- Map<String, Operation> opMap = new HashMap<String, Operation>();
for (Operation op : javaInterface.getOperations()) {
- opMap.put(op.getName(), op);
+ JavaOperation operation = (JavaOperation) op;
// In the case of @WebMethod, the method name can be different from the operation name
- if (op instanceof JavaOperation) {
- opMap.put(((JavaOperation)op).getJavaMethod().getName(), op);
- }
+
if (dataBindingId != null) {
op.setDataBinding(dataBindingId);
op.setWrapperStyle(wrapperStyle);
}
- }
- for (Method method : clazz.getMethods()) {
- if (method.getDeclaringClass() == Object.class) {
- continue;
- }
- Operation operation = opMap.get(method.getName());
- if (operation == null) { // @WebMethod exclude=true
- continue;
- }
+
+ Method method = operation.getJavaMethod();
+
DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class);
if (methodDataBinding == null) {
methodDataBinding = dataBinding;
diff --git a/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java b/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
index de29088..7bf9833 100644
--- a/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
+++ b/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
@@ -19,11 +19,16 @@
package org.apache.tuscany.sca.core.databinding.wire;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.apache.tuscany.sca.databinding.Mediator;
+import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.invocation.Interceptor;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
@@ -50,6 +55,21 @@
super();
this.sourceOperation = sourceOperation;
this.targetOperation = targetOperation;
+ if ( sourceOperation instanceof JavaOperation ) {
+ JavaOperation javaOp = (JavaOperation) sourceOperation;
+ Method sourceMethod = javaOp.getJavaMethod();
+ }
+ // Holder pattern. In order to perform data mediation on Holder return types, it is
+ // necessary to set up a data transformation on the Holder<T> class T. on return.
+ DataType<DataType> returnTargetType = getFirstHolderType( sourceOperation.getInputType() );
+ if ( returnTargetType != null ) {
+ this.sourceOperation.setOutputType(returnTargetType);
+ }
+ returnTargetType = getFirstHolderType( targetOperation.getInputType() );
+ if ( returnTargetType != null ) {
+ this.targetOperation.setOutputType(returnTargetType);
+ }
+
this.mediator = mediator;
this.invocable = invocable;
}
@@ -64,12 +84,14 @@
Object input = mediator.mediateInput(msg.getBody(), sourceOperation, targetOperation, metadata);
msg.setBody(input);
Message resultMsg = next.invoke(msg);
- Object result = resultMsg.getBody();
+
if (sourceOperation.isNonBlocking()) {
// Not to reset the message body
return resultMsg;
}
+ Object result = resultMsg.getBody();
+
if (resultMsg.isFault()) {
Object transformedFault = null;
if ((result instanceof Exception) && !(result instanceof RuntimeException)) {
@@ -95,4 +117,32 @@
this.next = next;
}
+ /**
+ * Returns return type for first Holder in input list.
+ * Returns null if the inputs do not contain a Holder.
+ */
+ protected static DataType<DataType> getFirstHolderType( DataType<List<DataType>> inputTypes ) {
+ if (inputTypes != null) {
+ List<DataType> logicalType = inputTypes.getLogical();
+ if (logicalType != null) {
+ for (int i = 0; i < logicalType.size(); i++) {
+ DataType dataType = logicalType.get(i);
+ if (isHolder(dataType.getGenericType())) {
+ // Fix up output from void to returned data type.
+ // System.out.println("DataTransformationInterceptor.<> source input[" + i + "] is Holder, logicalType=" + dataType);
+ return dataType;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ protected static boolean isHolder( Type type ) {
+ String typeString = type.toString();
+ if ( typeString.startsWith( "javax.xml.ws.Holder" ) ) {
+ return true;
+ }
+ return false;
+ }
}
diff --git a/modules/core-runtime-pom/pom.xml b/modules/core-runtime-pom/pom.xml
new file mode 100644
index 0000000..0dbc017
--- /dev/null
+++ b/modules/core-runtime-pom/pom.xml
@@ -0,0 +1,193 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-core-runtime-pom</artifactId>
+ <name>Apache Tuscany SCA Core Runtime POM</name>
+ <packaging>pom</packaging>
+
+ <!--
+ The core Tuscany modules that are generally required in order
+ to build an extension. This set of module contains the Tuscany
+ SPI
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xsd</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <!-- included because binding-ws-wsdlgen needs it -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <!-- included as the runtime normalizes interfaces to WSDL -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-builder</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-common-java</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-common-http</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-common-xml</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-deployment</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-extensibility</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java-jaxws</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-monitor</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-xsd</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/modules/core-runtime-pom/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to modules/core-runtime-pom/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/modules/core-runtime-pom/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to modules/core-runtime-pom/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/modules/core-runtime-pom/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to modules/core-runtime-pom/src/main/resources/README.txt
diff --git a/modules/core-spi/pom.xml b/modules/core-spi/pom.xml
index 268a2fb..82780bd 100644
--- a/modules/core-spi/pom.xml
+++ b/modules/core-spi/pom.xml
@@ -56,7 +56,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
@@ -69,7 +69,7 @@
</dependencies>
<build>
- <plugins>
+ <!-- plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
@@ -112,7 +112,7 @@
</execution>
</executions>
</plugin>
- </plugins>
+ </plugins-->
</build>
</project>
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java
index 23a50e5..6605ff3 100644
--- a/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java
@@ -35,7 +35,7 @@
* @version $Rev$ $Date$
*/
public class CompositeContext {
- protected final static InheritableThreadLocal<CompositeContext> context = new InheritableThreadLocal<CompositeContext>();
+
protected ExtensionPointRegistry extensionPointRegistry;
protected EndpointRegistry endpointRegistry;
protected ComponentContextFactory componentContextFactory;
@@ -84,10 +84,6 @@
RuntimeComponentContext componentContext = component.getComponentContext();
return componentContext.getCompositeContext();
}
- CompositeContext compositeContext = context.get();
- if (compositeContext != null) {
- return compositeContext;
- }
return null;
}
@@ -124,14 +120,6 @@
return domainComposite;
}
- public static void setThreadCompositeContext(CompositeContext value) {
- context.set(value);
- }
-
- public static void removeCompositeContext() {
- context.remove();
- }
-
public String getNodeURI() {
return nodeURI;
}
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java
new file mode 100644
index 0000000..3d47bd2
--- /dev/null
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BaseBindingImpl.java
@@ -0,0 +1,94 @@
+/*
+ * 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.sca.provider;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
+
+/**
+ * Base abstract impl for a binding model.
+ */
+public abstract class BaseBindingImpl implements Binding {
+
+ private String name;
+ private String uri;
+ private boolean unresolved;
+ private OperationSelector operationSelector;
+ private WireFormat requestWireFormat;
+ private WireFormat responseWireFormat;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ this.unresolved = unresolved;
+ }
+
+ public abstract QName getType();
+
+ public WireFormat getRequestWireFormat() {
+ return requestWireFormat;
+ }
+
+ public void setRequestWireFormat(WireFormat wireFormat) {
+ this.requestWireFormat = wireFormat;
+ }
+
+ public WireFormat getResponseWireFormat() {
+ return responseWireFormat;
+ }
+
+ public void setResponseWireFormat(WireFormat wireFormat) {
+ this.responseWireFormat = wireFormat;
+ }
+
+ public OperationSelector getOperationSelector() {
+ return operationSelector;
+ }
+
+ public void setOperationSelector(OperationSelector operationSelector) {
+ this.operationSelector = operationSelector;
+ }
+
+}
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
index 6aad678..40b6275 100644
--- a/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java
@@ -65,7 +65,10 @@
if(providerFactory instanceof PolicyProviderFactory) {
policyProviderFactories.add((PolicyProviderFactory)providerFactory);
}
- providerFactories.put(providerFactory.getModelType(), providerFactory);
+ // Only add the 1st instance so that the ones with higher ranking with prevail
+ if (!providerFactories.containsKey(providerFactory.getModelType())) {
+ providerFactories.put(providerFactory.getModelType(), providerFactory);
+ }
}
/**
@@ -148,9 +151,6 @@
throw new IllegalStateException(e);
}
- // Get the target extension point
- ProviderFactoryExtensionPoint factoryExtensionPoint =
- registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
List<ProviderFactory> factories = new ArrayList<ProviderFactory>();
for (ServiceDeclaration factoryDeclaration : factoryDeclarations) {
@@ -163,7 +163,7 @@
// Create a provider factory wrapper and register it
ImplementationProviderFactory factory =
new LazyImplementationProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
+ addProviderFactory(factory);
factories.add(factory);
} else if (factoryClass == BindingProviderFactory.class) {
@@ -174,7 +174,7 @@
// Create a provider factory wrapper and register it
BindingProviderFactory factory =
new LazyBindingProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
+ addProviderFactory(factory);
factories.add(factory);
} else if (factoryClass == PolicyProviderFactory.class) {
// Load a policy provider factory
@@ -183,7 +183,7 @@
// Create a provider factory wrapper and register it
PolicyProviderFactory factory =
new LazyPolicyProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
+ addProviderFactory(factory);
factories.add(factory);
} else if (factoryClass == WireFormatProviderFactory.class) {
@@ -193,7 +193,7 @@
// Create a provider factory wrapper and register it
WireFormatProviderFactory factory =
new LazyWireFormatProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
+ addProviderFactory(factory);
factories.add(factory);
} else if (factoryClass == OperationSelectorProviderFactory.class) {
@@ -203,7 +203,7 @@
// Create a provider factory wrapper and register it
OperationSelectorProviderFactory factory =
new LazyOperationSelectorProviderFactory(registry, modelTypeName, factoryDeclaration);
- factoryExtensionPoint.addProviderFactory(factory);
+ addProviderFactory(factory);
factories.add(factory);
}
}
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java
index f4411d7..78f2d95 100644
--- a/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java
@@ -72,4 +72,12 @@
*/
CompositeContext getCompositeContext();
+ /**
+ * Retrieve the normalized WSDL contract relating to the input WSDL contract
+ *
+ * @param interfaceContract
+ * @return
+ */
+ public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract);
+
}
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
index 197a46b..42e7328 100644
--- a/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
@@ -69,4 +69,12 @@
boolean isOutOfDate();
void rebuild();
boolean isStarted();
+
+ /**
+ * Retrieve the normalized WSDL contract relating to the input WSDL contract
+ *
+ * @param interfaceContract
+ * @return
+ */
+ public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract);
}
diff --git a/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java b/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java
index 2c5fb55..f8a1ef4 100644
--- a/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java
+++ b/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.work;
+import java.util.concurrent.ExecutorService;
+
/**
* Defines the contract for scheduling asynchronous units of work.
*
@@ -50,5 +52,11 @@
* @param work The unit of work that needs to be asynchronously executed.
*/
<T extends Runnable>void scheduleWork(T work);
+
+ /**
+ * Get the underlying getExecutorService
+ * @return
+ */
+ ExecutorService getExecutorService();
}
diff --git a/modules/core/META-INF/MANIFEST.MF b/modules/core/META-INF/MANIFEST.MF
index 62fc183..db05de3 100644
--- a/modules/core/META-INF/MANIFEST.MF
+++ b/modules/core/META-INF/MANIFEST.MF
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
Export-Package: org.apache.tuscany.sca.core.assembly;version="2.0.0";uses:="org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core",
+ org.apache.tuscany.sca.core.assembly.impl;version="2.0.0",
org.apache.tuscany.sca.core.context;version="2.0.0";
uses:="javax.xml.stream,
org.apache.tuscany.sca.runtime,
@@ -33,6 +34,7 @@
Import-Package: javax.security.auth,
javax.xml.namespace,
javax.xml.stream,
+ javax.xml.transform,
net.sf.cglib.proxy;resolution:=optional,
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.builder;version="2.0.0",
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 8832a00..48d76a6 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -62,7 +62,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
index fe9e437..9193c15 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
@@ -212,6 +212,12 @@
bindingInvocationChain = new InvocationChainImpl(null, null, false, phaseManager);
initServiceBindingInvocationChains();
}
+
+ // Init the operation invocation chains now. We know they will
+ // be needed as well as the binding invocation chain and this
+ // makes the wire processors run
+ getInvocationChains();
+
return bindingInvocationChain;
}
@@ -235,6 +241,10 @@
invocationChainMap.put(operation, chain);
return chain;
}
+ if (interfaceContractMapper.isCompatible(operation, op, Compatibility.SUBSET)) {
+ invocationChainMap.put(operation, chain);
+ return chain;
+ }
} else {
// [rfeng] We need to run the compatibility check for local operations as they
// can be overloaded
@@ -488,27 +498,32 @@
InterfaceContract serviceContract = getComponentServiceInterfaceContract();
InterfaceContract bindingContract = getBindingInterfaceContract();
-
+
if ((serviceContract != null) &&
(bindingContract != null)){
boolean bindingHasCallback = bindingContract.getCallbackInterface() != null;
- try {
- if ((serviceContract.getClass() != bindingContract.getClass()) &&
- (serviceContract instanceof JavaInterfaceContract)) {
- interfaceContractMapper.checkCompatibility(getGeneratedWSDLContract(serviceContract),
- bindingContract,
- Compatibility.SUBSET,
- !bindingHasCallback, // ignore callbacks if binding doesn't have one
- false);
- } else {
- interfaceContractMapper.checkCompatibility(serviceContract,
- bindingContract,
- Compatibility.SUBSET,
- !bindingHasCallback, // ignore callbacks if binding doesn't have one
- false);
- }
+ try {
+
+ // Use the normalized contract if the interface types are different or if
+ // a normalized contract has been previously generate, for example, by virtue
+ // of finding a JAXWS annotation on a Java class that references a WSDL file
+ if (serviceContract.getClass() != bindingContract.getClass() ||
+ serviceContract.getNormalizedWSDLContract() != null ||
+ bindingContract.getNormalizedWSDLContract() != null) {
+ interfaceContractMapper.checkCompatibility(getGeneratedWSDLContract(serviceContract),
+ getGeneratedWSDLContract(bindingContract),
+ Compatibility.SUBSET,
+ !bindingHasCallback, // ignore callbacks if binding doesn't have one
+ false);
+ } else {
+ interfaceContractMapper.checkCompatibility(serviceContract,
+ bindingContract,
+ Compatibility.SUBSET,
+ !bindingHasCallback, // ignore callbacks if binding doesn't have one
+ false);
+ }
} catch (Exception ex){
throw new ServiceRuntimeException("Component " +
this.getComponent().getName() +
@@ -620,7 +635,6 @@
for (PolicyProvider p : pps) {
Interceptor interceptor = p.createInterceptor(operation);
if (interceptor != null) {
- //chain.addInterceptor(p.createInterceptor(operation));
chain.addInterceptor(interceptor);
}
}
@@ -811,7 +825,7 @@
if (contractBuilder == null){
throw new ServiceRuntimeException("Contract builder not found while calculating WSDL contract for " + this.toString());
}
- contractBuilder.build(getComponentServiceInterfaceContract(), null);
+ contractBuilder.build(interfaceContract, null);
}
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
index 3873185..36480f3 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
@@ -38,7 +38,6 @@
import org.apache.tuscany.sca.assembly.Contract;
import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.assembly.builder.BuilderExtensionPoint;
-import org.apache.tuscany.sca.assembly.builder.ContractBuilder;
import org.apache.tuscany.sca.assembly.impl.EndpointReferenceImpl;
import org.apache.tuscany.sca.context.CompositeContext;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
@@ -53,7 +52,6 @@
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.invocation.Interceptor;
import org.apache.tuscany.sca.invocation.InvocationChain;
@@ -61,7 +59,6 @@
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.invocation.MessageFactory;
import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.provider.BindingProviderFactory;
import org.apache.tuscany.sca.provider.EndpointReferenceProvider;
import org.apache.tuscany.sca.provider.PolicyProvider;
@@ -325,15 +322,18 @@
if ((referenceContract != null) &&
(bindingContract != null)){
-
+
boolean bindingHasCallback = bindingContract.getCallbackInterface() != null;
try {
-
- if ((referenceContract.getClass() != bindingContract.getClass()) &&
- (referenceContract instanceof JavaInterfaceContract)) {
+ // Use the normalized contract if the interface types are different or if
+ // a normalized contract has been previously generate, for example, by virtue
+ // of finding a JAXWS annotation on a Java class that references a WSDL file
+ if (referenceContract.getClass() != bindingContract.getClass() ||
+ referenceContract.getNormalizedWSDLContract() != null ||
+ bindingContract.getNormalizedWSDLContract() != null) {
interfaceContractMapper.checkCompatibility(getGeneratedWSDLContract(referenceContract),
- bindingContract,
+ getGeneratedWSDLContract(bindingContract),
Compatibility.SUBSET,
!bindingHasCallback, // ignore callbacks if binding doesn't have one
false);
@@ -344,7 +344,6 @@
!bindingHasCallback, // ignore callbacks if binding doesn't have one
false);
}
-
} catch (Exception ex){
throw new ServiceRuntimeException("Component " +
this.getComponent().getName() +
@@ -539,7 +538,10 @@
if (bindingInterfaceContract != null) {
return bindingInterfaceContract;
}
- bindingInterfaceContract = getBindingProvider().getBindingInterfaceContract();
+ ReferenceBindingProvider provider = getBindingProvider();
+ if (provider != null) {
+ bindingInterfaceContract = provider.getBindingInterfaceContract();
+ }
if (bindingInterfaceContract == null) {
bindingInterfaceContract = getComponentReferenceInterfaceContract();
}
@@ -608,7 +610,7 @@
if (contractBuilder == null){
throw new ServiceRuntimeException("Contract builder not found while calculating WSDL contract for " + this.toString());
}
- contractBuilder.build(getComponentReferenceInterfaceContract(), null);
+ contractBuilder.build(interfaceContract, null);
}
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
index 999854a..cfa2a3c 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java
@@ -47,6 +47,7 @@
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
import org.apache.tuscany.sca.runtime.CompositeActivator;
import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
@@ -59,6 +60,8 @@
import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.ServiceRuntimeException;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
+
/**
* Implementation of ComponentContext that delegates to a ComponentContextProvider.
*
@@ -75,6 +78,7 @@
private final JavaInterfaceFactory javaInterfaceFactory;
private final PropertyValueFactory propertyFactory;
private final EndpointReferenceBinder eprBinder;
+ private final ExtensionPointRegistry registry;
public ComponentContextImpl(ExtensionPointRegistry registry,
CompositeContext compositeContext,
@@ -96,6 +100,7 @@
this.eprBinder = utilities.getUtility(EndpointReferenceBinder.class);
+ this.registry = registry;
}
public String getURI() {
@@ -106,12 +111,18 @@
return proxyFactory.cast(target);
}
- public <B> B getService(Class<B> businessInterface, String referenceName) {
- ServiceReference<B> serviceRef = getServiceReference(businessInterface, referenceName);
- return serviceRef.getService();
+ public <B> B getService(Class<B> businessInterface, String referenceName) throws IllegalArgumentException {
+ B service = null;
+
+ ServiceReference<B> serviceRef = getServiceReference(businessInterface, referenceName);
+ if(serviceRef != null) {
+ service = serviceRef.getService();
+ }
+
+ return service;
}
- public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) {
+ public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName) throws IllegalArgumentException {
for (ComponentReference ref : component.getReferences()) {
if (referenceName.equals(ref.getName())) {
@@ -121,10 +132,17 @@
+ " has multiplicity "
+ multiplicity);
}
- return getServiceReference(businessInterface, (RuntimeEndpointReference)getEndpointReference(ref));
+ if (ref.getEndpointReferences().size() < 1) {
+ return null;
+ }
+ ServiceReference<B> sr = getServiceReference(businessInterface, (RuntimeEndpointReference)getEndpointReference(ref));
+ if (sr == null) {
+ throw new IllegalArgumentException("Reference " + referenceName + " is null");
+ }
+ return sr;
}
}
- throw new ServiceRuntimeException("Reference not found: " + referenceName);
+ throw new IllegalArgumentException("[JCA80011] Reference not found: " + referenceName);
}
@@ -201,10 +219,10 @@
public <B> B getProperty(Class<B> type, String propertyName) {
for (ComponentProperty p : component.getProperties()) {
if (propertyName.equals(p.getName())) {
- return propertyFactory.createPropertyValue(p, type);
+ return propertyFactory.createPropertyValue(p, type);
}
}
- throw new ServiceRuntimeException("Property not found: " + propertyName);
+ throw new IllegalArgumentException("Property not found: " + propertyName);
}
/**
@@ -238,6 +256,8 @@
ComponentService service = getSingleService(component);
try {
return createSelfReference(businessInterface, service);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e.getMessage(), e);
}
@@ -263,7 +283,9 @@
return getServiceReference(businessInterface, (RuntimeEndpoint)endpoint);
}
}
- throw new ServiceRuntimeException("Service not found: " + serviceName);
+ throw new IllegalArgumentException("Service not found: " + serviceName);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (ServiceRuntimeException e) {
throw e;
} catch (Exception e) {
@@ -283,6 +305,8 @@
(RuntimeEndpointReference)createEndpointReference(component, service, null, businessInterface);
ref.setComponent(component);
return getServiceReference(businessInterface, ref);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e);
}
@@ -305,6 +329,8 @@
*/
public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface,
RuntimeEndpointReference endpointReference) {
+ ServiceReference<B> result = null;
+
try {
InterfaceContract interfaceContract = endpointReference.getComponentTypeReferenceInterfaceContract();
if (businessInterface == null) {
@@ -312,20 +338,26 @@
}
RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference();
InterfaceContract refInterfaceContract = getInterfaceContract(interfaceContract, businessInterface);
- if (refInterfaceContract != interfaceContract) {
- ref = (RuntimeComponentReference)ref.clone();
- if (interfaceContract != null) {
- ref.setInterfaceContract(interfaceContract);
- } else {
- ref.setInterfaceContract(refInterfaceContract);
- }
+ if (refInterfaceContract != null) {
+ if (refInterfaceContract != interfaceContract) {
+ ref = (RuntimeComponentReference)ref.clone();
+ if (interfaceContract != null) {
+ ref.setInterfaceContract(interfaceContract);
+ } else {
+ ref.setInterfaceContract(refInterfaceContract);
+ }
+ }
+
+ ref.setComponent(component);
+ result = new ServiceReferenceImpl<B>(businessInterface, endpointReference, component.getComponentContext().getCompositeContext());
}
- ref.setComponent(component);
- return new ServiceReferenceImpl<B>(businessInterface, endpointReference, component.getComponentContext()
- .getCompositeContext());
+ } catch (IllegalArgumentException iae ) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e);
}
+
+ return result;
}
public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, RuntimeEndpoint endpoint) {
@@ -338,6 +370,8 @@
(RuntimeEndpointReference)createEndpointReference(endpoint, businessInterface);
ref.setComponent(component);
return new ServiceReferenceImpl<B>(businessInterface, ref, compositeContext);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (Exception e) {
throw new ServiceRuntimeException(e);
}
@@ -412,6 +446,11 @@
if (businessInterface == null) {
return interfaceContract;
}
+ if (interfaceContract == null) {
+ JavaInterfaceContract ic = javaInterfaceFactory.createJavaInterfaceContract();
+ ic.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
+ return ic;
+ }
boolean compatible = false;
if (interfaceContract != null && interfaceContract.getInterface() != null) {
Interface interfaze = interfaceContract.getInterface();
@@ -420,18 +459,24 @@
if (businessInterface.isAssignableFrom(cls)) {
compatible = true;
}
+ if(!compatible) {
+ InterfaceContract biContract = javaInterfaceFactory.createJavaInterfaceContract();
+ JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(businessInterface);
+ biContract.setInterface(callInterface);
+ if (callInterface.getCallbackClass() != null) {
+ biContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(callInterface
+ .getCallbackClass()));
+ }
+ InterfaceContractMapper ifcm = registry.getExtensionPoint(InterfaceContractMapper.class);
+ compatible = ifcm.isCompatibleSubset(biContract , interfaceContract);
+ }
+
}
}
-
- if (!compatible) {
- // The interface is not assignable from the interface contract
- interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(businessInterface);
- interfaceContract.setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(callInterface
- .getCallbackClass()));
- }
+
+ if(!compatible) {
+ // JCA-9011
+ throw new IllegalArgumentException("Business interface " + businessInterface.getName() + " is not compatible with " + interfaceContract.getInterface().getClass().getName());
}
return interfaceContract;
@@ -465,6 +510,11 @@
try {
for (ComponentReference ref : component.getReferences()) {
if (referenceName.equals(ref.getName())) {
+ if ( ref.getMultiplicity() == Multiplicity.ONE_ONE )
+ throw new IllegalArgumentException("Reference " + referenceName + " is not a valid argument for getServiceReferences because it has a multiplicity of 1..1");
+ if (ref.getMultiplicity() == Multiplicity.ZERO_ONE)
+ throw new IllegalArgumentException("Reference " + referenceName + " is not a valid argument for getServiceReferences because it has a multiplicity of 0..1");
+
ArrayList<ServiceReference<B>> serviceRefs = new ArrayList<ServiceReference<B>>();
for (EndpointReference endpointReference : ref.getEndpointReferences()) {
RuntimeEndpointReference epr = (RuntimeEndpointReference)endpointReference;
@@ -473,7 +523,9 @@
return serviceRefs;
}
}
- throw new ServiceRuntimeException("Reference not found: " + referenceName);
+ throw new IllegalArgumentException("Reference not found: " + referenceName);
+ } catch (IllegalArgumentException iae) {
+ throw iae;
} catch (ServiceRuntimeException e) {
throw e;
} catch (Exception e) {
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java
index af6f039..03505da 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/DefaultProxyFactoryExtensionPoint.java
@@ -39,21 +39,21 @@
private ProxyFactory interfaceFactory;
private ProxyFactory classFactory;
- public DefaultProxyFactoryExtensionPoint(ExtensionPointRegistry extensionPoints) {
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+ public DefaultProxyFactoryExtensionPoint(ExtensionPointRegistry registry) {
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
this.messageFactory = modelFactories.getFactory(MessageFactory.class);
- interfaceFactory = new JDKProxyFactory(messageFactory, interfaceContractMapper);
+ interfaceFactory = new JDKProxyFactory(registry, messageFactory, interfaceContractMapper);
}
- public DefaultProxyFactoryExtensionPoint(MessageFactory messageFactory, InterfaceContractMapper mapper) {
- this.interfaceContractMapper = mapper;
- this.messageFactory = messageFactory;
- interfaceFactory = new JDKProxyFactory(messageFactory, mapper);
- }
+ // public DefaultProxyFactoryExtensionPoint(MessageFactory messageFactory, InterfaceContractMapper mapper) {
+ // this.interfaceContractMapper = mapper;
+ // this.messageFactory = messageFactory;
+ // interfaceFactory = new JDKProxyFactory(null, messageFactory, mapper);
+ // }
public ProxyFactory getClassProxyFactory() {
return classFactory;
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncJDKInvocationHandler.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncJDKInvocationHandler.java
index e0e219d..4af9ce5 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncJDKInvocationHandler.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncJDKInvocationHandler.java
@@ -19,17 +19,21 @@
package org.apache.tuscany.sca.core.invocation.impl;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
import java.io.StringReader;
import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
-import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
@@ -55,13 +59,16 @@
import org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
import org.apache.tuscany.sca.core.invocation.AsyncFaultWrapper;
+import org.apache.tuscany.sca.core.invocation.AsyncResponseException;
import org.apache.tuscany.sca.core.invocation.AsyncResponseHandler;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
import org.apache.tuscany.sca.interfacedef.util.FaultException;
+import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
import org.apache.tuscany.sca.invocation.InvocationChain;
import org.apache.tuscany.sca.invocation.MessageFactory;
import org.apache.tuscany.sca.policy.Intent;
@@ -71,8 +78,9 @@
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+import org.apache.tuscany.sca.work.WorkScheduler;
import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.ServiceRuntimeException;
/**
* An InvocationHandler which deals with JAXWS-defined asynchronous client Java API method calls
@@ -90,26 +98,46 @@
* a callback operation that is automatically called when the async call completes
*/
public class AsyncJDKInvocationHandler extends JDKInvocationHandler {
-
- private static final long serialVersionUID = 1L;
-
- private static int invocationCount = 10; // # of threads to use
- private static long maxWaitTime = 30; // Max wait time for completion = 30sec
-
- // Run the async service invocations using a ThreadPoolExecutor
- private static ThreadPoolExecutor theExecutor = new ThreadPoolExecutor( invocationCount, invocationCount,
- maxWaitTime, TimeUnit.SECONDS,
- new ArrayBlockingQueue<Runnable>( invocationCount ) );
-
- public AsyncJDKInvocationHandler(MessageFactory messageFactory, ServiceReference<?> callableReference) {
+ private static final long serialVersionUID = 1L;
+
+ private static int invocationCount = 10; // # of threads to use
+ private static long maxWaitTime = 30; // Max wait time for completion = 30sec
+
+ // Run the async service invocations using a ThreadPoolExecutor
+ private ExecutorService theExecutor;
+
+ public AsyncJDKInvocationHandler(ExtensionPointRegistry registry,
+ MessageFactory messageFactory,
+ ServiceReference<?> callableReference) {
super(messageFactory, callableReference);
+ initExecutorService(registry);
}
- public AsyncJDKInvocationHandler(MessageFactory messageFactory,
+ public AsyncJDKInvocationHandler(ExtensionPointRegistry registry,
+ MessageFactory messageFactory,
Class<?> businessInterface,
Invocable source) {
super(messageFactory, businessInterface, source);
+ initExecutorService(registry);
+ }
+
+ private final void initExecutorService(ExtensionPointRegistry registry) {
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ WorkScheduler scheduler = utilities.getUtility(WorkScheduler.class);
+ theExecutor = scheduler.getExecutorService();
+
+ /*
+ synchronized (AsyncJDKInvocationHandler.class) {
+ theExecutor = utilities.getUtility(ExecutorService.class);
+ if (theExecutor == null) {
+ theExecutor =
+ new ThreadPoolExecutor(invocationCount, invocationCount, maxWaitTime, TimeUnit.SECONDS,
+ new ArrayBlockingQueue<Runnable>(invocationCount));
+ utilities.addUtility(ExecutorService.class, theExecutor);
+ }
+ }
+ */
}
/**
@@ -118,12 +146,17 @@
*/
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+
+ // force the bind of the reference so that we can look at the
+ // target contract to see if it's asynchronous
+ source.getInvocationChains();
+
if (isAsyncCallback(method)) {
- return doInvokeAsyncCallback(proxy, method, args);
+ return doInvokeAsyncCallback(proxy, method, args);
} else if (isAsyncPoll(method)) {
- return doInvokeAsyncPoll(proxy, method, args);
+ return doInvokeAsyncPoll(proxy, method, args);
} else {
- // Regular synchronous method call
+ // Regular synchronous method call
return doInvokeSync(proxy, method, args);
}
}
@@ -134,9 +167,9 @@
* @return - true if the method has the form of an async callback
*/
protected boolean isAsyncCallback(Method method) {
- if (method.getName().endsWith("Async") && (method.getReturnType().isAssignableFrom(Future.class))) {
+ if (method.getName().endsWith("Async") && (method.getReturnType() == Future.class)) {
if (method.getParameterTypes().length > 0) {
- return method.getParameterTypes()[method.getParameterTypes().length-1].isAssignableFrom(AsyncHandler.class);
+ return method.getParameterTypes()[method.getParameterTypes().length - 1] == AsyncHandler.class;
}
}
return false;
@@ -148,7 +181,7 @@
* @return - true if the method has the form of an async polling method
*/
protected boolean isAsyncPoll(Method method) {
- return method.getName().endsWith("Async") && (method.getReturnType().isAssignableFrom(Response.class));
+ return method.getName().endsWith("Async") && (method.getReturnType() == Response.class);
}
/**
@@ -160,40 +193,50 @@
* type of the response
*/
@SuppressWarnings("unchecked")
- protected Response doInvokeAsyncPoll(Object proxy, Method asyncMethod, Object[] args) {
- Class<?> returnType = getNonAsyncMethod(asyncMethod).getReturnType();
+ protected Response doInvokeAsyncPoll(Object proxy, Method asyncMethod, Object[] args) {
+ Method method = getNonAsyncMethod(asyncMethod);
+ Class<?> returnType = method.getReturnType();
// Allocate the Future<?> / Response<?> object - note: Response<?> is a subclass of Future<?>
- AsyncInvocationFutureImpl future = AsyncInvocationFutureImpl.newInstance( returnType, getInterfaceClassloader() );
+ AsyncInvocationFutureImpl future = AsyncInvocationFutureImpl.newInstance(returnType, getInterfaceClassloader());
try {
- invokeAsync(proxy, getNonAsyncMethod(asyncMethod), args, future);
+ invokeAsync(proxy, method, args, future, asyncMethod);
} catch (Exception e) {
- future.setFault( new AsyncFaultWrapper(e) );
- } catch (Throwable t ) {
- Exception e = new ServiceRuntimeException("Received Throwable: " + t.getClass().getName() +
- " when invoking: " + asyncMethod.getName(), t);
- future.setFault( new AsyncFaultWrapper(e) );
+ future.setFault(new AsyncFaultWrapper(e));
+ } catch (Throwable t) {
+ Exception e =
+ new ServiceRuntimeException("Received Throwable: " + t.getClass().getName()
+ + " when invoking: "
+ + asyncMethod.getName(), t);
+ future.setFault(new AsyncFaultWrapper(e));
} // end try
return future;
} // end method doInvokeAsyncPoll
-
+
/**
* Provide a synchronous invocation of a service operation that is either synchronous or asynchronous
* @return
*/
protected Object doInvokeSync(Object proxy, Method method, Object[] args) throws Throwable {
- if ( isAsyncInvocation( source ) ) {
- // Target service is asynchronous
- Class<?> returnType = method.getReturnType();
- AsyncInvocationFutureImpl future = AsyncInvocationFutureImpl.newInstance( returnType, getInterfaceClassloader() );
- invokeAsync(proxy, method, args, future);
+ if (isAsyncInvocation(source)) {
+ // Target service is asynchronous
+ Class<?> returnType = method.getReturnType();
+ AsyncInvocationFutureImpl future =
+ AsyncInvocationFutureImpl.newInstance(returnType, getInterfaceClassloader());
+ invokeAsync(proxy, method, args, future, method);
// Wait for some maximum time for the result - 1000 seconds here
// Really, if the service is async, the client should use async client methods to invoke the service
// - and be prepared to wait a *really* long time
- return future.get(1000, TimeUnit.SECONDS);
- } else {
- // Target service is not asynchronous, so perform sync invocation
- return super.invoke(proxy, method, args);
- } // end if
+ Object response = null;
+ try {
+ response = future.get(1000, TimeUnit.SECONDS);
+ } catch (ExecutionException ex) {
+ throw ex.getCause();
+ }
+ return response;
+ } else {
+ // Target service is not asynchronous, so perform sync invocation
+ return super.invoke(proxy, method, args);
+ } // end if
} // end method doInvokeSync
/**
@@ -206,15 +249,23 @@
* the response
*/
@SuppressWarnings("unchecked")
- private Object doInvokeAsyncCallback(Object proxy, Method asyncMethod, Object[] args) {
- AsyncHandler handler = (AsyncHandler)args[args.length-1];
- Response response = doInvokeAsyncPoll(proxy,asyncMethod,Arrays.copyOf(args, args.length-1));
- // Invoke the callback handler, if present
- if( handler != null ) {
- handler.handleResponse(response);
- } // end if
-
- return response;
+ private Object doInvokeAsyncCallback(final Object proxy, final Method asyncMethod, final Object[] args)
+ throws Exception {
+ Future<Response> future = theExecutor.submit(new Callable<Response>() {
+
+ @Override
+ public Response call() {
+ AsyncHandler handler = (AsyncHandler)args[args.length - 1];
+ Response response = doInvokeAsyncPoll(proxy, asyncMethod, Arrays.copyOf(args, args.length - 1));
+ // Invoke the callback handler, if present
+ if (handler != null) {
+ handler.handleResponse(response);
+ } // end if
+ return response;
+ }
+ });
+ return future.get();
+
} // end method doInvokeAsyncCallback
/**
@@ -227,11 +278,15 @@
* @throws Throwable - if an exception is thrown during the invocation
*/
@SuppressWarnings("unchecked")
- private void invokeAsync(Object proxy, Method method, Object[] args, AsyncInvocationFutureImpl future) throws Throwable {
+ private void invokeAsync(Object proxy,
+ Method method,
+ Object[] args,
+ AsyncInvocationFutureImpl future,
+ Method asyncMethod) throws Throwable {
if (source == null) {
throw new ServiceRuntimeException("No runtime source is available");
}
-
+
if (source instanceof RuntimeEndpointReference) {
RuntimeEndpointReference epr = (RuntimeEndpointReference)source;
if (epr.isOutOfDate()) {
@@ -239,129 +294,173 @@
chains.clear();
}
} // end if
-
+
InvocationChain chain = getInvocationChain(method, source);
-
+
if (chain == null) {
throw new IllegalArgumentException("No matching operation is found: " + method);
}
-
+
// Organize for an async service
- RuntimeEndpoint theEndpoint = getAsyncCallback( source );
+ RuntimeEndpoint theEndpoint = getAsyncCallback(source);
boolean isAsyncService = false;
- if( theEndpoint != null ) {
- // ... the service is asynchronous ...
- attachFuture( theEndpoint, future );
- isAsyncService = true;
+ if (theEndpoint != null) {
+ // ... the service is asynchronous ...
+ attachFuture(theEndpoint, future);
+ isAsyncService = true;
} else {
- // ... the service is synchronous ...
+ // ... the service is synchronous ...
} // end if
-
- // Perform the invocations on separate thread...
- theExecutor.execute( new separateThreadInvoker( chain, args, source, future, isAsyncService ) );
+
+ // Perform the invocations on separate thread...
+ theExecutor.submit(new separateThreadInvoker(chain, args, source, future, asyncMethod, isAsyncService));
return;
} // end method invokeAsync
-
- /**
- * An inner class which acts as a runnable task for invoking services asynchronously on threads that are separate from
- * those used to execute operations of components
- *
- * This supports both synchronous services and asynchronous services
- */
- private class separateThreadInvoker implements Runnable {
-
- private AsyncInvocationFutureImpl future;
- private InvocationChain chain;
- private Object[] args;
- private Invocable invocable;
- private boolean isAsyncService;
-
- public separateThreadInvoker( InvocationChain chain, Object[] args, Invocable invocable,
- AsyncInvocationFutureImpl future, boolean isAsyncService ) {
- super();
- this.chain = chain;
- this.args = args;
- this.invocable = invocable;
- this.future = future;
- this.isAsyncService = isAsyncService;
- } // end constructor
- public void run() {
- Object result;
-
- try {
- if( isAsyncService ) {
- invoke(chain, args, invocable, future.getUniqueID());
- // The result is returned asynchronously via the future...
- } else {
- // ... the service is synchronous ...
- result = invoke(chain, args, invocable);
- future.setResponse(result);
- } // end if
- } catch ( ServiceRuntimeException s ) {
- Throwable e = s.getCause();
- if( e != null && e instanceof FaultException ) {
- if( "AsyncResponse".equals(e.getMessage()) ) {
- // Do nothing...
- } else {
- future.setFault( new AsyncFaultWrapper( s ) );
- } // end if
- } // end if
- } catch ( Throwable t ) {
- System.out.println("Async invoke got exception: " + t.toString());
- future.setFault( new AsyncFaultWrapper( t ) );
- } // end try
-
- } // end method run
-
- } // end class separateThreadInvoker
-
+ /**
+ * An inner class which acts as a runnable task for invoking services asynchronously on threads that are separate from
+ * those used to execute operations of components
+ *
+ * This supports both synchronous services and asynchronous services
+ */
+ private class separateThreadInvoker implements Runnable {
+
+ private AsyncInvocationFutureImpl future;
+ private Method asyncMethod;
+ private InvocationChain chain;
+ private Object[] args;
+ private Invocable invocable;
+ private boolean isAsyncService;
+
+ public separateThreadInvoker(InvocationChain chain,
+ Object[] args,
+ Invocable invocable,
+ AsyncInvocationFutureImpl future,
+ Method asyncMethod,
+ boolean isAsyncService) {
+ super();
+ this.chain = chain;
+ this.asyncMethod = asyncMethod;
+ this.args = args;
+ this.invocable = invocable;
+ this.future = future;
+ this.isAsyncService = isAsyncService;
+ } // end constructor
+
+ public void run() {
+ Object result;
+
+ try {
+ if (isAsyncService) {
+ invoke(chain, args, invocable, future.getUniqueID());
+ // The result is returned asynchronously via the future...
+ } else {
+ // ... the service is synchronous ...
+ result = invoke(chain, args, invocable);
+ Type type = null;
+ if (asyncMethod.getReturnType() == Future.class) {
+ // For callback async menthod
+ Type[] types = asyncMethod.getGenericParameterTypes();
+ if (types.length > 0 && asyncMethod.getParameterTypes()[types.length - 1] == AsyncHandler.class) {
+ // Last paremeter, AsyncHandler<T>
+ type = types[types.length - 1];
+ }
+ } else if (asyncMethod.getReturnType() == Response.class) {
+ // For the polling method, Response<T>
+ type = asyncMethod.getGenericReturnType();
+ }
+ if (type instanceof ParameterizedType) {
+ // Check if the parameterized type of Response<T> is a doc-lit-wrapper class
+ Class<?> wrapperClass = (Class<?>)((ParameterizedType)type).getActualTypeArguments()[0];
+ WrapperInfo wrapperInfo = chain.getSourceOperation().getWrapper();
+ if (wrapperInfo != null && wrapperInfo.getOutputWrapperClass() == wrapperClass) {
+ Object wrapper = wrapperClass.newInstance();
+ // Find the 1st matching property
+ for (PropertyDescriptor p : Introspector.getBeanInfo(wrapperClass).getPropertyDescriptors()) {
+ if (p.getWriteMethod() == null) {
+ // There is a "class" property ...
+ continue;
+ }
+ if (p.getWriteMethod().getParameterTypes()[0].isInstance(result)) {
+ p.getWriteMethod().invoke(wrapper, result);
+ result = wrapper;
+ break;
+ }
+ }
+
+ }
+ }
+ future.setResponse(result);
+ } // end if
+ } catch (ServiceRuntimeException s) {
+ Throwable e = s.getCause();
+ if (e != null && e instanceof FaultException) {
+ if ("AsyncResponse".equals(e.getMessage())) {
+ // Do nothing...
+ } else {
+ future.setFault(new AsyncFaultWrapper(s));
+ } // end if
+ } // end if
+ } catch (AsyncResponseException ar) {
+ // do nothing
+ } catch (Throwable t) {
+ System.out.println("Async invoke got exception: " + t.toString());
+ future.setFault(new AsyncFaultWrapper(t));
+ } // end try
+
+ } // end method run
+
+ } // end class separateThreadInvoker
+
/**
* Attaches a future to the callback endpoint - so that the Future is triggered when a response is
* received from the asynchronous service invocation associated with the Future
* @param endpoint - the async callback endpoint
* @param future - the async invocation future to attach
*/
- private void attachFuture( RuntimeEndpoint endpoint, AsyncInvocationFutureImpl<?> future ) {
- Implementation impl = endpoint.getComponent().getImplementation();
- AsyncResponseHandlerImpl<?> asyncHandler = (AsyncResponseHandlerImpl<?>) impl;
- asyncHandler.addFuture(future);
+ private void attachFuture(RuntimeEndpoint endpoint, AsyncInvocationFutureImpl<?> future) {
+ Implementation impl = endpoint.getComponent().getImplementation();
+ AsyncResponseHandlerImpl<?> asyncHandler = (AsyncResponseHandlerImpl<?>)impl;
+ asyncHandler.addFuture(future);
} // end method attachFuture
-
+
/**
* Get the async callback endpoint - if not already created, create and start it
* @param source - the RuntimeEndpointReference which needs an async callback endpoint
* @param future
* @return - the RuntimeEndpoint of the async callback
*/
- private RuntimeEndpoint getAsyncCallback( Invocable source ) {
- if( !(source instanceof RuntimeEndpointReference) ) return null;
- RuntimeEndpointReference epr = (RuntimeEndpointReference) source;
- if( !isAsyncInvocation( epr ) ) return null;
- RuntimeEndpoint endpoint;
- synchronized( epr ) {
- endpoint = (RuntimeEndpoint)epr.getCallbackEndpoint();
- // If the async callback endpoint is already created, return it...
- if( endpoint != null ) return endpoint;
- // Create the endpoint for the async callback
- endpoint = createAsyncCallbackEndpoint( epr );
- epr.setCallbackEndpoint(endpoint);
- } // end synchronized
-
- // Activate the new callback endpoint
- startEndpoint( epr.getCompositeContext(), endpoint );
- endpoint.getInvocationChains();
-
- return endpoint;
+ private RuntimeEndpoint getAsyncCallback(Invocable source) {
+ if (!(source instanceof RuntimeEndpointReference))
+ return null;
+ RuntimeEndpointReference epr = (RuntimeEndpointReference)source;
+ if (!isAsyncInvocation(epr))
+ return null;
+ RuntimeEndpoint endpoint;
+ synchronized (epr) {
+ endpoint = (RuntimeEndpoint)epr.getCallbackEndpoint();
+ // If the async callback endpoint is already created, return it...
+ if (endpoint != null)
+ return endpoint;
+ // Create the endpoint for the async callback
+ endpoint = createAsyncCallbackEndpoint(epr);
+ epr.setCallbackEndpoint(endpoint);
+ } // end synchronized
+
+ // Activate the new callback endpoint
+ startEndpoint(epr.getCompositeContext(), endpoint);
+ endpoint.getInvocationChains();
+
+ return endpoint;
} // end method setupAsyncCallback
-
+
/**
* Start the callback endpoint
* @param compositeContext - the composite context
* @param ep - the endpoint to start
*/
- private void startEndpoint(CompositeContext compositeContext, RuntimeEndpoint ep ) {
+ private void startEndpoint(CompositeContext compositeContext, RuntimeEndpoint ep) {
for (PolicyProvider policyProvider : ep.getPolicyProviders()) {
policyProvider.start();
} // end for
@@ -373,45 +472,46 @@
public Object run() {
bindingProvider.start();
return null;
- }
+ }
});
compositeContext.getEndpointRegistry().addEndpoint(ep);
}
} // end method startEndpoint
-
+
/**
* Create the async callback endpoint for a reference that is going to invoke an asyncInvocation service
* @param epr - the RuntimeEndpointReference for which the callback is created
* @return - a RuntimeEndpoint representing the callback endpoint
*/
- private RuntimeEndpoint createAsyncCallbackEndpoint( RuntimeEndpointReference epr ) {
- CompositeContext compositeContext = epr.getCompositeContext();
- RuntimeAssemblyFactory assemblyFactory = getAssemblyFactory( compositeContext );
+ private RuntimeEndpoint createAsyncCallbackEndpoint(RuntimeEndpointReference epr) {
+ CompositeContext compositeContext = epr.getCompositeContext();
+ RuntimeAssemblyFactory assemblyFactory = getAssemblyFactory(compositeContext);
RuntimeEndpoint endpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();
- endpoint.bind( compositeContext );
-
+ endpoint.bind(compositeContext);
+
// Create a pseudo-component and pseudo-service
// - need to end with a chain with an invoker into the AsyncCallbackHandler class
RuntimeComponent fakeComponent = null;
try {
- fakeComponent = (RuntimeComponent)epr.getComponent().clone();
- applyImplementation( fakeComponent );
- } catch (CloneNotSupportedException e2) {
- // will not happen
- } // end try
+ fakeComponent = (RuntimeComponent)epr.getComponent().clone();
+ applyImplementation(fakeComponent);
+ } catch (CloneNotSupportedException e2) {
+ // will not happen
+ } // end try
endpoint.setComponent(fakeComponent);
-
+
// Create pseudo-service
ComponentService service = assemblyFactory.createComponentService();
- ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
+ ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- JavaInterfaceFactory javaInterfaceFactory = (JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
+ JavaInterfaceFactory javaInterfaceFactory =
+ (JavaInterfaceFactory)modelFactories.getFactory(JavaInterfaceFactory.class);
JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
try {
- interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(AsyncResponseHandler.class));
- } catch (InvalidInterfaceException e1) {
- // Nothing to do here - will not happen
- } // end try
+ interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(AsyncResponseHandler.class));
+ } catch (InvalidInterfaceException e1) {
+ // Nothing to do here - will not happen
+ } // end try
service.setInterfaceContract(interfaceContract);
String serviceName = epr.getReference().getName() + "_asyncCallback";
service.setName(serviceName);
@@ -420,20 +520,20 @@
List<ComponentService> services = fakeComponent.getServices();
services.clear();
services.add(service);
-
+
// Create a binding
- Binding binding = createMatchingBinding( epr.getBinding(), fakeComponent, service, registry );
- endpoint.setBinding(binding);
-
- // Need to establish policies here (binding has some...)
- endpoint.getRequiredIntents().addAll( epr.getRequiredIntents() );
- endpoint.getPolicySets().addAll( epr.getPolicySets() );
- String epURI = epr.getComponent().getName() + "#service-binding(" + serviceName + "/" + serviceName + ")";
- endpoint.setURI(epURI);
+ Binding binding = createMatchingBinding(epr.getBinding(), fakeComponent, service, registry);
+ endpoint.setBinding(binding);
+
+ // Need to establish policies here (binding has some...)
+ endpoint.getRequiredIntents().addAll(epr.getRequiredIntents());
+ endpoint.getPolicySets().addAll(epr.getPolicySets());
+ String epURI = epr.getComponent().getName() + "#service-binding(" + serviceName + "/" + serviceName + ")";
+ endpoint.setURI(epURI);
endpoint.setUnresolved(false);
- return endpoint;
+ return endpoint;
}
-
+
/**
* Create a matching binding to a supplied binding
* - the matching binding has the same binding type, but is for the supplied component and service
@@ -444,100 +544,108 @@
* @return - the matching binding, or null if it could not be created
*/
@SuppressWarnings("unchecked")
- private Binding createMatchingBinding( Binding matchBinding, RuntimeComponent component,
- ComponentService service, ExtensionPointRegistry registry ) {
- // Since there is no simple way to obtain a Factory for a binding where the type is not known ahead of
- // time, the process followed here is to generate the <binding.xxx/> XML element from the binding type QName
- // and then read the XML using the processor for that XML...
- QName bindingName = matchBinding.getType();
- String bindingXML = "<ns1:" + bindingName.getLocalPart() + " xmlns:ns1='" + bindingName.getNamespaceURI() + "'/>";
-
- StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(bindingName);
-
- FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- ValidatingXMLInputFactory inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
- StreamSource source = new StreamSource( new StringReader(bindingXML) );
-
- ProcessorContext context = new ProcessorContext();
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(source);
- reader.next();
- Binding newBinding = (Binding) processor.read(reader, context );
-
- // Create a URI address for the callback based on the Component_Name/Reference_Name pattern
- String callbackURI = "/" + component.getName() + "/" + service.getName();
- newBinding.setURI(callbackURI);
-
- BuilderExtensionPoint builders = registry.getExtensionPoint(BuilderExtensionPoint.class);
- BindingBuilder builder = builders.getBindingBuilder(newBinding.getType());
+ private Binding createMatchingBinding(Binding matchBinding,
+ RuntimeComponent component,
+ ComponentService service,
+ ExtensionPointRegistry registry) {
+ // Since there is no simple way to obtain a Factory for a binding where the type is not known ahead of
+ // time, the process followed here is to generate the <binding.xxx/> XML element from the binding type QName
+ // and then read the XML using the processor for that XML...
+ QName bindingName = matchBinding.getType();
+ String bindingXML =
+ "<ns1:" + bindingName.getLocalPart() + " xmlns:ns1='" + bindingName.getNamespaceURI() + "'/>";
+
+ StAXArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(bindingName);
+
+ FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ ValidatingXMLInputFactory inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);
+ StreamSource source = new StreamSource(new StringReader(bindingXML));
+
+ ProcessorContext context = new ProcessorContext();
+ try {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(source);
+ reader.next();
+ Binding newBinding = (Binding)processor.read(reader, context);
+
+ // Create a URI address for the callback based on the Component_Name/Reference_Name pattern
+ String callbackURI = "/" + component.getName() + "/" + service.getName();
+ newBinding.setURI(callbackURI);
+
+ BuilderExtensionPoint builders = registry.getExtensionPoint(BuilderExtensionPoint.class);
+ BindingBuilder builder = builders.getBindingBuilder(newBinding.getType());
if (builder != null) {
- org.apache.tuscany.sca.assembly.builder.BuilderContext builderContext = new BuilderContext(registry);
- builder.build(component, service, newBinding, builderContext, true);
+ org.apache.tuscany.sca.assembly.builder.BuilderContext builderContext = new BuilderContext(registry);
+ builder.build(component, service, newBinding, builderContext, true);
} // end if
-
- return newBinding;
- } catch (ContributionReadException e) {
- e.printStackTrace();
- } catch (XMLStreamException e) {
- e.printStackTrace();
- }
-
- return null;
+
+ return newBinding;
+ } catch (ContributionReadException e) {
+ e.printStackTrace();
+ } catch (XMLStreamException e) {
+ e.printStackTrace();
+ }
+
+ return null;
} // end method createMatchingBinding
-
+
/**
* Gets a RuntimeAssemblyFactory from the CompositeContext
* @param compositeContext
* @return the RuntimeAssemblyFactory
*/
- private RuntimeAssemblyFactory getAssemblyFactory( CompositeContext compositeContext ) {
- ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
+ private RuntimeAssemblyFactory getAssemblyFactory(CompositeContext compositeContext) {
+ ExtensionPointRegistry registry = compositeContext.getExtensionPointRegistry();
FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
return (RuntimeAssemblyFactory)modelFactories.getFactory(AssemblyFactory.class);
} // end method RuntimeAssemblyFactory
-
+
/**
* Applies an AsyncResponseHandlerImpl as the implementation of a RuntimeComponent
* - the AsyncResponseHandlerImpl acts as both the implementation class and the implementation provider...
* @param component - the component
*/
- private void applyImplementation( RuntimeComponent component ) {
- AsyncResponseHandlerImpl<?> asyncHandler = new AsyncResponseHandlerImpl<Object>();
- component.setImplementation( asyncHandler );
- component.setImplementationProvider( asyncHandler );
+ private void applyImplementation(RuntimeComponent component) {
+ AsyncResponseHandlerImpl<?> asyncHandler = new AsyncResponseHandlerImpl<Object>();
+ component.setImplementation(asyncHandler);
+ component.setImplementationProvider(asyncHandler);
return;
} // end method getImplementationProvider
-
- private static QName ASYNC_INVOKE = new QName( Constants.SCA11_NS, "asyncInvocation" );
+
+ private static QName ASYNC_INVOKE = new QName(Constants.SCA11_NS, "asyncInvocation");
+
/**
* Determines if the service invocation is asynchronous
* @param source - the EPR involved in the invocation
* @return - true if the invocation is async
*/
- private boolean isAsyncInvocation( Invocable source ) {
- if( !(source instanceof RuntimeEndpointReference) ) return false;
- RuntimeEndpointReference epr = (RuntimeEndpointReference) source;
- // First check is to see if the EPR itself has the asyncInvocation intent marked
- for( Intent intent : epr.getRequiredIntents() ) {
- if ( intent.getName().equals(ASYNC_INVOKE) ) return true;
- } // end for
-
- // Second check is to see if the target service has the asyncInvocation intent marked
- Endpoint ep = epr.getTargetEndpoint();
- for( Intent intent : ep.getRequiredIntents() ) {
- if ( intent.getName().equals(ASYNC_INVOKE) ) return true;
- } // end for
- return false;
+ private boolean isAsyncInvocation(Invocable source) {
+ if (!(source instanceof RuntimeEndpointReference))
+ return false;
+ RuntimeEndpointReference epr = (RuntimeEndpointReference)source;
+ // First check is to see if the EPR itself has the asyncInvocation intent marked
+ for (Intent intent : epr.getRequiredIntents()) {
+ if (intent.getName().equals(ASYNC_INVOKE))
+ return true;
+ } // end for
+
+ // Second check is to see if the target service has the asyncInvocation intent marked
+ Endpoint ep = epr.getTargetEndpoint();
+ for (Intent intent : ep.getRequiredIntents()) {
+ if (intent.getName().equals(ASYNC_INVOKE))
+ return true;
+ } // end for
+ return false;
} // end isAsyncInvocation
-
+
/**
* Return the synchronous method that is the equivalent of an async method
* @param asyncMethod - the async method
* @return - the equivalent synchronous method
*/
protected Method getNonAsyncMethod(Method asyncMethod) {
- String methodName = asyncMethod.getName().substring(0, asyncMethod.getName().length()-5);
+ String methodName = asyncMethod.getName().substring(0, asyncMethod.getName().length() - 5);
for (Method m : businessInterface.getMethods()) {
if (methodName.equals(m.getName())) {
return m;
@@ -545,12 +653,12 @@
}
throw new IllegalStateException("No synchronous method matching async method " + asyncMethod.getName());
} // end method getNonAsyncMethod
-
+
/**
* Gets the classloader of the business interface
* @return
*/
- private ClassLoader getInterfaceClassloader( ) {
- return businessInterface.getClassLoader();
+ private ClassLoader getInterfaceClassloader() {
+ return businessInterface.getClassLoader();
}
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncResponseHandlerImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncResponseHandlerImpl.java
index 8d56088..aa9cf4a 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncResponseHandlerImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/AsyncResponseHandlerImpl.java
@@ -157,6 +157,10 @@
public Message invoke(Message msg) {
// Get the unique ID from the message header
String idValue = (String)msg.getHeaders().get(WS_MESSAGE_ID);
+ if (idValue == null){
+ idValue = (String)msg.getHeaders().get("MESSAGE_ID");
+ }
+
if( idValue == null ) {
System.out.println( "Async message ID not found ");
} else {
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java
index d0095f4..03853a2 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKInvocationHandler.java
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Map;
+import javax.xml.ws.Holder;
+
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.context.ThreadMessageContext;
import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
@@ -103,12 +105,33 @@
if (chain == null) {
throw new IllegalArgumentException("No matching operation is found: " + method);
- }
-
- // send the invocation down the source
- Object result = invoke(chain, args, source);
+ }
- return result;
+ // Holder pattern. Items stored in a Holder<T> are promoted to T.
+ // After the invoke, the returned data <T> are placed back in Holder<T>.
+ Object [] promotedArgs = promoteHolderArgs( args );
+
+ Object result = invoke(chain, promotedArgs, source);
+
+ // Returned Holder data <T> are placed back in Holder<T>.
+ boolean holderPattern = false;
+ Class [] parameters = method.getParameterTypes();
+ if ( parameters != null ) {
+ for ( int i = 0, resultIdx = 0; i < parameters.length; i++ ) {
+ Class parameterType = parameters[ i ];
+ if ( isHolder( parameterType ) ) {
+ holderPattern = true;
+ // Pop results and place in holder (demote).
+ Holder holder = (Holder) args[ i ];
+ Object[] resultArray = (Object[])result;
+ holder.value = resultArray[++resultIdx];
+ }
+ }
+ }
+ if ( holderPattern )
+ return ((Object[])result)[0];
+ else
+ return result;
}
/**
@@ -307,5 +330,58 @@
public void setCallableReference(ServiceReference<?> callableReference) {
this.callableReference = (ServiceReferenceExt<?>)callableReference;
}
-
+
+ /**
+ * Creates a copy of arguments. Holder<T> values are promoted to T.
+ * Note. It is essential that arg Holders not be destroyed here.
+ * PromotedArgs should not destroy holders. They are used on response return.
+ * @param args containing Holders and other objects.
+ * @return Object []
+ */
+ protected static Object [] promoteHolderArgs( Object [] args ) {
+ if ( args == null )
+ return args;
+ Object [] promotedArgs = new Object[ args.length ];
+
+ for ( int i = 0; i < args.length; i++ ) {
+ Object argument = args[ i ];
+ if ( argument != null ) {
+ if ( isHolder( argument ) ) {
+ promotedArgs[ i ] = ((Holder)argument).value;
+ } else {
+ promotedArgs[ i ] = args[ i ];
+ }
+
+ }
+ }
+ return promotedArgs;
+ }
+
+ /**
+ * Given a Class, tells if it is a Holder by comparing to "javax.xml.ws.Holder"
+ * @param testClass
+ * @return boolean whether class is Holder type.
+ */
+ protected static boolean isHolder( Class testClass ) {
+ if ( testClass.getName().startsWith( "javax.xml.ws.Holder" )) {
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Given an Object, tells if it is a Holder by comparing to "javax.xml.ws.Holder"
+ * @param testClass
+ * @return boolean stating whether Object is a Holder type.
+ * @author DOB
+ */
+ protected static boolean isHolder( Object object ) {
+ String objectName = object.getClass().getName();
+ if ( object instanceof javax.xml.ws.Holder ) {
+ return true;
+ }
+ return false;
+ }
+
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java
index a162110..f072d66 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/impl/JDKProxyFactory.java
@@ -31,6 +31,7 @@
import javax.xml.ws.Response;
import org.apache.tuscany.sca.common.java.collection.LRUCache;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.LifeCycleListener;
import org.apache.tuscany.sca.core.context.ServiceReferenceExt;
import org.apache.tuscany.sca.core.context.impl.CallbackServiceReferenceImpl;
@@ -44,17 +45,20 @@
import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.ServiceRuntimeException;
-
/**
* the default implementation of a wire service that uses JDK dynamic proxies
*
* @version $Rev$ $Date$
*/
public class JDKProxyFactory implements ProxyFactory, LifeCycleListener {
+ protected ExtensionPointRegistry registry;
protected InterfaceContractMapper contractMapper;
private MessageFactory messageFactory;
- public JDKProxyFactory(MessageFactory messageFactory, InterfaceContractMapper mapper) {
+ public JDKProxyFactory(ExtensionPointRegistry registry,
+ MessageFactory messageFactory,
+ InterfaceContractMapper mapper) {
+ this.registry = registry;
this.contractMapper = mapper;
this.messageFactory = messageFactory;
}
@@ -66,15 +70,17 @@
public <T> T createProxy(final Class<T> interfaze, Invocable invocable) throws ProxyCreationException {
if (invocable instanceof RuntimeEndpoint) {
InvocationHandler handler;
- if (isAsync(interfaze)) {
- handler = new AsyncJDKInvocationHandler(messageFactory, interfaze, invocable);
- } else {
- handler = new JDKInvocationHandler(messageFactory, interfaze, invocable);
- }
+ // TUSCANY-3659 - Always install a asynch handler regardless of whether ref is sync or async
+ // needs tidying
+ // if (isAsync(interfaze)) {
+ handler = new AsyncJDKInvocationHandler(registry, messageFactory, interfaze, invocable);
+ // } else {
+ // handler = new JDKInvocationHandler(messageFactory, interfaze, invocable);
+ // }
// Allow privileged access to class loader. Requires RuntimePermission in security policy.
ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
- return interfaze.getClassLoader();
+ return interfaze.getClassLoader();
}
});
T proxy = interfaze.cast(newProxyInstance(cl, new Class[] {interfaze}, handler));
@@ -83,33 +89,36 @@
ServiceReference<T> serviceReference = new ServiceReferenceImpl<T>(interfaze, invocable, null);
return createProxy(serviceReference);
}
-
+
public <T> T createProxy(ServiceReference<T> callableReference) throws ProxyCreationException {
assert callableReference != null;
final Class<T> interfaze = callableReference.getBusinessInterface();
InvocationHandler handler;
- if (isAsync(interfaze)) {
- handler = new AsyncJDKInvocationHandler(messageFactory, callableReference);
- } else {
- handler = new JDKInvocationHandler(messageFactory, callableReference);
- }
+ // TUSCANY-3659 - Always install a asynch handler regardless of whether ref is sync or async
+ // needs tidying
+ // if (isAsync(interfaze)) {
+ handler = new AsyncJDKInvocationHandler(registry, messageFactory, callableReference);
+ // } else {
+ // handler = new JDKInvocationHandler(messageFactory, callableReference);
+ // }
// Allow privileged access to class loader. Requires RuntimePermission in security policy.
ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
- return interfaze.getClassLoader();
+ return interfaze.getClassLoader();
}
});
T proxy = interfaze.cast(newProxyInstance(cl, new Class[] {interfaze}, handler));
((ServiceReferenceExt<T>)callableReference).setProxy(proxy);
return proxy;
}
-
+
private boolean isAsync(Class<?> interfaze) {
for (Method method : interfaze.getMethods()) {
if (method.getName().endsWith("Async")) {
if (method.getReturnType().isAssignableFrom(Future.class)) {
if (method.getParameterTypes().length > 0) {
- if (method.getParameterTypes()[method.getParameterTypes().length-1].isAssignableFrom(AsyncHandler.class)) {
+ if (method.getParameterTypes()[method.getParameterTypes().length - 1]
+ .isAssignableFrom(AsyncHandler.class)) {
return true;
}
}
@@ -139,7 +148,7 @@
InvocationHandler handler = new JDKCallbackInvocationHandler(messageFactory, callbackReference);
ClassLoader cl = interfaze.getClassLoader();
T proxy = interfaze.cast(newProxyInstance(cl, new Class[] {interfaze}, handler));
- ((ServiceReferenceExt<T>) callbackReference).setProxy(proxy);
+ ((ServiceReferenceExt<T>)callbackReference).setProxy(proxy);
return proxy;
}
@@ -158,15 +167,14 @@
public boolean isProxyClass(Class<?> clazz) {
return Proxy.isProxyClass(clazz);
}
-
+
// This is a cache containing the proxy class constructor for each business interface.
// This improves performance compared to calling Proxy.newProxyInstance()
// every time that a proxy is needed.
private final LRUCache<Class<?>, Constructor<?>> cache = new LRUCache<Class<?>, Constructor<?>>(512);
- public Object newProxyInstance(ClassLoader classloader,
- Class<?> interfaces[],
- InvocationHandler invocationhandler) throws IllegalArgumentException {
+ public Object newProxyInstance(ClassLoader classloader, Class<?> interfaces[], InvocationHandler invocationhandler)
+ throws IllegalArgumentException {
if (interfaces.length > 1) {
// We only cache the proxy constructors with one single interface which the case in SCA where
// one reference can have one interface
@@ -197,6 +205,6 @@
}
public void stop() {
- cache.clear();
- }
+ cache.clear();
+ }
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index b58635d..82860e2 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -44,11 +44,13 @@
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl;
import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
import org.apache.tuscany.sca.interfacedef.util.Audit;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.MonitorFactory;
import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ExtensionType;
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.IntentMap;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -327,7 +329,11 @@
if (endpointReference.getReference().getName().startsWith("$self$.")){
// just select the first one and don't do any policy matching
- matchedEndpoint = endpoints.get(0);
+ if (endpointReference.getTargetEndpoint() != null && !endpointReference.getTargetEndpoint().isUnresolved()) {
+ matchedEndpoint = endpointReference.getTargetEndpoint();
+ } else {
+ matchedEndpoint = endpoints.get(0);
+ }
} else {
// find the first endpoint that matches this endpoint reference
for (Endpoint endpoint : endpoints){
@@ -496,6 +502,7 @@
" " +
epIntent.toString() +
" ");
+ matchAudit.appendSeperator();
return false;
}
}
@@ -549,6 +556,7 @@
(noEndpointReferencePolicies) &&
(noEndpointPolicies)) {
matchAudit.append("Match because there are no intents or policies ");
+ matchAudit.appendSeperator();
return true;
}
@@ -559,8 +567,8 @@
// this they must be satisfied by reference policy sets
// Failing this the intent is unresolved and the reference and
// service don't match
- List<Intent> eprIntents = new ArrayList<Intent>();
- eprIntents.addAll(endpointReference.getRequiredIntents());
+
+
// TODO - seems that we should do this loop on a binding by binding basis
// rather than each time we do matching
@@ -573,6 +581,13 @@
}
}
+ // Before we start examining intents, remove any whose constrained
+ // types don't include the binding type
+ removeConstrainedIntents(endpointReference, bindingType);
+
+ List<Intent> eprIntents = new ArrayList<Intent>();
+ eprIntents.addAll(endpointReference.getRequiredIntents());
+
// first check the binding type
for (Intent intent : endpointReference.getRequiredIntents()){
if (bindingType != null &&
@@ -612,6 +627,7 @@
// if there are unresolved intents the service and reference don't match
if (eprIntents.size() > 0){
matchAudit.append("No match because there are unresolved intents " + eprIntents.toString() + " ");
+ matchAudit.appendSeperator();
return false;
}
@@ -619,6 +635,7 @@
// they match
if (noEndpointPolicies && noEndpointReferencePolicies){
matchAudit.append("Match because the intents are resolved and there are no policy sets ");
+ matchAudit.appendSeperator();
return true;
}
@@ -626,11 +643,13 @@
// the don't match
if (noEndpointPolicies && !noEndpointReferencePolicies) {
matchAudit.append("No match because there are policy sets at the endpoint reference but not at the endpoint ");
+ matchAudit.appendSeperator();
return false;
}
if (!noEndpointPolicies && noEndpointReferencePolicies){
matchAudit.append("No match because there are policy sets at the endpoint but not at the endpoint reference ");
+ matchAudit.appendSeperator();
return false;
}
@@ -640,6 +659,7 @@
Set<PolicySet> servicePolicySet = new HashSet<PolicySet>(endpoint.getPolicySets());
if(referencePolicySet.equals(servicePolicySet)){
matchAudit.append("Match because the policy sets on both sides are eactly the same ");
+ matchAudit.appendSeperator();
return true;
}
@@ -672,6 +692,7 @@
" and " +
epLanguage +
" ");
+ matchAudit.appendSeperator();
return false;
}
@@ -694,16 +715,48 @@
if (!match){
matchAudit.append("No match because the language specific matching failed ");
+ matchAudit.appendSeperator();
endpointReference.getPolicySets().clear();
endpointReference.getPolicySets().addAll(originalPolicySets);
} else {
matchAudit.append("Match because the language specific matching succeeded ");
+ matchAudit.appendSeperator();
}
return match;
}
- protected boolean isQualifiedBy(Intent qualifiableIntent, Intent qualifiedIntent){
+ // Copied from ComponentPolicyBuilder, should probably be refactored
+ protected void removeConstrainedIntents(EndpointReference subject, BindingType bindingType) {
+ List<Intent> intents = subject.getRequiredIntents();
+
+ // Remove the intents whose @contrains do not include the current element
+ if(bindingType != null){
+ List<Intent> copy = new ArrayList<Intent>(intents);
+ for (Intent i : copy) {
+ List<ExtensionType> constrainedTypes = i.getConstrainedTypes();
+ if (( constrainedTypes.size() == 0 ) && ( i.getQualifiableIntent() != null ) )
+ constrainedTypes = i.getQualifiableIntent().getConstrainedTypes();
+
+ if (constrainedTypes.size() > 0){
+ boolean constraintFound = false;
+ for (ExtensionType constrainedType : i.getConstrainedTypes()){
+ if (constrainedType.getType().equals(bindingType.getType()) ||
+ constrainedType.getType().equals(bindingType.getBaseType())){
+ constraintFound = true;
+ break;
+ }
+ }
+ if(!constraintFound){
+ intents.remove(i);
+ }
+ }
+ }
+ }
+ }
+
+
+ protected boolean isQualifiedBy(Intent qualifiableIntent, Intent qualifiedIntent){
if (qualifiedIntent.getQualifiableIntent() == qualifiableIntent){
return true;
} else {
@@ -728,32 +781,50 @@
private boolean haveMatchingInterfaceContracts(EndpointReference endpointReference, Endpoint endpoint, Audit matchAudit){
matchAudit.append("Match interface of " + endpointReference.toString() + " to " + endpoint.toString() + " ");
- if (endpointReference.getReference().getInterfaceContract() == null){
+ InterfaceContract endpointReferenceContract = endpointReference.getReference().getInterfaceContract();
+ InterfaceContract endpointContract = endpoint.getComponentServiceInterfaceContract();
+
+ if (endpointReferenceContract == null){
matchAudit.append("Match because there is no interface contract on the reference ");
+ matchAudit.appendSeperator();
return true;
}
// TODO - is there a better test for this. Would have to cast to the
// correct iface type to get to the resolved flag
- if (endpoint.getComponentServiceInterfaceContract().getInterface().getOperations().size() == 0){
+ // We need to rely on normailzed interfaces in this case!!
+ if (endpointContract.getInterface().getOperations().size() == 0){
// the interface contract is likely remote but unresolved
// we discussed this on the ML and decided that we could
// live with this for the case where there is no central matching of references
// to services. Any errors will be detected when the message flows.
matchAudit.append("Match because the endpoint is remote and we don't have a copy of it's interface contract ");
+ matchAudit.appendSeperator();
return true;
}
+
+ // If the contracts are not of the same type or normalized interfaces are available
+ // use them
+ if (endpointReferenceContract.getClass() != endpointContract.getClass() ||
+ endpointReferenceContract.getNormalizedWSDLContract() != null ||
+ endpointContract.getNormalizedWSDLContract() != null) {
+ endpointReferenceContract = ((RuntimeEndpointReference)endpointReference).getGeneratedWSDLContract(endpointReferenceContract);
+ endpointContract = ((RuntimeEndpoint)endpoint).getGeneratedWSDLContract(endpointContract);
+ }
boolean match = false;
- match = interfaceContractMapper.isCompatibleSubset(endpointReference.getReference().getInterfaceContract(),
- endpoint.getComponentServiceInterfaceContract(), matchAudit);
+ match = interfaceContractMapper.isCompatibleSubset(endpointReferenceContract,
+ endpointContract,
+ matchAudit);
if (!match){
- matchAudit.append("Match failed because the linterface contract mapper failed ");
+ matchAudit.append("Match failed because the interface contract mapper failed ");
} else {
matchAudit.append("Match because the interface contract mapper succeeded ");
}
+ matchAudit.appendSeperator();
+
return match;
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java
index 380ca81..dd4abf0 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/DefaultWorkScheduler.java
@@ -21,6 +21,7 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Map;
+import java.util.concurrent.ExecutorService;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.LifeCycleListener;
@@ -201,4 +202,9 @@
}
}
+
+ @Override
+ public ExecutorService getExecutorService() {
+ return getWorkManager().getExecutorService();
+ }
}
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java
index 1cd70c7..7e11665 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/ThreadPoolWorkManager.java
@@ -45,7 +45,7 @@
private Map<WorkItem, WorkListener> workItems = new ConcurrentHashMap<WorkItem, WorkListener>();
// Thread-pool
- private ExecutorService executor;
+ protected ExecutorService executor;
/**
* Initializes the thread-pool.
@@ -224,5 +224,9 @@
executor.shutdown();
}
+ public ExecutorService getExecutorService() {
+ return executor;
+ }
+
}
diff --git a/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory b/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
index f2a6f0b..6a01eac 100644
--- a/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
+++ b/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
@@ -14,4 +14,4 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-org.apache.tuscany.sca.core.assembly.impl.LocalDomainRegistryFactory
+org.apache.tuscany.sca.core.assembly.impl.LocalDomainRegistryFactory;ranking=10
diff --git a/modules/databinding-axiom/pom.xml b/modules/databinding-axiom/pom.xml
index 480b5ed..31eb019 100644
--- a/modules/databinding-axiom/pom.xml
+++ b/modules/databinding-axiom/pom.xml
@@ -31,28 +31,11 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
@@ -86,26 +69,7 @@
</exclusion>
</exclusions>
</dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+
</dependencies>
diff --git a/modules/databinding-jaxb-axiom/pom.xml b/modules/databinding-jaxb-axiom/pom.xml
index c5f4bb7..1da0475 100644
--- a/modules/databinding-jaxb-axiom/pom.xml
+++ b/modules/databinding-jaxb-axiom/pom.xml
@@ -31,14 +31,12 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-api</artifactId>
@@ -71,26 +69,6 @@
</dependency>
</dependencies>
- <repositories>
- <repository>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>java.net</id>
- <name>java.net Maven 1.x Repository</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>java.net2</id>
- <name>java.net Maven 2.x Repository</name>
- <url>http://download.java.net/maven/2</url>
- </pluginRepository>
- </pluginRepositories>
-
<build>
<plugins>
<plugin>
diff --git a/modules/databinding-json/pom.xml b/modules/databinding-json/pom.xml
index fe4c64f..897bee6 100644
--- a/modules/databinding-json/pom.xml
+++ b/modules/databinding-json/pom.xml
@@ -31,36 +31,26 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
+ <type>pom</type>
<version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-common-xml</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
- <version>1.5.4</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
- <version>1.5.4</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
- <version>1.5.4</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
diff --git a/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JSON2Object.java b/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JSON2Object.java
index 3620fc1..ca28ec5 100644
--- a/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JSON2Object.java
+++ b/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JSON2Object.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.databinding.json.jackson;
@@ -49,7 +49,12 @@
try {
JavaType javaType = TypeFactory.type(context.getTargetDataType().getGenericType());
if (source instanceof String) {
- return mapper.readValue((String)source, javaType);
+ String sourceString = (String) source;
+ if(sourceString.isEmpty()) {
+ return sourceString;
+ } else {
+ return mapper.readValue((String)source, javaType);
+ }
} else if (source instanceof JsonNode) {
return mapper.treeToValue((JsonNode)source, context.getTargetDataType().getPhysical());
} else if (source instanceof JsonParser) {
diff --git a/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java b/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java
index 0948341..d543d05 100644
--- a/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java
+++ b/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/Object2JSON.java
@@ -19,6 +19,8 @@
package org.apache.tuscany.sca.databinding.json.jackson;
+import java.math.BigDecimal;
+
import org.apache.tuscany.sca.databinding.PullTransformer;
import org.apache.tuscany.sca.databinding.TransformationContext;
import org.apache.tuscany.sca.databinding.TransformationException;
@@ -53,9 +55,16 @@
targetType = String.class;
}
try {
+ if (targetType != null && targetType.isPrimitive()) {
+ return source;
+ }
String value = mapper.writeValueAsString(source);
- if (targetType == String.class || targetType == Object.class) {
+ if (targetType == String.class ||
+ targetType == Object.class ||
+ targetType.isPrimitive()) {
return value;
+ } else if (targetType == BigDecimal.class){
+ return value.toString();
} else if (JsonNode.class.isAssignableFrom(targetType)) {
return JacksonHelper.createJsonParser(value).readValueAsTree();
}
diff --git a/modules/domain-hazelcast/META-INF/MANIFEST.MF b/modules/domain-hazelcast/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3db18cf
--- /dev/null
+++ b/modules/domain-hazelcast/META-INF/MANIFEST.MF
@@ -0,0 +1,36 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Hazelcast Based Domain
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany Domain Hazelcast
+Bundle-SymbolicName: org.apache.tuscany.sca.domain.hazelcast
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: com.hazelcast.config,
+ com.hazelcast.client,
+ com.hazelcast.core,
+ com.hazelcast.nio,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.impl;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.binding.ws;version="2.0.0",
+ org.apache.tuscany.sca.binding.ws.wsdlgen;version="2.0.0",
+ org.apache.tuscany.sca.common.xml;version="2.0.0",
+ org.apache.tuscany.sca.context;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.databinding.xml;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.oasisopen.sca,
+ org.oasisopen.sca.annotation,
+ org.w3c.dom,
+ org.xml.sax
+Export-Package: org.apache.tuscany.sca.endpoint.hazelcast;version="2.0.0";
+ uses:="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core"
+
diff --git a/modules/domain-hazelcast/pom.xml b/modules/domain-hazelcast/pom.xml
new file mode 100644
index 0000000..16755a2
--- /dev/null
+++ b/modules/domain-hazelcast/pom.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <name>Apache Tuscany SCA EndPoint Registry using Hazelcast</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast-client</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ <!-- dependency>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast-all</artifactId>
+ <version>1.9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast-client</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.hazelcast</groupId>
+ <artifactId>hazelcast-hibernate</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/EndpointStash.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/EndpointStash.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/EndpointStash.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/EndpointStash.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBinding.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBinding.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBinding.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBinding.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingProviderFactory.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingProviderFactory.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingProviderFactory.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingProviderFactory.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastReferenceBindingProvider.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastReferenceBindingProvider.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastReferenceBindingProvider.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastReferenceBindingProvider.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastServiceBindingProvider.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastServiceBindingProvider.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastServiceBindingProvider.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastServiceBindingProvider.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ReferenceInvoker.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ReferenceInvoker.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ReferenceInvoker.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ReferenceInvoker.java
diff --git a/modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ServiceInvoker.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ServiceInvoker.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ServiceInvoker.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/binding/hazelcast/ServiceInvoker.java
diff --git a/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastDomainRegistryFactory.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastDomainRegistryFactory.java
similarity index 100%
rename from modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastDomainRegistryFactory.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastDomainRegistryFactory.java
diff --git a/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
similarity index 100%
rename from modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/HazelcastEndpointRegistry.java
diff --git a/modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java
similarity index 100%
rename from modules/endpoint-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryConfig.java
diff --git a/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientDomainRegistryFactory.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientDomainRegistryFactory.java
similarity index 100%
rename from modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientDomainRegistryFactory.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientDomainRegistryFactory.java
diff --git a/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java b/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
similarity index 100%
rename from modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
rename to modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
diff --git a/modules/binding-hazelcast-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
rename to modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
diff --git a/modules/binding-hazelcast-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
rename to modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
diff --git a/modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory b/modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
new file mode 100644
index 0000000..2dfacf1
--- /dev/null
+++ b/modules/domain-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org.apache.tuscany.sca.endpoint.hazelcast.HazelcastDomainRegistryFactory;ranking=100
+org.apache.tuscany.sca.endpoint.hazelcast.client.HazelcastClientDomainRegistryFactory;ranking=100
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/BadStringException.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/BadStringException.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/BadStringException.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/BadStringException.java
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/ComplexType.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/ComplexType.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/ComplexType.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/ComplexType.java
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingTestCase.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingTestCase.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingTestCase.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/HazelcastBindingTestCase.java
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestService.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestService.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestService.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestService.java
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceClient.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceClient.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceClient.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceClient.java
diff --git a/modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceImpl.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceImpl.java
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceImpl.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/binding/hazelcast/TestServiceImpl.java
diff --git a/modules/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/MultiRegTestCase.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/MultiRegTestCase.java
similarity index 100%
rename from modules/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/MultiRegTestCase.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/MultiRegTestCase.java
diff --git a/modules/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java b/modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
similarity index 100%
rename from modules/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
rename to modules/domain-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
diff --git a/modules/binding-hazelcast-runtime/src/test/resources/client.composite b/modules/domain-hazelcast/src/test/resources/client.composite
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/resources/client.composite
rename to modules/domain-hazelcast/src/test/resources/client.composite
diff --git a/modules/binding-hazelcast-runtime/src/test/resources/client2.composite b/modules/domain-hazelcast/src/test/resources/client2.composite
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/resources/client2.composite
rename to modules/domain-hazelcast/src/test/resources/client2.composite
diff --git a/modules/binding-hazelcast-runtime/src/test/resources/service.composite b/modules/domain-hazelcast/src/test/resources/service.composite
similarity index 100%
rename from modules/binding-hazelcast-runtime/src/test/resources/service.composite
rename to modules/domain-hazelcast/src/test/resources/service.composite
diff --git a/modules/domain-node/pom.xml b/modules/domain-node/pom.xml
index 49b8ce8..c456eeb 100644
--- a/modules/domain-node/pom.xml
+++ b/modules/domain-node/pom.xml
@@ -56,6 +56,20 @@
<version>2.0-Beta1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</project>
diff --git a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java
index 4b60ed0..9cf0e90 100644
--- a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java
+++ b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/Node.java
@@ -46,12 +46,13 @@
* root contribution and other dependent contributions. May be null.
* @param runDeployables true if the composites defined as deployable in the contributions sca-contribution.xml
* file or supplied metaData file should be run, false if they should not be.
+ * @return the URI of the installed contribution
*
* @throws ContributionReadException
* @throws ActivationException
* @throws ValidationException
*/
- void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException;
+ String installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException;
/**
* Creates an installed contribution from a supplied Contribution object.
@@ -62,19 +63,21 @@
* root contribution and other dependent contributions. May be null.
* @param runDeployables true if the composites defined as deployable in the contributions sca-contribution.xml
* file or supplied metaData file should be run, false if they should not be.
+ * @return the URI of the installed contribution
*
* @throws ContributionReadException
* @throws ActivationException
* @throws ValidationException
*/
- void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException;
+ String installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException;
/**
- * Creates an installed contribution from a supplied root contribution.
- * See section 10.5.1 of the Assembly Specification.
+ * Creates an installed contribution from a supplied root contribution URL.
+ * See section 10.5.1 of the Assembly Specification. This version of
+ * installContribution automatically runs deployable composites
*
* @param contributionURL the URL where the contribution is located
- * @return the URI where the contribution was installed
+ * @return the URI of the installed contribution
*
* @throws ContributionReadException
* @throws ActivationException
@@ -179,21 +182,23 @@
* 4685 services and references in the supplied composite is not defined; since there is no composite scope
* 4686 outside the domain composite, the usual idea of promotion has no utility.
*
+ * @param cotributionURI
* @param compositeURI
* @throws ActivationException
* @throws ValidationException
*/
- void addToDomainLevelComposite(String compositeURI) throws ActivationException, ValidationException;
+ void addToDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException;
/**
* 4687 10.7.2 remove From Domain-Level Composite
* 4688 Removes from the Domain Level composite the elements corresponding to the composite identified by a
* 4689 supplied composite URI. This means that the removal of the components, wires, services and references
* 4690 originally added to the domain level composite by the identified composite. *
+ * @param contributionURI
* @param compositeURI
* @throws ActivationException
*/
- void removeFromDomainLevelComposite(String compositeURI) throws ActivationException;
+ void removeFromDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException;
/**
* 10.7.3 get Domain-Level Composite
@@ -240,7 +245,7 @@
* @param contributionURI the contribution URI
* @return the List of deployed composites
*/
- List<String> getDeployedCompostes(String contributionURI);
+ List<String> getDeployedComposites(String contributionURI);
/**
* Get the URIs of all the contributions installed on this Node
diff --git a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
index cafa772..c7b8db2 100644
--- a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
+++ b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/NodeFactory.java
@@ -19,22 +19,35 @@
package org.apache.tuscany.sca.node2;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
import java.util.Properties;
import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.common.java.io.IOHelper;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
+import org.apache.tuscany.sca.core.assembly.impl.EndpointRegistryImpl;
import org.apache.tuscany.sca.deployment.Deployer;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
import org.apache.tuscany.sca.node2.impl.NodeImpl;
+import org.apache.tuscany.sca.runtime.ActivationException;
import org.apache.tuscany.sca.runtime.CompositeActivator;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory;
import org.apache.tuscany.sca.runtime.RuntimeProperties;
import org.apache.tuscany.sca.work.WorkScheduler;
+import org.oasisopen.sca.ServiceRuntimeException;
public class NodeFactory {
@@ -44,37 +57,36 @@
private ExtensibleDomainRegistryFactory domainRegistryFactory;
private RuntimeAssemblyFactory assemblyFactory;
+ public static NodeFactory newInstance() {
+ return new NodeFactory(null);
+ }
+ public static NodeFactory newInstance(Properties config) {
+ return new NodeFactory(config);
+ }
+
/**
- * A helper method to simplify creating a Node with an installed contributions
- * @param compositeURI URI of a composite to run relative to the first contribution
- * if compositeURI is null then all deployable composites in the first contribution will be run
- * @param contributionURLs URLs to contributions to install
+ * A helper method to simplify creating a standalone Node
+ * @param compositeURI URI within the contribution of a composite to run
+ * if compositeURI is null then all deployable composites in the contribution will be run
+ * @param contributionURL URL of the contribution
+ * @param dependentContributionURLs optional URLs of dependent contributions
* @return a Node with installed contributions
*/
- public static Node createNode(String compositeURI, String... contributionURLs) {
+ public static Node newStandaloneNode(String compositeURI, String contributionURL, String... dependentContributionURLs) {
try {
-
- Node node = newInstance().createOneoffNode();
- String uri = "";
- for (int i=contributionURLs.length-1; i>-1; i--) {
- boolean runDeployables = (i==0) && (compositeURI == null);
- int lastDot = contributionURLs[i].lastIndexOf('.');
- int lastSep = contributionURLs[i].lastIndexOf("/");
- if (lastDot > -1 && lastSep > -1 && lastDot > lastSep) {
- uri = contributionURLs[i].substring(lastSep+1, lastDot);
- } else {
- uri = contributionURLs[i];
- }
+ NodeFactory nodeFactory = newInstance();
+ EndpointRegistry endpointRegistry = new EndpointRegistryImpl(nodeFactory.extensionPointRegistry, null, null);
+ NodeImpl node = new NodeImpl("default", nodeFactory.deployer, nodeFactory.compositeActivator, endpointRegistry, nodeFactory.extensionPointRegistry, nodeFactory);
- node.installContribution(uri, contributionURLs[i], null, null, runDeployables);
- }
- if (compositeURI != null) {
- if (uri.endsWith("/")) {
- uri = uri + compositeURI;
- } else {
- uri = uri + "/" + compositeURI;
+ if (dependentContributionURLs != null) {
+ for (int i=dependentContributionURLs.length-1; i>-1; i--) {
+ node.installContribution(null, dependentContributionURLs[i], null, null, false);
}
- node.addToDomainLevelComposite(uri);
+ }
+
+ String curi = node.installContribution(null, contributionURL, null, null, compositeURI == null);
+ if (compositeURI != null) {
+ node.addToDomainLevelComposite(curi, compositeURI);
}
return node;
@@ -83,26 +95,30 @@
}
}
- public static NodeFactory newInstance() {
- return new NodeFactory(null);
- }
- public static NodeFactory newInstance(Properties config) {
- return new NodeFactory(config);
- }
-
protected NodeFactory(Properties config) {
init(config);
}
+
+ public Node createNode() {
+ return createNode(null);
+ }
public Node createNode(String domainURI) {
- String domainName = getDomainName(domainURI);
+ String domainName = "default";
+ if (domainURI != null){
+ domainName = getDomainName(domainURI);
+ }
EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName);
return new NodeImpl(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null);
}
- protected Node createOneoffNode() {
- EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry("default", "default");
- return new NodeImpl("default", deployer, compositeActivator, endpointRegistry, extensionPointRegistry, this);
+ public Node createNodeFromXML(String configURL) throws ContributionReadException, ActivationException, ValidationException {
+ NodeConfiguration configuration = loadConfiguration(configURL);
+ Node node = createNode(configuration.getDomainURI());
+ for ( ContributionConfiguration c : configuration.getContributions()) {
+ node.installContribution(c.getURI(), c.getLocation(), c.getMetaDataURL(), c.getDependentContributionURIs(), c.isStartDeployables());
+ }
+ return node;
}
public void stop() {
@@ -163,4 +179,37 @@
return domainURI.substring(scheme+1, qm);
}
}
+
+ protected NodeConfiguration loadConfiguration(String configURL) {
+ InputStream xml =null;
+ try {
+ URL base = IOHelper.getLocationAsURL(configURL);
+ xml = IOHelper.openStream(base);
+ InputStreamReader reader = new InputStreamReader(xml, "UTF-8");
+ ProcessorContext context = deployer.createProcessorContext();
+ NodeConfiguration config = deployer.loadXMLDocument(reader, context.getMonitor());
+ if (base != null && config != null) {
+ // Resolve the contribution location against the node.xml
+ // TODO: absolute locations?
+ for (ContributionConfiguration c : config.getContributions()) {
+ String location = c.getLocation();
+ if (location != null) {
+ URL url = new URL(base, location);
+ url = IOHelper.normalize(url);
+ c.setLocation(url.toString());
+ }
+ }
+ }
+ return config;
+ } catch (Throwable e) {
+ throw new ServiceRuntimeException(e);
+ } finally {
+ try {
+ if (xml != null) xml.close();
+ } catch (IOException e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+ }
+
}
diff --git a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/DeployedComposite.java b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/DeployedComposite.java
index 98c90d5..6e31f28 100644
--- a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/DeployedComposite.java
+++ b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/DeployedComposite.java
@@ -102,8 +102,6 @@
null, // don't need node uri
deployer.getSystemDefinitions());
- CompositeContext.setThreadCompositeContext(compositeContext); // TODO: what is this doing?
-
compositeActivator.activate(compositeContext, domainComposite);
compositeActivator.start(compositeContext, domainComposite);
diff --git a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java
index 40ea587..f2dc3bc 100644
--- a/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java
+++ b/modules/domain-node/src/main/java/org/apache/tuscany/sca/node2/impl/NodeImpl.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.node2.impl;
+import java.io.File;
import java.io.Reader;
import java.net.URI;
import java.util.ArrayList;
@@ -70,19 +71,13 @@
}
public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException {
- int lastDot = contributionURL.lastIndexOf('.');
- int lastSep = contributionURL.lastIndexOf("/");
- String uri;
- if (lastDot > -1 && lastSep > -1 && lastDot > lastSep) {
- uri = contributionURL.substring(lastSep+1, lastDot);
- } else {
- uri = contributionURL;
- }
- installContribution(uri, contributionURL, null, null, true);
- return uri;
+ return installContribution(null, contributionURL, null, null, true);
}
-
- public void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException {
+
+ public String installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException {
+ if (uri == null) {
+ uri = getDefaultContributionURI(contributionURL);
+ }
Monitor monitor = deployer.createMonitor();
Contribution contribution = deployer.loadContribution(IOHelper.createURI(uri), IOHelper.getLocationAsURL(contributionURL), monitor);
monitor.analyzeProblems();
@@ -90,6 +85,7 @@
mergeContributionMetaData(metaDataURL, contribution);
}
installContribution(contribution, dependentContributionURIs, runDeployables);
+ return uri;
}
private void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException {
@@ -106,7 +102,7 @@
contribution.getExports().addAll(metaData.getExports());
}
- public void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException {
+ public String installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean runDeployables) throws ContributionReadException, ActivationException, ValidationException {
InstalledContribution ic = new InstalledContribution(contribution.getURI(), contribution.getLocation(), contribution, dependentContributionURIs);
installedContributions.put(contribution.getURI(), ic);
if (runDeployables) {
@@ -126,6 +122,7 @@
}
monitor.analyzeProblems();
}
+ return ic.getURI();
}
protected List<Contribution> calculateDependentContributions(InstalledContribution ic) {
@@ -164,15 +161,14 @@
return compositeArtifcatURI;
}
- public void addToDomainLevelComposite(String compositeURI) throws ActivationException, ValidationException {
- String contributionURI = getContributionUriForArtifact(compositeURI);
+ @Override
+ public void addToDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException, ValidationException {
InstalledContribution ic = installedContributions.get(contributionURI);
if (ic == null) {
throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
}
- String relativeURI = compositeURI.substring(contributionURI.endsWith("/") ? contributionURI.length() : contributionURI.length()+1);
for (Artifact a : ic.getContribution().getArtifacts()) {
- if (a.getURI().equals(relativeURI)) {
+ if (a.getURI().equals(compositeURI)) {
runComposite((Composite) a.getModel(), ic);
return;
}
@@ -180,12 +176,14 @@
throw new IllegalArgumentException("composite not found: " + compositeURI);
}
- public void removeFromDomainLevelComposite(String compositeURI) throws ActivationException {
- String contributionURI = getContributionUriForArtifact(compositeURI);
+ @Override
+ public void removeFromDomainLevelComposite(String contributionURI, String compositeURI) throws ActivationException {
InstalledContribution ic = installedContributions.get(contributionURI);
- String relativeURI = compositeURI.substring(contributionURI.length()+1);
+ if (ic == null) {
+ throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
+ }
for (DeployedComposite dc : ic.getDeployedComposites()) {
- if (relativeURI.equals(dc.getURI())) {
+ if (compositeURI.equals(dc.getURI())) {
ic.getDeployedComposites().remove(dc);
dc.unDeploy();
return;
@@ -272,7 +270,7 @@
return domainName;
}
- public List<String> getDeployedCompostes(String contributionURI) {
+ public List<String> getDeployedComposites(String contributionURI) {
ArrayList<String> compositeURIs = new ArrayList<String>();
InstalledContribution ic = installedContributions.get(contributionURI);
if (ic == null) {
@@ -332,4 +330,29 @@
}
return dependentContributionURIs;
}
+
+ /**
+ * Returns a default URI for a contribution based on the contribution URL
+ */
+ protected String getDefaultContributionURI(String contributionURL) {
+ String uri = null;
+ try {
+ File f = new File(contributionURL);
+ if ("classes".equals(f.getName()) && "target".equals(f.getParentFile().getName())) {
+ uri = f.getParentFile().getParentFile().getName();
+ } else {
+ uri = f.getName();
+ }
+ } catch (Exception e) {
+ // ignore
+ }
+ if (uri == null) {
+ uri = contributionURL;
+ }
+ if (uri.endsWith(".zip") || uri.endsWith(".jar")) {
+ uri = uri.substring(0, uri.length()-4);
+ }
+ return uri;
+ }
+
}
diff --git a/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java
index 450e5a8..4d0d4ab 100644
--- a/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java
+++ b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/DeployerTestCase.java
@@ -69,7 +69,7 @@
monitor.analyzeProblems();
composite.setURI("helloworld2.composite");
node.addDeploymentComposite("foo", composite);
- List<String> dcs = node.getDeployedCompostes("foo");
+ List<String> dcs = node.getDeployedComposites("foo");
Assert.assertEquals(1, dcs.size());
Assert.assertEquals("helloworld2.composite", dcs.get(0));
}
diff --git a/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java
index d822879..cdf8b02 100644
--- a/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java
+++ b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeTestCase.java
@@ -25,8 +25,6 @@
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.monitor.ValidationException;
-import org.apache.tuscany.sca.node2.Node;
-import org.apache.tuscany.sca.node2.NodeFactory;
import org.apache.tuscany.sca.node2.impl.NodeImpl;
import org.apache.tuscany.sca.runtime.ActivationException;
import org.junit.Ignore;
@@ -45,12 +43,12 @@
// Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
}
- @Ignore("TODO: fails with Sun JDK due to SCA properties issue")
@Test
+ @Ignore("Depdends on itest/T3558 which isn't in the build?")
public void testInstallWithDependent() throws NoSuchServiceException, ContributionReadException, ActivationException, ValidationException {
Node node = NodeFactory.newInstance().createNode("default");
- node.installContribution("store", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store.jar", null, null, true);
- node.installContribution("store-client", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store-client.jar", null, null, true);
+ node.installContribution("store", "../../itest/T3558/src/test/resources/sample-store.jar", null, null, true);
+ node.installContribution("store-client", "../../itest/T3558/src/test/resources/sample-store-client.jar", null, null, true);
// Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
// Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
@@ -69,7 +67,7 @@
// // expected as there is no deployables
// }
- node.addToDomainLevelComposite("helloworld" + "/helloworld.composite");
+ node.addToDomainLevelComposite("helloworld", "helloworld.composite");
// Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
// Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
}
@@ -87,7 +85,7 @@
public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
Node node = NodeFactory.newInstance().createNode("default");
node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
- List<String> dcs = node.getDeployedCompostes("foo");
+ List<String> dcs = node.getDeployedComposites("foo");
Assert.assertEquals(1, dcs.size());
Assert.assertEquals("helloworld.composite", dcs.get(0));
}
@@ -96,8 +94,8 @@
public void testRemoveComposte() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
Node node = NodeFactory.newInstance().createNode("default");
node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
- node.removeFromDomainLevelComposite("foo/helloworld.composite");
- List<String> dcs = node.getDeployedCompostes("foo");
+ node.removeFromDomainLevelComposite("foo", "helloworld.composite");
+ List<String> dcs = node.getDeployedComposites("foo");
Assert.assertEquals(0, dcs.size());
}
@@ -106,7 +104,7 @@
Node node = NodeFactory.newInstance().createNode("default");
((NodeImpl)node).installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null, true);
- List<String> dcs = node.getDeployedCompostes("helloworld");
+ List<String> dcs = node.getDeployedComposites("helloworld");
Assert.assertEquals(1, dcs.size());
Assert.assertEquals("helloworld.composite", dcs.get(0));
@@ -123,20 +121,20 @@
@Test
public void testStaticCreate() {
- Node node = NodeFactory.createNode("helloworld.composite", "src/test/resources/sample-helloworld.jar");
+ Node node = NodeFactory.newStandaloneNode("helloworld.composite", "src/test/resources/sample-helloworld.jar");
List<String> cs = node.getInstalledContributions();
Assert.assertEquals(1, cs.size());
- List<String> dcs = node.getDeployedCompostes(cs.get(0));
+ List<String> dcs = node.getDeployedComposites(cs.get(0));
Assert.assertEquals(1, dcs.size());
Assert.assertEquals("helloworld.composite", dcs.get(0));
}
@Test
public void testStaticCreateWithNullComposite() {
- Node node = NodeFactory.createNode(null, "src/test/resources/sample-helloworld.jar");
+ Node node = NodeFactory.newStandaloneNode(null, "src/test/resources/sample-helloworld.jar");
List<String> cs = node.getInstalledContributions();
Assert.assertEquals(1, cs.size());
- List<String> dcs = node.getDeployedCompostes(cs.get(0));
+ List<String> dcs = node.getDeployedComposites(cs.get(0));
Assert.assertEquals(1, dcs.size());
Assert.assertEquals("helloworld.composite", dcs.get(0));
}
diff --git a/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeXMLTestCase.java b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeXMLTestCase.java
new file mode 100644
index 0000000..110fbfd
--- /dev/null
+++ b/modules/domain-node/src/test/java/org/apache/tuscany/sca/node2/NodeXMLTestCase.java
@@ -0,0 +1,44 @@
+/*
+ * 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.sca.node2;
+
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.junit.Test;
+
+public class NodeXMLTestCase {
+
+ @Test
+ public void testHelloworldXML() throws ContributionReadException, ActivationException, ValidationException {
+ Node node = NodeFactory.newInstance().createNodeFromXML("src/test/resources/helloworldNode.xml");
+ Assert.assertEquals("helloworld", node.getDomainName());
+ List<String> cs = node.getInstalledContributions();
+ Assert.assertEquals(1, cs.size());
+ Assert.assertEquals("sample-helloworld", cs.get(0));
+ List<String> compsoites = node.getDeployedComposites("sample-helloworld");
+ Assert.assertEquals(1, compsoites.size());
+ Assert.assertEquals("helloworld.composite", compsoites.get(0));
+ }
+
+}
diff --git a/modules/domain-node/src/test/resources/helloworldNode.xml b/modules/domain-node/src/test/resources/helloworldNode.xml
new file mode 100644
index 0000000..ea2f577
--- /dev/null
+++ b/modules/domain-node/src/test/resources/helloworldNode.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ domain="helloworld">
+
+ <contribution location="sample-helloworld.jar" startDeployables="true" />
+
+</node>
\ No newline at end of file
diff --git a/modules/endpoint-hazelcast-client/META-INF/MANIFEST.MF b/modules/endpoint-hazelcast-client/META-INF/MANIFEST.MF
deleted file mode 100644
index ea13b89..0000000
--- a/modules/endpoint-hazelcast-client/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA Hazelcast Client Based EndPoint Registry
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Hazelcast Client Endpoint Regsitry
-Bundle-SymbolicName: org.apache.tuscany.sca.endpoint.hazelcast.client
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-Import-Package: com.hazelcast.client,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.endpoint.hazelcast;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0"
-Export-Package: org.apache.tuscany.sca.endpoint.hazelcast.client;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core,org.apache.tuscany.sca.endpoint.hazelcast"
diff --git a/modules/endpoint-hazelcast-client/pom.xml b/modules/endpoint-hazelcast-client/pom.xml
deleted file mode 100644
index 56f2a84..0000000
--- a/modules/endpoint-hazelcast-client/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
- <name>Apache Tuscany SCA EndPoint Registry using Hazelcast Native Client</name>
-
- <dependencies>
- <dependency>
- <groupId>com.hazelcast</groupId>
- <artifactId>hazelcast-client</artifactId>
- <version>1.8.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>2.0-Beta1</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/modules/endpoint-hazelcast-client/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory b/modules/endpoint-hazelcast-client/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
deleted file mode 100644
index b15ea6a..0000000
--- a/modules/endpoint-hazelcast-client/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.apache.tuscany.sca.endpoint.hazelcast.client.HazelcastClientDomainRegistryFactory;ranking=100
diff --git a/modules/endpoint-hazelcast/META-INF/MANIFEST.MF b/modules/endpoint-hazelcast/META-INF/MANIFEST.MF
deleted file mode 100644
index 9680bb9..0000000
--- a/modules/endpoint-hazelcast/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA Hazelcast Based EndPoint Registry
-Bundle-Vendor: The Apache Software Foundation
-Bundle-Version: 2.0.0
-Bundle-ManifestVersion: 2
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany Hazelcast Endpoint Regsitry
-Bundle-SymbolicName: org.apache.tuscany.sca.endpoint.hazelcast
-Bundle-DocURL: http://www.apache.org/
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-Import-Package: com.hazelcast.config,
- com.hazelcast.core,
- com.hazelcast.nio,
- org.apache.tuscany.sca.assembly;version="2.0.0",
- org.apache.tuscany.sca.core;version="2.0.0",
- org.apache.tuscany.sca.runtime;version="2.0.0"
-Export-Package: org.apache.tuscany.sca.endpoint.hazelcast;version="2.0.0";
- uses:="org.apache.tuscany.sca.runtime,org.apache.tuscany.sca.assembly,org.apache.tuscany.sca.core"
diff --git a/modules/endpoint-hazelcast/pom.xml b/modules/endpoint-hazelcast/pom.xml
deleted file mode 100644
index 372f2a1..0000000
--- a/modules/endpoint-hazelcast/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <name>Apache Tuscany SCA EndPoint Registry using Hazelcast</name>
-
- <dependencies>
- <dependency>
- <groupId>com.hazelcast</groupId>
- <artifactId>hazelcast</artifactId>
- <version>1.8.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-Beta1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-deployment</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/modules/endpoint-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory b/modules/endpoint-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
deleted file mode 100644
index 2355170..0000000
--- a/modules/endpoint-hazelcast/src/main/resources/META-INF/services/org.apache.tuscany.sca.runtime.DomainRegistryFactory
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-org.apache.tuscany.sca.endpoint.hazelcast.HazelcastDomainRegistryFactory;ranking=100
diff --git a/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java b/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
index 9c9b041..c28a303 100644
--- a/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
+++ b/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
@@ -34,9 +34,11 @@
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.junit.Assert;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
// Ignore so its not run in the build yet till its working
+@Ignore("TUSCANY-3718")
public class MultiRegTestCase implements EndpointListener {
private static ExtensionPointRegistry extensionPoints;
private static AssemblyFactory assemblyFactory;
diff --git a/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java b/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
index 173d212..99c5472 100644
--- a/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
+++ b/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
@@ -28,8 +28,10 @@
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
+@Ignore("TUSCANY-3718")
public class ReplicatedEndpointRegistryTestCase {
@Test
diff --git a/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java b/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
index 6736f9c..122729a 100644
--- a/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
+++ b/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java
@@ -64,7 +64,7 @@
bundleTracker = new ActiveBundleTracker(context);
bundleTracker.open();
}
-
+
public void stop() {
bundleTracker.close();
}
@@ -73,7 +73,7 @@
String header = (String)bundle.getHeaders().get("SCA-Version");
return Version.parseVersion(header);
}
-
+
public static class ActiveBundleTracker extends BundleTracker {
/**
@@ -95,7 +95,6 @@
}
-
public static class ServiceDeclarationImpl implements ServiceDeclaration {
private Bundle bundle;
private URL url;
@@ -162,11 +161,16 @@
try {
loadClass();
} catch (ClassNotFoundException e) {
- // Ignore
+ // Ignore
}
return (javaClass != null && serviceType.isAssignableFrom(javaClass));
}
+ @Override
+ public Enumeration<URL> getResources(final String name) throws IOException {
+ return (Enumeration<URL>) bundle.getResources(name);
+ }
+
}
/**
@@ -201,7 +205,6 @@
}
-
public ServiceDeclaration getServiceDeclaration(String name) throws IOException {
Collection<ServiceDeclaration> declarations = getServiceDeclarations(name);
if (declarations.isEmpty()) {
@@ -210,13 +213,13 @@
return declarations.iterator().next();
}
}
-
+
private boolean isProviderBundle(Bundle bundle, boolean isTuscanyService) {
if (bundle.getBundleId() == 0 || bundle.getSymbolicName().startsWith("1.x-osgi-bundle")
|| bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null) {
// Skip system bundle as it has access to the application classloader
// Skip the 1.x runtime bundle as this has 1.x services in it
- // For testing running 1.x and 2.x in same VM.
+ // For testing running 1.x and 2.x in same VM.
// Don't know what final form will be yet.
// Skip bundle fragments too
return false;
@@ -231,7 +234,7 @@
}
return true;
}
-
+
protected Collection<Bundle> getBundles(boolean isTuscanyService) {
// return bundles.keySet();
Set<Bundle> set = new HashSet<Bundle>();
@@ -257,14 +260,21 @@
// http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/XPathFactory.html
boolean isPropertyFile = "javax.xml.xpath.XPathFactory".equals(serviceName);
boolean isTuscanyService = serviceName.startsWith("org.apache.tuscany.sca.");
- serviceName = "META-INF/services/" + serviceName;
+
+ if (serviceName.startsWith("/")) {
+ // If the service name starts with /, treat it as the entry name
+ serviceName = serviceName.substring(1);
+ } else {
+ // Use JDK SPI pattern
+ serviceName = "META-INF/services/" + serviceName;
+ }
Set<URL> visited = new HashSet<URL>();
//System.out.println(">>>> getServiceDeclarations()");
for (Bundle bundle : getBundles(isTuscanyService)) {
-// if (!isProviderBundle(bundle)) {
-// continue;
-// }
+ // if (!isProviderBundle(bundle)) {
+ // continue;
+ // }
Enumeration<URL> urls = null;
try {
// Use getResources to find resources on the classpath of the bundle
@@ -278,17 +288,17 @@
if (urls == null) {
URL entry = bundle.getEntry(serviceName);
if (entry != null) {
- logger.warning("Unresolved resource " + serviceName + " found in " + toString(bundle));
+ logger.warning("Unresolved resource " + serviceName + " found in bundle: " + toString(bundle));
try {
bundle.start();
} catch (BundleException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
+ logger.log(Level.SEVERE, "Bundle: " + bundle.getSymbolicName() + " - " + e.getMessage(), e);
}
// urls = Collections.enumeration(Arrays.asList(entry));
}
}
} catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
+ logger.log(Level.SEVERE, "Bundle: " + bundle.getSymbolicName() + " - " + e.getMessage(), e);
}
if (urls == null) {
continue;
@@ -307,17 +317,18 @@
try {
for (Map<String, String> attributes : ServiceDeclarationParser.load(url, isPropertyFile)) {
String className = attributes.get("class");
- ServiceDeclarationImpl descriptor = new ServiceDeclarationImpl(bundle, url, className, attributes);
+ ServiceDeclarationImpl descriptor =
+ new ServiceDeclarationImpl(bundle, url, className, attributes);
descriptors.add(descriptor);
}
} catch (IOException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
+ logger.log(Level.SEVERE, "Bundle: " + bundle.getSymbolicName() + " - " + e.getMessage(), e);
}
}
}
return descriptors;
}
-
+
public ClassLoader getContextClassLoader() {
// Get the bundle classloader for the extensibility bundle that has DynamicImport-Package *
return getClass().getClassLoader();
diff --git a/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java b/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
index 0b0e46f..72c2542 100644
--- a/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
+++ b/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscovererTestCase.java
@@ -111,6 +111,12 @@
descriptors = discoverer.getServiceDeclarations("notthere");
Assert.assertEquals(0, descriptors.size());
}
+
+ @Test
+ public void testDiscoverResources() throws IOException {
+ Collection<ServiceDeclaration> descriptors = discoverer.getServiceDeclarations("/META-INF/services/test.TestService");
+ Assert.assertEquals(2, descriptors.size());
+ }
@Test
public void testDiscoveryFirst() throws IOException {
diff --git a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java
index f15e897..598c897 100644
--- a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java
+++ b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClassLoaderContext.java
@@ -6,24 +6,27 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.extensibility;
+import java.io.IOException;
+import java.net.URL;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Enumeration;
import java.util.List;
import org.apache.tuscany.sca.extensibility.impl.ClassLoaderDelegate;
@@ -108,10 +111,10 @@
/**
* Set the thread context classloader (TCCL) to a classloader that delegates to a collection
- * of classloaders
+ * of classloaders
* @param parent The parent classloader
* @param delegates A list of classloaders to try
- * @return The existing TCCL
+ * @return The existing TCCL
*/
public static ClassLoader setContextClassLoader(ClassLoader parent, ClassLoader... delegates) {
ClassLoaderContext context = new ClassLoaderContext(parent, delegates);
@@ -124,7 +127,9 @@
* @param serviceNames A list of service provider names
* @return The old TCCL if a new one is set, otherwise null
*/
- public static ClassLoader setContextClassLoader(ClassLoader parent, ServiceDiscovery discovery, String... serviceNames) {
+ public static ClassLoader setContextClassLoader(ClassLoader parent,
+ ServiceDiscovery discovery,
+ String... serviceNames) {
ClassLoaderContext context = new ClassLoaderContext(parent, discovery, serviceNames);
return context.setContextClassLoader();
}
@@ -135,7 +140,9 @@
* @param serviceNames A list of service provider names
* @return The old TCCL if a new one is set, otherwise null
*/
- public static ClassLoader setContextClassLoader(ClassLoader parent, ServiceDiscovery discovery, Class<?>... serviceTypes) {
+ public static ClassLoader setContextClassLoader(ClassLoader parent,
+ ServiceDiscovery discovery,
+ Class<?>... serviceTypes) {
ClassLoaderContext context = new ClassLoaderContext(parent, discovery, serviceTypes);
return context.setContextClassLoader();
}
@@ -154,7 +161,15 @@
try {
ServiceDeclaration sd = discovery.getServiceDeclaration(serviceProvider);
if (sd != null) {
- return sd.loadClass().getClassLoader();
+ try {
+ if (sd.loadClass() != null) {
+ return sd.loadClass().getClassLoader();
+ } else {
+ return new ClassLoaderImpl(sd);
+ }
+ } catch (ClassNotFoundException e) {
+ return new ClassLoaderImpl(sd);
+ }
}
} catch (Exception e) {
// Ignore
@@ -195,7 +210,7 @@
List<ClassLoader> loaders = new ArrayList<ClassLoader>();
for (Class<?> serviceType : serviceTypes) {
ClassLoader classLoader = getClassLoader(discovery, serviceType);
- if (classLoader != null && loaders.contains(classLoader)) {
+ if (classLoader != null && !loaders.contains(classLoader)) {
loaders.add(classLoader);
}
}
@@ -210,4 +225,29 @@
return classLoader;
}
+ private static class ClassLoaderImpl extends ClassLoader {
+ private final ServiceDeclaration sd;
+
+ public ClassLoaderImpl(ServiceDeclaration sd) {
+ super();
+ this.sd = sd;
+ }
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ return sd.loadClass(name);
+ }
+
+ @Override
+ protected URL findResource(String name) {
+ return sd.getResource(name);
+ }
+
+ @Override
+ protected Enumeration<URL> findResources(String name) throws IOException {
+ return sd.getResources(name);
+ }
+
+ }
+
}
diff --git a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java
index eec4ff1..d40c37e 100644
--- a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java
+++ b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java
@@ -28,6 +28,7 @@
import java.security.PrivilegedExceptionAction;
import java.util.Collection;
import java.util.Collections;
+import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -106,6 +107,11 @@
}
return (javaClass != null && serviceType.isAssignableFrom(javaClass));
}
+
+ @Override
+ public Enumeration<URL> getResources(String name) throws IOException {
+ return Collections.enumeration(ContextClassLoaderServiceDiscoverer.this.getResources(name));
+ }
}
private WeakReference<ClassLoader> classLoaderReference;
@@ -155,7 +161,16 @@
// http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/XPathFactory.html
boolean isPropertyFile = "javax.xml.xpath.XPathFactory".equals(serviceName);
- String name = "META-INF/services/" + serviceName;
+
+ String name = serviceName;
+ if (serviceName.startsWith("/")) {
+ // If the service name starts with /, treat it as the entry name
+ name = serviceName.substring(1);
+ } else {
+ // Use JDK SPI pattern
+ name = "META-INF/services/" + serviceName;
+ }
+
boolean debug = logger.isLoggable(Level.FINE);
try {
for (final URL url : getResources(name)) {
diff --git a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java
index 47a91aa..24b2c17 100644
--- a/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java
+++ b/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDeclaration.java
@@ -19,7 +19,9 @@
package org.apache.tuscany.sca.extensibility;
+import java.io.IOException;
import java.net.URL;
+import java.util.Enumeration;
import java.util.Map;
/**
@@ -67,6 +69,7 @@
String getClassName();
URL getResource(String name);
+ Enumeration<URL> getResources(String name) throws IOException;
/**
* The service descriptor might be hashed
diff --git a/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java b/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java
index c0aac21..6865ba0 100644
--- a/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java
+++ b/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscovererTestCase.java
@@ -52,6 +52,12 @@
}
@Test
+ public void testDiscoverResources() throws IOException {
+ Collection<ServiceDeclaration> descriptors = discover.getServiceDeclarations("/META-INF/services/org.apache.tuscany.sca.extensibility.test.TestInterface");
+ Assert.assertEquals(3, descriptors.size());
+ }
+
+ @Test
public void testDiscoveryFirst() throws IOException {
ServiceDeclaration descriptor =
discover.getServiceDeclaration("org.apache.tuscany.sca.core.ModuleActivatorExtensionPoint");
diff --git a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
index 3145e90..8ecb81f 100644
--- a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
+++ b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/DefaultServletHostExtensionPoint.java
@@ -27,6 +27,7 @@
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.LifeCycleListener;
@@ -173,6 +174,11 @@
public void stop() {
ServiceHelper.stop(host);
}
+
+ @Override
+ public ServletContext getServletContext() {
+ return getServletHost().getServletContext();
+ }
}
public void start() {
diff --git a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
index 1b63904..107b6b3 100644
--- a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
+++ b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ExtensibleServletHost.java
@@ -24,6 +24,7 @@
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
@@ -131,4 +132,9 @@
public String getName() {
return getDefaultServletHost().getName();
}
+
+ @Override
+ public ServletContext getServletContext() {
+ return getDefaultServletHost().getServletContext();
+ }
}
diff --git a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
index 6b38559..f70a6ed 100644
--- a/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
+++ b/modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/ServletHost.java
@@ -22,6 +22,7 @@
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
/**
* Interface implemented by host environments that allow Servlets to be
@@ -35,6 +36,8 @@
*/
public interface ServletHost {
+ ServletContext getServletContext();
+
/**
* Sets the default port for the server.
*
diff --git a/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java b/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
index ba131e0..aa53815 100644
--- a/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
+++ b/modules/host-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java
@@ -32,12 +32,13 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
@@ -80,7 +81,7 @@
private boolean sendServerVersion;
private WorkScheduler workScheduler;
-
+
// TODO - this static seems to be set by the JSORPC binding unit test
// doesn't look to be a great way of doing things
public static int portDefault = 8080;
@@ -130,12 +131,12 @@
keyStoreType = System.getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
trustStoreType = System.getProperty("javax.net.ssl.trustStoreType", KeyStore.getDefaultType());
- System.setProperty("JETTY_NO_SHUTDOWN_HOOK", "true");
+ System.setProperty("JETTY_NO_SHUTDOWN_HOOK", "true");
return null;
}
});
}
-
+
public String getName() {
return "jetty";
}
@@ -181,11 +182,14 @@
private void configureSSL(SslSocketConnector connector, SecurityContext securityContext) {
connector.setProtocol("TLS");
if (securityContext != null) {
- keyStoreType = securityContext.getSSLProperties().getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
+ keyStoreType =
+ securityContext.getSSLProperties().getProperty("javax.net.ssl.keyStoreType", KeyStore.getDefaultType());
keyStore = securityContext.getSSLProperties().getProperty("javax.net.ssl.keyStore");
keyStorePassword = securityContext.getSSLProperties().getProperty("javax.net.ssl.keyStorePassword");
- trustStoreType = securityContext.getSSLProperties().getProperty("javax.net.ssl.trustStoreType", KeyStore.getDefaultType());
+ trustStoreType =
+ securityContext.getSSLProperties().getProperty("javax.net.ssl.trustStoreType",
+ KeyStore.getDefaultType());
trustStore = securityContext.getSSLProperties().getProperty("javax.net.ssl.trustStore");
trustStorePassword = securityContext.getSSLProperties().getProperty("javax.net.ssl.trustStorePassword");
}
@@ -203,30 +207,31 @@
}
}
-
+
public String addServletMapping(String suri, Servlet servlet) throws ServletMappingException {
return addServletMapping(suri, servlet, null);
- }
+ }
- public String addServletMapping(String suri, Servlet servlet, final SecurityContext securityContext) throws ServletMappingException {
+ public String addServletMapping(String suri, Servlet servlet, final SecurityContext securityContext)
+ throws ServletMappingException {
URI uri = URI.create(suri);
// Get the URI scheme and port
String scheme = null;
- if(securityContext != null && securityContext.isSSLEnabled()) {
+ if (securityContext != null && securityContext.isSSLEnabled()) {
scheme = "https";
} else {
scheme = uri.getScheme();
if (scheme == null) {
scheme = "http";
- }
+ }
}
-
+
String host = uri.getHost();
if ("0.0.0.0".equals(host)) {
host = null;
}
-
+
int portNumber = uri.getPort();
if (portNumber == -1) {
if ("http".equals(scheme)) {
@@ -350,21 +355,21 @@
public URL getURLMapping(String suri, SecurityContext securityContext) throws ServletMappingException {
return map(suri, securityContext, true);
}
-
+
private URL map(String suri, SecurityContext securityContext, boolean resolve) throws ServletMappingException {
URI uri = URI.create(suri);
-
+
// Get the URI scheme and port
String scheme = null;
- if(securityContext != null && securityContext.isSSLEnabled()) {
+ if (securityContext != null && securityContext.isSSLEnabled()) {
scheme = "https";
} else {
scheme = uri.getScheme();
if (scheme == null) {
scheme = "http";
- }
+ }
}
-
+
int portNumber = uri.getPort();
if (portNumber == -1) {
if ("http".equals(scheme)) {
@@ -372,7 +377,7 @@
} else {
portNumber = defaultSSLPort;
}
- }
+ }
// Get the host
String host = uri.getHost();
@@ -576,7 +581,16 @@
Log.setLog(jettyLogger);
} catch (Throwable e) {
// Ignore
- }
+ }
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ if (ports.size() > 0) {
+ return ports.values().iterator().next().getServletHandler().getServletContext();
+ } else {
+ return null;
+ }
}
}
diff --git a/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java b/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
index a3199cf..e8c6bba 100644
--- a/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
+++ b/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java
@@ -27,6 +27,8 @@
import java.net.InetAddress;
import java.net.Socket;
import java.net.URL;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
@@ -70,17 +72,18 @@
private static final int HTTP_PORT = 8085;
private WorkScheduler workScheduler = new WorkScheduler() {
-
+ private ExecutorService executorService = Executors.newCachedThreadPool();
+
public <T extends Runnable> void scheduleWork(T work) {
- Thread thread = new Thread(work);
- thread.start();
+ executorService.submit(work);
}
public <T extends Runnable> void scheduleWork(T work, NotificationListener<T> listener) {
scheduleWork(work);
}
- public void destroy() {
+ public ExecutorService getExecutorService() {
+ return executorService;
}
};
@@ -120,7 +123,9 @@
String url4 = service.addServletMapping("http://0.0.0.0:8088/MyService", servlet);
Assert.assertEquals("http://" + host + ":8088/MyService", url4);
String url5 = service.addServletMapping("http://" + hostName + ":8089/MyService", servlet);
- Assert.assertEquals("http://" + hostName + ":8089/MyService", url5);
+ // Can't reliably test like this as on some hosts registering a servlet with a hostname
+ // produces a url with an IP address.
+ //Assert.assertEquals("http://" + hostName + ":8089/MyService", url5);
service.stop();
}
diff --git a/modules/host-rmi/pom.xml b/modules/host-rmi/pom.xml
index 40b5685..7676860 100644
--- a/modules/host-rmi/pom.xml
+++ b/modules/host-rmi/pom.xml
@@ -31,8 +31,10 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppContributionScanner.java b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppContributionScanner.java
new file mode 100644
index 0000000..8357836
--- /dev/null
+++ b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppContributionScanner.java
@@ -0,0 +1,83 @@
+/*
+ * 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.sca.host.webapp;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.PackageType;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+
+/**
+ *
+ */
+public class WebAppContributionScanner implements ContributionScanner {
+ private ServletContext servletContext;
+ private ContributionFactory contributionFactory;
+
+ public WebAppContributionScanner(ExtensionPointRegistry registry) {
+ super();
+ this.servletContext = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(ServletContext.class);
+ this.contributionFactory =
+ registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(ContributionFactory.class);
+ }
+
+ public String getContributionType() {
+ return PackageType.WAR;
+ }
+
+ public List<Artifact> scan(Contribution contribution) throws ContributionReadException {
+ try {
+ List<Artifact> artifacts = new ArrayList<Artifact>();
+ URL location = new URL(contribution.getLocation());
+ URL root = servletContext.getResource("/");
+ URI relative = root.toURI().relativize(location.toURI());
+ String path = relative.getPath();
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ for (Object file : servletContext.getResourcePaths(path)) {
+ Artifact artifact = contributionFactory.createArtifact();
+ String name = (String)file;
+ // Remove leading /
+ name = name.substring(1);
+ artifact.setURI(name);
+ URL artifactURL = new URL(location, name);
+ artifact.setLocation(artifactURL.toString());
+ artifacts.add(artifact);
+ }
+ return artifacts;
+ } catch (Exception e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+}
diff --git a/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
index 41ae426..47fd852 100644
--- a/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
+++ b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
@@ -31,6 +31,7 @@
import javax.servlet.ServletException;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
import org.apache.tuscany.sca.node.Node;
@@ -38,6 +39,15 @@
import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
public class WebAppHelper {
+ private static final String ROOT = "/";
+ // The prefix for the parameters in web.xml which configure the folders that contain SCA contributions
+ private static final String CONTRIBUTIONS = "contributions";
+ // The prefix for the parameters in web.xml which configure the individual SCA contributions
+ private static final String CONTRIBUTION = "contribution";
+ private static final String NODE_CONFIGURATION = "node.configuration";
+ private static final String WEB_COMPOSITE = "/WEB-INF/web.composite";
+ private static final String DOMAIN_URI = "domain.uri";
+ private static final String NODE_URI = "node.uri";
public static final String DOMAIN_NAME_ATTR = "org.apache.tuscany.sca.domain.name";
public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
private static NodeFactory factory;
@@ -49,8 +59,8 @@
return uri.toURL();
} else {
String path = location;
- if (!path.startsWith("/")) {
- path = "/" + path;
+ if (!path.startsWith(ROOT)) {
+ path = ROOT + path;
}
URL url = servletContext.getResource(path);
if (url != null && url.getProtocol().equals("jndi")) {
@@ -63,11 +73,19 @@
}
}
}
+
+ private static String[] parse(String listOfValues) {
+ if (listOfValues == null) {
+ return null;
+ }
+ return listOfValues.split("(\\s|,)+");
+ }
@SuppressWarnings("unchecked")
- private static NodeConfiguration getNodeConfiguration(ServletContext servletContext) throws IOException, URISyntaxException {
+ private static NodeConfiguration getNodeConfiguration(ServletContext servletContext) throws IOException,
+ URISyntaxException {
NodeConfiguration configuration = null;
- String nodeConfigURI = (String) servletContext.getAttribute("node.configuration");
+ String nodeConfigURI = (String)servletContext.getAttribute(NODE_CONFIGURATION);
if (nodeConfigURI != null) {
URL url = getResource(servletContext, nodeConfigURI);
configuration = factory.loadConfiguration(url.openStream(), url);
@@ -76,35 +94,52 @@
Enumeration<String> names = servletContext.getAttributeNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
- if (name.startsWith("contribution")) {
- String contrib = (String) servletContext.getAttribute(name);
- if (contrib != null) {
- File f = new File(getResource(servletContext, contrib).toURI());
- if (f.isDirectory()) {
- for (File n : f.listFiles()) {
- configuration.addContribution(n.toURI().toURL());
+ if (name.equals(CONTRIBUTION) || name.startsWith(CONTRIBUTION + ".")) {
+ // We need to have a way to select one or more folders within the webapp as the contributions
+ String listOfValues = (String)servletContext.getAttribute(name);
+ if (listOfValues != null) {
+ for (String path : parse(listOfValues)) {
+ if ("".equals(path)) {
+ continue;
}
- } else {
+ File f = new File(getResource(servletContext, path).toURI());
configuration.addContribution(f.toURI().toURL());
}
}
+ } else if (name.equals(CONTRIBUTIONS) || name.startsWith(CONTRIBUTIONS + ".")) {
+ String listOfValues = (String)servletContext.getAttribute(name);
+ if (listOfValues != null) {
+ for (String path : parse(listOfValues)) {
+ if ("".equals(path)) {
+ continue;
+ }
+ File f = new File(getResource(servletContext, path).toURI());
+ if (f.isDirectory()) {
+ for (File n : f.listFiles()) {
+ configuration.addContribution(n.toURI().toURL());
+ }
+ } else {
+ configuration.addContribution(f.toURI().toURL());
+ }
+ }
+ }
}
}
-
+
if (configuration.getContributions().isEmpty()) {
// TODO: Which path should be the default root
- configuration.addContribution(getResource(servletContext, "/"));
+ configuration.addContribution(getResource(servletContext, ROOT));
}
- URL composite = getResource(servletContext, "/WEB-INF/web.composite");
+ URL composite = getResource(servletContext, WEB_COMPOSITE);
if (composite != null) {
configuration.getContributions().get(0).addDeploymentComposite(composite);
}
- String nodeURI = (String) servletContext.getAttribute("node.uri");
+ String nodeURI = (String)servletContext.getAttribute(NODE_URI);
if (nodeURI == null) {
- nodeURI = new File(servletContext.getRealPath("/")).getName();
+ nodeURI = new File(servletContext.getRealPath(ROOT)).getName();
}
configuration.setURI(nodeURI);
- String domainURI = (String) servletContext.getAttribute("domain.uri");
+ String domainURI = (String)servletContext.getAttribute(DOMAIN_URI);
if (domainURI != null) {
configuration.setDomainURI(domainURI);
} else {
@@ -122,34 +157,39 @@
private static String getDomainName(String configURI) {
String domainName;
if (configURI.startsWith("tuscany:vm:")) {
- domainName = configURI.substring("tuscany:vm:".length());
+ domainName = configURI.substring("tuscany:vm:".length());
} else if (configURI.startsWith("tuscany:")) {
int i = configURI.indexOf('?');
if (i == -1) {
- domainName = configURI.substring("tuscany:".length());
- } else{
- domainName = configURI.substring("tuscany:".length(), i);
+ domainName = configURI.substring("tuscany:".length());
+ } else {
+ domainName = configURI.substring("tuscany:".length(), i);
}
} else {
- domainName = configURI;
+ domainName = configURI;
}
return domainName;
}
-
+
public synchronized static ServletHost init(final ServletContext servletContext) {
if (host == null) {
try {
-
+
String configValue = servletContext.getInitParameter("org.apache.tuscany.sca.config");
if (configValue != null) {
factory = NodeFactory.newInstance(configValue);
} else {
factory = NodeFactory.newInstance();
}
+
+ // Add ServletContext as a utility
ExtensionPointRegistry registry = factory.getExtensionPointRegistry();
+ UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ utilityExtensionPoint.addUtility(ServletContext.class, servletContext);
+
ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
servletHosts.setWebApp(true);
-
+
// TODO: why are the init parameters copied to the attributes?
for (Enumeration<?> e = servletContext.getInitParameterNames(); e.hasMoreElements();) {
String name = (String)e.nextElement();
@@ -200,7 +240,7 @@
private static WebAppServletHost getServletHost(NodeFactory factory) {
ExtensionPointRegistry registry = factory.getExtensionPointRegistry();
- return (WebAppServletHost) org.apache.tuscany.sca.host.http.ServletHostHelper.getServletHost(registry);
+ return (WebAppServletHost)org.apache.tuscany.sca.host.http.ServletHostHelper.getServletHost(registry);
}
private static Node createAndStartNode(final ServletContext servletContext) throws ServletException {
@@ -217,10 +257,10 @@
}
public static void stop(ServletContext servletContext) {
- Node node = (Node)servletContext.getAttribute(WebAppHelper.SCA_NODE_ATTRIBUTE);
+ Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE);
if (node != null) {
node.stop();
- servletContext.setAttribute(WebAppHelper.SCA_NODE_ATTRIBUTE, null);
+ servletContext.setAttribute(SCA_NODE_ATTRIBUTE, null);
}
}
diff --git a/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
index 0c5431a..e6f6368 100644
--- a/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
+++ b/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.host.webapp;
@@ -24,12 +24,12 @@
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
-import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
@@ -45,7 +45,7 @@
/**
* ServletHost implementation for use in a webapp environment.
- *
+ *
* @version $Rev$ $Date$
*/
public class WebAppServletHost implements ServletHost {
@@ -73,14 +73,14 @@
public int getDefaultPort() {
return defaultPortNumber;
}
-
+
public String getName() {
return "webapp";
}
-
+
public String addServletMapping(String suri, Servlet servlet) throws ServletMappingException {
return addServletMapping(suri, servlet, null);
- }
+ }
public String addServletMapping(String suri, Servlet servlet, SecurityContext securityContext) throws ServletMappingException {
URI pathURI = URI.create(suri);
@@ -94,7 +94,7 @@
// String relativeURI = suri;
if (!suri.startsWith(contextPath + "/")) {
suri = contextPath + suri;
- }
+ }
if (!servlets.values().contains(servlet)) {
// The same servlet can be registred more than once
@@ -104,12 +104,12 @@
throw new ServletMappingException(e);
}
}
-
+
// In a webapp just use the given path and ignore the host and port
// as they are fixed by the Web container
servlets.put(suri, servlet);
- URL url = getURLMapping(suri, securityContext);
+ URL url = getURLMapping(pathURI.toString(), securityContext);
logger.info("Added Servlet mapping: " + url);
return url.toString();
}
@@ -161,7 +161,8 @@
scheme = "http";
}
int portNumber = uri.getPort();
- if (portNumber == -1) {
+ if (portNumber == -1 && uri.getScheme() == null) {
+ // Only set the default port number if the scheme is not present
portNumber = defaultPortNumber;
}
@@ -169,8 +170,10 @@
String host = uri.getHost();
if (host == null) {
try {
- host = InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException e) {
+ //TUSCANY-3667 - InetAddress is not allowed in GoogleAppEngine
+ host = InetAddress.getLocalHost().getHostName();
+ } catch (Throwable t) {
+ logger.log(Level.WARNING, "Error retrieving host information : " + t.getMessage());
host = "localhost";
}
}
@@ -233,22 +236,22 @@
public void init(ServletConfig config) throws ServletException {
this.servletConfig = config;
servletContext = config.getServletContext();
-
+
for (String name : tempAttributes.keySet()) {
servletContext.setAttribute(name, tempAttributes.get(name));
}
-
+
// WebAppHelper.init(servletContext);
-
+
initContextPath(config);
// Initialize the registered Servlets
for (Servlet servlet : servlets.values()) {
servlet.init(config);
}
-
+
}
-
+
/**
* Initializes the contextPath
* The 2.5 Servlet API has a getter for this, for pre 2.5 Servlet
@@ -256,9 +259,9 @@
*/
@SuppressWarnings("unchecked")
public void initContextPath(ServletConfig config) {
-
+
String oldContextPath = contextPath;
-
+
if (Collections.list(config.getInitParameterNames()).contains("contextPath")) {
contextPath = config.getInitParameter("contextPath");
} else {
@@ -292,9 +295,9 @@
servlets.put(ns, servlets.remove(oldURI));
}
}
-
- }
-
+
+ }
+
void destroy() {
// Destroy the registered Servlets
@@ -335,4 +338,8 @@
tempAttributes.put(name, value);
}
}
+
+ public ServletContext getServletContext() {
+ return servletContext;
+ }
}
diff --git a/modules/implementation-bpel-runtime/pom.xml b/modules/implementation-bpel-runtime/pom.xml
index fafe8bf..5875002 100644
--- a/modules/implementation-bpel-runtime/pom.xml
+++ b/modules/implementation-bpel-runtime/pom.xml
@@ -30,55 +30,11 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
<version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
+ <scope>provided</scope>
+ </dependency>
<!-- ODE Jars -->
<dependency>
<groupId>org.apache.ode</groupId>
@@ -211,7 +167,7 @@
<dependency>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-transaction</artifactId>
- <version>2.0.1</version>
+ <version>2.1.4</version>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -263,7 +219,7 @@
<dependency>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-connector</artifactId>
- <version>2.0.1</version>
+ <version>2.1.4</version>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -459,6 +415,18 @@
</exclusion>
</exclusions>
</dependency>
+
+ <!-- Explicitly add slf4j so that ODE uses the latest versions -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>1.5.11</version>
+ </dependency>
</dependencies>
<build>
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java
index 209546c..f5d9860 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java
@@ -36,15 +36,18 @@
private final Injector<T>[] injectors;
private final EventInvoker<T> initInvoker;
private final EventInvoker<T> destroyInvoker;
+ private final Injector<T>[] callbackInjectors;
public ReflectiveInstanceFactory(Constructor<T> ctr,
ObjectFactory<?>[] ctrArgs,
Injector<T>[] injectors,
+ Injector<T>[] callbackInjectors,
EventInvoker<T> initInvoker,
EventInvoker<T> destroyInvoker) {
this.ctr = ctr;
this.ctrArgs = ctrArgs;
this.injectors = injectors;
+ this.callbackInjectors = callbackInjectors;
this.initInvoker = initInvoker;
this.destroyInvoker = destroyInvoker;
}
@@ -88,6 +91,6 @@
}
}
- return new ReflectiveInstanceWrapper<T>(instance, initInvoker, destroyInvoker);
+ return new ReflectiveInstanceWrapper<T>(instance, initInvoker, destroyInvoker, callbackInjectors);
}
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java
index 7c96606..a3ed16d 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java
@@ -21,6 +21,7 @@
import org.apache.tuscany.sca.core.factory.InstanceWrapper;
import org.apache.tuscany.sca.core.scope.TargetDestructionException;
import org.apache.tuscany.sca.core.scope.TargetInitializationException;
+import org.apache.tuscany.sca.implementation.java.injection.Injector;
import org.apache.tuscany.sca.implementation.java.invocation.EventInvoker;
/**
@@ -30,11 +31,13 @@
private final EventInvoker<T> initInvoker;
private final EventInvoker<T> destroyInvoker;
private final T instance;
+ private final Injector<T>[] callbackInjectors;
- public ReflectiveInstanceWrapper(T instance, EventInvoker<T> initInvoker, EventInvoker<T> destroyInvoker) {
+ public ReflectiveInstanceWrapper(T instance, EventInvoker<T> initInvoker, EventInvoker<T> destroyInvoker, Injector<T>[] callbackInjectors) {
this.instance = instance;
this.initInvoker = initInvoker;
this.destroyInvoker = destroyInvoker;
+ this.callbackInjectors = callbackInjectors;
}
public T getInstance() {
@@ -61,4 +64,9 @@
destroyInvoker.invokeEvent(instance);
}
}
+
+ public Injector<T>[] getCallbackInjectors() {
+ return this.callbackInjectors;
+ }
+
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java
index dd454be..4d97e72 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.implementation.java.injection;
import java.lang.reflect.Field;
+import java.lang.reflect.Type;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -58,10 +59,28 @@
* Inject a new value on the given instance
*/
public void inject(T instance) throws ObjectCreationException {
+ inject(instance, objectFactory.getInstance());
+ }
+
+ public void inject(T instance, Object value) {
try {
- field.set(instance, objectFactory.getInstance());
+ field.set(instance, value);
} catch (IllegalAccessException e) {
throw new ObjectCreationException("Field is not accessible [" + field + "]", e);
}
}
+
+ public Class<?> getType() {
+ return field.getType();
+ }
+
+ public Type getGenericType() {
+ return field.getGenericType();
+ }
+
+ public void injectNull(T instance) throws ObjectCreationException {
+ inject(instance, null);
+ }
+
+
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java
index 4d06285..f0208c4 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.implementation.java.injection;
+import java.lang.reflect.Type;
+
import org.apache.tuscany.sca.core.factory.ObjectCreationException;
/**
@@ -31,5 +33,8 @@
* Inject a value on the given instance
*/
void inject(T instance) throws ObjectCreationException;
+ void injectNull(T instance) throws ObjectCreationException;
+ Class<?> getType();
+ Type getGenericType();
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
index 6069846..a190b76 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
@@ -100,10 +100,34 @@
}
public <B> B createPropertyValue(ComponentProperty property, Class<B> type) {
+
+ validateTypes(property, type);
+
ObjectFactory<B> factory = this.createValueFactory(property, property.getValue(), type);
return factory.getInstance();
}
+ private <B> void validateTypes(ComponentProperty property, Class<B> type) {
+ // JAXB seems to do some strange things with conversions, so
+ // we can't rely on the databinding conversion from Node->Java to catch
+ // incompatible types.
+
+ DataType prop1 = property.getProperty().getDataType();
+
+ if ( (prop1 != null) && (type.isAssignableFrom(prop1.getPhysical())) ) {
+ return;
+ } else if ( simpleTypeMapper.getXMLType(type) != null ) {
+ if ( simpleTypeMapper.getXMLType(type).getQName().equals(property.getXSDType()))
+ return;
+ } else if ( isSimpleType(property) ) {
+ if ( type.isAssignableFrom(simpleTypeMapper.getJavaType(property.getXSDType())))
+ return;
+ }
+
+ throw new IllegalArgumentException("Property type " + prop1.getPhysical().getName() + " is not compatible with " + type.getName());
+
+ }
+
abstract class ObjectFactoryImplBase implements ObjectFactory {
protected SimpleTypeMapper simpleTypeMapper = new SimpleTypeMapperImpl();
protected Property property;
@@ -304,9 +328,12 @@
* @return
*/
private static List<Node> getValues(Document document) {
+ List<Node> propValues = new ArrayList<Node>();
+ if ( document == null )
+ return propValues;
// The root is the property element
Element rootElement = document.getDocumentElement();
- List<Node> propValues = new ArrayList<Node>();
+
NodeList nodes = rootElement.getChildNodes();
for (int count = 0; count < nodes.getLength(); ++count) {
Node node = nodes.item(count);
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java
index baf9eb9..cd43a60 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java
@@ -20,6 +20,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -51,8 +52,12 @@
}
public void inject(T instance) throws ObjectCreationException {
+ inject(instance, objectFactory.getInstance());
+ }
+
+ private void inject(T instance, Object value) {
try {
- method.invoke(instance, objectFactory.getInstance());
+ method.invoke(instance, value);
} catch (IllegalAccessException e) {
throw new ObjectCreationException("Method is not accessible [" + method + "]", e);
} catch (IllegalArgumentException e) {
@@ -61,4 +66,18 @@
throw new ObjectCreationException("Exception thrown by setter: " + method.getName(), e);
}
}
+
+ public Class<?> getType() {
+ return method.getParameterTypes()[0];
+ }
+
+ public Type getGenericType() {
+ return method.getGenericParameterTypes()[0];
+ }
+
+ public void injectNull(T instance) throws ObjectCreationException {
+ inject(instance, null);
+ }
+
+
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaAsyncImplementationInvoker.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaAsyncImplementationInvoker.java
index de810a0..97b7570 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaAsyncImplementationInvoker.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaAsyncImplementationInvoker.java
@@ -21,12 +21,12 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.concurrent.TimeUnit;
import org.apache.tuscany.sca.core.factory.InstanceWrapper;
import org.apache.tuscany.sca.core.factory.ObjectCreationException;
import org.apache.tuscany.sca.core.invocation.AsyncResponseException;
import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.invocation.Message;
@@ -41,8 +41,9 @@
*/
public class JavaAsyncImplementationInvoker extends JavaImplementationInvoker {
- public JavaAsyncImplementationInvoker(Operation operation, Method method, RuntimeComponent component) {
- super( operation, method, component);
+ public JavaAsyncImplementationInvoker(Operation operation, Method method, RuntimeComponent component,
+ InterfaceContract interfaceContract) {
+ super( operation, method, component, interfaceContract);
assert method != null : "Operation method cannot be null";
assert ((JavaOperation) operation).isAsyncServer() : "Operation must be async";
} // end constructor
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
index 49de13c..1fa5131 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
@@ -52,10 +52,13 @@
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.JavaResourceImpl;
+import org.apache.tuscany.sca.implementation.java.JavaScopeImpl;
import org.apache.tuscany.sca.implementation.java.context.InstanceFactory;
import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
@@ -76,6 +79,7 @@
private JavaInstanceFactoryProvider<?> instanceFactoryProvider;
private ProxyFactory proxyFactory;
private InstanceFactory instanceFactory;
+ private JavaScopeImpl scope;
public JavaComponentContextProvider(RuntimeComponent component,
JavaInstanceFactoryProvider configuration,
@@ -93,6 +97,7 @@
// }
this.component = component;
this.propertyValueFactory = (JavaPropertyValueObjectFactory) propertyValueObjectFactory;
+ this.scope = ((JavaImplementation)component.getImplementation()).getJavaScope();
}
InstanceWrapper<?> createInstanceWrapper() throws ObjectCreationException {
@@ -144,6 +149,16 @@
}
void start() {
+ List<JavaElementImpl> callbackInjectionList = null;
+
+ // If the component implementation is stateless, we need to inject the callbacks on service invocation
+ // rather than doing it once at the component level.
+ if ( scope.equals(JavaScopeImpl.STATELESS)) {
+ callbackInjectionList = instanceFactoryProvider.getCallbackInjectionSites();
+ } else {
+ callbackInjectionList = instanceFactoryProvider.getInjectionSites();
+ }
+
if (!instanceFactoryProvider.getImplementation().getCallbackMembers().isEmpty()) {
Map<String, List<EndpointReference>> callbackWires = new HashMap<String, List<EndpointReference>>();
for (ComponentService service : component.getServices()) {
@@ -179,7 +194,7 @@
factory = new CallbackWireObjectFactory(businessInterface, proxyFactory, wires);
}
if (!(element.getAnchor() instanceof Constructor)) {
- instanceFactoryProvider.getInjectionSites().add(element);
+ callbackInjectionList.add(element);
}
instanceFactoryProvider.setObjectFactory(element, factory);
}
@@ -288,14 +303,15 @@
//cleanUpPolicyHandlers();
}
- Invoker createInvoker(Operation operation) throws NoSuchMethodException {
+ Invoker createInvoker(Operation operation, InterfaceContract interfaceContract) throws NoSuchMethodException {
Class<?> implClass = instanceFactoryProvider.getImplementationClass();
Method method = JavaInterfaceUtil.findMethod(implClass, operation);
- if( ((JavaOperation) operation).isAsyncServer() ) {
- return new JavaAsyncImplementationInvoker(operation, method, component);
+ if (operation instanceof JavaOperation &&
+ ((JavaOperation) operation).isAsyncServer() ) {
+ return new JavaAsyncImplementationInvoker(operation, method, component, interfaceContract);
} else {
- return new JavaImplementationInvoker(operation, method, component);
+ return new JavaImplementationInvoker(operation, method, component, interfaceContract);
} // end if
} // end
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
index 4d54fbd..9eade3b 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
@@ -20,19 +20,30 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.ws.Holder;
import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.core.factory.InstanceWrapper;
import org.apache.tuscany.sca.core.factory.ObjectCreationException;
+import org.apache.tuscany.sca.core.scope.Scope;
import org.apache.tuscany.sca.core.scope.ScopeContainer;
import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.context.ReflectiveInstanceWrapper;
+import org.apache.tuscany.sca.implementation.java.injection.Injector;
+import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.ServiceRuntimeException;
/**
@@ -48,23 +59,27 @@
@SuppressWarnings("unchecked")
protected final ScopeContainer scopeContainer;
+ private final InterfaceContract interfaze;
- public JavaImplementationInvoker(Operation operation, Method method, RuntimeComponent component) {
+ public JavaImplementationInvoker(Operation operation, Method method, RuntimeComponent component, InterfaceContract intf) {
assert method != null : "Operation method cannot be null";
this.method = method;
this.operation = operation;
this.scopeContainer = ((ScopedRuntimeComponent)component).getScopeContainer();
this.allowsPBR = ((JavaImplementation)component.getImplementation()).isAllowsPassByReference(method);
+ this.interfaze = intf;
}
- public JavaImplementationInvoker(Operation operation, RuntimeComponent component) {
+ public JavaImplementationInvoker(Operation operation, RuntimeComponent component, InterfaceContract intf) {
// used if the method can't be computed statically in advance
this.operation = operation;
this.scopeContainer = ((ScopedRuntimeComponent)component).getScopeContainer();
+ this.interfaze = intf;
}
@SuppressWarnings("unchecked")
public Message invoke(Message msg) {
+
Operation op = msg.getOperation();
if (op == null) {
op = this.operation;
@@ -83,8 +98,14 @@
try {
// The following call might create a new conversation, as a result, the msg.getConversationID() might
// return a new value
- InstanceWrapper wrapper = scopeContainer.getWrapper(contextId);
-
+ ReflectiveInstanceWrapper wrapper = (ReflectiveInstanceWrapper) scopeContainer.getWrapper(contextId);
+
+ // If there is a callback interface and the implementation is stateless, we need to
+ // inject callbacks at invocation time. For Composite scope, this has already been done.
+ if (( interfaze.getCallbackInterface() != null ) && (scopeContainer.getScope().equals(Scope.STATELESS))){
+ injectCallbacks(wrapper, (JavaInterface)interfaze.getCallbackInterface());
+ }
+
Object instance = wrapper.getInstance();
// If the method couldn't be computed statically, or the instance being
@@ -106,6 +127,30 @@
Thread.currentThread().setContextClassLoader(instance.getClass().getClassLoader());
+ int argumentHolderCount = 0;
+
+ // Holder pattern. Any payload parameters <T> which are should be in holders are placed in Holder<T>.
+ // Only check Holder for remotable interfaces
+ if (imethod != null && op.getInterface().isRemotable()) {
+ List<DataType> inputTypes = op.getInputType().getLogical();
+ for (int i = 0, size = inputTypes.size(); i < size; i++) {
+ if (ParameterMode.IN != op.getParameterModes().get(i)) {
+ // Promote array params from [<T>] to [Holder<T>]
+ Object[] payloadArray = (Object[])payload;
+
+ if ( ParameterMode.INOUT == op.getParameterModes().get(i)) {
+ Object item = payloadArray[i];
+ payloadArray[i] = new Holder(item);
+ } else {
+ // Create an empty Holder since we should not pass values for OUT parameters
+ payloadArray[i] = new Holder();
+ }
+
+ argumentHolderCount++;
+ }
+ }
+ }
+
Object ret;
if (payload != null && !payload.getClass().isArray()) {
ret = imethod.invoke(instance, payload);
@@ -115,7 +160,29 @@
scopeContainer.returnWrapper(wrapper, contextId);
- msg.setBody(ret);
+
+ if (argumentHolderCount > 0) {
+ // Holder pattern. Any payload Holder<T> types are returned as the message body.
+ List<Object> returnArgs = new ArrayList<Object>();
+ returnArgs.add(ret);
+ if (imethod != null) {
+ Object[] payloadArray = (Object[])payload;
+ for (int i = 0, size = op.getParameterModes().size(); i < size; i++) {
+ // System.out.println( "JavaImplementationInvoker.invoke return parameter " + i + " type=" + parameter.getClass().getName() );
+ if (ParameterMode.IN != op.getParameterModes().get(i)) {
+ // Demote array params from Holder<T> to <T>.
+ Holder<Object> item = (Holder<Object>)payloadArray[i];
+ payloadArray[i] = item.value;
+ returnArgs.add(payloadArray[i]);
+ }
+ }
+ }
+
+ msg.setBody(returnArgs.toArray());
+
+ } else {
+ msg.setBody(ret);
+ }
} catch (InvocationTargetException e) {
Throwable cause = e.getTargetException();
boolean isChecked = false;
@@ -125,8 +192,7 @@
msg.setFaultBody(cause);
break;
}
- }
-
+ }
if (!isChecked) {
if (cause instanceof RuntimeException) {
throw (RuntimeException)cause;
@@ -149,4 +215,28 @@
return msg;
}
+ private void injectCallbacks(ReflectiveInstanceWrapper wrapper,
+ JavaInterface callbackInterface) {
+
+ for (Injector injector : wrapper.getCallbackInjectors()) {
+ if (injector != null) {
+ try {
+ if (ServiceReference.class.isAssignableFrom(injector.getType())) {
+ Class<?> intf = JavaIntrospectionHelper.getBusinessInterface(injector.getType(), injector.getGenericType());
+ if ( intf.isAssignableFrom(callbackInterface.getJavaClass())) {
+ injector.inject(wrapper.getInstance());
+ }
+ } else if (injector.getType().isAssignableFrom(callbackInterface.getJavaClass())) {
+ injector.inject(wrapper.getInstance());
+ } else {
+ injector.injectNull(wrapper.getInstance());
+ }
+ } catch (Exception e) {
+ throw new ObjectCreationException("Exception invoking injector - " + e.getMessage(), e);
+ }
+ }
+ }
+
+ }
+
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
index 3cee156..d7abd02 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java
@@ -118,7 +118,7 @@
public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
try {
- return componentContextProvider.createInvoker(operation);
+ return componentContextProvider.createInvoker(operation, service.getInterfaceContract());
} catch (NoSuchMethodException e) {
// It's possible that the instance being invoked is a user-specified
// callback object that isn't an instance of the component implementation
@@ -132,12 +132,12 @@
if (iface instanceof JavaInterface) {
try {
Method method = JavaInterfaceUtil.findMethod(((JavaInterface)iface).getJavaClass(), operation);
- return new JavaImplementationInvoker(operation, method, componentContextProvider.getComponent());
+ return new JavaImplementationInvoker(operation, method, componentContextProvider.getComponent(), service.getInterfaceContract());
} catch (NoSuchMethodException e1) {
throw new IllegalArgumentException(e1);
}
} else {
- return new JavaImplementationInvoker(operation, componentContextProvider.getComponent());
+ return new JavaImplementationInvoker(operation, componentContextProvider.getComponent(), service.getInterfaceContract());
}
}
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java
index 7fcfaad..1f1f1ee 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaInstanceFactoryProvider.java
@@ -57,6 +57,7 @@
private final EventInvoker<T> initInvoker;
private final EventInvoker<T> destroyInvoker;
private final Map<JavaElementImpl, Object> factories = new HashMap<JavaElementImpl, Object>();
+ private final List<JavaElementImpl> callbackInjectionSites;
public JavaInstanceFactoryProvider(JavaImplementation definition) {
this.definition = definition;
@@ -65,6 +66,7 @@
this.destroyInvoker = definition.getDestroyMethod() == null ? null : new MethodEventInvoker<T>(definition
.getDestroyMethod());
injectionSites = new ArrayList<JavaElementImpl>();
+ callbackInjectionSites = new ArrayList<JavaElementImpl>();
}
ProxyFactory getProxyFactory() {
@@ -85,12 +87,15 @@
@SuppressWarnings("unchecked")
public InstanceFactory<T> createFactory() {
ObjectFactory<?>[] initArgs = getConstructorArgs();
- Injector<T>[] injectors = getInjectors();
+ Injector<T>[] injectors = getInjectors(false);
+ Injector<T>[] callbackInjectors = getInjectors(true);
return new ReflectiveInstanceFactory<T>((Constructor<T>)definition.getConstructor().getConstructor(),
- initArgs, injectors, initInvoker, destroyInvoker);
+ initArgs, injectors, callbackInjectors, initInvoker, destroyInvoker);
}
- private ObjectFactory<?>[] getConstructorArgs() {
+
+
+ private ObjectFactory<?>[] getConstructorArgs() {
JavaConstructorImpl<?> constructor = definition.getConstructor();
ObjectFactory<?>[] initArgs = new ObjectFactory<?>[constructor.getParameters().length];
for (int i = 0; i < initArgs.length; i++) {
@@ -101,13 +106,21 @@
return initArgs;
}
+
+
@SuppressWarnings("unchecked")
- private Injector<T>[] getInjectors() {
+ private Injector<T>[] getInjectors(boolean callback) {
+ List<JavaElementImpl> sites = null;
+ if ( callback )
+ sites = callbackInjectionSites;
+ else
+ sites = injectionSites;
+
// work around JDK1.5 issue with allocating generic arrays
- Injector<T>[] injectors = new Injector[injectionSites.size()];
+ Injector<T>[] injectors = new Injector[sites.size()];
int i = 0;
- for (JavaElementImpl element : injectionSites) {
+ for (JavaElementImpl element : sites) {
Object obj = factories.get(element);
if (obj != null) {
if (obj instanceof ObjectFactory) {
@@ -172,6 +185,13 @@
return injectionSites;
}
+ /**
+ * @return the callbackInjectionSites
+ */
+ public List<JavaElementImpl> getCallbackInjectionSites() {
+ return callbackInjectionSites;
+ }
+
/**
* @return the factories
*/
@@ -179,4 +199,6 @@
return factories;
}
+
+
}
diff --git a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java
index 0d56a6e..dc0bb94 100644
--- a/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java
+++ b/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/ResponseDispatchImpl.java
@@ -63,6 +63,7 @@
*/
private static final long serialVersionUID = 300158355992568592L;
private static String WS_MESSAGE_ID = "WS_MESSAGE_ID";
+ private static String MESSAGE_ID = "MESSAGE_ID";
// A latch used to ensure that the sendResponse() and sendFault() operations are used at most once
// The latch is initialized with the value "false"
@@ -87,7 +88,12 @@
callbackRef = getAsyncCallbackRef( msg );
callbackAddress = msg.getFrom().getCallbackEndpoint().getURI();
- messageID = (String) msg.getHeaders().get(WS_MESSAGE_ID);
+
+ // TODO - why is WS stuff bleeding into general code?
+ messageID = (String) msg.getHeaders().get(MESSAGE_ID);
+ if (messageID == null){
+ messageID = (String) msg.getHeaders().get(WS_MESSAGE_ID);
+ }
} // end constructor
@@ -206,6 +212,7 @@
// Add in the header for the RelatesTo Message ID
msgContext.getHeaders().put(WS_MESSAGE_ID, messageID);
+ msgContext.getHeaders().put(MESSAGE_ID, messageID);
ThreadMessageContext.setMessageContext(msgContext);
} // end method setResponseHeaders
diff --git a/modules/implementation-java/META-INF/MANIFEST.MF b/modules/implementation-java/META-INF/MANIFEST.MF
index 7850a30..2d00510 100644
--- a/modules/implementation-java/META-INF/MANIFEST.MF
+++ b/modules/implementation-java/META-INF/MANIFEST.MF
@@ -24,6 +24,8 @@
org.apache.tuscany.sca.assembly.builder;version="2.0.0";resolution:=optional,
org.apache.tuscany.sca.assembly.impl;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.binding.ws;version="2.0.0",
+ org.apache.tuscany.sca.binding.ws.xml,
org.apache.tuscany.sca.contribution.processor;version="2.0.0",
org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
org.apache.tuscany.sca.core;version="2.0.0",
@@ -36,6 +38,7 @@
org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0";resolution:=optional,
org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
org.apache.tuscany.sca.monitor;version="2.0.0",
org.apache.tuscany.sca.policy;version="2.0.0",
org.apache.tuscany.sca.policy.util;version="2.0.0",
diff --git a/modules/implementation-java/pom.xml b/modules/implementation-java/pom.xml
index 46fcfb0..faa123b 100644
--- a/modules/implementation-java/pom.xml
+++ b/modules/implementation-java/pom.xml
@@ -40,6 +40,18 @@
<artifactId>tuscany-interface-java</artifactId>
<version>2.0-Beta1</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java-jaxws</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
@@ -70,9 +82,15 @@
<artifactId>tuscany-contribution</artifactId>
<version>2.0-Beta1</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-builder</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
@@ -83,7 +101,14 @@
<artifactId>tuscany-binding-sca-runtime</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency-->
</dependencies>
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java
index c8b7c07..a3b0343 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.sca.implementation.java;
+import javax.xml.namespace.QName;
+
import org.apache.tuscany.sca.assembly.Extensible;
import org.apache.tuscany.sca.assembly.Implementation;
@@ -55,5 +57,12 @@
* @param javaClass the Java implementation class
*/
void setJavaClass(Class<?> javaClass);
+
+ /**
+ * Customize the implementation type so that components are implemented using Java based framework such as
+ * implementation.spring or implementation.jaxrs can leverage the introspection
+ * @param type
+ */
+ void setType(QName type);
}
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java
index 0d9187c..7cbb4d7 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java
@@ -89,4 +89,9 @@
return false;
}
}
+
+ @Override
+ public void setType(QName type) {
+ this.type = type;
+ }
}
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
index 5a934b5..a04ad37 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.implementation.java.introspect;
@@ -39,13 +39,14 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.oasisopen.sca.ServiceReference;
/**
* Implements various reflection-related operations
- *
+ *
* @version $Rev$ $Date$
*/
public final class JavaIntrospectionHelper {
@@ -83,70 +84,95 @@
return fields;
}
fields = getAllPublicAndProtectedFields(clazz.getSuperclass(), fields, validating);
- Field[] declaredFields = clazz.getDeclaredFields();
- for (final Field field : declaredFields) {
- int modifiers = field.getModifiers();
- // The field should be non-final and non-static
- if ((Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) && !Modifier.isStatic(modifiers) && !Modifier.isFinal(modifiers)) {
- // Allow privileged access to set accessibility. Requires ReflectPermission
- // in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true); // ignore Java accessibility
- return null;
+
+ Field[] declaredFields = null;
+
+ try {
+ declaredFields = clazz.getDeclaredFields();
+ } catch(Throwable t) {
+ //TUSCANY-3667 - clazz.getDeclaredFields might fail in GAE environment (log and ignore)
+ logger.log(Level.WARNING, "Error retrieving declared fields from class : " + t.getMessage());
+ }
+
+ if( declaredFields != null ) {
+ for (final Field field : declaredFields) {
+ int modifiers = field.getModifiers();
+ // The field should be non-final and non-static
+ if ((Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) && !Modifier.isStatic(modifiers) && !Modifier.isFinal(modifiers)) {
+ // Allow privileged access to set accessibility. Requires ReflectPermission
+ // in security policy.
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ field.setAccessible(true); // ignore Java accessibility
+ return null;
+ }
+ });
+ fields.add(field);
+ } /*else {
+ if (validating) {
+ checkInvalidAnnotations(field);
}
- });
- fields.add(field);
- } /*else {
- if (validating) {
- checkInvalidAnnotations(field);
- }
- }*/
+ }*/
+ }
}
return fields;
}
-
+
/**
* Returns a collection of injectable fields declared by a class
* or one of its supertypes
- *
- * For now we will include final or static fields so that validation problems can be reported
+ *
+ * For now we will include final or static fields so that validation problems can be reported
*/
public static Set<Field> getInjectableFields(Class<?> clazz, boolean validating) {
return getInjectableFields(clazz, new HashSet<Field>(), validating);
}
-
+
/**
- * Recursively evaluates the type hierarchy to return all fields
+ * Recursively evaluates the type hierarchy to return all fields
*/
private static Set<Field> getInjectableFields(Class<?> clazz, Set<Field> fields, boolean validating) {
if (clazz == null || clazz.isArray() || Object.class.equals(clazz)) {
return fields;
}
+
fields = getInjectableFields(clazz.getSuperclass(), fields, validating);
- Field[] declaredFields = clazz.getDeclaredFields();
- for (final Field field : declaredFields) {
- int modifiers = field.getModifiers();
- // The field should be non-final and non-static
- if (!Modifier.isStatic(modifiers)
- // && !Modifier.isFinal(modifiers)
- ) {
-
- // Allow privileged access to set accessibility. Requires ReflectPermission
- // in security policy.
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- field.setAccessible(true); // ignore Java accessibility
- return null;
+
+ Field[] declaredFields = null;
+
+ try {
+ declaredFields = clazz.getDeclaredFields();
+ } catch(Throwable t) {
+ //TUSCANY-3667 - clazz.getDeclaredFields might fail in GAE environment (log and ignore)
+ logger.log(Level.WARNING, "Error retrieving declared fields from class : " + t.getMessage());
+ }
+
+ if( declaredFields != null ) {
+ for (final Field field : declaredFields) {
+ int modifiers = field.getModifiers();
+ // The field should be non-final and non-static
+ if (!Modifier.isStatic(modifiers)
+ // && !Modifier.isFinal(modifiers)
+ ) {
+
+ // Allow privileged access to set accessibility. Requires ReflectPermission
+ // in security policy.
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ field.setAccessible(true); // ignore Java accessibility
+ return null;
+ }
+ });
+ fields.add(field);
+ } else {
+ if (validating) {
+ checkInvalidAnnotations(field);
}
- });
- fields.add(field);
- } else {
- if (validating) {
- checkInvalidAnnotations(field);
}
}
}
+
+
return fields;
}
@@ -216,7 +242,7 @@
/**
* Finds the closest matching field with the given name, that is, a field of
* the exact specified type or, alternately, of a supertype.
- *
+ *
* @param name the name of the field
* @param type the field type
* @param fields the collection of fields to search
@@ -252,7 +278,7 @@
/**
* Finds the closest matching method with the given name, that is, a method
* taking the exact parameter types or, alternately, parameter supertypes.
- *
+ *
* @param name the name of the method
* @param types the method parameter types
* @param methods the collection of methods to search
@@ -325,7 +351,7 @@
/**
* Returns the simple name of a class - i.e. the class name devoid of its
* package qualifier
- *
+ *
* @param implClass the implementation class
*/
public static String getBaseName(Class<?> implClass) {
@@ -484,7 +510,7 @@
* JavaIntrospectionHelper.getGenerics(field.getGenericType());
* <p/>
* JavaIntrospectionHelper.getGenerics(m.getGenericParameterTypes()[0];); </code>
- *
+ *
* @return the generic types in order of declaration or an empty array if
* the type is not genericized
*/
@@ -603,7 +629,7 @@
methods.add(declaredMethod);
}
}
-
+
return methods;
}
@@ -616,7 +642,7 @@
fields.add(declaredField);
}
}
-
+
return fields;
}
}
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java
index 9ad7e8f..5c0e2c1 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java
@@ -47,7 +47,7 @@
EagerInit annotation = clazz.getAnnotation(EagerInit.class);
if (annotation == null) {
Class<?> superClass = clazz.getSuperclass();
- while (!Object.class.equals(superClass)) {
+ while (superClass != null && !Object.class.equals(superClass)) {
annotation = superClass.getAnnotation(EagerInit.class);
if (annotation != null) {
break;
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
index f5148fd..31cee72 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java
@@ -21,6 +21,7 @@
import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getBaseType;
import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.toPropertyName;
import java.lang.annotation.Annotation;
@@ -56,6 +57,7 @@
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.oasisopen.sca.ServiceReference;
import org.oasisopen.sca.annotation.Callback;
import org.oasisopen.sca.annotation.ComponentName;
import org.oasisopen.sca.annotation.Context;
@@ -131,6 +133,11 @@
evaluateConstructor(type, clazz);
}
+ // Check if the implementation is implementation.java
+ private boolean isImplementationJava(JavaImplementation type) {
+ return JavaImplementation.TYPE.equals(type.getType());
+ }
+
private void addService(JavaImplementation type, Class<?> clazz) throws IntrospectionException {
try {
org.apache.tuscany.sca.assembly.Service service = createService(clazz);
@@ -142,7 +149,13 @@
private static boolean isAnnotatedWithSCA(AnnotatedElement element) {
for (Annotation a : element.getAnnotations()) {
- if (isSCAAnnotation(a)) {
+ // JCI_8023
+ // policy annotations can be added to reference fields that
+ // don't have @Reference annotations so we need to allow
+ // for the fields to be detected as references
+ if (isSCAPolicyAnnotation(a)){
+ continue;
+ } else if (isSCAAnnotation(a)) {
return true;
}
}
@@ -152,6 +165,16 @@
private static boolean isSCAAnnotation(Annotation a) {
return a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.");
}
+
+ private static boolean isSCAPolicyAnnotation(Annotation a) {
+ if (a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.PolicySets") ){
+ return true;
+ } else if (a.annotationType().getName().startsWith("org.oasisopen.sca.annotation.Intent") ){
+ return true;
+ } else {
+ return false;
+ }
+ }
private <T> void calcPropRefs(Set<Method> methods,
List<org.apache.tuscany.sca.assembly.Service> services,
@@ -179,7 +202,7 @@
Class<?> param = method.getParameterTypes()[0];
Type genericType = method.getGenericParameterTypes()[0];
if (isReferenceType(param, genericType)) {
- type.getReferences().add(createReference(name, param));
+ type.getReferences().add(createReference(name, param, genericType));
type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
} else {
type.getProperties().add(createProperty(name, param, genericType));
@@ -206,7 +229,7 @@
// avoid duplicate property or ref names
if (isReferenceType(param, method.getGenericParameterTypes()[0])) {
if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, param));
+ type.getReferences().add(createReference(name, param, paramType));
type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
}
} else {
@@ -233,7 +256,7 @@
Type genericType = field.getGenericType();
if (isReferenceType(paramType, field.getGenericType())) {
if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, paramType));
+ type.getReferences().add(createReference(name, paramType, genericType));
type.getReferenceMembers().put(name, new JavaElementImpl(field));
}
} else {
@@ -269,6 +292,10 @@
explict = true;
constructor = definition.getConstructor();
} else {
+ if (!isImplementationJava(type)) {
+ // FIXME: [rfeng] Don't process the constructors for non implementation.java types
+ return;
+ }
// no definition, heuristically determine constructor
Constructor[] constructors = clazz.getConstructors();
if (constructors.length == 0) {
@@ -374,7 +401,7 @@
for (JavaParameterImpl p : parameters) {
String name = p.getType().getSimpleName().toLowerCase();
if (isReferenceType(p.getType(), p.getGenericType())) {
- type.getReferences().add(createReference(name, p.getType()));
+ type.getReferences().add(createReference(name, p.getType(), p.getGenericType()));
p.setClassifer(Reference.class);
type.getReferenceMembers().put(name, p);
} else {
@@ -472,23 +499,40 @@
return AbstractPropertyProcessor.createProperty(assemblyFactory, name, javaClass, genericType);
}
- private org.apache.tuscany.sca.assembly.Reference createReference(String name, Class<?> paramType)
+ private org.apache.tuscany.sca.assembly.Reference createReference(String name, Class<?> paramType,
+ Type genericType )
throws IntrospectionException {
org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
reference.setName(name);
JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
reference.setInterfaceContract(interfaceContract);
+ // Compute the interface type dealing with array/Collection types and with Generic types
+ Class<?> baseType = getBaseType(paramType, genericType);
+ if (ServiceReference.class.isAssignableFrom(baseType)) {
+ if (Collection.class.isAssignableFrom(paramType)) {
+ genericType = JavaIntrospectionHelper.getParameterType(genericType);
+ }
+ baseType = JavaIntrospectionHelper.getBusinessInterface(baseType, genericType);
+ } // end if
try {
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(paramType);
+ JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(baseType);
+
reference.getInterfaceContract().setInterface(callInterface);
if (callInterface.getCallbackClass() != null) {
JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
reference.getInterfaceContract().setCallbackInterface(callbackInterface);
}
- reference.setMultiplicity(Multiplicity.ZERO_ONE);
+ // Multiplicity of an implicit reference is 1..1 for a simple interface type
+ // and 1..n for an array of interface or Collection of interface type
+ // as defined in the OASIS SCA Java POJO specification, section 8.1 : TUSCANY-3636
+ if( isCollectionType( paramType ) || isArrayType( paramType )) {
+ reference.setMultiplicity(Multiplicity.ONE_N);
+ } else {
+ reference.setMultiplicity(Multiplicity.ONE_ONE);
+ } // end if
} catch (InvalidInterfaceException e1) {
throw new IntrospectionException(e1);
- }
+ } // end try
// FIXME: This part seems to have already been taken care above!!
try {
@@ -498,6 +542,26 @@
}
return reference;
}
+
+ /**
+ * Reports if a parameter type is a form of java.util.Collection
+ * @param paramType
+ * @return true if paramType is a form of java.util.Collection, false otherwise
+ */
+ private boolean isCollectionType( Class<?> paramType ) {
+ if( Collection.class.isAssignableFrom(paramType) ) return true;
+ return false;
+ }
+
+ /**
+ * Reports if a parameter type is an array
+ * @param paramType
+ * @return true if paramType is an array
+ */
+ private boolean isArrayType( Class<?> paramType ) {
+ if( paramType.isArray() ) return true;
+ return false;
+ }
private org.apache.tuscany.sca.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService();
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
new file mode 100644
index 0000000..50bb5f8
--- /dev/null
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
@@ -0,0 +1,337 @@
+/*
+ * 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.sca.implementation.java.introspect.impl;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory;
+import org.apache.tuscany.sca.binding.ws.xml.WebServiceConstants;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.implementation.java.IntrospectionException;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySubject;
+
+/**
+ * Process JAXWS annotations and updates the component type accordingly
+ *
+ */
+public class JAXWSProcessor extends BaseJavaClassVisitor {
+
+ private PolicyFactory policyFactory;
+ private WSDLFactory wsdlFactory;
+ private WebServiceBindingFactory wsBindingFactory;
+
+ public JAXWSProcessor(ExtensionPointRegistry registry) {
+ super(registry);
+ FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ this.wsdlFactory = factories.getFactory(WSDLFactory.class);
+ this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+ this.policyFactory = factories.getFactory(PolicyFactory.class);
+ this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
+ this.wsBindingFactory = factories.getFactory(WebServiceBindingFactory.class);
+ }
+
+ @Override
+ public <T> void visitClass(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
+
+ boolean hasJaxwsAnnotation = false;
+
+ // Process @ServiceMode annotation - JCA 11013
+ if ( clazz.getAnnotation(ServiceMode.class) != null ) {
+ addSOAPIntent(type);
+ hasJaxwsAnnotation = true;
+ }
+
+ // Process @WebService annotation - POJO_8029, POJO_8030
+ WebService webServiceAnnotation = clazz.getAnnotation(WebService.class);
+ org.oasisopen.sca.annotation.Service serviceAnnotation = clazz.getAnnotation(org.oasisopen.sca.annotation.Service.class);
+
+ if (webServiceAnnotation != null &&
+ serviceAnnotation == null) {
+ String serviceName = clazz.getSimpleName();
+ serviceName = getValue(webServiceAnnotation.name(), serviceName);
+
+ String serviceInterfaceClassName = webServiceAnnotation.endpointInterface();
+
+ String wsdlLocation = webServiceAnnotation.wsdlLocation();
+
+ try {
+ createService(type, clazz, serviceName, serviceInterfaceClassName, wsdlLocation, false);
+ } catch (InvalidInterfaceException e) {
+ throw new IntrospectionException(e);
+ }
+ hasJaxwsAnnotation = true;
+ }
+
+ // Process @WebServiceProvider annotation - JCA_11015, POJO_8034
+ WebServiceProvider webServiceProviderAnnotation = clazz.getAnnotation(WebServiceProvider.class);
+ if (webServiceProviderAnnotation != null) {
+ // if the implmentation already has a service set, use it's name
+ // and the new service, which uses the implementation as an interface,
+ // will be replaced
+ String serviceName = clazz.getSimpleName();
+
+ if (type.getServices().size() > 0){
+ serviceName = ((Service)type.getServices().get(0)).getName();
+ }
+
+ // the annotation may specify a service name
+ serviceName = getValue(webServiceProviderAnnotation.serviceName(), serviceName);
+
+ String wsdlLocation = webServiceProviderAnnotation.wsdlLocation();
+
+ // Make sure that there is a service with an interface
+ // based on the implementation class and have it replace
+ // any service with the same name
+ try {
+ createService(type, clazz, serviceName, null, wsdlLocation, true);
+ } catch (InvalidInterfaceException e) {
+ throw new IntrospectionException(e);
+ }
+
+ // Make sure all service references are remotable
+ for ( Service service : type.getServices() ) {
+ service.getInterfaceContract().getInterface().setRemotable(true);
+ }
+
+ hasJaxwsAnnotation = true;
+ }
+
+ // Process @WebParam and @WebResult annotations - POJO_8031, POJO_8032
+ Class<?> interfaze = clazz;
+ Method[] implMethods = interfaze.getDeclaredMethods();
+ for ( Service service : type.getServices() ) {
+ JavaInterface javaInterface = (JavaInterface)service.getInterfaceContract().getInterface();
+ interfaze = javaInterface.getJavaClass();
+
+ if (interfaze == null){
+ // this interface has come from an @WebService enpointInterface annotation
+ // so hasn't been resolved. Use the implementation class as the interface
+ interfaze = clazz;
+ }
+
+ boolean hasHeaderParam = false;
+ for (Method method : interfaze.getDeclaredMethods()){
+ // find the impl method for this service method
+ for (int i = 0; i < implMethods.length; i++){
+ Method implMethod = implMethods[i];
+ if (implMethod.getName().equals(method.getName())){
+ for (int j = 0; j < implMethod.getParameterTypes().length; j++) {
+ WebParam webParamAnnotation = getParameterAnnotation(implMethod, j, WebParam.class);
+ if (webParamAnnotation != null &&
+ webParamAnnotation.header()) {
+ hasHeaderParam = true;
+ break;
+ }
+ }
+
+ WebResult webResultAnnotation = implMethod.getAnnotation(WebResult.class);
+ if (webResultAnnotation != null &&
+ webResultAnnotation.header()){
+ hasHeaderParam = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (hasHeaderParam){
+ // Add a SOAP intent to the service
+ addSOAPIntent(service);
+ hasJaxwsAnnotation = true;
+ }
+ }
+
+ // Process @SOAPBinding annotation - POJO_8033
+ if ( clazz.getAnnotation(SOAPBinding.class) != null ) {
+ // If the implementation is annotated with @SOAPBinding,
+ // give all services a SOAP intent
+ for ( Service service : type.getServices() ) {
+ addSOAPIntent(service);
+ }
+ hasJaxwsAnnotation = true;
+ }
+
+
+ // Process @BindingType annotation - POJO_8037
+ BindingType bindingType = clazz.getAnnotation(BindingType.class);
+
+ if ( bindingType != null ) {
+ String bindingTypeValue = bindingType.value();
+ for ( Service service : type.getServices() ) {
+ addBindingTypeIntent(service, bindingTypeValue);
+ }
+ hasJaxwsAnnotation = true;
+ }
+
+ if (hasJaxwsAnnotation == true){
+ // Note that services are based on JAXWS annotations in case
+ // we need to know later. Add a ws binding and a JAXWS annotation
+ // implies a WS binding
+ for ( Service service : type.getServices() ) {
+ service.setJAXWSService(true);
+ createWSBinding(type, service);
+ }
+ }
+
+
+
+ }
+
+ private void addBindingTypeIntent(PolicySubject subject,
+ String bindingTypeValue) {
+
+ Intent soapIntent = policyFactory.createIntent();
+ if ( javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING.equals(bindingTypeValue)) {
+ soapIntent.setName(Constants.SOAP11_INTENT);
+ } else if ( javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING.equals(bindingTypeValue)) {
+ soapIntent.setName(Constants.SOAP12_INTENT);
+ } else {
+ soapIntent.setName(Constants.SOAP11_INTENT);
+ }
+
+ subject.getRequiredIntents().add(soapIntent);
+
+ }
+
+ /**
+ * Utility methods
+ */
+
+ private static String getValue(String value, String defaultValue) {
+ return "".equals(value) ? defaultValue : value;
+ }
+
+ private Service createService(JavaImplementation type, Class<?> clazz, String serviceName, String javaInterfaceName, String wsdlFileName, boolean replace) throws InvalidInterfaceException, IntrospectionException {
+ Service service = assemblyFactory.createService();
+
+ if (serviceName != null) {
+ service.setName(serviceName);
+ } else if (javaInterfaceName != null){
+ service.setName(javaInterfaceName.substring(javaInterfaceName.lastIndexOf('.')));
+ }
+
+ // create the physical Java interface contract
+ JavaInterfaceContract javaInterfaceContract = javaInterfaceFactory.createJavaInterfaceContract();;
+ service.setInterfaceContract(javaInterfaceContract);
+
+ if (javaInterfaceName != null &&
+ javaInterfaceName.length() > 0){
+ JavaInterface callInterface = javaInterfaceFactory.createJavaInterface();
+ callInterface.setName(javaInterfaceName);
+ callInterface.setRemotable(true);
+ callInterface.setUnresolved(true);
+ javaInterfaceContract.setInterface(callInterface);
+ } else {
+ // we use the bean class as the service interface
+ JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(clazz);
+ callInterface.setRemotable(true);
+ callInterface.setUnresolved(false); // this will already be false but this makes it easy to follow the logic
+ javaInterfaceContract.setInterface(callInterface);
+ }
+
+ // create the logical WSDL interface if it's specified in
+ // the @WebService annotation
+ if (wsdlFileName != null &&
+ wsdlFileName.length() > 0){
+ WSDLInterface callInterface = wsdlFactory.createWSDLInterface();
+ callInterface.setUnresolved(true);
+ callInterface.setRemotable(true);
+
+ WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
+ wsdlInterfaceContract.setInterface(callInterface);
+ wsdlInterfaceContract.setLocation(wsdlFileName);
+ javaInterfaceContract.setNormailizedWSDLContract(wsdlInterfaceContract);
+ }
+
+ // add the service model into the implementation type
+ Service serviceAlreadyPresent = null;
+ for (Service typeService : type.getServices()){
+ if (typeService.getName().equals(service.getName())){
+ serviceAlreadyPresent = typeService;
+ break;
+ }
+ }
+
+ if (replace == true){
+ type.getServices().remove(serviceAlreadyPresent);
+ type.getServices().add(service);
+ } else {
+ if (serviceAlreadyPresent == null){
+ type.getServices().add(service);
+ }
+ }
+
+ return service;
+ }
+
+ private <T extends Annotation> T getParameterAnnotation(Method method, int index, Class<T> annotationType) {
+ Annotation[] annotations = method.getParameterAnnotations()[index];
+ for (Annotation annotation : annotations) {
+ if (annotation.annotationType() == annotationType) {
+ return annotationType.cast(annotation);
+ }
+ }
+ return null;
+ }
+
+ private void addSOAPIntent(PolicySubject policySubject){
+ Intent soapIntent = policyFactory.createIntent();
+ soapIntent.setName(Constants.SOAP_INTENT);
+ policySubject.getRequiredIntents().add(soapIntent);
+ }
+
+ private void createWSBinding(JavaImplementation javaImplementation, Service service){
+ if(service.getBindings().size() == 0){
+ WebServiceBinding wsBinding = wsBindingFactory.createWebServiceBinding();
+ wsBinding.setName(service.getName());
+ ExtensionType bindingType = policyFactory.createBindingType();
+ bindingType.setType(WebServiceConstants.BINDING_WS_QNAME);
+ bindingType.setUnresolved(true);
+ ((PolicySubject)wsBinding).setExtensionType(bindingType);
+ service.getBindings().add(wsBinding);
+ }
+ }
+
+}
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
index d062fdc..70a7d48 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java
@@ -78,7 +78,7 @@
) {
Service service;
try {
- service = createService(interfaze, null);
+ service = createService(clazz, interfaze, null);
} catch (InvalidInterfaceException e) {
throw new IntrospectionException(e);
}
@@ -124,12 +124,13 @@
for (int i=0; i < interfaces.length; i++) {
try {
String name = (annotation.names().length > 0) ? annotation.names()[i] : null;
- Service service = createService(interfaces[i], name);
+ Service service = createService(clazz, interfaces[i], name);
type.getServices().add(service);
} catch (InvalidInterfaceException e) {
throw new IntrospectionException(e);
}
}
+
}
protected boolean hasMethod(Method m1, Method[] ms) {
@@ -180,21 +181,40 @@
createCallback(type, element);
}
- public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException {
+ public Service createService(Class<?> clazz, Class<?> interfaze, String name) throws InvalidInterfaceException {
Service service = assemblyFactory.createService();
JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
service.setInterfaceContract(interfaceContract);
+
+ JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
if (name == null) {
- service.setName(interfaze.getSimpleName());
+ String serviceName = interfaze.getSimpleName();
+ // If the interface has @WebService annotation then take the
+ // service name from the @name attribute if present
+ if (interfaze.isAnnotationPresent(WebService.class)){
+ if (callInterface.getQName() != null){
+ serviceName = callInterface.getQName().getLocalPart();
+ }
+ }
+
+ service.setName(serviceName);
} else {
service.setName(name);
}
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
+
+ boolean remotable = clazz.getAnnotation(Remotable.class) != null;
+ if (remotable){
+ callInterface.setRemotable(true);
+ }
service.getInterfaceContract().setInterface(callInterface);
+
if (callInterface.getCallbackClass() != null) {
JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
+ if (remotable){
+ callbackInterface.setRemotable(true);
+ }
service.getInterfaceContract().setCallbackInterface(callbackInterface);
}
return service;
diff --git a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
index efb4a37..ebf905e 100644
--- a/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
+++ b/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java
@@ -50,14 +50,24 @@
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.resolver.ClassReference;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.implementation.java.IntrospectionException;
import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
+import org.apache.tuscany.sca.interfacedef.Compatibility;
+import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
@@ -74,13 +84,18 @@
private AssemblyFactory assemblyFactory;
private PolicyFactory policyFactory;
private PolicySubjectProcessor policyProcessor;
-
+ private StAXArtifactProcessor<Object> extensionProcessor;
+ private transient InterfaceContractMapper interfaceContractMapper;
- public JavaImplementationProcessor(FactoryExtensionPoint modelFactories) {
+ public JavaImplementationProcessor(ExtensionPointRegistry registry, StAXArtifactProcessor<?> staxProcessor) {
+ FactoryExtensionPoint modelFactories = registry.getExtensionPoint(FactoryExtensionPoint.class);
this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
this.javaFactory = modelFactories.getFactory(JavaImplementationFactory.class);
this.policyProcessor = new PolicySubjectProcessor(policyFactory);
+ this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
}
/**
@@ -190,7 +205,10 @@
checkNoStaticAnnotations(monitor, javaImplementation);
+ postJAXWSProcessorResolve(resolver, javaImplementation, context);
+
javaImplementation.setUnresolved(false);
+
mergeComponentType(resolver, javaImplementation, context);
// FIXME the introspector should always create at least one service
@@ -309,6 +327,49 @@
}
}
+
+ private void postJAXWSProcessorResolve(ModelResolver resolver, JavaImplementation impl, ProcessorContext context)
+ throws ContributionResolveException, IncompatibleInterfaceContractException {
+ for(Service service : impl.getServices()){
+ JavaInterfaceContract javaInterfaceContract = (JavaInterfaceContract)service.getInterfaceContract();
+
+ JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
+ if (javaInterface.isUnresolved()){
+ extensionProcessor.resolve(javaInterfaceContract, resolver, context);
+ }
+
+ WSDLInterfaceContract wsdlInterfaceContract = (WSDLInterfaceContract)javaInterfaceContract.getNormalizedWSDLContract();
+ if(wsdlInterfaceContract != null){
+ // The user has explicitly associated a WSDL with the Java implementation
+ // using a @WebService(wsdlLocation="...") annotation
+ WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
+ if (wsdlInterface.isUnresolved()){
+ //WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlInterface.getWsdlDefinition(), context);
+ extensionProcessor.resolve(wsdlInterfaceContract, resolver, context);
+
+ // check that the Java and WSDL contracts are compatible
+ interfaceContractMapper.checkCompatibility(wsdlInterfaceContract,
+ javaInterfaceContract,
+ Compatibility.SUBSET,
+ false,
+ false);
+
+ // retrieve the resolved WSDL interface
+ wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
+
+ // copy policy from the WSDL interface to the Java interface
+ javaInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
+ javaInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
+
+ // copy policy from the WSDL interface to the component type service
+ service.getPolicySets().addAll(wsdlInterface.getPolicySets());
+ service.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
+
+ // TODO - is there anything else to be copied from the user specified WSDL?
+ }
+ }
+ }
+ }
private ComponentType getComponentType(ModelResolver resolver, JavaImplementation impl, ProcessorContext context) {
String className = impl.getJavaClass().getName();
diff --git a/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor b/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
index 676dd27..d0723f4 100644
--- a/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
+++ b/modules/implementation-java/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor
@@ -29,5 +29,6 @@
org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;ranking=1100
org.apache.tuscany.sca.implementation.java.introspect.impl.ScopeProcessor;ranking=1000
org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;ranking=900
+org.apache.tuscany.sca.implementation.java.introspect.impl.JAXWSProcessor;ranking=850
org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor;ranking=800
-org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;ranking=700
+org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;ranking=700
\ No newline at end of file
diff --git a/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java b/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
new file mode 100644
index 0000000..2e6ef50
--- /dev/null
+++ b/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessorTestCase.java
@@ -0,0 +1,127 @@
+/*
+ * 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.sca.implementation.java.introspect.impl;
+
+import static org.apache.tuscany.sca.implementation.java.introspect.impl.ModelHelper.getService;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.jws.WebService;
+
+import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
+import org.apache.tuscany.sca.implementation.java.IntrospectionException;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
+import org.apache.tuscany.sca.interfacedef.InvalidCallbackException;
+import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * @version $Rev: 826368 $ $Date: 2009-10-18 08:22:23 +0100 (Sun, 18 Oct 2009) $
+ */
+public class JAXWSProcessorTestCase {
+ private JAXWSProcessor processor;
+ private JavaImplementationFactory javaImplementationFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
+ processor = new JAXWSProcessor(registry);
+ javaImplementationFactory = new DefaultJavaImplementationFactory();
+ }
+
+ @Test
+ public void testWebServiceNoName() throws Exception {
+ JavaImplementation type = javaImplementationFactory.createJavaImplementation();
+ processor.visitClass(Foo0Impl.class, type);
+ org.apache.tuscany.sca.assembly.Service service = getService(type, "Foo0Impl");
+ assertNotNull(service);
+ }
+
+ @Test
+ public void testWebServiceName() throws Exception {
+ JavaImplementation type = javaImplementationFactory.createJavaImplementation();
+ processor.visitClass(Foo1Impl.class, type);
+ org.apache.tuscany.sca.assembly.Service service = getService(type, "Foo1");
+ assertNotNull(service);
+ }
+
+ @Test
+ public void testWebServiceEP() throws Exception {
+ JavaImplementation type = javaImplementationFactory.createJavaImplementation();
+ processor.visitClass(Foo2Impl.class, type);
+ org.apache.tuscany.sca.assembly.Service service = getService(type, "Foo2");
+ assertNotNull(service);
+ }
+
+ @Test
+ public void testWebServiceWSDL() throws Exception {
+ JavaImplementation type = javaImplementationFactory.createJavaImplementation();
+ processor.visitClass(Foo3Impl.class, type);
+ org.apache.tuscany.sca.assembly.Service service = getService(type, "Foo3");
+ assertNotNull(service);
+ }
+
+ @WebService()
+ private static class Foo0Impl{
+ public String doSomething(String aParam){
+ return null;
+ }
+ }
+
+ @WebService(name="Foo1")
+ private static class Foo1Impl{
+ public String doSomething(String aParam){
+ return null;
+ }
+ }
+
+ private interface Foo2 {
+ public String doSomething(String aParam);
+ }
+
+ @WebService(name="Foo2", endpointInterface="org.apache.tuscany.sca.implementation.java.introspect.impl.JAXWSProcessorTestCase.Foo2")
+ private static class Foo2Impl{
+ public String doSomething(String aParam){
+ return null;
+ }
+ }
+
+ @WebService(name="Foo3", wsdlLocation="foo3.wsdl")
+ private static class Foo3Impl{
+ public String doSomething(String aParam){
+ return null;
+ }
+ }
+
+
+}
diff --git a/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java b/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
index 635b491..6ea4868 100644
--- a/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
+++ b/modules/implementation-java/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java
@@ -95,7 +95,8 @@
Composite composite = (Composite)staxProcessor.read(reader, context);
assertNotNull(composite);
- compositeBuilder.build(composite, builderContext);
+ // remove dependency on builder
+ //compositeBuilder.build(composite, builderContext);
}
diff --git a/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF b/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF
index 90894d9..0e5b82e 100644
--- a/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF
+++ b/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA Implementation JAXRS Runtime
-Bundle-SymbolicName: org.apache.tuscany.sca.implementation.jaxrs.provider
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.jaxrs.runtime
Bundle-DocURL: http://www.apache.org/
Import-Package: javax.servlet,
javax.servlet.http,
@@ -22,11 +22,11 @@
org.apache.tuscany.sca.policy;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
org.apache.tuscany.sca.runtime;version="2.0.0",
- org.apache.wink.server.internal,
- org.apache.wink.server.internal.handlers,
- org.apache.wink.server.internal.registry,
- org.apache.wink.server.internal.servlet,
- org.apache.wink.server.utils,
+ org.apache.wink.server.internal;version="1.1.1.incubating",
+ org.apache.wink.server.internal.handlers;version="1.1.1.incubating",
+ org.apache.wink.server.internal.registry;version="1.1.1.incubating",
+ org.apache.wink.server.internal.servlet;version="1.1.1.incubating",
+ org.apache.wink.server.utils;version="1.1.1.incubating",
org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/modules/implementation-jaxrs-runtime/pom.xml b/modules/implementation-jaxrs-runtime/pom.xml
index 3fbb6e4..a352821 100644
--- a/modules/implementation-jaxrs-runtime/pom.xml
+++ b/modules/implementation-jaxrs-runtime/pom.xml
@@ -88,7 +88,14 @@
<groupId>org.apache.wink</groupId>
<artifactId>wink-server</artifactId>
<version>1.1.1-incubating</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
diff --git a/modules/implementation-python-runtime/LICENSE b/modules/implementation-python-runtime/LICENSE
new file mode 100644
index 0000000..2c5d23a
--- /dev/null
+++ b/modules/implementation-python-runtime/LICENSE
@@ -0,0 +1,246 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
+===============================================================================================================
+
+Apache Tuscany SCA for Java Subcomponents
+=========================================:
+
+The Tuscany SCA for Java release includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+=================================================================================================================
+
+This module includes one file under the following BSD license:
+
+Copyright (c) Django Software Foundation and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. Neither the name of Django nor the names of its contributors may be used
+ to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+=================================================================================================================
diff --git a/modules/implementation-python-runtime/META-INF/MANIFEST.MF b/modules/implementation-python-runtime/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..35e5486
--- /dev/null
+++ b/modules/implementation-python-runtime/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany Python Implementation Runtime
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Python Implementation Runtime
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.python.runtime
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Export-Package: org.apache.tuscany.sca.implementation.python.provider;version="2.0.0"
+Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.core.invocation;version="2.0.0",
+ org.apache.tuscany.sca.host.http;version="2.0.0",
+ org.apache.tuscany.sca.implementation.jaxrs;version="2.0.0",
+ org.apache.tuscany.sca.implementation.python;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.policy;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.oasisopen.sca;version="2.0.0",
+ org.oasisopen.sca.annotation;version="2.0.0"
diff --git a/modules/implementation-python-runtime/NOTICE b/modules/implementation-python-runtime/NOTICE
new file mode 100644
index 0000000..aaa8297
--- /dev/null
+++ b/modules/implementation-python-runtime/NOTICE
@@ -0,0 +1,13 @@
+${pom.name}
+Copyright (c) 2005 - 2010 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+This product also includes software under the BSD license
+(see the LICENSE file contained in this distribution), with
+the following copyright:
+
+Copyright (c) Django Software Foundation and individual contributors.
+All rights reserved.
+
diff --git a/modules/implementation-python-runtime/jython-install b/modules/implementation-python-runtime/jython-install
new file mode 100755
index 0000000..dc89bb3
--- /dev/null
+++ b/modules/implementation-python-runtime/jython-install
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# 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.
+
+# Install Jython 2.5.2b1 jar in the local Maven repository, as it's not
+# yet available in a central Maven repository
+mkdir -p target
+cd target
+wget http://sourceforge.net/projects/jython/files/jython-dev/2.5.2b1/jython_installer-2.5.2b1.jar/download
+java -jar jython_installer-2.5.2b1.jar -s -d jython -t standalone
+mvn install:install-file -DgroupId=org.python -DartifactId=jython -Dversion=2.5.2 -Dpackaging=jar -Dfile=jython/jython.jar
+
diff --git a/modules/implementation-python-runtime/pom.xml b/modules/implementation-python-runtime/pom.xml
new file mode 100644
index 0000000..928ad22
--- /dev/null
+++ b/modules/implementation-python-runtime/pom.xml
@@ -0,0 +1,89 @@
+<?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.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-implementation-python-runtime</artifactId>
+ <name>Apache Tuscany SCA Python Implementation Extension</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-python</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.python</groupId>
+ <artifactId>jython</artifactId>
+ <version>2.5.2-beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java
new file mode 100644
index 0000000..7d381ac
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java
@@ -0,0 +1,106 @@
+/*
+ * 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.sca.implementation.python.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.python.PythonEval;
+import org.apache.tuscany.sca.implementation.python.PythonImplementation;
+import org.apache.tuscany.sca.implementation.python.PythonProperty;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+import org.python.core.Py;
+import org.python.core.PyObject;
+import org.python.core.PyString;
+import org.python.core.PySystemState;
+import org.python.core.PyTuple;
+import org.python.util.PythonInterpreter;
+
+/**
+ * Implementation provider for Python component implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+class PythonImplementationProvider implements ImplementationProvider {
+ final RuntimeComponent component;
+ final PythonImplementation implementation;
+ PythonInterpreter python;
+ PyObject callable;
+ ProxyFactory pxFactory;
+
+ PythonImplementationProvider(final RuntimeComponent comp, final PythonImplementation impl, ProxyFactory pxf) {
+ component = comp;
+ implementation = impl;
+ pxFactory = pxf;
+ }
+
+ public void start() {
+ final PySystemState pss = new PySystemState();
+ pss.path.insert(0, new PyString(implementation.getLocation()));
+ pss.path.insert(0, new PyString(getClass().getProtectionDomain().getCodeSource().getLocation().getFile()));
+ python = new PythonInterpreter(null, pss);
+ python.exec("from invoker import *");
+
+ final List<PyObject> px = new ArrayList<PyObject>();
+ for(final ComponentReference r: component.getReferences()) {
+ final PythonEval pe = pxFactory.createProxy(PythonEval.class, (RuntimeEndpointReference)r.getEndpointReferences().get(0));
+ px.add(Py.java2py(new PythonEval() {
+ @Override
+ public String eval(final String args) throws Exception {
+ final String v = pe.eval(args);
+ return v;
+ }
+ }));
+ }
+ final List<PyObject> pr = new ArrayList<PyObject>();
+ for(final ComponentProperty p: component.getProperties()) {
+ final String v = String.valueOf(p.getValue());
+ pr.add(Py.java2py(new PythonProperty() {
+ @Override
+ public String eval() {
+ return v;
+ }
+ }));
+ }
+
+ PyObject mkc = python.get("mkcomponent");
+ callable = mkc.__call__(new PyString(component.getName()), new PyString(implementation.getScript()), new PyTuple(px.toArray(new PyObject[0])), new PyTuple(pr.toArray(new PyObject[0])));
+ }
+
+ public void stop() {
+ python.cleanup();
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+ public Invoker createInvoker(final RuntimeComponentService s, final Operation op) {
+ return new PythonInvoker(python, callable, op);
+ }
+}
diff --git a/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java
new file mode 100644
index 0000000..752e3fd
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java
@@ -0,0 +1,49 @@
+/*
+ * 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.sca.implementation.python.provider;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.python.PythonImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * A factory for Python implementation providers.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PythonImplementationProviderFactory implements ImplementationProviderFactory<PythonImplementation> {
+ final ProxyFactory pxFactory;
+
+ public PythonImplementationProviderFactory(final ExtensionPointRegistry ep) {
+ pxFactory = ExtensibleProxyFactory.getInstance(ep);
+ }
+
+ public ImplementationProvider createImplementationProvider(final RuntimeComponent comp, final PythonImplementation impl) {
+ return new PythonImplementationProvider(comp, impl, pxFactory);
+ }
+
+ public Class<PythonImplementation> getModelType() {
+ return PythonImplementation.class;
+ }
+}
diff --git a/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java
new file mode 100644
index 0000000..a49e5e3
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java
@@ -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.sca.implementation.python.provider;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.python.core.PyObject;
+import org.python.core.PyString;
+import org.python.util.PythonInterpreter;
+
+/**
+ * An invoker for Python components.
+ *
+ * @version $Rev$ $Date$
+ */
+class PythonInvoker implements Invoker {
+ final PythonInterpreter python;
+ final PyObject callable;
+ final Operation operation;
+
+ PythonInvoker(final PythonInterpreter py, final PyObject c, final Operation op) {
+ python = py;
+ callable = c;
+ operation = op;
+ }
+
+ String apply(final String req) {
+ PyObject r = callable.__call__(new PyString(req));
+ return r.toString();
+ }
+
+ public Message invoke(final Message msg) {
+ try {
+ msg.setBody(apply((String)((Object[])msg.getBody())[0]));
+ } catch(Exception e) {
+ e.printStackTrace();
+ msg.setFaultBody(e.getCause());
+ }
+ return msg;
+ }
+}
diff --git a/modules/implementation-python-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/modules/implementation-python-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
new file mode 100644
index 0000000..3c1e6c4
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation provider for Python components
+org.apache.tuscany.sca.implementation.python.provider.PythonImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.python.PythonImplementation
+
diff --git a/modules/implementation-python-runtime/src/main/resources/atomutil.py b/modules/implementation-python-runtime/src/main/resources/atomutil.py
new file mode 100644
index 0000000..6c0a7c9
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/atomutil.py
@@ -0,0 +1,120 @@
+# 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.
+
+# ATOM data conversion functions
+
+from util import *
+from elemutil import *
+from xmlutil import *
+
+# Convert a list of elements to a list of values representing an ATOM entry
+def entryElementsToValues(e):
+ lt = filter(selector((element, "'title")), e)
+ t = "" if isNil(lt) else elementValue(car(lt))
+ li = filter(selector((element, "'id")), e)
+ i = "" if isNil(li) else elementValue(car(li))
+ lc = filter(selector((element, "'content")), e)
+ return (t, i, elementValue(car(lc)))
+
+# Convert a list of elements to a list of values representing ATOM entries
+def entriesElementsToValues(e):
+ if isNil(e):
+ return e
+ return cons(entryElementsToValues(car(e)), entriesElementsToValues(cdr(e)))
+
+# Convert a list of strings to a list of values representing an ATOM entry
+def readATOMEntry(l):
+ e = readXML(l)
+ if isNil(e):
+ return ()
+ return entryElementsToValues(car(e))
+
+# Convert a list of values representy an ATOM entry to a value
+def entryValue(e):
+ v = elementsToValues((caddr(e),))
+ return cons(car(e), (cadr(e), cdr(car(v))))
+
+# Return true if a list of strings represents an ATOM feed
+def isATOMFeed(l):
+ if isNil(l):
+ return False
+ if car(l)[0:5] != "<?xml":
+ return False
+ return contains(car(l), "<feed")
+
+# Convert a list of strings to a list of values representing an ATOM feed
+def readATOMFeed(l):
+ f = readXML(l)
+ if isNil(f):
+ return ()
+ t = filter(selector((element, "'title")), car(f))
+ i = filter(selector((element, "'id")), car(f))
+ e = filter(selector((element, "'entry")), car(f))
+ if isNil(e):
+ return (elementValue(car(t)), elementValue(car(i)))
+ return cons(elementValue(car(t)), cons(elementValue(car(i)), entriesElementsToValues(e)))
+
+# Convert an ATOM feed containing elements to an ATOM feed containing values
+def feedValuesLoop(e):
+ if (isNil(e)):
+ return e
+ return cons(entryValue(car(e)), feedValuesLoop(cdr(e)))
+
+def feedValues(e):
+ return cons(car(e), cons(cadr(e), feedValuesLoop(cddr(e))))
+
+# Convert a list of values representy an ATOM entry to a list of elements
+def entryElement(l):
+ return (element, "'entry", (attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
+ (element, "'title", (attribute, "'type", "text"), car(l)),
+ (element, "'id", cadr(l)),
+ (element, "'content", (attribute, "'type", ("application/xml" if isList(caddr(l)) else "text")), caddr(l)),
+ (element, "'link", (attribute, "'href", cadr(l))))
+
+# Convert a list of values representing ATOM entries to a list of elements
+def entriesElements(l):
+ if isNil(l):
+ return l
+ return cons(entryElement(car(l)), entriesElements(cdr(l)))
+
+# Convert a list of values representing an ATOM entry to an ATOM entry
+def writeATOMEntry(l):
+ return writeXML((entryElement(l),), True)
+
+# Convert a list of values representing an ATOM feed to an ATOM feed
+def writeATOMFeed(l):
+ f = (element, "'feed", (attribute, "'xmlns", "http://www.w3.org/2005/Atom"),
+ (element, "'title", (attribute, "'type", "text"), car(l)),
+ (element, "'id", cadr(l)))
+ if isNil(cddr(l)):
+ return writeXML((f,), True)
+ fe = append(f, entriesElements(cddr(l)))
+ return writeXML((fe,), True)
+
+# Convert an ATOM entry containing a value to an ATOM entry containing an item element
+def entryValuesToElements(v):
+ return cons(car(v), cons(cadr(v), valuesToElements((cons("'item", caddr(v)),))))
+
+# Convert an ATOM feed containing values to an ATOM feed containing elements
+def feedValuesToElementsLoop(v):
+ if isNil(v):
+ return v
+ return cons(entryValuesToElements(car(v)), feedValuesToElementsLoop(cdr(v)))
+
+def feedValuesToElements(v):
+ return cons(car(v), cons(cadr(v), feedValuesToElementsLoop(cddr(v))))
+
diff --git a/modules/implementation-python-runtime/src/main/resources/django/__init__.py b/modules/implementation-python-runtime/src/main/resources/django/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/__init__.py
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/__init__.py b/modules/implementation-python-runtime/src/main/resources/django/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/__init__.py
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/__init__.py b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/__init__.py
new file mode 100644
index 0000000..15b7173
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/__init__.py
@@ -0,0 +1,252 @@
+r"""
+A simple, fast, extensible JSON encoder and decoder
+
+JSON (JavaScript Object Notation) <http://json.org> is a subset of
+JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
+interchange format.
+
+simplejson exposes an API familiar to uses of the standard library
+marshal and pickle modules.
+
+Encoding basic Python object hierarchies::
+
+ >>> import simplejson
+ >>> simplejson.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
+ '["foo", {"bar": ["baz", null, 1.0, 2]}]'
+ >>> print simplejson.dumps("\"foo\bar")
+ "\"foo\bar"
+ >>> print simplejson.dumps(u'\u1234')
+ "\u1234"
+ >>> print simplejson.dumps('\\')
+ "\\"
+ >>> print simplejson.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)
+ {"a": 0, "b": 0, "c": 0}
+ >>> from StringIO import StringIO
+ >>> io = StringIO()
+ >>> simplejson.dump(['streaming API'], io)
+ >>> io.getvalue()
+ '["streaming API"]'
+
+Compact encoding::
+
+ >>> import simplejson
+ >>> simplejson.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':'))
+ '[1,2,3,{"4":5,"6":7}]'
+
+Pretty printing::
+
+ >>> import simplejson
+ >>> print simplejson.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)
+ {
+ "4": 5,
+ "6": 7
+ }
+
+Decoding JSON::
+
+ >>> import simplejson
+ >>> simplejson.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
+ [u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
+ >>> simplejson.loads('"\\"foo\\bar"')
+ u'"foo\x08ar'
+ >>> from StringIO import StringIO
+ >>> io = StringIO('["streaming API"]')
+ >>> simplejson.load(io)
+ [u'streaming API']
+
+Specializing JSON object decoding::
+
+ >>> import simplejson
+ >>> def as_complex(dct):
+ ... if '__complex__' in dct:
+ ... return complex(dct['real'], dct['imag'])
+ ... return dct
+ ...
+ >>> simplejson.loads('{"__complex__": true, "real": 1, "imag": 2}',
+ ... object_hook=as_complex)
+ (1+2j)
+
+Extending JSONEncoder::
+
+ >>> import simplejson
+ >>> class ComplexEncoder(simplejson.JSONEncoder):
+ ... def default(self, obj):
+ ... if isinstance(obj, complex):
+ ... return [obj.real, obj.imag]
+ ... return simplejson.JSONEncoder.default(self, obj)
+ ...
+ >>> dumps(2 + 1j, cls=ComplexEncoder)
+ '[2.0, 1.0]'
+ >>> ComplexEncoder().encode(2 + 1j)
+ '[2.0, 1.0]'
+ >>> list(ComplexEncoder().iterencode(2 + 1j))
+ ['[', '2.0', ', ', '1.0', ']']
+
+
+Note that the JSON produced by this module's default settings
+is a subset of YAML, so it may be used as a serializer for that as well.
+"""
+__version__ = '1.5'
+__all__ = [
+ 'dump', 'dumps', 'load', 'loads',
+ 'JSONDecoder', 'JSONEncoder',
+]
+
+from django.utils.simplejson.decoder import JSONDecoder
+from django.utils.simplejson.encoder import JSONEncoder
+
+def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True,
+ allow_nan=True, cls=None, indent=None, **kw):
+ """
+ Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
+ ``.write()``-supporting file-like object).
+
+ If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types
+ (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
+ will be skipped instead of raising a ``TypeError``.
+
+ If ``ensure_ascii`` is ``False``, then the some chunks written to ``fp``
+ may be ``unicode`` instances, subject to normal Python ``str`` to
+ ``unicode`` coercion rules. Unless ``fp.write()`` explicitly
+ understands ``unicode`` (as in ``codecs.getwriter()``) this is likely
+ to cause an error.
+
+ If ``check_circular`` is ``False``, then the circular reference check
+ for container types will be skipped and a circular reference will
+ result in an ``OverflowError`` (or worse).
+
+ If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to
+ serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
+ in strict compliance of the JSON specification, instead of using the
+ JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).
+
+ If ``indent`` is a non-negative integer, then JSON array elements and object
+ members will be pretty-printed with that indent level. An indent level
+ of 0 will only insert newlines. ``None`` is the most compact representation.
+
+ To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
+ ``.default()`` method to serialize additional types), specify it with
+ the ``cls`` kwarg.
+ """
+ if cls is None:
+ cls = JSONEncoder
+ iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
+ check_circular=check_circular, allow_nan=allow_nan, indent=indent,
+ **kw).iterencode(obj)
+ # could accelerate with writelines in some versions of Python, at
+ # a debuggability cost
+ for chunk in iterable:
+ fp.write(chunk)
+
+def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
+ allow_nan=True, cls=None, indent=None, separators=None, **kw):
+ """
+ Serialize ``obj`` to a JSON formatted ``str``.
+
+ If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types
+ (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
+ will be skipped instead of raising a ``TypeError``.
+
+ If ``ensure_ascii`` is ``False``, then the return value will be a
+ ``unicode`` instance subject to normal Python ``str`` to ``unicode``
+ coercion rules instead of being escaped to an ASCII ``str``.
+
+ If ``check_circular`` is ``False``, then the circular reference check
+ for container types will be skipped and a circular reference will
+ result in an ``OverflowError`` (or worse).
+
+ If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to
+ serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
+ strict compliance of the JSON specification, instead of using the
+ JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).
+
+ If ``indent`` is a non-negative integer, then JSON array elements and
+ object members will be pretty-printed with that indent level. An indent
+ level of 0 will only insert newlines. ``None`` is the most compact
+ representation.
+
+ If ``separators`` is an ``(item_separator, dict_separator)`` tuple
+ then it will be used instead of the default ``(', ', ': ')`` separators.
+ ``(',', ':')`` is the most compact JSON representation.
+
+ To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
+ ``.default()`` method to serialize additional types), specify it with
+ the ``cls`` kwarg.
+ """
+ if cls is None:
+ cls = JSONEncoder
+ return cls(
+ skipkeys=skipkeys, ensure_ascii=ensure_ascii,
+ check_circular=check_circular, allow_nan=allow_nan, indent=indent,
+ separators=separators,
+ **kw).encode(obj)
+
+def load(fp, encoding=None, cls=None, object_hook=None, **kw):
+ """
+ Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
+ a JSON document) to a Python object.
+
+ If the contents of ``fp`` is encoded with an ASCII based encoding other
+ than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must
+ be specified. Encodings that are not ASCII based (such as UCS-2) are
+ not allowed, and should be wrapped with
+ ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode``
+ object and passed to ``loads()``
+
+ ``object_hook`` is an optional function that will be called with the
+ result of any object literal decode (a ``dict``). The return value of
+ ``object_hook`` will be used instead of the ``dict``. This feature
+ can be used to implement custom decoders (e.g. JSON-RPC class hinting).
+
+ To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
+ kwarg.
+ """
+ if cls is None:
+ cls = JSONDecoder
+ if object_hook is not None:
+ kw['object_hook'] = object_hook
+ return cls(encoding=encoding, **kw).decode(fp.read())
+
+def loads(s, encoding=None, cls=None, object_hook=None, **kw):
+ """
+ Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON
+ document) to a Python object.
+
+ If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding
+ other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name
+ must be specified. Encodings that are not ASCII based (such as UCS-2)
+ are not allowed and should be decoded to ``unicode`` first.
+
+ ``object_hook`` is an optional function that will be called with the
+ result of any object literal decode (a ``dict``). The return value of
+ ``object_hook`` will be used instead of the ``dict``. This feature
+ can be used to implement custom decoders (e.g. JSON-RPC class hinting).
+
+ To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
+ kwarg.
+ """
+ if cls is None:
+ cls = JSONDecoder
+ if object_hook is not None:
+ kw['object_hook'] = object_hook
+ return cls(encoding=encoding, **kw).decode(s)
+
+def read(s):
+ """
+ json-py API compatibility hook. Use loads(s) instead.
+ """
+ import warnings
+ warnings.warn("simplejson.loads(s) should be used instead of read(s)",
+ DeprecationWarning)
+ return loads(s)
+
+def write(obj):
+ """
+ json-py API compatibility hook. Use dumps(s) instead.
+ """
+ import warnings
+ warnings.warn("simplejson.dumps(s) should be used instead of write(s)",
+ DeprecationWarning)
+ return dumps(obj)
+
+
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/decoder.py b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/decoder.py
new file mode 100644
index 0000000..66f68a2
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/decoder.py
@@ -0,0 +1,273 @@
+"""
+Implementation of JSONDecoder
+"""
+import re
+
+from django.utils.simplejson.scanner import Scanner, pattern
+
+FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
+
+def _floatconstants():
+ import struct
+ import sys
+ _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
+ if sys.byteorder != 'big':
+ _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1]
+ nan, inf = struct.unpack('dd', _BYTES)
+ return nan, inf, -inf
+
+NaN, PosInf, NegInf = _floatconstants()
+
+def linecol(doc, pos):
+ lineno = doc.count('\n', 0, pos) + 1
+ if lineno == 1:
+ colno = pos
+ else:
+ colno = pos - doc.rindex('\n', 0, pos)
+ return lineno, colno
+
+def errmsg(msg, doc, pos, end=None):
+ lineno, colno = linecol(doc, pos)
+ if end is None:
+ return '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos)
+ endlineno, endcolno = linecol(doc, end)
+ return '%s: line %d column %d - line %d column %d (char %d - %d)' % (
+ msg, lineno, colno, endlineno, endcolno, pos, end)
+
+_CONSTANTS = {
+ '-Infinity': NegInf,
+ 'Infinity': PosInf,
+ 'NaN': NaN,
+ 'true': True,
+ 'false': False,
+ 'null': None,
+}
+
+def JSONConstant(match, context, c=_CONSTANTS):
+ return c[match.group(0)], None
+pattern('(-?Infinity|NaN|true|false|null)')(JSONConstant)
+
+def JSONNumber(match, context):
+ match = JSONNumber.regex.match(match.string, *match.span())
+ integer, frac, exp = match.groups()
+ if frac or exp:
+ res = float(integer + (frac or '') + (exp or ''))
+ else:
+ res = int(integer)
+ return res, None
+pattern(r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?')(JSONNumber)
+
+STRINGCHUNK = re.compile(r'(.*?)(["\\])', FLAGS)
+BACKSLASH = {
+ '"': u'"', '\\': u'\\', '/': u'/',
+ 'b': u'\b', 'f': u'\f', 'n': u'\n', 'r': u'\r', 't': u'\t',
+}
+
+DEFAULT_ENCODING = "utf-8"
+
+def scanstring(s, end, encoding=None, _b=BACKSLASH, _m=STRINGCHUNK.match):
+ if encoding is None:
+ encoding = DEFAULT_ENCODING
+ chunks = []
+ _append = chunks.append
+ begin = end - 1
+ while 1:
+ chunk = _m(s, end)
+ if chunk is None:
+ raise ValueError(
+ errmsg("Unterminated string starting at", s, begin))
+ end = chunk.end()
+ content, terminator = chunk.groups()
+ if content:
+ if not isinstance(content, unicode):
+ content = unicode(content, encoding)
+ _append(content)
+ if terminator == '"':
+ break
+ try:
+ esc = s[end]
+ except IndexError:
+ raise ValueError(
+ errmsg("Unterminated string starting at", s, begin))
+ if esc != 'u':
+ try:
+ m = _b[esc]
+ except KeyError:
+ raise ValueError(
+ errmsg("Invalid \\escape: %r" % (esc,), s, end))
+ end += 1
+ else:
+ esc = s[end + 1:end + 5]
+ try:
+ m = unichr(int(esc, 16))
+ if len(esc) != 4 or not esc.isalnum():
+ raise ValueError
+ except ValueError:
+ raise ValueError(errmsg("Invalid \\uXXXX escape", s, end))
+ end += 5
+ _append(m)
+ return u''.join(chunks), end
+
+def JSONString(match, context):
+ encoding = getattr(context, 'encoding', None)
+ return scanstring(match.string, match.end(), encoding)
+pattern(r'"')(JSONString)
+
+WHITESPACE = re.compile(r'\s*', FLAGS)
+
+def JSONObject(match, context, _w=WHITESPACE.match):
+ pairs = {}
+ s = match.string
+ end = _w(s, match.end()).end()
+ nextchar = s[end:end + 1]
+ # trivial empty object
+ if nextchar == '}':
+ return pairs, end + 1
+ if nextchar != '"':
+ raise ValueError(errmsg("Expecting property name", s, end))
+ end += 1
+ encoding = getattr(context, 'encoding', None)
+ iterscan = JSONScanner.iterscan
+ while True:
+ key, end = scanstring(s, end, encoding)
+ end = _w(s, end).end()
+ if s[end:end + 1] != ':':
+ raise ValueError(errmsg("Expecting : delimiter", s, end))
+ end = _w(s, end + 1).end()
+ try:
+ value, end = iterscan(s, idx=end, context=context).next()
+ except StopIteration:
+ raise ValueError(errmsg("Expecting object", s, end))
+ pairs[key] = value
+ end = _w(s, end).end()
+ nextchar = s[end:end + 1]
+ end += 1
+ if nextchar == '}':
+ break
+ if nextchar != ',':
+ raise ValueError(errmsg("Expecting , delimiter", s, end - 1))
+ end = _w(s, end).end()
+ nextchar = s[end:end + 1]
+ end += 1
+ if nextchar != '"':
+ raise ValueError(errmsg("Expecting property name", s, end - 1))
+ object_hook = getattr(context, 'object_hook', None)
+ if object_hook is not None:
+ pairs = object_hook(pairs)
+ return pairs, end
+pattern(r'{')(JSONObject)
+
+def JSONArray(match, context, _w=WHITESPACE.match):
+ values = []
+ s = match.string
+ end = _w(s, match.end()).end()
+ # look-ahead for trivial empty array
+ nextchar = s[end:end + 1]
+ if nextchar == ']':
+ return values, end + 1
+ iterscan = JSONScanner.iterscan
+ while True:
+ try:
+ value, end = iterscan(s, idx=end, context=context).next()
+ except StopIteration:
+ raise ValueError(errmsg("Expecting object", s, end))
+ values.append(value)
+ end = _w(s, end).end()
+ nextchar = s[end:end + 1]
+ end += 1
+ if nextchar == ']':
+ break
+ if nextchar != ',':
+ raise ValueError(errmsg("Expecting , delimiter", s, end))
+ end = _w(s, end).end()
+ return values, end
+pattern(r'\[')(JSONArray)
+
+ANYTHING = [
+ JSONObject,
+ JSONArray,
+ JSONString,
+ JSONConstant,
+ JSONNumber,
+]
+
+JSONScanner = Scanner(ANYTHING)
+
+class JSONDecoder(object):
+ """
+ Simple JSON <http://json.org> decoder
+
+ Performs the following translations in decoding:
+
+ +---------------+-------------------+
+ | JSON | Python |
+ +===============+===================+
+ | object | dict |
+ +---------------+-------------------+
+ | array | list |
+ +---------------+-------------------+
+ | string | unicode |
+ +---------------+-------------------+
+ | number (int) | int, long |
+ +---------------+-------------------+
+ | number (real) | float |
+ +---------------+-------------------+
+ | true | True |
+ +---------------+-------------------+
+ | false | False |
+ +---------------+-------------------+
+ | null | None |
+ +---------------+-------------------+
+
+ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
+ their corresponding ``float`` values, which is outside the JSON spec.
+ """
+
+ _scanner = Scanner(ANYTHING)
+ __all__ = ['__init__', 'decode', 'raw_decode']
+
+ def __init__(self, encoding=None, object_hook=None):
+ """
+ ``encoding`` determines the encoding used to interpret any ``str``
+ objects decoded by this instance (utf-8 by default). It has no
+ effect when decoding ``unicode`` objects.
+
+ Note that currently only encodings that are a superset of ASCII work,
+ strings of other encodings should be passed in as ``unicode``.
+
+ ``object_hook``, if specified, will be called with the result
+ of every JSON object decoded and its return value will be used in
+ place of the given ``dict``. This can be used to provide custom
+ deserializations (e.g. to support JSON-RPC class hinting).
+ """
+ self.encoding = encoding
+ self.object_hook = object_hook
+
+ def decode(self, s, _w=WHITESPACE.match):
+ """
+ Return the Python representation of ``s`` (a ``str`` or ``unicode``
+ instance containing a JSON document)
+ """
+ obj, end = self.raw_decode(s, idx=_w(s, 0).end())
+ end = _w(s, end).end()
+ if end != len(s):
+ raise ValueError(errmsg("Extra data", s, end, len(s)))
+ return obj
+
+ def raw_decode(self, s, **kw):
+ """
+ Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning
+ with a JSON document) and return a 2-tuple of the Python
+ representation and the index in ``s`` where the document ended.
+
+ This can be used to decode a JSON document from a string that may
+ have extraneous data at the end.
+ """
+ kw.setdefault('context', self)
+ try:
+ obj, end = self._scanner.iterscan(s, **kw).next()
+ except StopIteration:
+ raise ValueError("No JSON object could be decoded")
+ return obj, end
+
+__all__ = ['JSONDecoder']
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/encoder.py b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/encoder.py
new file mode 100644
index 0000000..c83c687
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/encoder.py
@@ -0,0 +1,331 @@
+"""
+Implementation of JSONEncoder
+"""
+import re
+
+ESCAPE = re.compile(r'[\x00-\x19\\"\b\f\n\r\t]')
+ESCAPE_ASCII = re.compile(r'([\\"/]|[^\ -~])')
+ESCAPE_DCT = {
+ # escape all forward slashes to prevent </script> attack
+ '/': '\\/',
+ '\\': '\\\\',
+ '"': '\\"',
+ '\b': '\\b',
+ '\f': '\\f',
+ '\n': '\\n',
+ '\r': '\\r',
+ '\t': '\\t',
+}
+for i in range(0x20):
+ ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
+
+# assume this produces an infinity on all machines (probably not guaranteed)
+INFINITY = float('1e66666')
+
+def floatstr(o, allow_nan=True):
+ # Check for specials. Note that this type of test is processor- and/or
+ # platform-specific, so do tests which don't depend on the internals.
+
+ if o != o:
+ text = 'NaN'
+ elif o == INFINITY:
+ text = 'Infinity'
+ elif o == -INFINITY:
+ text = '-Infinity'
+ else:
+ return str(o)
+
+ if not allow_nan:
+ raise ValueError("Out of range float values are not JSON compliant: %r"
+ % (o,))
+
+ return text
+
+
+def encode_basestring(s):
+ """
+ Return a JSON representation of a Python string
+ """
+ def replace(match):
+ return ESCAPE_DCT[match.group(0)]
+ return '"' + ESCAPE.sub(replace, s) + '"'
+
+def encode_basestring_ascii(s):
+ def replace(match):
+ s = match.group(0)
+ try:
+ return ESCAPE_DCT[s]
+ except KeyError:
+ return '\\u%04x' % (ord(s),)
+ return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"'
+
+
+class JSONEncoder(object):
+ """
+ Extensible JSON <http://json.org> encoder for Python data structures.
+
+ Supports the following objects and types by default:
+
+ +-------------------+---------------+
+ | Python | JSON |
+ +===================+===============+
+ | dict | object |
+ +-------------------+---------------+
+ | list, tuple | array |
+ +-------------------+---------------+
+ | str, unicode | string |
+ +-------------------+---------------+
+ | int, long, float | number |
+ +-------------------+---------------+
+ | True | true |
+ +-------------------+---------------+
+ | False | false |
+ +-------------------+---------------+
+ | None | null |
+ +-------------------+---------------+
+
+ To extend this to recognize other objects, subclass and implement a
+ ``.default()`` method with another method that returns a serializable
+ object for ``o`` if possible, otherwise it should call the superclass
+ implementation (to raise ``TypeError``).
+ """
+ __all__ = ['__init__', 'default', 'encode', 'iterencode']
+ item_separator = ', '
+ key_separator = ': '
+ def __init__(self, skipkeys=False, ensure_ascii=True,
+ check_circular=True, allow_nan=True, sort_keys=False,
+ indent=None, separators=None):
+ """
+ Constructor for JSONEncoder, with sensible defaults.
+
+ If skipkeys is False, then it is a TypeError to attempt
+ encoding of keys that are not str, int, long, float or None. If
+ skipkeys is True, such items are simply skipped.
+
+ If ensure_ascii is True, the output is guaranteed to be str
+ objects with all incoming unicode characters escaped. If
+ ensure_ascii is false, the output will be unicode object.
+
+ If check_circular is True, then lists, dicts, and custom encoded
+ objects will be checked for circular references during encoding to
+ prevent an infinite recursion (which would cause an OverflowError).
+ Otherwise, no such check takes place.
+
+ If allow_nan is True, then NaN, Infinity, and -Infinity will be
+ encoded as such. This behavior is not JSON specification compliant,
+ but is consistent with most JavaScript based encoders and decoders.
+ Otherwise, it will be a ValueError to encode such floats.
+
+ If sort_keys is True, then the output of dictionaries will be
+ sorted by key; this is useful for regression tests to ensure
+ that JSON serializations can be compared on a day-to-day basis.
+
+ If indent is a non-negative integer, then JSON array
+ elements and object members will be pretty-printed with that
+ indent level. An indent level of 0 will only insert newlines.
+ None is the most compact representation.
+
+ If specified, separators should be a (item_separator, key_separator)
+ tuple. The default is (', ', ': '). To get the most compact JSON
+ representation you should specify (',', ':') to eliminate whitespace.
+ """
+
+ self.skipkeys = skipkeys
+ self.ensure_ascii = ensure_ascii
+ self.check_circular = check_circular
+ self.allow_nan = allow_nan
+ self.sort_keys = sort_keys
+ self.indent = indent
+ self.current_indent_level = 0
+ if separators is not None:
+ self.item_separator, self.key_separator = separators
+
+ def _newline_indent(self):
+ return '\n' + (' ' * (self.indent * self.current_indent_level))
+
+ def _iterencode_list(self, lst, markers=None):
+ if not lst:
+ yield '[]'
+ return
+ if markers is not None:
+ markerid = id(lst)
+ if markerid in markers:
+ raise ValueError("Circular reference detected")
+ markers[markerid] = lst
+ yield '['
+ if self.indent is not None:
+ self.current_indent_level += 1
+ newline_indent = self._newline_indent()
+ separator = self.item_separator + newline_indent
+ yield newline_indent
+ else:
+ newline_indent = None
+ separator = self.item_separator
+ first = True
+ for value in lst:
+ if first:
+ first = False
+ else:
+ yield separator
+ for chunk in self._iterencode(value, markers):
+ yield chunk
+ if newline_indent is not None:
+ self.current_indent_level -= 1
+ yield self._newline_indent()
+ yield ']'
+ if markers is not None:
+ del markers[markerid]
+
+ def _iterencode_dict(self, dct, markers=None):
+ if not dct:
+ yield '{}'
+ return
+ if markers is not None:
+ markerid = id(dct)
+ if markerid in markers:
+ raise ValueError("Circular reference detected")
+ markers[markerid] = dct
+ yield '{'
+ key_separator = self.key_separator
+ if self.indent is not None:
+ self.current_indent_level += 1
+ newline_indent = self._newline_indent()
+ item_separator = self.item_separator + newline_indent
+ yield newline_indent
+ else:
+ newline_indent = None
+ item_separator = self.item_separator
+ first = True
+ if self.ensure_ascii:
+ encoder = encode_basestring_ascii
+ else:
+ encoder = encode_basestring
+ allow_nan = self.allow_nan
+ if self.sort_keys:
+ keys = dct.keys()
+ keys.sort()
+ items = [(k, dct[k]) for k in keys]
+ else:
+ items = dct.iteritems()
+ for key, value in items:
+ if isinstance(key, basestring):
+ pass
+ # JavaScript is weakly typed for these, so it makes sense to
+ # also allow them. Many encoders seem to do something like this.
+ elif isinstance(key, float):
+ key = floatstr(key, allow_nan)
+ elif isinstance(key, (int, long)):
+ key = str(key)
+ elif key is True:
+ key = 'true'
+ elif key is False:
+ key = 'false'
+ elif key is None:
+ key = 'null'
+ elif self.skipkeys:
+ continue
+ else:
+ raise TypeError("key %r is not a string" % (key,))
+ if first:
+ first = False
+ else:
+ yield item_separator
+ yield encoder(key)
+ yield key_separator
+ for chunk in self._iterencode(value, markers):
+ yield chunk
+ if newline_indent is not None:
+ self.current_indent_level -= 1
+ yield self._newline_indent()
+ yield '}'
+ if markers is not None:
+ del markers[markerid]
+
+ def _iterencode(self, o, markers=None):
+ if isinstance(o, basestring):
+ if self.ensure_ascii:
+ encoder = encode_basestring_ascii
+ else:
+ encoder = encode_basestring
+ yield encoder(o)
+ elif o is None:
+ yield 'null'
+ elif o is True:
+ yield 'true'
+ elif o is False:
+ yield 'false'
+ elif isinstance(o, (int, long)):
+ yield str(o)
+ elif isinstance(o, float):
+ yield floatstr(o, self.allow_nan)
+ elif isinstance(o, (list, tuple)):
+ for chunk in self._iterencode_list(o, markers):
+ yield chunk
+ elif isinstance(o, dict):
+ for chunk in self._iterencode_dict(o, markers):
+ yield chunk
+ else:
+ if markers is not None:
+ markerid = id(o)
+ if markerid in markers:
+ raise ValueError("Circular reference detected")
+ markers[markerid] = o
+ for chunk in self._iterencode_default(o, markers):
+ yield chunk
+ if markers is not None:
+ del markers[markerid]
+
+ def _iterencode_default(self, o, markers=None):
+ newobj = self.default(o)
+ return self._iterencode(newobj, markers)
+
+ def default(self, o):
+ """
+ Implement this method in a subclass such that it returns
+ a serializable object for ``o``, or calls the base implementation
+ (to raise a ``TypeError``).
+
+ For example, to support arbitrary iterators, you could
+ implement default like this::
+
+ def default(self, o):
+ try:
+ iterable = iter(o)
+ except TypeError:
+ pass
+ else:
+ return list(iterable)
+ return JSONEncoder.default(self, o)
+ """
+ raise TypeError("%r is not JSON serializable" % (o,))
+
+ def encode(self, o):
+ """
+ Return a JSON string representation of a Python data structure.
+
+ >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
+ '{"foo":["bar", "baz"]}'
+ """
+ # This doesn't pass the iterator directly to ''.join() because it
+ # sucks at reporting exceptions. It's going to do this internally
+ # anyway because it uses PySequence_Fast or similar.
+ chunks = list(self.iterencode(o))
+ return ''.join(chunks)
+
+ def iterencode(self, o):
+ """
+ Encode the given object and yield each string
+ representation as available.
+
+ For example::
+
+ for chunk in JSONEncoder().iterencode(bigobject):
+ mysocket.write(chunk)
+ """
+ if self.check_circular:
+ markers = {}
+ else:
+ markers = None
+ return self._iterencode(o, markers)
+
+__all__ = ['JSONEncoder']
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/jsonfilter.py b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/jsonfilter.py
new file mode 100644
index 0000000..d02ae20
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/jsonfilter.py
@@ -0,0 +1,40 @@
+from django.utils import simplejson
+import cgi
+
+class JSONFilter(object):
+ def __init__(self, app, mime_type='text/x-json'):
+ self.app = app
+ self.mime_type = mime_type
+
+ def __call__(self, environ, start_response):
+ # Read JSON POST input to jsonfilter.json if matching mime type
+ response = {'status': '200 OK', 'headers': []}
+ def json_start_response(status, headers):
+ response['status'] = status
+ response['headers'].extend(headers)
+ environ['jsonfilter.mime_type'] = self.mime_type
+ if environ.get('REQUEST_METHOD', '') == 'POST':
+ if environ.get('CONTENT_TYPE', '') == self.mime_type:
+ args = [_ for _ in [environ.get('CONTENT_LENGTH')] if _]
+ data = environ['wsgi.input'].read(*map(int, args))
+ environ['jsonfilter.json'] = simplejson.loads(data)
+ res = simplejson.dumps(self.app(environ, json_start_response))
+ jsonp = cgi.parse_qs(environ.get('QUERY_STRING', '')).get('jsonp')
+ if jsonp:
+ content_type = 'text/javascript'
+ res = ''.join(jsonp + ['(', res, ')'])
+ elif 'Opera' in environ.get('HTTP_USER_AGENT', ''):
+ # Opera has bunk XMLHttpRequest support for most mime types
+ content_type = 'text/plain'
+ else:
+ content_type = self.mime_type
+ headers = [
+ ('Content-type', content_type),
+ ('Content-length', len(res)),
+ ]
+ headers.extend(response['headers'])
+ start_response(response['status'], headers)
+ return [res]
+
+def factory(app, global_conf, **kw):
+ return JSONFilter(app, **kw)
diff --git a/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/scanner.py b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/scanner.py
new file mode 100644
index 0000000..64f4999
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/scanner.py
@@ -0,0 +1,63 @@
+"""
+Iterator based sre token scanner
+"""
+import sre_parse, sre_compile, sre_constants
+from sre_constants import BRANCH, SUBPATTERN
+from re import VERBOSE, MULTILINE, DOTALL
+import re
+
+__all__ = ['Scanner', 'pattern']
+
+FLAGS = (VERBOSE | MULTILINE | DOTALL)
+class Scanner(object):
+ def __init__(self, lexicon, flags=FLAGS):
+ self.actions = [None]
+ # combine phrases into a compound pattern
+ s = sre_parse.Pattern()
+ s.flags = flags
+ p = []
+ for idx, token in enumerate(lexicon):
+ phrase = token.pattern
+ try:
+ subpattern = sre_parse.SubPattern(s,
+ [(SUBPATTERN, (idx + 1, sre_parse.parse(phrase, flags)))])
+ except sre_constants.error:
+ raise
+ p.append(subpattern)
+ self.actions.append(token)
+
+ p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])
+ self.scanner = sre_compile.compile(p)
+
+
+ def iterscan(self, string, idx=0, context=None):
+ """
+ Yield match, end_idx for each match
+ """
+ match = self.scanner.scanner(string, idx).match
+ actions = self.actions
+ lastend = idx
+ end = len(string)
+ while True:
+ m = match()
+ if m is None:
+ break
+ matchbegin, matchend = m.span()
+ if lastend == matchend:
+ break
+ action = actions[m.lastindex]
+ if action is not None:
+ rval, next_pos = action(m, context)
+ if next_pos is not None and next_pos != matchend:
+ # "fast forward" the scanner
+ matchend = next_pos
+ match = self.scanner.scanner(string, matchend).match
+ yield rval, matchend
+ lastend = matchend
+
+def pattern(pattern, flags=FLAGS):
+ def decorator(fn):
+ fn.pattern = pattern
+ fn.regex = re.compile(pattern, flags)
+ return fn
+ return decorator
diff --git a/modules/implementation-python-runtime/src/main/resources/elemutil.py b/modules/implementation-python-runtime/src/main/resources/elemutil.py
new file mode 100644
index 0000000..ad971ba
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/elemutil.py
@@ -0,0 +1,168 @@
+# 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.
+
+# Functions to help represent data as lists of elements and attributes
+
+from util import *
+
+element = "'element"
+attribute = "'attribute"
+atsign = "'@"
+
+# Return true if a value is an element
+def isElement(v):
+ if not isList(v) or isNil(v) or v == None or car(v) != element:
+ return False
+ return True
+
+# Return true if a value is an attribute
+def isAttribute(v):
+ if not isList(v) or isNil(v) or v == None or car(v) != attribute:
+ return False
+ return True
+
+# Return the name of attribute
+def attributeName(l):
+ return cadr(l)
+
+# Return the value of attribute
+def attributeValue(l):
+ return caddr(l)
+
+# Return the name of an element
+def elementName(l):
+ return cadr(l)
+
+# Return true if an element has children
+def elementHasChildren(l):
+ return not isNil(cddr(l))
+
+# Return the children of an element
+def elementChildren(l):
+ return cddr(l)
+
+# Return true if an element has a value
+def elementHasValue(l):
+ r = reverse(l)
+ if isSymbol(car(r)):
+ return False
+ if isList(car(r)) and not isNil(car(r)) and isSymbol(car(car(r))):
+ return False
+ return True
+
+# Return the value of an element
+def elementValue(l):
+ return car(reverse(l))
+
+# Convert an element to a value
+def elementToValueIsList(v):
+ if not isList(v):
+ return False
+ return isNil(v) or not isSymbol(car(v))
+
+def elementToValue(t):
+ if isTaggedList(t, attribute):
+ return (atsign + attributeName(t)[1:], attributeValue(t))
+ if isTaggedList(t, element):
+ if elementHasValue(t):
+ if not elementToValueIsList(elementValue(t)):
+ return (elementName(t), elementValue(t))
+ return cons(elementName(t), (elementsToValues(elementValue(t)),))
+ return cons(elementName(t), elementsToValues(elementChildren(t)))
+ if not isList(t):
+ return t
+ return elementsToValues(t)
+
+# Convert a list of elements to a list of values
+def elementToValueIsSymbol(v):
+ if not isList(v):
+ return False
+ if (isNil(v)):
+ return False
+ if not isSymbol(car(v)):
+ return False
+ return True
+
+def elementToValueGroupValues(v, l):
+ if isNil(l) or not elementToValueIsSymbol(v) or not elementToValueIsSymbol(car(l)):
+ return cons(v, l)
+ if car(car(l)) != car(v):
+ return cons(v, l)
+ if not elementToValueIsList(cadr(car(l))):
+ g = (car(v), (cdr(v), cdr(car(l))))
+ return elementToValueGroupValues(g, cdr(l))
+ g = (car(v), cons(cdr(v), cadr(car(l))))
+ return elementToValueGroupValues(g, cdr(l))
+
+def elementsToValues(e):
+ if isNil(e):
+ return e
+ return elementToValueGroupValues(elementToValue(car(e)), elementsToValues(cdr(e)))
+
+# Convert a value to an element
+def valueToElement(t):
+ if isList(t) and not isNil(t) and isSymbol(car(t)):
+ n = car(t)
+ v = cadr(t)
+ if not isList(v):
+ if n[0:2] == atsign:
+ return (attribute, n[1:], v)
+ return (element, n, v)
+ if isNil(v) or not isSymbol(car(v)):
+ return cons(element, cons(n, (valuesToElements(v),)))
+ return cons(element, cons(n, valuesToElements(cdr(t))))
+ if not isList(t):
+ return t
+ return valuesToElements(t)
+
+# Convert a list of values to a list of elements
+def valuesToElements(l):
+ if isNil(l):
+ return l
+ return cons(valueToElement(car(l)), valuesToElements(cdr(l)))
+
+# Return a selector lambda function which can be used to filter elements
+def evalSelect(s, v):
+ if isNil(s):
+ return True
+ if isNil(v):
+ return False
+ if car(s) != car(v):
+ return False
+ return evalSelect(cdr(s), cdr(v))
+
+def selector(s):
+ return lambda v: evalSelect(s, v)
+
+# Return the value of the attribute with the given name
+def namedAttributeValue(name, l):
+ f = filter(lambda v: isAttribute(v) and attributeName(v) == name, l)
+ if isNil(f):
+ return None
+ return caddr(car(f))
+
+# Return child elements with the given name
+def namedElementChildren(name, l):
+ return filter(lambda v: isElement(v) and elementName(v) == name, l)
+
+# Return the child element with the given name
+def namedElementChild(name, l):
+ f = namedElementChildren(name, l)
+ if isNil(f):
+ return None
+ return car(f)
+
diff --git a/modules/implementation-python-runtime/src/main/resources/invoker.py b/modules/implementation-python-runtime/src/main/resources/invoker.py
new file mode 100644
index 0000000..4810767
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/invoker.py
@@ -0,0 +1,108 @@
+#!/usr/bin/python
+# 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.
+
+# Component invocation functions
+
+from sys import stderr, argv
+from util import *
+from jsonutil import *
+
+# JSON request id
+id = 1
+
+# Make a callable reference client
+class proxy:
+ def __init__(self, jpx):
+ self.jpx = jpx
+
+ def __call__(self, func, *args):
+
+ # Create a JSON-RPC request
+ global id
+ req = StringIO()
+ writeStrings(jsonRequest(id, func, args), req)
+ id = id + 1
+
+ # Eval the Java proxy
+ res = self.jpx.eval(req.getvalue())
+
+ # Extract result from JSON-RPC response
+ return jsonResultValue((res,))
+
+ def __repr__(self):
+ return repr((jpx,))
+
+def mkproxies(jpx):
+ if isNil(jpx):
+ return ()
+ return cons(proxy(car(jpx)), mkproxies(cdr(jpx)))
+
+class prop:
+ def __init__(self, jpy):
+ self.jpy = jpy
+
+ def __call__(self):
+ # Eval the property
+ res = self.jpy.eval()
+ return res
+
+def __repr__(self):
+ return repr((jpy,))
+
+def mkprops(jpy):
+ if isNil(jpy):
+ return ()
+ return cons(prop(car(jpy)), mkprops(cdr(jpy)))
+
+# Make a callable component
+class component:
+ def __init__(self, name, impl, jpx, jpy):
+ self.name = name
+ self.impl = impl[0:len(impl) - 3]
+ self.mod = __import__(self.impl)
+ self.proxies = mkproxies(jpx)
+ self.props = mkprops(jpy)
+
+ def __call__(self, func, *args):
+ return self.mod.__getattribute__(func)(*(args + self.proxies + self.props))
+
+ def __repr__(self):
+ return repr((self.name, self.impl, self.mod, self.props, self.proxies))
+
+# Converts the args received in a JSON request to a list of key value pairs
+def jsonArgs(a):
+ if isNil(a):
+ return ((),)
+ l = car(a);
+ return cons(l, jsonArgs(cdr(a)))
+
+# Apply a JSON function request to a component
+def apply(jsreq, comp):
+ json = elementsToValues(readJSON((jsreq,)))
+ args = jsonArgs(json)
+ jid = cadr(assoc("'id", args))
+ func = funcName(cadr(assoc("'method", args)))
+ params = cadr(assoc("'params", args))
+ v = comp(func, *params)
+ return jsonResult(jid, v)[0]
+
+# Make a component that can be called with a JSON function request
+def mkcomponent(name, impl, jpx, jpy):
+ comp = component(name, impl, jpx, jpy)
+ return lambda jsreq: apply(jsreq, comp)
+
diff --git a/modules/implementation-python-runtime/src/main/resources/jsonutil.py b/modules/implementation-python-runtime/src/main/resources/jsonutil.py
new file mode 100644
index 0000000..f69559d
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/jsonutil.py
@@ -0,0 +1,142 @@
+# 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.
+
+# JSON data conversion functions
+
+try:
+ import json
+except:
+ from django.utils import simplejson as json
+
+from StringIO import StringIO
+from util import *
+from elemutil import *
+
+# Return true if a list represents a JS array
+def isJSArray(l):
+ if isNil(l):
+ return True
+ v = car(l)
+ if isSymbol(v):
+ return False
+ if isList(v):
+ if not isNil(v) and isSymbol(car(v)):
+ return False
+ return True
+
+# Converts JSON properties to values
+def jsPropertiesToValues(propertiesSoFar, o, i):
+ if isNil(i):
+ return propertiesSoFar
+ p = car(i)
+ jsv = o[p]
+ v = jsValToValue(jsv)
+
+ if isinstance(p, basestring):
+ n = str(p)
+ if n[0:1] == "@":
+ return jsPropertiesToValues(cons((attribute, "'" + n[1:], v), propertiesSoFar), o, cdr(i))
+ if isList(v) and not isJSArray(v):
+ return jsPropertiesToValues(cons(cons(element, cons("'" + n, v)), propertiesSoFar), o, cdr(i))
+ return jsPropertiesToValues(cons((element, "'" + n, v), propertiesSoFar), o, cdr(i))
+ return jsPropertiesToValues(cons(v, propertiesSoFar), o, cdr(i))
+
+# Converts a JSON val to a value
+def jsValToValue(jsv):
+ if isinstance(jsv, dict):
+ return jsPropertiesToValues((), jsv, tuple(jsv.keys()))
+ if isList(jsv):
+ return jsPropertiesToValues((), jsv, tuple(reversed(range(0, len(jsv)))))
+ if isinstance(jsv, basestring):
+ return str(jsv)
+ return jsv
+
+# Convert a list of strings representing a JSON document to a list of values
+def readJSON(l):
+ s = StringIO()
+ writeStrings(l, s)
+ val = json.loads(s.getvalue())
+ return jsValToValue(val)
+
+# Convert a list of values to JSON array elements
+def valuesToJSElements(a, l, i):
+ if isNil(l):
+ return a
+ pv = valueToJSVal(car(l))
+ a[i] = pv
+ return valuesToJSElements(a, cdr(l), i + 1)
+
+# Convert a value to a JSON value
+def valueToJSVal(v):
+ if not isList(v):
+ return v
+ if isJSArray(v):
+ return valuesToJSElements(list(range(0, len(v))), v, 0)
+ return valuesToJSProperties({}, v)
+
+# Convert a list of values to JSON properties
+def valuesToJSProperties(o, l):
+ if isNil(l):
+ return o
+ token = car(l)
+ if isTaggedList(token, attribute):
+ pv = valueToJSVal(attributeValue(token))
+ o["@" + attributeName(token)[1:]] = pv
+ elif isTaggedList(token, element):
+ if elementHasValue(token):
+ pv = valueToJSVal(elementValue(token))
+ o[elementName(token)[1:]] = pv
+ else:
+ child = {}
+ o[elementName(token)[1:]] = child
+ valuesToJSProperties(child, elementChildren(token))
+ return valuesToJSProperties(o, cdr(l))
+
+# Convert a list of values to a list of strings representing a JSON document
+def writeJSON(l):
+ jsv = valuesToJSProperties({}, l)
+ s = json.dumps(jsv, separators=(',',':'))
+ return (s,)
+
+# Convert a list + params to a JSON-RPC request
+def jsonRequest(id, func, params):
+ r = (("'id", id), ("'method", func), ("'params", params))
+ return writeJSON(valuesToElements(r))
+
+# Convert a value to a JSON-RPC result
+def jsonResult(id, val):
+ return writeJSON(valuesToElements((("'id", id), ("'result", val))))
+
+# Convert a JSON-RPC result to a value
+def jsonResultValue(s):
+ jsres = readJSON(s)
+ res = elementsToValues(jsres)
+ val = cadr(assoc("'result", res))
+ if isList(val) and not isJSArray(val):
+ return (val,)
+ return val
+
+# Return a portable function name from a JSON-RPC function name
+def funcName(f):
+ if f.startswith("."):
+ return f[1:]
+ if f.startswith("system."):
+ return f[7:]
+ if f.startswith("Service."):
+ return f[8:]
+ return f
+
diff --git a/modules/implementation-python-runtime/src/main/resources/rssutil.py b/modules/implementation-python-runtime/src/main/resources/rssutil.py
new file mode 100644
index 0000000..4f060d2
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/rssutil.py
@@ -0,0 +1,119 @@
+# 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.
+
+# RSS data conversion functions
+
+from util import *
+from elemutil import *
+from xmlutil import *
+
+# Convert a list of elements to a list of values representing an RSS entry
+def entryElementsToValues(e):
+ lt = filter(selector((element, "'title")), e)
+ t = "" if isNil(lt) else elementValue(car(lt))
+ li = filter(selector((element, "'link")), e)
+ i = "" if isNil(li) else elementValue(car(li))
+ lc = filter(selector((element, "'description")), e)
+ return (t, i, elementValue(car(lc)))
+
+# Convert a list of elements to a list of values representing RSS entries
+def entriesElementsToValues(e):
+ if isNil(e):
+ return e
+ return cons(entryElementsToValues(car(e)), entriesElementsToValues(cdr(e)))
+
+# Convert a list of strings to a list of values representing an RSS entry
+def readRSSEntry(l):
+ e = readXML(l)
+ if isNil(e):
+ return ()
+ return entryElementsToValues(car(e))
+
+# Convert a list of values representy an RSS entry to a value
+def entryValue(e):
+ v = elementsToValues((caddr(e),))
+ return cons(car(e), (cadr(e), cdr(car(v))))
+
+# Return true if a list of strings represents an RSS feed
+def isRSSFeed(l):
+ if isNil(l):
+ return False
+ if car(l)[0:5] != "<?xml":
+ return False
+ return contains(car(l), "<rss")
+
+# Convert a list of strings to a list of values representing an RSS feed
+def readRSSFeed(l):
+ f = readXML(l)
+ if isNil(f):
+ return ()
+ c = filter(selector((element, "'channel")), car(f))
+ t = filter(selector((element, "'title")), car(c))
+ i = filter(selector((element, "'link")), car(c))
+ e = filter(selector((element, "'item")), car(c))
+ if isNil(e):
+ return (elementValue(car(t)), elementValue(car(i)))
+ return cons(elementValue(car(t)), cons(elementValue(car(i)), entriesElementsToValues(e)))
+
+# Convert an RSS feed containing elements to an RSS feed containing values
+def feedValuesLoop(e):
+ if (isNil(e)):
+ return e
+ return cons(entryValue(car(e)), feedValuesLoop(cdr(e)))
+
+def feedValues(e):
+ return cons(car(e), cons(cadr(e), feedValuesLoop(cddr(e))))
+
+# Convert a list of values representy an RSS entry to a list of elements
+def entryElement(l):
+ return (element, "'item",
+ (element, "'title", car(l)),
+ (element, "'link", cadr(l)),
+ (element, "'description", caddr(l)))
+
+# Convert a list of values representing RSS entries to a list of elements
+def entriesElements(l):
+ if isNil(l):
+ return l
+ return cons(entryElement(car(l)), entriesElements(cdr(l)))
+
+# Convert a list of values representing an RSS entry to an RSS entry
+def writeRSSEntry(l):
+ return writeXML((entryElement(l),), True)
+
+# Convert a list of values representing an RSS feed to an RSS feed
+def writeRSSFeed(l):
+ c = ((element, "'title", car(l)),
+ (element, "'link", cadr(l)),
+ (element, "'description", car(l)))
+ ce = c if isNil(cddr(l)) else append(c, entriesElements(cddr(l)))
+ fe = (element, "'rss", (attribute, "'version", "2.0"), append((element, "'channel"), ce))
+ return writeXML((fe,), True)
+
+# Convert an RSS entry containing a value to an RSS entry containing an item element
+def entryValuesToElements(v):
+ return cons(car(v), cons(cadr(v), valuesToElements((cons("'item", caddr(v)),))))
+
+# Convert an RSS feed containing values to an RSS feed containing elements
+def feedValuesToElementsLoop(v):
+ if isNil(v):
+ return v
+ return cons(entryValuesToElements(car(v)), feedValuesToElementsLoop(cdr(v)))
+
+def feedValuesToElements(v):
+ return cons(car(v), cons(cadr(v), feedValuesToElementsLoop(cddr(v))))
+
diff --git a/modules/implementation-python-runtime/src/main/resources/util.py b/modules/implementation-python-runtime/src/main/resources/util.py
new file mode 100644
index 0000000..560101e
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/util.py
@@ -0,0 +1,145 @@
+# 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.
+
+# Simple utility functions
+from sys import maxint
+
+# Scheme-like lists
+def cons(a, b):
+ return (a,) + b
+
+def car(l):
+ return l[0]
+
+def first(l):
+ return car(l)
+
+def cdr(l):
+ return l[1:]
+
+def rest(l):
+ return cdr(l)
+
+def cadr(l):
+ return car(cdr(l))
+
+def cddr(l):
+ return cdr(cdr(l))
+
+def caddr(l):
+ return car(cddr(l))
+
+def append(a, b):
+ return a + b
+
+def reverse(l):
+ r = list(l)
+ r.reverse()
+ return tuple(r)
+
+def isNil(l):
+ if isinstance(l, streampair):
+ return l.isNil()
+ return l == ()
+
+def isSymbol(v):
+ return isinstance(v, basestring) and v[0:1] == "'"
+
+def isList(v):
+ if getattr(v, '__iter__', False) == False:
+ return False
+ if isinstance(v, basestring) or isinstance(v, dict):
+ return False
+ return True
+
+def isTaggedList(v, t):
+ return isList(v) and not isNil(v) and car(v) == t
+
+
+# Scheme-like streams
+class streampair(object):
+ def __init__(self, car, cdr):
+ self.car = car
+ self.cdr = cdr
+
+ def __repr__(self):
+ return repr(self[0:len(self)])
+
+ def isNil(self):
+ return self.cdr == ()
+
+ def __len__(self):
+ if self.cdr == ():
+ return 0
+ return 1 + len(self.cdr())
+
+ def __getitem__(self, i):
+ if i == 0:
+ return self.car
+ return self.cdr()[i - 1]
+
+ def __getslice__(self, i, j):
+ if isNil(self):
+ return ()
+ if i > 0:
+ if j == maxint:
+ return self.cdr()[i - 1: j]
+ return self.cdr()[i - 1: j - 1]
+ if j == maxint:
+ return self
+ if j == 0:
+ return (self.car,)
+ return (self.car,) + self.cdr()[: j - 1]
+
+ def __eq__(self, other):
+ sl = len(self)
+ ol = len(other)
+ if sl != ol:
+ return False
+ return self[0: sl] == other[0: ol]
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+def cons_stream(car, cdr):
+ return streampair(car, cdr)
+
+
+# Scheme-like associations
+def assoc(k, l):
+ if l == ():
+ return None
+
+ if k == car(car(l)):
+ return car(l)
+ return assoc(k, cdr(l))
+
+# Currying / partial function application
+def curry(f, *args):
+ return lambda *a: f(*(args + a))
+
+# Split a path into a list of segments
+def tokens(path):
+ return tuple(filter(lambda s: len(s) != 0, path.split("/")))
+
+# Write a list of strings to a stream
+def writeStrings(l, os):
+ if l == ():
+ return os
+ os.write(car(l))
+ return writeStrings(cdr(l), os)
+
diff --git a/modules/implementation-python-runtime/src/main/resources/xmlutil.py b/modules/implementation-python-runtime/src/main/resources/xmlutil.py
new file mode 100644
index 0000000..a1bc046
--- /dev/null
+++ b/modules/implementation-python-runtime/src/main/resources/xmlutil.py
@@ -0,0 +1,114 @@
+# 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.
+
+# XML handling functions
+
+from StringIO import StringIO
+from xml.parsers import expat
+import xml.etree.ElementTree as et
+from util import *
+from elemutil import *
+
+# Read a list of XML attributes
+def readAttributes(a):
+ if a == ():
+ return a
+ return cons((attribute, "'" + car(car(a)), cadr(car(a))), readAttributes(cdr(a)))
+
+# Read an XML element
+def readElement(e):
+ l = (element, "'" + e.tag) + readAttributes(tuple(e.items())) + readElements(tuple(e.getchildren()))
+ if e.text == None:
+ return l
+ return l + (e.text,)
+
+# Read a list of XML elements
+def readElements(l):
+ if l == ():
+ return l
+ return cons(readElement(car(l)), readElements(cdr(l)))
+
+# Parse a list of strings representing an XML document
+class NamespaceParser(et.XMLTreeBuilder):
+ def __init__(self):
+ et.XMLTreeBuilder.__init__(self)
+ self._parser = parser = expat.ParserCreate(None)
+ parser.DefaultHandlerExpand = self._default
+ parser.StartElementHandler = self._start
+ parser.EndElementHandler = self._end
+ parser.CharacterDataHandler = self._data
+ try:
+ parser.buffer_text = 1
+ except AttributeError:
+ pass
+ try:
+ parser.ordered_attributes = 1
+ parser.specified_attributes = 1
+ parser.StartElementHandler = self._start_list
+ except AttributeError:
+ pass
+
+def parseXML(l):
+ s = StringIO()
+ writeStrings(l, s)
+ parser = NamespaceParser()
+ parser.feed(s.getvalue())
+ return parser.close()
+
+# Read a list of values from a list of strings representing an XML document
+def readXML(l):
+ e = parseXML(l)
+ return (readElement(e),)
+
+# Write a list of XML element and attribute tokens
+def expandElementValues(n, l):
+ if isNil(l):
+ return l
+ return cons(cons(element, cons(n, car(l))), expandElementValues(n, cdr(l)))
+
+def writeList(l, xml):
+ if isNil(l):
+ return xml
+ token = car(l)
+ if isTaggedList(token, attribute):
+ xml.attrib[attributeName(token)[1:]] = str(attributeValue(token))
+ elif isTaggedList(token, element):
+ if elementHasValue(token):
+ v = elementValue(token)
+ if isList(v):
+ e = expandElementValues(elementName(token), v)
+ writeList(e, xml)
+ else:
+ child = et.Element(elementName(token)[1:])
+ writeList(elementChildren(token), child)
+ xml.append(child)
+ else:
+ child = et.Element(elementName(token)[1:])
+ writeList(elementChildren(token), child)
+ xml.append(child)
+ else:
+ xml.text = str(token)
+ writeList(cdr(l), xml)
+ return xml
+
+# Convert a list of values to a list of strings representing an XML document
+def writeXML(l, xmlTag):
+ e = writeList(l, [])
+ if not xmlTag:
+ return (et.tostring(car(e)),)
+ return (et.tostring(car(e), "UTF-8") + "\n",)
+
diff --git a/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java
new file mode 100644
index 0000000..f69ce32
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java
@@ -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.sca.implementation.python.provider;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * Test Java component.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ClientTest implements EchoTest {
+
+ @Reference
+ public EchoTest ref;
+
+ public String echo(final String s1, final String s2) {
+ return ref.echo(s1, s2);
+ }
+}
diff --git a/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java
new file mode 100644
index 0000000..557bc96
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sca.implementation.python.provider;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Test client interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface EchoTest {
+
+ public String echo(String s1, String s2);
+}
diff --git a/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java
new file mode 100644
index 0000000..0d4b00d
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java
@@ -0,0 +1,93 @@
+/*
+ * 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.sca.implementation.python.provider;
+
+import static org.apache.tuscany.sca.node.ContributionLocationHelper.getContributionLocation;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.jabsorb.client.Client;
+import org.jabsorb.client.Session;
+import org.jabsorb.client.TransportRegistry;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests the Python implementation provider.
+ *
+ * @version $Rev$ $Date$
+ */
+public class InvokeTestCase {
+ static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ try {
+ final String loc = getContributionLocation("domain-test.composite");
+ node = NodeFactory.newInstance().createNode("domain-test.composite", new Contribution("c", loc));
+ node.start();
+ } catch(Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testService() throws Exception {
+ final Session s = TransportRegistry.i().createSession("http://localhost:8080/python");
+ final Client c = new Client(s);
+ final Object px = c.openProxy("", EchoTest.class);
+ final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
+ c.closeProxy(px);
+ s.close();
+ assertEquals("Hey There", r);
+ }
+
+ @Test
+ public void testReference() throws Exception {
+ final Session s = TransportRegistry.i().createSession("http://localhost:8080/client");
+ final Client c = new Client(s);
+ final Object px = c.openProxy("", EchoTest.class);
+ final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
+ c.closeProxy(px);
+ s.close();
+ assertEquals("Hey There", r);
+ }
+
+ @Test
+ public void testLocal() throws Exception {
+ final Session s = TransportRegistry.i().createSession("http://localhost:8080/java-client");
+ final Client c = new Client(s);
+ final Object px = c.openProxy("", EchoTest.class);
+ final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
+ c.closeProxy(px);
+ s.close();
+ assertEquals("Hey There", r);
+ }
+
+}
diff --git a/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java
new file mode 100644
index 0000000..b0f3b58
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.sca.implementation.python.provider;
+
+/**
+ * Test Java component.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerTest implements EchoTest {
+
+ public String echo(final String s1, final String s2) {
+ return s1 + " " + s2;
+ }
+}
diff --git a/modules/implementation-python-runtime/src/test/resources/client_test.py b/modules/implementation-python-runtime/src/test/resources/client_test.py
new file mode 100644
index 0000000..e3cbaf0
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/resources/client_test.py
@@ -0,0 +1,35 @@
+# 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.
+
+# JSON-RPC test case
+
+def echo(x, y, ref):
+ return ref("echo", x, y)
+
+# ATOMPub test case
+
+def get(id, ref):
+ return ref("get", id)
+
+def post(collection, item, ref):
+ return ref("post", collection, item)
+
+def put(id, item, ref):
+ return ref("put", id, item)
+
+def delete(id, ref):
+ return ref("delete", id)
diff --git a/modules/implementation-python-runtime/src/test/resources/domain-test.composite b/modules/implementation-python-runtime/src/test/resources/domain-test.composite
new file mode 100644
index 0000000..dfcf4f8
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/resources/domain-test.composite
@@ -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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://domain/test"
+ name="domain-test">
+
+ <component name="python-test">
+ <t:implementation.python script="server_test.py"/>
+ <service name="test">
+ <t:binding.jsonrpc uri="http://localhost:8080/python"/>
+ </service>
+ </component>
+
+ <component name="client-test">
+ <t:implementation.python script="client_test.py"/>
+ <service name="client">
+ <t:binding.jsonrpc uri="http://localhost:8080/client"/>
+ </service>
+ <reference name="ref" target="python-test">
+ </reference>
+ </component>
+
+ <component name="java-test">
+ <implementation.java class="org.apache.tuscany.sca.implementation.python.provider.ServerTest"/>
+ <service name="EchoTest">
+ <t:binding.jsonrpc uri="http://localhost:8080/java"/>
+ </service>
+ </component>
+
+ <component name="python-to-java-test">
+ <t:implementation.python script="client_test.py"/>
+ <service name="client">
+ <t:binding.jsonrpc uri="http://localhost:8080/python-to-java"/>
+ </service>
+ <reference name="ref" target="java-test"/>
+ </component>
+
+ <component name="java-client-test">
+ <implementation.java class="org.apache.tuscany.sca.implementation.python.provider.ClientTest"/>
+ <service name="EchoTest">
+ <t:binding.jsonrpc uri="http://localhost:8080/java-client"/>
+ </service>
+ <reference name="ref" target="python-to-java-test"/>
+ </component>
+
+</composite>
diff --git a/modules/implementation-python-runtime/src/test/resources/server_test.py b/modules/implementation-python-runtime/src/test/resources/server_test.py
new file mode 100644
index 0000000..75f9712
--- /dev/null
+++ b/modules/implementation-python-runtime/src/test/resources/server_test.py
@@ -0,0 +1,42 @@
+# 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.
+
+# JSON-RPC test case
+
+def echo(x, y):
+ return x + " " + y
+
+# ATOMPub test case
+
+def get(id):
+ if id == ():
+ return ("Sample Feed", "123456789",
+ ("Item", "111", (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))),
+ ("Item", "222", (("'javaClass", "services.Item"), ("'name", "Orange"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 3.55))),
+ ("Item", "333", (("'javaClass", "services.Item"), ("name", "Pear"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 1.55))))
+
+ entry = (("'javaClass", "services.Item"), ("'name", "Apple"), ("'currencyCode", "USD"), ("'currencySymbol", "$"), ("'price", 2.99))
+ return ("Item", id[0], entry)
+
+def post(collection, item):
+ return ("123456789",)
+
+def put(id, item):
+ return True
+
+def delete(id):
+ return True
diff --git a/modules/binding-rss-runtime/LICENSE b/modules/implementation-python/LICENSE
similarity index 100%
rename from modules/binding-rss-runtime/LICENSE
rename to modules/implementation-python/LICENSE
diff --git a/modules/implementation-python/META-INF/MANIFEST.MF b/modules/implementation-python/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f4f0238
--- /dev/null
+++ b/modules/implementation-python/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany Python Implementation Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Python Implementation Model
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.python
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Export-Package: org.apache.tuscany.sca.implementation.python;version="2.0.0"
+Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.builder;version="2.0.0",
+ org.apache.tuscany.sca.assembly.impl;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.contribution;version="2.0.0",
+ org.apache.tuscany.sca.contribution.processor;version="2.0.0",
+ org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.implementation.jaxrs;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.impl;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.monitor;version="2.0.0",
+ org.apache.tuscany.sca.policy;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.apache.tuscany.sca.xsd;version="2.0.0"
diff --git a/samples/dosgi-calculator-operations/NOTICE b/modules/implementation-python/NOTICE
similarity index 100%
copy from samples/dosgi-calculator-operations/NOTICE
copy to modules/implementation-python/NOTICE
diff --git a/modules/implementation-python/pom.xml b/modules/implementation-python/pom.xml
new file mode 100644
index 0000000..bea17cf
--- /dev/null
+++ b/modules/implementation-python/pom.xml
@@ -0,0 +1,84 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-implementation-python</artifactId>
+ <name>Apache Tuscany SCA Python Implementation Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-monitor</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java
new file mode 100644
index 0000000..ae9caab
--- /dev/null
+++ b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sca.implementation.python;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Python component generic evaluation interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface PythonEval {
+
+ public String eval(String args) throws Exception;
+}
diff --git a/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java
new file mode 100644
index 0000000..058c01a
--- /dev/null
+++ b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java
@@ -0,0 +1,104 @@
+/*
+ * 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.sca.implementation.python;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
+import org.apache.tuscany.sca.assembly.impl.PropertyImpl;
+import org.apache.tuscany.sca.assembly.impl.ReferenceImpl;
+import org.apache.tuscany.sca.assembly.impl.ServiceImpl;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+
+/**
+ * The model representing a Python implementation in an SCA assembly.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PythonImplementation extends ImplementationImpl {
+ final String script;
+ final String location;
+ final InterfaceContract contract;
+ final Service service;
+
+ PythonImplementation(final QName qn, final String scr, final String loc, final InterfaceContract c) {
+ super(qn);
+ script = scr;
+ location = loc;
+ contract = c;
+
+ class DynService extends ServiceImpl {
+ public DynService() {
+ setName("default");
+ setInterfaceContract(contract);
+ }
+ }
+ ;
+ service = new DynService();
+ getServices().add(service);
+ }
+
+ public String getScript() {
+ return script;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public Service getService(final String n) {
+ return service;
+ }
+
+ public Reference getReference(final String n) {
+ final Reference r = super.getReference(n);
+ if(r != null)
+ return r;
+ class DynReference extends ReferenceImpl {
+ public DynReference() {
+ setName(n);
+ setInterfaceContract(contract);
+ }
+ }
+ final Reference nr = new DynReference();
+ getReferences().add(nr);
+ return nr;
+ }
+
+ public Property getProperty(final String n) {
+ final Property p = super.getProperty(n);
+ if(p != null)
+ return p;
+ class DynProperty extends PropertyImpl {
+ public DynProperty() {
+ setName(n);
+ setDataType(new DataTypeImpl<XMLType>(null, String.class, String.class, XMLType.UNKNOWN));
+ setXSDType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
+ }
+ }
+ final Property np = new DynProperty();
+ getProperties().add(np);
+ return np;
+ }
+}
diff --git a/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java
new file mode 100644
index 0000000..b4daab3
--- /dev/null
+++ b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java
@@ -0,0 +1,107 @@
+/*
+ * 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.sca.implementation.python;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static org.apache.tuscany.sca.assembly.Base.SCA11_TUSCANY_NS;
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.databinding.json.JSONDataBinding;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceImpl;
+
+/**
+ * Implements a StAX artifact processor for Python implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PythonImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<PythonImplementation> {
+ static QName QN = new QName(SCA11_TUSCANY_NS, "implementation.python");
+
+ final InterfaceContract contract;
+
+ public PythonImplementationProcessor(final ExtensionPointRegistry ep) throws InvalidInterfaceException {
+ final FactoryExtensionPoint fep = ep.getExtensionPoint(FactoryExtensionPoint.class);
+ final JavaInterfaceFactory jf = fep.getFactory(JavaInterfaceFactory.class);
+ final JavaInterface eval = jf.createJavaInterface(PythonEval.class);
+
+ class DynamicInterface extends JavaInterfaceImpl {
+ DynamicInterface() {
+ setJavaClass(eval.getJavaClass());
+ setName(eval.getName());
+ setRemotable(eval.isRemotable());
+ Operation op = eval.getOperations().get(0);
+ op.setDynamic(true);
+ getOperations().add(op);
+ resetDataBinding(JSONDataBinding.NAME);
+ setUnresolved(false);
+ }
+
+ @Override
+ public boolean isDynamic() {
+ return true;
+ }
+ }
+
+ contract = jf.createJavaInterfaceContract();
+ contract.setInterface(new DynamicInterface());
+ }
+
+ public QName getArtifactType() {
+ return QN;
+ }
+
+ public Class<PythonImplementation> getModelType() {
+ return PythonImplementation.class;
+ }
+
+ public PythonImplementation read(final XMLStreamReader r, final ProcessorContext ctx) throws ContributionReadException, XMLStreamException {
+ final String scr = r.getAttributeValue(null, "script");
+ while(r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName())))
+ ;
+ return new PythonImplementation(QN, scr, URI.create(ctx.getContribution().getLocation()).getPath(), contract);
+ }
+
+ public void resolve(final PythonImplementation impl, final ModelResolver res, final ProcessorContext ctx) throws ContributionResolveException {
+ }
+
+ public void write(final PythonImplementation impl, final XMLStreamWriter w, final ProcessorContext ctx) throws ContributionWriteException, XMLStreamException {
+ writeStart(w, QN.getNamespaceURI(), QN.getLocalPart(), new XAttr("script", impl.getScript()));
+ writeEnd(w);
+ }
+}
diff --git a/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java
new file mode 100644
index 0000000..6efee36
--- /dev/null
+++ b/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sca.implementation.python;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Python component property evaluation interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface PythonProperty {
+
+ public String eval();
+}
diff --git a/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..c6f60b9
--- /dev/null
+++ b/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.implementation.python.PythonImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.python,model=org.apache.tuscany.sca.implementation.python.PythonImplementation
+
diff --git a/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
new file mode 100644
index 0000000..2543a67
--- /dev/null
+++ b/modules/implementation-python/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org/apache/tuscany/sca/implementation/python/tuscany-sca-1.1-implementation-python.xsd
diff --git a/modules/implementation-python/src/main/resources/org/apache/tuscany/sca/implementation/python/tuscany-sca-1.1-implementation-python.xsd b/modules/implementation-python/src/main/resources/org/apache/tuscany/sca/implementation/python/tuscany-sca-1.1-implementation-python.xsd
new file mode 100644
index 0000000..75e69f1
--- /dev/null
+++ b/modules/implementation-python/src/main/resources/org/apache/tuscany/sca/implementation/python/tuscany-sca-1.1-implementation-python.xsd
@@ -0,0 +1,38 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"/>
+
+ <element name="implementation.python" type="t:PythonImplementation" substitutionGroup="sca:implementation"/>
+
+ <complexType name="PythonImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <attribute name="script" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java b/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java
new file mode 100644
index 0000000..6e5a70f
--- /dev/null
+++ b/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java
@@ -0,0 +1,88 @@
+/*
+ * 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.sca.implementation.python;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.DefaultContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.monitor.DefaultMonitorFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test reading/writing Python implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadWriteTestCase {
+ static XMLInputFactory xif;
+ static XMLOutputFactory xof;
+ static StAXArtifactProcessor<Object> xproc;
+ static ProcessorContext ctx;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ final DefaultExtensionPointRegistry ep = new DefaultExtensionPointRegistry();
+ final ContributionFactory contribFactory = new DefaultContributionFactory();
+ final Contribution contrib = contribFactory.createContribution();
+ contrib.setLocation(ReadWriteTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString());
+ final Monitor mon = new DefaultMonitorFactory().createMonitor();
+ ctx = new ProcessorContext(contrib, mon);
+ xif = XMLInputFactory.newInstance();
+ xof = XMLOutputFactory.newInstance();
+ final StAXArtifactProcessorExtensionPoint xpep = new DefaultStAXArtifactProcessorExtensionPoint(ep);
+ xproc = new ExtensibleStAXArtifactProcessor(xpep, xif, xof);
+ }
+
+ @Test
+ public void testRead() throws Exception {
+ final InputStream is = getClass().getClassLoader().getResourceAsStream("domain-test.composite");
+ final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
+ assertNotNull(c);
+ assertEquals("server_test.py", ((PythonImplementation)c.getComponents().get(0).getImplementation()).getScript());
+ }
+
+ @Test
+ public void testReadWrite() throws Exception {
+ final InputStream is = getClass().getClassLoader().getResourceAsStream("domain-test.composite");
+ final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ xproc.write(c, xof.createXMLStreamWriter(bos), ctx);
+ assertTrue(bos.toString().contains("script=\"server_test.py\""));
+ }
+}
diff --git a/modules/implementation-python/src/test/resources/domain-test.composite b/modules/implementation-python/src/test/resources/domain-test.composite
new file mode 100644
index 0000000..c1e40dc
--- /dev/null
+++ b/modules/implementation-python/src/test/resources/domain-test.composite
@@ -0,0 +1,39 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://domain/test"
+ name="domain-test">
+
+ <component name="python-test">
+ <t:implementation.python script="server_test.py"/>
+ <service name="test">
+ </service>
+ </component>
+
+ <component name="client-test">
+ <t:implementation.python script="client_test.py"/>
+ <service name="client">
+ </service>
+ <reference name="ref" target="python-test">
+ </reference>
+ </component>
+
+</composite>
diff --git a/modules/implementation-spring-runtime/META-INF/MANIFEST.MF b/modules/implementation-spring-runtime/META-INF/MANIFEST.MF
index 4a22836..b598607 100644
--- a/modules/implementation-spring-runtime/META-INF/MANIFEST.MF
+++ b/modules/implementation-spring-runtime/META-INF/MANIFEST.MF
@@ -11,6 +11,35 @@
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
Import-Package: org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0",
+ javax.xml.namespace,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.builder;version="2.0.0",
+ org.apache.tuscany.sca.assembly.impl;version="2.0.0",
+ org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.context;version="2.0.0",
+ org.apache.tuscany.sca.contribution;version="2.0.0",
+ org.apache.tuscany.sca.contribution.processor;version="2.0.0",
+ org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.core.factory;version="2.0.0",
+ org.apache.tuscany.sca.core.invocation;version="2.0.0",
+ org.apache.tuscany.sca.databinding;version="2.0.0",
+ org.apache.tuscany.sca.databinding.impl;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring.xml;version="2.0.0",
+ org.apache.tuscany.sca.implementation.java;version="2.0.0",
+ org.apache.tuscany.sca.implementation.java.injection;version="2.0.0",
+ org.apache.tuscany.sca.implementation.java.introspect;version="2.0.0",
+ org.apache.tuscany.sca.implementation.java.introspect.impl;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.monitor;version="2.0.0",
+ org.apache.tuscany.sca.policy;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
org.springframework.beans;version="3.0.2.RELEASE",
org.springframework.beans.factory;version="3.0.2.RELEASE",
org.springframework.beans.factory.annotation;version="3.0.2.RELEASE",
@@ -19,6 +48,16 @@
org.springframework.beans.factory.xml;version="3.0.2.RELEASE",
org.springframework.context;version="3.0.2.RELEASE",
org.springframework.context.support;version="3.0.2.RELEASE",
+ org.springframework.core;version="3.0.2.RELEASE",
org.springframework.core.io;version="3.0.2.RELEASE",
org.springframework.util;version="3.0.2.RELEASE"
+Export-Package: org.apache.tuscany.sca.implementation.spring.context;version="2.0.0";
+ uses:="org.springframework.beans.factory.support,
+ org.springframework.context.support,
+ org.springframework.core.io,
+ org.apache.tuscany.sca.implementation.spring,
+ org.springframework.context,
+ org.apache.tuscany.sca.implementation.spring.provider,
+ org.springframework.beans.factory.config,
+ org.springframework.beans.factory"
diff --git a/modules/implementation-spring-runtime/README b/modules/implementation-spring-runtime/README
deleted file mode 100644
index e1b1f98..0000000
--- a/modules/implementation-spring-runtime/README
+++ /dev/null
@@ -1,9 +0,0 @@
-Note that the implementation spring modules have a different structure from other extensions.
-
-The aim is to have the Tuscany runtime embedded in a container with the Tuscany classes hidden
-from user applications and the Spring jar's packaged with the application. That means that the
-Tuscany code has no visibilty of the Spring classes and visa-versa. To implement that the
-implementation-spring module has no dependencies on Spring and the implementation-spring-runtime
-module has no dependencies on Tuscany (other than the sca-api), and reflection is used to call
-methods between the modules.
-
diff --git a/modules/implementation-spring-runtime/pom.xml b/modules/implementation-spring-runtime/pom.xml
index e7128e2..f66004f 100644
--- a/modules/implementation-spring-runtime/pom.xml
+++ b/modules/implementation-spring-runtime/pom.xml
@@ -30,22 +30,13 @@
<dependencies>
- <!-- **************************************** -->
- <!-- * * -->
- <!-- * DONT ADD ANY TUSCANY DEPENDENCIES!!! * -->
- <!-- * * -->
- <!-- * See the README for details why not * -->
- <!-- * * -->
- <!-- * * -->
- <!-- **************************************** -->
-
- <!-- SCA API dependency -->
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
<version>2.0-Beta1</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
<!-- Spring dependencies... -->
<dependency>
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java
new file mode 100644
index 0000000..44a3ee2
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAGenericApplicationContext.java
@@ -0,0 +1,145 @@
+/*
+ * 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.sca.implementation.spring.context;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
+import org.apache.tuscany.sca.implementation.spring.SpringPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanReference;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+public class SCAGenericApplicationContext extends GenericApplicationContext {
+
+ private ClassLoader classloader = null;
+ private List<SpringSCAPropertyElement> propertyElements = new ArrayList<SpringSCAPropertyElement>();
+ private List<SpringSCAServiceElement> serviceElements = new ArrayList<SpringSCAServiceElement>();
+ private List<SpringSCAReferenceElement> referenceElements = new ArrayList<SpringSCAReferenceElement>();
+ private List<SpringBeanElement> beanElements;
+
+ public SCAGenericApplicationContext(DefaultListableBeanFactory beanFactory,
+ ApplicationContext parent,
+ ClassLoader classloader) {
+ super(beanFactory, parent);
+ this.classloader = classloader;
+ }
+
+ public SCAGenericApplicationContext(ApplicationContext parent, ClassLoader classloader) {
+ super(parent);
+ this.classloader = classloader;
+ }
+
+ @Override
+ protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
+ beanFactory.setBeanClassLoader(classloader);
+ }
+
+ public void addSCAPropertyElement(SpringSCAPropertyElement propertyElement) {
+ propertyElements.add(propertyElement);
+ }
+
+ public void addSCAServiceElement(SpringSCAServiceElement serviceElement) {
+ serviceElements.add(serviceElement);
+ }
+
+ public void addSCAReferenceElement(SpringSCAReferenceElement referenceElement) {
+ referenceElements.add(referenceElement);
+ }
+
+ public synchronized List<SpringBeanElement> getBeanElements() {
+ if (beanElements == null) {
+ beanElements = new ArrayList<SpringBeanElement>();
+ for (String name : getBeanDefinitionNames()) {
+ BeanDefinition def = getBeanDefinition(name);
+ SpringBeanElement beanElement = new SpringBeanElement(name, def.getBeanClassName());
+ beanElements.add(beanElement);
+ beanElement.setAbstractBean(def.isAbstract());
+ beanElement.setFactoryBeanAttribute(def.getFactoryBeanName() != null);
+ beanElement.setFactoryMethodAttribute(def.getFactoryMethodName() != null);
+ beanElement.setParentAttribute(def.getParentName() != null);
+ beanElement.setInnerBean(beanElement.getId() == null);
+
+ ConstructorArgumentValues args = def.getConstructorArgumentValues();
+ for (Map.Entry<Integer, ValueHolder> e: args.getIndexedArgumentValues().entrySet()) {
+ ValueHolder holder = e.getValue();
+ SpringConstructorArgElement arg = new SpringConstructorArgElement(holder.getType());
+ arg.setIndex(e.getKey());
+ beanElement.addCustructorArgs(arg);
+ }
+
+ MutablePropertyValues values = def.getPropertyValues();
+ for (PropertyValue p : values.getPropertyValueList()) {
+ SpringPropertyElement propertyElement = new SpringPropertyElement(p.getName());
+ Object value = p.getValue();
+ configurePropertyElement(propertyElement, value);
+ beanElement.getProperties().add(propertyElement);
+ }
+ }
+ }
+ return beanElements;
+ }
+
+ public void configurePropertyElement(SpringPropertyElement propertyElement, Object value) {
+ if (value instanceof BeanReference) {
+ BeanReference beanRef = (BeanReference)value;
+ propertyElement.addRef(beanRef.getBeanName());
+ } else if (value instanceof Collection) {
+ Collection collection = (Collection)value;
+ for (Object item : collection) {
+ configurePropertyElement(propertyElement, item);
+ }
+ } else if (value instanceof TypedStringValue) {
+ TypedStringValue stringValue = (TypedStringValue)value;
+ propertyElement.addValue(stringValue.getValue());
+ } else {
+ if (value != null) {
+ propertyElement.addValue(value.toString());
+ }
+ }
+ }
+
+ public List<SpringSCAPropertyElement> getPropertyElements() {
+ return propertyElements;
+ }
+
+ public List<SpringSCAServiceElement> getServiceElements() {
+ return serviceElements;
+ }
+
+ public List<SpringSCAReferenceElement> getReferenceElements() {
+ return referenceElements;
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java
new file mode 100644
index 0000000..cd81fac
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SCAParentApplicationContext.java
@@ -0,0 +1,213 @@
+/*
+ * 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.sca.implementation.spring.context;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.tuscany.sca.implementation.spring.provider.SpringImplementationWrapper;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.MessageSourceResolvable;
+import org.springframework.context.NoSuchMessageException;
+import org.springframework.core.io.Resource;
+
+/**
+ * A Spring ParentApplicationContext for a given Spring Implementation
+ *
+ * The Parent application context is responsible for handling those entities within a Spring
+ * application context that actually belong to SCA rather than to Spring. The principal things
+ * are Properties and References. These may be present either through explicit <sca:property/>
+ * and <sca:reference/> elements in the application context or they may be implicit through
+ * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
+ * context that must provide Spring beans that correspond to the property or reference, as derived
+ * from the SCA composite in which the Spring application context is an implementation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCAParentApplicationContext implements ApplicationContext {
+
+ // The Spring implementation for which this is the parent application context
+ private SpringImplementationWrapper implementation;
+
+ private static final String[] EMPTY_ARRAY = new String[0];
+
+ public SCAParentApplicationContext(SpringImplementationWrapper implementation) {
+ this.implementation = implementation;
+ } // end constructor
+
+ public Object getBean(String name) throws BeansException {
+ return getBean(name, (Class)null);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class requiredType) throws BeansException {
+ Object bean = implementation.getBean(name, requiredType);
+ if (bean == null && getParent() != null) {
+ bean = getParent().getBean(name, requiredType);
+ }
+ if (bean == null) {
+ throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
+ } else {
+ return bean;
+ }
+ } // end method getBean( String, Class )
+
+ public Object getBean(String name, Object[] args) throws BeansException {
+ return getBean(name, ((Class)null));
+ }
+
+ public <T> T getBean(Class<T> clazz) throws BeansException {
+ return clazz.cast(getBean(clazz.getName(), clazz));
+ }
+
+ public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> clazz) throws BeansException {
+ return null;
+ }
+
+ public <A extends Annotation> A findAnnotationOnBean(String arg0, Class<A> clazz) {
+ return null;
+ }
+
+ public boolean containsBean(String name) {
+ // TODO
+ return false;
+ }
+
+ public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
+ // TODO
+ return false;
+ }
+
+ public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Class getType(String name) throws NoSuchBeanDefinitionException {
+ return null;
+ }
+
+ public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
+ return EMPTY_ARRAY;
+ }
+
+ public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
+ return null;
+ }
+
+ public String getId() {
+ return this.toString();
+ }
+
+ public String getDisplayName() {
+ return implementation.getURI();
+ }
+
+ public long getStartupDate() {
+ return 0;
+ }
+
+ public boolean containsBeanDefinition(String beanName) {
+ return false;
+ }
+
+ public int getBeanDefinitionCount() {
+ return 0;
+ }
+
+ public String[] getBeanDefinitionNames() {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type) {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
+ return new String[0];
+ }
+
+ public Map getBeansOfType(Class type) throws BeansException {
+ return null;
+ }
+
+ public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
+ return null;
+ }
+
+ public boolean isPrototype(String theString) {
+ return false;
+ }
+
+ public BeanFactory getParentBeanFactory() {
+ return null;
+ }
+
+ public boolean containsLocalBean(String name) {
+ return false;
+ }
+
+ public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
+ return null;
+ }
+
+ public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public void publishEvent(ApplicationEvent event) {
+
+ }
+
+ public Resource[] getResources(String locationPattern) throws IOException {
+ return new Resource[0];
+ }
+
+ public Resource getResource(String location) {
+ return null;
+ }
+
+ public ClassLoader getClassLoader() {
+ // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
+ // resource loading mechanism is exposed right now.
+ return this.getClass().getClassLoader();
+ }
+
+ @Override
+ public ApplicationContext getParent() {
+ return implementation.getParentApplicationContext();
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java
new file mode 100644
index 0000000..2d18b5a
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringApplicationContextAccessor.java
@@ -0,0 +1,41 @@
+/*
+ * 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.sca.implementation.spring.context;
+
+import org.springframework.context.ApplicationContext;
+
+/**
+ * A utility to receive the parent Spring application context
+ */
+public interface SpringApplicationContextAccessor {
+ /**
+ * Get the parent Spring application context for the hosting environment. This will be used as the parent
+ * application context for implementation.spring components
+ * @return The parent application context
+ */
+ ApplicationContext getParentApplicationContext();
+
+ /**
+ * Set the root Spring application context. This is particually useful for Spring web integration where Spring
+ * creates WebApplicationContext and keeps it in the ServletContext
+ * @param parentApplicationContext The parent application context
+ */
+ void setParentApplicationContext(ApplicationContext parentApplicationContext);
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringContextWrapper.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringContextWrapper.java
new file mode 100644
index 0000000..4b0ad72
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/context/SpringContextWrapper.java
@@ -0,0 +1,130 @@
+/*
+ * 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.sca.implementation.spring.context;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.ConstructorAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.provider.ComponentWrapper;
+import org.apache.tuscany.sca.implementation.spring.provider.PropertyValueWrapper;
+import org.apache.tuscany.sca.implementation.spring.provider.SpringImplementationWrapper;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+/**
+ * This is the runtime side tie for the corresponding tuscany side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextStub class
+ * in the implementation-spring module for what the stub does.
+ */
+public class SpringContextWrapper {
+
+ private GenericApplicationContext springContext;
+ private SpringImplementationWrapper implementation;
+
+ public SpringContextWrapper(SpringImplementationWrapper implementation, List<URL> resource) {
+ this.implementation = implementation;
+ SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
+ springContext = createApplicationContext(scaParentContext, resource);
+ }
+
+ public ApplicationContext getApplicationContext() {
+ return springContext;
+ }
+
+ public void start() {
+ // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
+ springContext.refresh();
+ springContext.start();
+ }
+
+ public void close() {
+ springContext.close();
+ if (springContext instanceof GenericApplicationContext) {
+ springContext.stop();
+ }
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+ private GenericApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext,
+ List<URL> resources) {
+
+ GenericApplicationContext appCtx =
+ new SCAGenericApplicationContext(scaParentContext, implementation.getClassLoader());
+ XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
+
+ // REVIEW: [rfeng] How do we control the schema validation
+ xmlReader.setValidating(false);
+
+ for (URL resource : resources) {
+ xmlReader.loadBeanDefinitions(new UrlResource(resource));
+ }
+ xmlReader.setBeanClassLoader(implementation.getClassLoader());
+ includeAnnotationProcessors(appCtx.getBeanFactory());
+ return appCtx;
+
+ }
+
+ public Object getBean(String id) throws BeansException {
+ return springContext.getBean(id);
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+ private void includeAnnotationProcessors(ConfigurableListableBeanFactory beanFactory) {
+
+ // Processor to deal with @Init and @Destroy SCA Annotations
+ BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(initDestroyProcessor);
+
+ // Processor to deal with @Reference SCA Annotations
+ ComponentWrapper component = implementation.getComponentWrapper();
+ BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
+ beanFactory.addBeanPostProcessor(referenceProcessor);
+
+ // Processor to deal with @Property SCA Annotations
+ PropertyValueWrapper pvs = implementation.getPropertyValueWrapper();
+ BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
+ beanFactory.addBeanPostProcessor(propertyProcessor);
+
+ // Processor to deal with @ComponentName SCA Annotations
+ BeanPostProcessor componentNameProcessor =
+ new ComponentNameAnnotationProcessor(implementation.getComponentName());
+ beanFactory.addBeanPostProcessor(componentNameProcessor);
+
+ // Processor to deal with @Constructor SCA Annotations
+ BeanPostProcessor constructorProcessor = new ConstructorAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(constructorProcessor);
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
index f136e45..66cb3c7 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
@@ -16,7 +16,15 @@
*/
package org.apache.tuscany.sca.implementation.spring.namespace;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
/**
* Handler for the <sca:> namespace in an application context
@@ -26,13 +34,60 @@
public class ScaNamespaceHandler extends NamespaceHandlerSupport {
public ScaNamespaceHandler() {
- init();
}
- public final void init() {
+ @Override
+ public void init() {
registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
}
+ private static String getNamespaceURI(Element element, String prefix) {
+ if (element == null) {
+ return null;
+ }
+ String name = ("".equals(prefix)) ? "xmlns" : "xmlns:" + prefix;
+ String ns = element.getAttribute(name);
+ if (ns != null && !"".equals(ns)) {
+ return ns;
+ }
+ Node parent = element.getParentNode();
+ if (parent instanceof Element) {
+ return getNamespaceURI((Element)parent, prefix);
+ } else {
+ return null;
+ }
+ }
+
+ public static List<QName> resolve(Element element, String listOfNames) {
+ List<QName> qnames = new ArrayList<QName>();
+ StringTokenizer tokenizer = new StringTokenizer(listOfNames);
+ while (tokenizer.hasMoreTokens()) {
+ String qname = tokenizer.nextToken();
+ String prefix = "";
+ String local = qname;
+ int index = qname.indexOf(':');
+ if (index != -1) {
+ local = qname.substring(index + 1);
+ prefix = qname.substring(0, index);
+ }
+ String ns = getNamespaceURI(element, prefix);
+ if (ns != null) {
+ qnames.add(new QName(ns, local, prefix));
+ } else {
+ throw new IllegalArgumentException("Prefix " + prefix + "is not bound to a namespace");
+ }
+ }
+ return qnames;
+ }
+
+ public static String getAttribute(Element element, String name) {
+ String attr = element.getAttributeNS(null, name);
+ if ("".equals(attr)) {
+ return null;
+ } else {
+ return attr;
+ }
+ }
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
index 5b1064d..bff0aa8 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
@@ -16,7 +16,10 @@
*/
package org.apache.tuscany.sca.implementation.spring.namespace;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext;
import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@@ -28,8 +31,14 @@
public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAPropertyElement propertyElement =
+ new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
+ context.addSCAPropertyElement(propertyElement);
+ }
// do nothing, this is handled by Tuscany
return null;
}
-
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
index fac0276..ab797c1 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
@@ -16,7 +16,16 @@
*/
package org.apache.tuscany.sca.implementation.spring.namespace;
+import static org.apache.tuscany.sca.implementation.spring.namespace.ScaNamespaceHandler.getAttribute;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext;
import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@@ -29,6 +38,28 @@
public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAReferenceElement referenceElement =
+ new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
+ referenceElement.setDefaultBean(getAttribute(element, "default"));
+
+ String requires = getAttribute(element, "requires");
+ if (requires != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, requires);
+ referenceElement.getIntentNames().addAll(qnames);
+ }
+
+ String policySets = getAttribute(element, "policySets");
+ if (policySets != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, policySets);
+ referenceElement.getPolicySetNames().addAll(qnames);
+ }
+
+ context.addSCAReferenceElement(referenceElement);
+ }
+
// do nothing, this is handled by Tuscany
return null;
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
index 3020dca..6a3beeb 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
@@ -16,7 +16,16 @@
*/
package org.apache.tuscany.sca.implementation.spring.namespace;
+import static org.apache.tuscany.sca.implementation.spring.namespace.ScaNamespaceHandler.getAttribute;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext;
import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@@ -29,6 +38,27 @@
public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAServiceElement serviceElement =
+ new SpringSCAServiceElement(getAttribute(element, "name"), getAttribute(element, "target"));
+ serviceElement.setType(getAttribute(element, "type"));
+
+ String requires = getAttribute(element, "requires");
+ if (requires != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, requires);
+ serviceElement.getIntentNames().addAll(qnames);
+ }
+
+ String policySets = getAttribute(element, "policySets");
+ if (policySets != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, policySets);
+ serviceElement.getPolicySetNames().addAll(qnames);
+ }
+
+ context.addSCAServiceElement(serviceElement);
+ }
// do nothing, handled by Tuscany
return null;
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
index 7613f81..68d49bb 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
@@ -36,13 +36,13 @@
public class ComponentNameAnnotationProcessor implements BeanPostProcessor {
private Class<? extends Annotation> componentNameAnnotationType = ComponentName.class;
-
+
private String componentName;
-
- public ComponentNameAnnotationProcessor (String componentName) {
+
+ public ComponentNameAnnotationProcessor(String componentName) {
this.componentName = componentName;
}
-
+
/**
* Gets componentName annotation type.
*/
@@ -63,8 +63,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
processAnnotation(bean);
return bean;
}
@@ -74,8 +73,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@@ -83,7 +81,7 @@
* <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
*/
protected void processAnnotation(final Object bean) {
-
+
final Class<?> clazz = bean.getClass();
ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
@@ -94,19 +92,20 @@
if (Modifier.isStatic(field.getModifiers())) {
throw new IllegalStateException("ComponentName annotation is not supported on static fields");
}
-
+
if (Modifier.isPrivate(field.getModifiers())) {
throw new IllegalStateException("ComponentName annotation is not supported on private fields");
}
ReflectionUtils.makeAccessible(field);
-
+
if (field.getType().getName().equals("java.lang.String")) {
- Object nameObj = componentName;
+ Object nameObj = componentName;
if (nameObj != null)
ReflectionUtils.setField(field, bean, nameObj);
} else {
- throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
}
}
}
@@ -115,33 +114,35 @@
ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) {
Annotation annotation = method.getAnnotation(getComponentNameAnnotationType());
-
+
if (annotation != null) {
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalStateException("ComponentName annotation is not supported on static methods");
}
-
+
if (Modifier.isPrivate(method.getModifiers())) {
throw new IllegalStateException("ComponentName annotation is not supported on private methods");
}
if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException("ComponentName annotation requires at least one argument: " + method);
+ throw new IllegalStateException(
+ "ComponentName annotation requires at least one argument: " + method);
}
-
- PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
-
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+
if (pd.getPropertyType().getName().equals("java.lang.String")) {
- Object nameObj = componentName;
+ Object nameObj = componentName;
if (nameObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { nameObj });
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {nameObj});
} catch (Throwable e) {
throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
}
}
} else {
- throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
}
}
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java
deleted file mode 100644
index c72ccd6..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.sca.implementation.spring.processor;
-
-import java.lang.reflect.Method;
-
-/**
- * This is the Spring runtime side stub for the corresponding Tuscany tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the ComponentTie class
- * in the implementation-spring module for what the tie does.
- */
-public class ComponentStub {
-
- private Object tie;
- private Method getService;
-
- public ComponentStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getService = tieClass.getMethod("getService", new Class<?>[]{Class.class, String.class});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getService(Class<?> type, String name) {
- try {
-
- return getService.invoke(tie, type, name);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
index 7eb6367..a52a85f 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
@@ -28,15 +28,14 @@
public class ConstructorAnnotationProcessor extends InstantiationAwareBeanPostProcessorAdapter {
- private Class<? extends Annotation> constructorAnnotationType
- = org.oasisopen.sca.annotation.Constructor.class;
-
+ private Class<? extends Annotation> constructorAnnotationType = org.oasisopen.sca.annotation.Constructor.class;
+
private Class<? extends Annotation> autowiredAnnotationType = Autowired.class;
-
- public ConstructorAnnotationProcessor () {
+
+ public ConstructorAnnotationProcessor() {
// Default constructor.
}
-
+
/**
* Set the 'autowired' annotation type, to be used on constructors, fields,
* setter methods and arbitrary config methods.
@@ -52,7 +51,7 @@
protected Class<? extends Annotation> getAutowiredAnnotationType() {
return this.autowiredAnnotationType;
}
-
+
/**
* Return the 'constructor' annotation type.
*/
@@ -73,8 +72,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@@ -83,11 +81,10 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
-
+
public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
/*Constructor[] declaredConstructors = beanClass.getDeclaredConstructors();
Method[] declaredMethods = beanClass.getDeclaredMethods();
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
index f800654..4763714 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
@@ -24,6 +24,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import org.apache.tuscany.sca.implementation.spring.provider.PropertyValueWrapper;
import org.oasisopen.sca.annotation.Property;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
@@ -35,10 +36,10 @@
public class PropertyAnnotationProcessor implements BeanPostProcessor {
private Class<? extends Annotation> propertyAnnotationType = Property.class;
-
- private PropertyValueStub propertyValue;
-
- public PropertyAnnotationProcessor (PropertyValueStub propertyValue) {
+
+ private PropertyValueWrapper propertyValue;
+
+ public PropertyAnnotationProcessor(PropertyValueWrapper propertyValue) {
this.propertyValue = propertyValue;
}
@@ -62,8 +63,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
processAnnotation(bean);
return bean;
}
@@ -73,8 +73,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@@ -82,27 +81,29 @@
* <p>Processes a beans fields for injection if it has a {@link Property} annotation.</p>
*/
protected void processAnnotation(final Object bean) {
-
- final Class<?> clazz = bean.getClass();
+
+ final Class<?> clazz = bean.getClass();
ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) {
- Property annotation = (Property) method.getAnnotation(getPropertyAnnotationType());
-
+ Property annotation = (Property)method.getAnnotation(getPropertyAnnotationType());
+
if (annotation != null) {
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalStateException("Property annotation is not supported on static methods");
}
-
+
+ /*
if (Modifier.isPrivate(method.getModifiers())) {
throw new IllegalStateException("Property annotation is not supported on private methods");
}
+ */
if (method.getParameterTypes().length == 0) {
throw new IllegalStateException("Property annotation requires at least one argument: " + method);
}
-
+
PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
if (pd != null) {
String propName = annotation.name();
@@ -115,47 +116,49 @@
}
}
});
-
+
ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
public void doWith(Field field) {
- Property annotation = (Property) field.getAnnotation(getPropertyAnnotationType());
-
+ Property annotation = (Property)field.getAnnotation(getPropertyAnnotationType());
+
if (annotation != null) {
if (Modifier.isStatic(field.getModifiers())) {
throw new IllegalStateException("Property annotation is not supported on static fields");
}
-
+
+ /*
if (Modifier.isPrivate(field.getModifiers())) {
throw new IllegalStateException("Property annotation is not supported on private fields");
}
+ */
ReflectionUtils.makeAccessible(field);
-
+
Object propertyObj = null;
String propName = annotation.name();
if ("".equals(propName)) {
- propertyObj = propertyValue.getPropertyObj(field.getType(), field.getName());
+ propertyObj = propertyValue.getPropertyObj(field.getType(), field.getName());
} else {
propertyObj = propertyValue.getPropertyObj(field.getType(), propName);
}
-
+
if (propertyObj != null)
ReflectionUtils.setField(field, bean, propertyObj);
}
}
});
}
-
+
public void injectProperty(Object bean, PropertyDescriptor pd, Object propertyObj) {
-
+
if (propertyObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { propertyObj });
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {propertyObj});
} catch (Throwable e) {
throw new FatalBeanException("Problem injecting property: " + e.getMessage(), e);
}
}
}
-
+
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java
deleted file mode 100644
index ea8f560..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.sca.implementation.spring.processor;
-
-import java.lang.reflect.Method;
-
-/**
- * This is the Spring runtime side stub for the corresponding Tuscany tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the PropertyValueTie class
- * in the implementation-spring module for what the tie does.
- */
-public class PropertyValueStub {
-
- private Object tie;
- private Method getPropertyObj;
-
- public PropertyValueStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getPropertyObj = tieClass.getMethod("getPropertyObj", new Class<?>[]{Class.class, String.class});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getPropertyObj(Class<?> propertyType, String name) {
- try {
-
- return getPropertyObj.invoke(tie, propertyType, name);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
index dd43d63..ad79db8 100644
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
@@ -24,6 +24,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import org.apache.tuscany.sca.implementation.spring.provider.ComponentWrapper;
import org.oasisopen.sca.annotation.Reference;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
@@ -35,12 +36,12 @@
public class ReferenceAnnotationProcessor implements BeanPostProcessor {
private Class<? extends Annotation> referenceAnnotationType = Reference.class;
- private ComponentStub component;
-
- public ReferenceAnnotationProcessor (ComponentStub component) {
+ private ComponentWrapper component;
+
+ public ReferenceAnnotationProcessor(ComponentWrapper component) {
this.component = component;
}
-
+
/**
* Gets referece annotation type.
*/
@@ -61,8 +62,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
processAnnotation(bean);
return bean;
}
@@ -72,8 +72,7 @@
*
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
*/
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
@@ -81,27 +80,30 @@
* <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
*/
protected void processAnnotation(final Object bean) {
-
- final Class<?> clazz = bean.getClass();
+
+ final Class<?> clazz = bean.getClass();
ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
public void doWith(Method method) {
- Reference annotation = (Reference) method.getAnnotation(getReferenceAnnotationType());
-
+ Reference annotation = (Reference)method.getAnnotation(getReferenceAnnotationType());
+
if (annotation != null) {
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalStateException("Reference annotation is not supported on static methods");
}
-
+
+ /*
if (Modifier.isPrivate(method.getModifiers())) {
throw new IllegalStateException("Reference annotation is not supported on private methods");
}
+ */
if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException("Reference annotation requires at least one argument: " + method);
+ throw new IllegalStateException(
+ "Reference annotation requires at least one argument: " + method);
}
-
+
PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
if (pd != null) {
String refName = annotation.name();
@@ -114,31 +116,33 @@
}
}
});
-
+
ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
public void doWith(Field field) {
- Reference annotation = (Reference) field.getAnnotation(getReferenceAnnotationType());
-
+ Reference annotation = (Reference)field.getAnnotation(getReferenceAnnotationType());
+
if (annotation != null) {
if (Modifier.isStatic(field.getModifiers())) {
throw new IllegalStateException("Reference annotation is not supported on static fields");
}
-
+
+ /*
if (Modifier.isPrivate(field.getModifiers())) {
throw new IllegalStateException("Reference annotation is not supported on private fields");
}
+ */
ReflectionUtils.makeAccessible(field);
-
+
Object referenceObj = null;
String refName = annotation.name();
if ("".equals(refName)) {
referenceObj = component.getService(field.getType(), field.getName());
} else {
referenceObj = component.getService(field.getType(), refName);
- }
-
+ }
+
if (referenceObj != null)
ReflectionUtils.setField(field, bean, referenceObj);
}
@@ -150,12 +154,12 @@
* Processes a property descriptor to inject a service.
*/
public void injectReference(Object bean, PropertyDescriptor pd, String name) {
-
+
Object referenceObj = component.getService(pd.getPropertyType(), name);
-
+
if (referenceObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { referenceObj });
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {referenceObj});
} catch (Throwable e) {
throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLBeanDefinitionLoaderImpl.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLBeanDefinitionLoaderImpl.java
new file mode 100644
index 0000000..6ba2c65
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/SpringXMLBeanDefinitionLoaderImpl.java
@@ -0,0 +1,79 @@
+/*
+ * 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.sca.implementation.spring.processor;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.apache.tuscany.sca.implementation.spring.context.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+/**
+ * A tie that allows Tuscany to call Spring library to load the application context for the purpose of introspection
+ */
+public class SpringXMLBeanDefinitionLoaderImpl implements SpringXMLBeanDefinitionLoader {
+
+ private static SCAGenericApplicationContext createApplicationContext(Object scaParentContext,
+ ClassLoader classLoader,
+ List<URL> resources) {
+ if (classLoader == null) {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ SCAGenericApplicationContext appCtx =
+ new SCAGenericApplicationContext((ApplicationContext)scaParentContext, classLoader);
+ XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
+
+ // REVIEW: [rfeng] How do we control the schema validation
+ xmlReader.setValidating(false);
+
+ for (URL resource : resources) {
+ xmlReader.loadBeanDefinitions(new UrlResource(resource));
+ }
+
+ return appCtx;
+
+ }
+
+ @Override
+ public Object load(List<URL> resources,
+ List<SpringSCAServiceElement> serviceElements,
+ List<SpringSCAReferenceElement> referenceElements,
+ List<SpringSCAPropertyElement> propertyElements,
+ List<SpringBeanElement> beanElements,
+ ProcessorContext context) {
+ // FIXME: [rfeng] We should try to avoid parsing the Spring xml twice for the deployment and runtime
+ SCAGenericApplicationContext applicationContext = createApplicationContext(null, null, resources);
+ serviceElements.addAll(applicationContext.getServiceElements());
+ referenceElements.addAll(applicationContext.getReferenceElements());
+ propertyElements.addAll(applicationContext.getPropertyElements());
+ beanElements.addAll(applicationContext.getBeanElements());
+ return applicationContext;
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/ComponentWrapper.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/ComponentWrapper.java
new file mode 100644
index 0000000..5bddd8a
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/ComponentWrapper.java
@@ -0,0 +1,38 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+/**
+ * Wrapper for the Component
+ */
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+public class ComponentWrapper {
+
+ private RuntimeComponent component;
+
+ public ComponentWrapper(RuntimeComponent component) {
+ this.component = component;
+ }
+
+ public Object getService(Class<?> type, String name) {
+ return component.getComponentContext().getService(type, name);
+ }
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/PropertyValueWrapper.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/PropertyValueWrapper.java
new file mode 100644
index 0000000..eca1492
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/PropertyValueWrapper.java
@@ -0,0 +1,50 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * Wrapper for PropertyValue
+ */
+public class PropertyValueWrapper {
+
+ private RuntimeComponent component;
+ private PropertyValueFactory propertyFactory;
+
+ public PropertyValueWrapper(RuntimeComponent component, PropertyValueFactory propertyFactory) {
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ }
+
+ public Object getPropertyObj(Class<?> type, String name) {
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ return propertyFactory.createPropertyValue(prop, type);
+ }
+ }
+ return null; // property name not found
+ }
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProvider.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProvider.java
new file mode 100644
index 0000000..db78313
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProvider.java
@@ -0,0 +1,81 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.spring.context.SpringContextWrapper;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * A provider class for runtime Spring implementation instances
+ * @version $Rev$ $Date$
+ */
+public class SpringImplementationProvider implements ImplementationProvider {
+ private RuntimeComponent component;
+
+ // A Spring application context object
+ private SpringContextWrapper springContext;
+
+ /**
+ * Constructor for the provider - takes a component definition and a Spring implementation
+ * description
+ * @param component - the component in the assembly
+ * @param implementation - the implementation
+ */
+ public SpringImplementationProvider(RuntimeComponent component,
+ SpringImplementationWrapper implementation,
+ ApplicationContext parentApplicationContext,
+ ProxyFactory proxyService,
+ PropertyValueFactory propertyValueObjectFactory) {
+ super();
+ this.component = component;
+
+ springContext = new SpringContextWrapper(implementation, implementation.getResource());
+
+ } // end constructor
+
+ public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
+ return new SpringInvoker(component, springContext, service, operation);
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+ /**
+ * Start this Spring implementation instance
+ */
+ public void start() {
+ springContext.start();
+ }
+
+ /**
+ * Stop this implementation instance
+ */
+ public void stop() {
+ springContext.close();
+ }
+
+} // end class SpringImplementationProvider
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java
new file mode 100644
index 0000000..be16fb3
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationProviderFactory.java
@@ -0,0 +1,78 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.implementation.spring.context.SpringApplicationContextAccessor;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * ImplementationProviderFactory for Spring implementation type
+ * @version $Rev$ $Date$
+ *
+ */
+public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
+ private ProxyFactory proxyFactory;
+ private PropertyValueFactory propertyFactory;
+ private SpringApplicationContextAccessor contextAccessor;
+
+ /**
+ * Simple constructor
+ *
+ */
+ public SpringImplementationProviderFactory(ExtensionPointRegistry registry) {
+ super();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ contextAccessor = utilities.getUtility(SpringApplicationContextAccessor.class);
+ proxyFactory = ExtensibleProxyFactory.getInstance(registry);
+ propertyFactory = utilities.getUtility(PropertyValueFactory.class);
+ }
+
+ /**
+ * Returns a SpringImplementationProvider for a given component and Spring implementation
+ * @param component the component for which implementation instances are required
+ * @param implementation the Spring implementation with details of the component
+ * implementation
+ * @return the SpringImplementationProvider for the specified component
+ */
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component,
+ SpringImplementation implementation) {
+ ApplicationContext parentApplicationContext =
+ (contextAccessor != null) ? contextAccessor.getParentApplicationContext() : null;
+ SpringImplementationWrapper tie =
+ new SpringImplementationWrapper(implementation, parentApplicationContext, component, propertyFactory);
+ return new SpringImplementationProvider(component, tie, parentApplicationContext, proxyFactory, propertyFactory);
+ }
+
+ /**
+ * Returns the class of the Spring implementation
+ */
+ public Class<SpringImplementation> getModelType() {
+ return SpringImplementation.class;
+ }
+
+} // end class SpringImplementationProviderFactory
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationWrapper.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationWrapper.java
new file mode 100644
index 0000000..e5593f5
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringImplementationWrapper.java
@@ -0,0 +1,158 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * Wrapper for SpringImplementation
+ */
+public class SpringImplementationWrapper {
+
+ private SpringImplementation implementation;
+ private ApplicationContext parentApplicationContext;
+ private RuntimeComponent component;
+ private PropertyValueFactory propertyFactory;
+
+ public SpringImplementationWrapper(SpringImplementation implementation,
+ ApplicationContext parentApplicationContext,
+ RuntimeComponent component,
+ PropertyValueFactory propertyFactory) {
+ this.implementation = implementation;
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ this.parentApplicationContext = parentApplicationContext;
+ }
+
+ public String getURI() {
+ return implementation.getURI();
+ }
+
+ public List<URL> getResource() {
+ return implementation.getResource();
+ }
+
+ public String getComponentName() {
+ return component.getName();
+ }
+
+ /**
+ * Method to create a Java Bean for a Property value
+ * @param <B> the class type of the Bean
+ * @param requiredType - a Class object for the required type
+ * @param name - the Property name
+ * @return - a Bean of the specified property, with value set
+ */
+ private <B> B getPropertyBean(Class<?> requiredType, String name) {
+ B propertyObject = null;
+ // Get the component's list of properties
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ // On finding the property, create a factory for it and create a Bean using
+ // the factory
+ propertyObject = (B)propertyFactory.createPropertyValue(prop, requiredType);
+ } // end if
+ } // end for
+
+ return propertyObject;
+ }
+
+ /**
+ * Creates a proxy Bean for a reference
+ * @param <B> the Business interface type for the reference
+ * @param businessInterface - the business interface as a Class
+ * @param referenceName - the name of the Reference
+ * @return an Bean of the type defined by <B>
+ */
+ private <B> B getService(Class<B> businessInterface, String referenceName) {
+ return component.getComponentContext().getService(businessInterface, referenceName);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class<?> requiredType) {
+ // The expectation is that the requested Bean is either a reference or a property
+ // from the Spring context
+ for (Reference reference : implementation.getReferences()) {
+ if (reference.getName().equals(name)) {
+ // Extract the Java interface for the reference (it can't be any other interface type
+ // for a Spring application context)
+ if (requiredType == null) {
+ JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
+ requiredType = javaInterface.getJavaClass();
+ }
+ // Create and return the proxy for the reference
+ return getService(requiredType, reference.getName());
+ } // end if
+ } // end for
+
+ // For a property, get the name and the required Java type and create a Bean
+ // of that type with the value inserted.
+ for (Property property : implementation.getProperties()) {
+ if (property.getName().equals(name)) {
+ if (requiredType == null) {
+ // The following code only deals with a subset of types and was superceded
+ // by the information from the implementation (which uses Classes as found
+ // in the Spring implementation itself.
+ //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
+ requiredType = implementation.getPropertyClass(name);
+ }
+ return getPropertyBean(requiredType, property.getName());
+ } // end if
+ } // end for
+ // TODO: NoSuchBeanException
+ // throw new RuntimeException("Unable to find Bean with name " + name);
+ return null;
+
+ } // end method getBean( String, Class )
+
+ public ComponentWrapper getComponentWrapper() {
+ return new ComponentWrapper(component);
+ }
+
+ public PropertyValueWrapper getPropertyValueWrapper() {
+ return new PropertyValueWrapper(component, propertyFactory);
+ }
+
+ public ClassLoader getClassLoader() {
+ return implementation.getClassLoader();
+ }
+
+ public ApplicationContext getParentApplicationContext() {
+ return parentApplicationContext;
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvocationException.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvocationException.java
new file mode 100644
index 0000000..0e1d3f5
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvocationException.java
@@ -0,0 +1,40 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SpringInvocationException extends Exception {
+
+ private static final long serialVersionUID = -1157790036638157513L;
+
+ public SpringInvocationException(String msg) {
+ super(msg);
+ }
+
+ public SpringInvocationException(Throwable e) {
+ super(e);
+ }
+
+ public SpringInvocationException(String msg, Throwable e) {
+ super(msg, e);
+ }
+
+}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvoker.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvoker.java
new file mode 100644
index 0000000..ea1d6e6
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/SpringInvoker.java
@@ -0,0 +1,126 @@
+/*
+ * 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.sca.implementation.spring.provider;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.implementation.spring.context.SpringContextWrapper;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * Initial implementation of a Spring bean invoker
+ * @version $Rev$ $Date$
+ */
+public class SpringInvoker implements Invoker {
+
+ private Method theMethod = null;
+ private Object bean;
+ private SpringBeanElement beanElement;
+ private boolean badInvoker = false;
+
+ private SpringContextWrapper springContext;
+ private Operation operation;
+
+ /**
+ * SpringInvoker constructor
+ * @param component - the Spring component to invoke
+ * @param service - the service to invoke
+ * @param operation - the operation to invoke
+ */
+ public SpringInvoker(RuntimeComponent component,
+ SpringContextWrapper springContext,
+ RuntimeComponentService service,
+ Operation operation) {
+
+ this.springContext = springContext;
+ this.operation = operation;
+
+ // From the component and the service, identify the Spring Bean which is the target
+ SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
+ beanElement = theImplementation.getBeanFromService(service.getService());
+
+ if (beanElement == null) {
+ badInvoker = true;
+ return;
+ }
+
+ } // end constructor SpringInvoker
+
+ // Lazy-load the method to avoid timing problems with the Spring Context
+ private void setupMethod() throws SpringInvocationException {
+ try {
+ bean = springContext.getBean(beanElement.getId());
+ Class<?> beanClass = bean.getClass();
+ theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
+ //System.out.println("SpringInvoker - found method " + theMethod.getName() );
+ } catch (NoSuchMethodException e) {
+ throw new SpringInvocationException(e);
+ }
+ }
+
+ private Object doInvoke(Object payload) throws SpringInvocationException {
+ if (theMethod == null)
+ setupMethod();
+
+ if (badInvoker)
+ throw new SpringInvocationException("Spring invoker incorrectly configured");
+ // Invoke the method on the Spring bean using the payload, returning the results
+ try {
+ Object ret;
+
+ if (payload != null && !payload.getClass().isArray()) {
+ ret = theMethod.invoke(bean, payload);
+ } else {
+ ret = theMethod.invoke(bean, (Object[])payload);
+ }
+ return ret;
+ } catch (InvocationTargetException e) {
+ throw new SpringInvocationException("Spring invoker invoke method '" + theMethod.getName() + "' error.",
+ e.getCause());
+ } catch (Exception e) {
+ throw new SpringInvocationException("Spring invoker invoke method '" + theMethod.getName() + "' error.", e);
+ }
+
+ } // end method doInvoke
+
+ /**
+ * @param msg the message to invoke on the target bean
+ */
+ public Message invoke(Message msg) {
+ try {
+ Object resp = doInvoke(msg.getBody());
+ msg.setBody(resp);
+ } catch (SpringInvocationException e) {
+ msg.setFaultBody(e.getCause());
+ } catch (Throwable e) {
+ msg.setFaultBody(e);
+ }
+ //System.out.println("Spring Invoker - invoke called");
+ return msg;
+ } // end method invoke
+
+} // end class SpringInvoker
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAGenericApplicationContext.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAGenericApplicationContext.java
deleted file mode 100644
index 6426306..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAGenericApplicationContext.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.sca.implementation.spring.runtime.context;
-
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-
-public class SCAGenericApplicationContext extends GenericApplicationContext {
-
- ClassLoader classloader = null;
-
- public SCAGenericApplicationContext(DefaultListableBeanFactory beanFactory,
- ApplicationContext parent,
- ClassLoader classloader) {
- super(beanFactory, parent);
- this.classloader = classloader;
- }
-
- public SCAGenericApplicationContext(ApplicationContext parent,
- ClassLoader classloader) {
- super(parent);
- this.classloader = classloader;
- }
-
- @Override
- protected void postProcessBeanFactory (ConfigurableListableBeanFactory beanFactory) {
- beanFactory.setBeanClassLoader(classloader);
- }
-}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java
deleted file mode 100644
index 36f1f6d..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * 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.sca.implementation.spring.runtime.context;
-
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.util.Locale;
-import java.util.Map;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.MessageSourceResolvable;
-import org.springframework.context.NoSuchMessageException;
-import org.springframework.core.io.Resource;
-
-/**
- * A Spring ParentApplicationContext for a given Spring Implementation
- *
- * The Parent application context is responsible for handling those entities within a Spring
- * application context that actually belong to SCA rather than to Spring. The principal things
- * are Properties and References. These may be present either through explicit <sca:property/>
- * and <sca:reference/> elements in the application context or they may be implicit through
- * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
- * context that must provide Spring beans that correspond to the property or reference, as derived
- * from the SCA composite in which the Spring application context is an implementation.
- *
- * @version $Rev$ $Date$
- */
-class SCAParentApplicationContext implements ApplicationContext {
-
- // The Spring implementation for which this is the parent application context
- private SpringImplementationStub implementation;
-
- private static final String[] EMPTY_ARRAY = new String[0];
-
- public SCAParentApplicationContext(SpringImplementationStub implementation) {
- this.implementation = implementation;
- } // end constructor
-
- public Object getBean(String name) throws BeansException {
- return getBean(name, (Class) null);
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class requiredType) throws BeansException {
- return implementation.getBean(name, requiredType);
- } // end method getBean( String, Class )
-
- public Object getBean(String name, Object[] args) throws BeansException {
- return getBean(name, ((Class)null));
- }
-
- public <T> T getBean(Class<T> clazz) throws BeansException {
- return clazz.cast(implementation.getBean(clazz.getName(), clazz));
- }
-
- public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> clazz) throws BeansException {
- return null;
- }
-
- public <A extends Annotation> A findAnnotationOnBean(String arg0, Class<A> clazz) {
- return null;
- }
-
- public boolean containsBean(String name) {
- // TODO
- return false;
- }
-
- public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
- // TODO
- return false;
- }
-
- public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
- throw new UnsupportedOperationException();
- }
-
- public Class getType(String name) throws NoSuchBeanDefinitionException {
- return null;
- }
-
- public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
- return EMPTY_ARRAY;
- }
-
- public ApplicationContext getParent() {
- return null;
- }
-
- public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
- return null;
- }
-
- public String getId() {
- return this.toString();
- }
-
- public String getDisplayName() {
- return implementation.getURI();
- }
-
- public long getStartupDate() {
- return 0;
- }
-
- public boolean containsBeanDefinition(String beanName) {
- return false;
- }
-
- public int getBeanDefinitionCount() {
- return 0;
- }
-
- public String[] getBeanDefinitionNames() {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type) {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
- return new String[0];
- }
-
- public Map getBeansOfType(Class type) throws BeansException {
- return null;
- }
-
- public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
- return null;
- }
-
- public boolean isPrototype(String theString) {
- return false;
- }
-
- public BeanFactory getParentBeanFactory() {
- return null;
- }
-
- public boolean containsLocalBean(String name) {
- return false;
- }
-
- public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
- return null;
- }
-
- public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public void publishEvent(ApplicationEvent event) {
-
- }
-
- public Resource[] getResources(String locationPattern) throws IOException {
- return new Resource[0];
- }
-
- public Resource getResource(String location) {
- return null;
- }
-
- public ClassLoader getClassLoader() {
- // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
- // resource loading mechanism is exposed right now.
- return this.getClass().getClassLoader();
- }
-}
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
deleted file mode 100644
index 77681b6..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.sca.implementation.spring.runtime.context;
-
-import java.net.URL;
-import java.util.List;
-
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ConstructorAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.UrlResource;
-
-/**
- * This is the runtime side tie for the corresponding tuscany side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the SpringContextStub class
- * in the implementation-spring module for what the stub does.
- */
-public class SpringContextTie {
-
- private AbstractApplicationContext springContext;
- private SpringImplementationStub implementation;
-
- public SpringContextTie(SpringImplementationStub implementation, List<URL> resource) {
- this.implementation = implementation;
- SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
- springContext = createApplicationContext(scaParentContext, resource);
- }
-
- public void start() {
- // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
- springContext.refresh();
- springContext.start();
- }
-
- public void close() {
- springContext.close();
- if (springContext instanceof GenericApplicationContext) {
- springContext.stop();
- }
- }
-
- /**
- * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
- */
- private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext, List<URL> resources) {
-
- XmlBeanFactory beanFactory = null;
- AbstractApplicationContext appContext = null;
-
- if (resources.size() > 1) {
- GenericApplicationContext appCtx =
- new SCAGenericApplicationContext(scaParentContext, implementation.getClassLoader());
- XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
- for (URL resource : resources) {
- xmlReader.loadBeanDefinitions(new UrlResource(resource));
- }
- xmlReader.setBeanClassLoader(implementation.getClassLoader());
- includeAnnotationProcessors(appCtx.getBeanFactory());
- return appCtx;
- }
-
- // use the generic application context as default
- beanFactory = new XmlBeanFactory(new UrlResource(resources.get(0)));
- beanFactory.setBeanClassLoader(implementation.getClassLoader());
- includeAnnotationProcessors(beanFactory);
- appContext = new SCAGenericApplicationContext(beanFactory,
- scaParentContext,
- implementation.getClassLoader());
- return appContext;
- }
-
- public Object getBean(String id) throws BeansException {
- return springContext.getBean(id);
- }
-
- /**
- * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
- */
- private void includeAnnotationProcessors(ConfigurableListableBeanFactory beanFactory) {
-
- // Processor to deal with @Init and @Destroy SCA Annotations
- BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
- beanFactory.addBeanPostProcessor(initDestroyProcessor);
-
- // Processor to deal with @Reference SCA Annotations
- ComponentStub component = new ComponentStub(implementation.getComponentTie());
- BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
- beanFactory.addBeanPostProcessor(referenceProcessor);
-
- // Processor to deal with @Property SCA Annotations
- PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueTie());
- BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
- beanFactory.addBeanPostProcessor(propertyProcessor);
-
- // Processor to deal with @ComponentName SCA Annotations
- BeanPostProcessor componentNameProcessor = new ComponentNameAnnotationProcessor(implementation.getComponentName());
- beanFactory.addBeanPostProcessor(componentNameProcessor);
-
- // Processor to deal with @Constructor SCA Annotations
- BeanPostProcessor constructorProcessor = new ConstructorAnnotationProcessor();
- beanFactory.addBeanPostProcessor(constructorProcessor);
- }
-
-}
\ No newline at end of file
diff --git a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java b/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
deleted file mode 100644
index af39869..0000000
--- a/modules/implementation-spring-runtime/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 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.sca.implementation.spring.runtime.context;
-
-import java.lang.reflect.Method;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-
-/**
- * This is the runtime side stub for the corresponding Tuscany-side stub class.
- * It enables the Spring code in the runtime module to invoke methods on a
- * Tuscany SpringImplementation without the Spring runtime module
- * needing to know about any Tuscany classes. See the SpringImplementationTie class
- * in the implementation-spring module for what the tie does.
- */
-public class SpringImplementationStub {
-
- Object tie;
- Method getURI;
- Method getBean;
- Method getComponentName;
- Method getComponentTie;
- Method getPropertyValueTie;
- Method getClassLoader;
-
- public SpringImplementationStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getURI = tieClass.getMethod("getURI", new Class<?>[]{});
- getBean = tieClass.getMethod("getBean", new Class<?>[]{String.class, Class.class});
- getComponentName = tieClass.getMethod("getComponentName");
- getComponentTie = tieClass.getMethod("getComponentTie");
- getPropertyValueTie = tieClass.getMethod("getPropertyValueTie");
- getClassLoader = tieClass.getMethod("getClassLoader");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public String getURI() {
- try {
-
- return (String)getURI.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class<?> requiredType) throws BeansException {
- try {
-
- Object bean = getBean.invoke(tie, new Object[] {name, requiredType});
- if (bean == null) {
- throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
- }
- return bean;
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public String getComponentName() {
- try {
-
- return (String)getComponentName.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getComponentTie() {
- try {
-
- return getComponentTie.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getPropertyValueTie() {
- try {
-
- return getPropertyValueTie.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public ClassLoader getClassLoader() {
- try {
-
- return (ClassLoader) getClassLoader.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader b/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader
new file mode 100644
index 0000000..4c8fa09
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org.apache.tuscany.sca.implementation.spring.processor.SpringXMLBeanDefinitionLoaderImpl;ranking=100
\ No newline at end of file
diff --git a/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
new file mode 100644
index 0000000..e6c8d70
--- /dev/null
+++ b/modules/implementation-spring-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the implementation extension
+org.apache.tuscany.sca.implementation.spring.provider.SpringImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.spring.SpringImplementation;ranking=100
+
diff --git a/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers b/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers
index 6d29e21..1e1f558 100644
--- a/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers
+++ b/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers
@@ -1 +1,2 @@
http\://www.springframework.org/schema/sca=org.apache.tuscany.sca.implementation.spring.namespace.ScaNamespaceHandler
+http\://docs.oasis-open.org/ns/opencsa/sca-j/spring/200810=org.apache.tuscany.sca.implementation.spring.namespace.ScaNamespaceHandler
diff --git a/modules/binding-rss-runtime/LICENSE b/modules/implementation-spring-stub/LICENSE
similarity index 100%
copy from modules/binding-rss-runtime/LICENSE
copy to modules/implementation-spring-stub/LICENSE
diff --git a/modules/implementation-spring-stub/META-INF/MANIFEST.MF b/modules/implementation-spring-stub/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..b2b2091
--- /dev/null
+++ b/modules/implementation-spring-stub/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Spring Implementation Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Spring Implementation Model
+Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.impl;version="2.0.0",
+ org.apache.tuscany.sca.context;version="2.0.0",
+ org.apache.tuscany.sca.contribution.processor;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.core.invocation;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring.xml;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.oasisopen.sca;version="2.0.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.spring.stub
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/modules/implementation-spring-stub/NOTICE b/modules/implementation-spring-stub/NOTICE
new file mode 100644
index 0000000..1325efd
--- /dev/null
+++ b/modules/implementation-spring-stub/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/modules/implementation-spring/README b/modules/implementation-spring-stub/README
similarity index 100%
rename from modules/implementation-spring/README
rename to modules/implementation-spring-stub/README
diff --git a/modules/implementation-spring-stub/pom.xml b/modules/implementation-spring-stub/pom.xml
new file mode 100644
index 0000000..91d18af
--- /dev/null
+++ b/modules/implementation-spring-stub/pom.xml
@@ -0,0 +1,56 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-spring-stub</artifactId>
+ <name>Apache Tuscany SCA Spring Implementation Runtime Stub</name>
+
+ <dependencies>
+
+ <!-- **************************************** -->
+ <!-- * * -->
+ <!-- * DONT ADD ANY SPRING DEPENDENCIES!!! * -->
+ <!-- * * -->
+ <!-- * See the README for details why not * -->
+ <!-- * * -->
+ <!-- * * -->
+ <!-- **************************************** -->
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/stub/SpringXMLBeanDefinitionLoaderStub.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/stub/SpringXMLBeanDefinitionLoaderStub.java
new file mode 100644
index 0000000..f34dfb8
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/stub/SpringXMLBeanDefinitionLoaderStub.java
@@ -0,0 +1,92 @@
+/*
+ * 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.sca.implementation.spring.processor.stub;
+
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader;
+import org.oasisopen.sca.ServiceRuntimeException;
+
+/**
+ * This is the Tuscany side stub for the corresponding runtime tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextTie class
+ * in the implementation-spring-runtime module for what the tie does.
+ */
+public class SpringXMLBeanDefinitionLoaderStub implements SpringXMLBeanDefinitionLoader {
+ private final static String TIE = "org.apache.tuscany.sca.implementation.spring.processor.tie.SpringXMLLoaderTie";
+
+ private static Method createApplicationContext;
+
+ public SpringXMLBeanDefinitionLoaderStub() throws Exception {
+ synchronized (SpringXMLBeanDefinitionLoaderStub.class) {
+ if (createApplicationContext == null) {
+ Class<?> tieClass = Class.forName(TIE, false, Thread.currentThread().getContextClassLoader());
+ createApplicationContext =
+ tieClass.getMethod("createApplicationContext", Object.class, ClassLoader.class, List.class);
+ }
+ }
+ }
+
+ public Object createApplicationContext(Object scaParentContext, ClassLoader classLoader, List<URL> resources)
+ throws Exception {
+ return createApplicationContext.invoke(null, scaParentContext, classLoader, resources);
+ }
+
+ public Object load(List<URL> resources,
+ List<SpringSCAServiceElement> serviceElements,
+ List<SpringSCAReferenceElement> referenceElements,
+ List<SpringSCAPropertyElement> propertyElements,
+ List<SpringBeanElement> beanElements,
+ ProcessorContext context) {
+ try {
+ Object appContext =
+ createApplicationContext(null, Thread.currentThread().getContextClassLoader(), resources);
+ Class<?> cls = appContext.getClass();
+ Method method = cls.getMethod("getElements", Class.class);
+ SpringSCAServiceElement[] serviceArray =
+ (SpringSCAServiceElement[])method.invoke(appContext, SpringSCAServiceElement.class);
+ serviceElements.addAll(Arrays.asList(serviceArray));
+
+ SpringSCAReferenceElement[] referenceArray =
+ (SpringSCAReferenceElement[])method.invoke(appContext, SpringSCAReferenceElement.class);
+ referenceElements.addAll(Arrays.asList(referenceArray));
+
+ SpringSCAPropertyElement[] propertyArray =
+ (SpringSCAPropertyElement[])method.invoke(appContext, SpringSCAPropertyElement.class);
+ propertyElements.addAll(Arrays.asList(propertyArray));
+
+ SpringBeanElement[] beanArray = (SpringBeanElement[])method.invoke(appContext, SpringBeanElement.class);
+ beanElements.addAll(Arrays.asList(beanArray));
+
+ return appContext;
+ } catch (Throwable e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/ComponentTie.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/ComponentTie.java
new file mode 100644
index 0000000..882aa58
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/ComponentTie.java
@@ -0,0 +1,41 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+/**
+ * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the ComponentStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+public class ComponentTie {
+
+ private RuntimeComponent component;
+
+ public ComponentTie(RuntimeComponent component) {
+ this.component = component;
+ }
+
+ public Object getService(Class<?> type, String name) {
+ return component.getComponentContext().getService(type, name);
+ }
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/PropertyValueTie.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/PropertyValueTie.java
new file mode 100644
index 0000000..5e0c526
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/PropertyValueTie.java
@@ -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.sca.implementation.spring.provider.stub;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the PropertyValueStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+public class PropertyValueTie {
+
+ private RuntimeComponent component;
+ private PropertyValueFactory propertyFactory;
+
+ public PropertyValueTie(RuntimeComponent component, PropertyValueFactory propertyFactory) {
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ }
+
+ public Object getPropertyObj(Class<?> type, String name) {
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ return propertyFactory.createPropertyValue(prop, type);
+ }
+ }
+ return null; // property name not found
+ }
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringApplicationContextAccessor.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringApplicationContextAccessor.java
new file mode 100644
index 0000000..84a65bc
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringApplicationContextAccessor.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+/**
+ * A utility to receive the parent Spring application context
+ */
+public interface SpringApplicationContextAccessor {
+ /**
+ * Get the parent Spring application context for the hosting environment. This will be used as the parent
+ * application context for implementation.spring components
+ * @return The parent application context
+ */
+ Object getParentApplicationContext();
+
+ /**
+ * Set the root Spring application context. This is particually useful for Spring web integration where Spring
+ * creates WebApplicationContext and keeps it in the ServletContext
+ * @param parentApplicationContext The parent application context
+ */
+ void setParentApplicationContext(Object parentApplicationContext);
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringContextStub.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringContextStub.java
new file mode 100644
index 0000000..062da4b
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringContextStub.java
@@ -0,0 +1,142 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side stub for the corresponding runtime tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextTie class
+ * in the implementation-spring-runtime module for what the tie does.
+ */
+public class SpringContextStub {
+
+ private static final String SPRING_IMPLEMENTATION_STUB =
+ "org.apache.tuscany.sca.implementation.spring.context.tie.SpringImplementationStub";
+ private static final String SPRING_CONTEXT_TIE =
+ "org.apache.tuscany.sca.implementation.spring.context.tie.SpringContextTie";
+ private Object tie;
+ private Method startMethod;
+ private Method closeMethod;
+ private Method getBeanMethod;
+
+ public SpringContextStub(RuntimeComponent component,
+ SpringImplementation implementation,
+ Object parentApplicationContext,
+ ProxyFactory proxyService,
+ PropertyValueFactory propertyValueObjectFactory) {
+
+ initTie(component, implementation, parentApplicationContext, propertyValueObjectFactory);
+
+ }
+
+ private void initTie(RuntimeComponent component,
+ SpringImplementation implementation,
+ Object parentApplicationContext,
+ PropertyValueFactory propertyValueObjectFactory) {
+
+ // TODO: what class loader to use?
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+ try {
+
+ Class<?> stubClass = Class.forName(SPRING_IMPLEMENTATION_STUB, true, cl);
+ Constructor<?> stubConstructor = stubClass.getConstructor(new Class<?>[] {Object.class});
+ Object stub =
+ stubConstructor.newInstance(new SpringImplementationTie(implementation, parentApplicationContext,
+ component, propertyValueObjectFactory));
+
+ Class<?> tieClass = Class.forName(SPRING_CONTEXT_TIE, true, cl);
+ Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[] {stubClass, List.class});
+ this.tie = tieConstructor.newInstance(stub, implementation.getResource());
+
+ this.startMethod = tieClass.getMethod("start");
+ this.closeMethod = tieClass.getMethod("close");
+ this.getBeanMethod = tieClass.getMethod("getBean", String.class);
+
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (SecurityException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void start() {
+ try {
+ startMethod.invoke(tie);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void close() {
+ try {
+ closeMethod.invoke(tie);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getBean(String id) throws SpringInvocationException {
+ try {
+
+ return getBeanMethod.invoke(tie, id);
+
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProvider.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProvider.java
new file mode 100644
index 0000000..e0207b9
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProvider.java
@@ -0,0 +1,80 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * A provider class for runtime Spring implementation instances
+ * @version $Rev$ $Date$
+ */
+public class SpringImplementationProvider implements ImplementationProvider {
+ private RuntimeComponent component;
+
+ // A Spring application context object
+ private SpringContextStub springContext;
+
+ /**
+ * Constructor for the provider - takes a component definition and a Spring implementation
+ * description
+ * @param component - the component in the assembly
+ * @param implementation - the implementation
+ */
+ public SpringImplementationProvider(RuntimeComponent component,
+ SpringImplementation implementation,
+ Object parentApplicationContext,
+ ProxyFactory proxyService,
+ PropertyValueFactory propertyValueObjectFactory) {
+ super();
+ this.component = component;
+
+ springContext = new SpringContextStub(component, implementation, parentApplicationContext, proxyService, propertyValueObjectFactory);
+
+ } // end constructor
+
+ public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
+ return new SpringInvoker(component, springContext, service, operation);
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+ /**
+ * Start this Spring implementation instance
+ */
+ public void start() {
+ springContext.start();
+ }
+
+ /**
+ * Stop this implementation instance
+ */
+ public void stop() {
+ springContext.close();
+ }
+
+} // end class SpringImplementationProvider
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProviderFactory.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProviderFactory.java
new file mode 100644
index 0000000..d402ff2
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationProviderFactory.java
@@ -0,0 +1,75 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * ImplementationProviderFactory for Spring implementation type
+ * @version $Rev$ $Date$
+ *
+ */
+public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
+ private ProxyFactory proxyFactory;
+ private PropertyValueFactory propertyFactory;
+ private SpringApplicationContextAccessor contextAccessor;
+
+ /**
+ * Simple constructor
+ *
+ */
+ public SpringImplementationProviderFactory(ExtensionPointRegistry registry) {
+ super();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ contextAccessor = utilities.getUtility(SpringApplicationContextAccessor.class);
+ proxyFactory = ExtensibleProxyFactory.getInstance(registry);
+ propertyFactory = utilities.getUtility(PropertyValueFactory.class);
+ }
+
+ /**
+ * Returns a SpringImplementationProvider for a given component and Spring implementation
+ * @param component the component for which implementation instances are required
+ * @param implementation the Spring implementation with details of the component
+ * implementation
+ * @return the SpringImplementationProvider for the specified component
+ */
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component,
+ SpringImplementation implementation) {
+ Object parentApplicationContext =
+ (contextAccessor != null) ? contextAccessor.getParentApplicationContext() : null;
+ return new SpringImplementationProvider(component, implementation, parentApplicationContext, proxyFactory,
+ propertyFactory);
+ }
+
+ /**
+ * Returns the class of the Spring implementation
+ */
+ public Class<SpringImplementation> getModelType() {
+ return SpringImplementation.class;
+ }
+
+} // end class SpringImplementationProviderFactory
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationTie.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationTie.java
new file mode 100644
index 0000000..fc75fae
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringImplementationTie.java
@@ -0,0 +1,156 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side tie for the corresponding runtime stub class.
+ * It enables the Sping code in the runtime module to invoke methods on a
+ * Tuscany SpringImplementation without the Spring runtime module
+ * needing to know about any Tuscany classes. See the SpringImplementationStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+public class SpringImplementationTie {
+
+ private SpringImplementation implementation;
+ private Object parentApplicationContext;
+ private RuntimeComponent component;
+ private PropertyValueFactory propertyFactory;
+
+ public SpringImplementationTie(SpringImplementation implementation,
+ Object parentApplicationContext,
+ RuntimeComponent component,
+ PropertyValueFactory propertyFactory) {
+ this.implementation = implementation;
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ this.parentApplicationContext = parentApplicationContext;
+ }
+
+ public String getURI() {
+ return implementation.getURI();
+ }
+
+ public String getComponentName() {
+ return component.getName();
+ }
+
+ /**
+ * Method to create a Java Bean for a Property value
+ * @param <B> the class type of the Bean
+ * @param requiredType - a Class object for the required type
+ * @param name - the Property name
+ * @return - a Bean of the specified property, with value set
+ */
+ private <B> B getPropertyBean(Class<?> requiredType, String name) {
+ B propertyObject = null;
+ // Get the component's list of properties
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ // On finding the property, create a factory for it and create a Bean using
+ // the factory
+ propertyObject = (B) propertyFactory.createPropertyValue(prop, requiredType);
+ } // end if
+ } // end for
+
+ return propertyObject;
+ }
+
+ /**
+ * Creates a proxy Bean for a reference
+ * @param <B> the Business interface type for the reference
+ * @param businessInterface - the business interface as a Class
+ * @param referenceName - the name of the Reference
+ * @return an Bean of the type defined by <B>
+ */
+ private <B> B getService(Class<B> businessInterface, String referenceName) {
+ return component.getComponentContext().getService(businessInterface, referenceName);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class<?> requiredType) {
+ // The expectation is that the requested Bean is either a reference or a property
+ // from the Spring context
+ for (Reference reference : implementation.getReferences()) {
+ if (reference.getName().equals(name)) {
+ // Extract the Java interface for the reference (it can't be any other interface type
+ // for a Spring application context)
+ if (requiredType == null) {
+ JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
+ requiredType = javaInterface.getJavaClass();
+ }
+ // Create and return the proxy for the reference
+ return getService(requiredType, reference.getName());
+ } // end if
+ } // end for
+
+ // For a property, get the name and the required Java type and create a Bean
+ // of that type with the value inserted.
+ for (Property property : implementation.getProperties()) {
+ if (property.getName().equals(name)) {
+ if (requiredType == null) {
+ // The following code only deals with a subset of types and was superceded
+ // by the information from the implementation (which uses Classes as found
+ // in the Spring implementation itself.
+ //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
+ requiredType = implementation.getPropertyClass(name);
+ }
+ return getPropertyBean(requiredType, property.getName());
+ } // end if
+ } // end for
+ // TODO: NoSuchBeanException
+ // throw new RuntimeException("Unable to find Bean with name " + name);
+ return null;
+
+ } // end method getBean( String, Class )
+
+ public Object getComponentTie() {
+ return new ComponentTie(component);
+ }
+
+ public Object getPropertyValueTie() {
+ return new PropertyValueTie(component, propertyFactory);
+ }
+
+ public ClassLoader getClassLoader() {
+ return implementation.getClassLoader();
+ }
+
+ public Object getParentApplicationContext() {
+ return parentApplicationContext;
+ }
+
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvocationException.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvocationException.java
new file mode 100644
index 0000000..909a640
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvocationException.java
@@ -0,0 +1,40 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SpringInvocationException extends Exception {
+
+ private static final long serialVersionUID = -1157790036638157513L;
+
+ public SpringInvocationException(String msg) {
+ super(msg);
+ }
+
+ public SpringInvocationException(Throwable e) {
+ super(e);
+ }
+
+ public SpringInvocationException(String msg, Throwable e) {
+ super(msg, e);
+ }
+
+}
diff --git a/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvoker.java b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvoker.java
new file mode 100644
index 0000000..7d73eb5
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/java/org/apache/tuscany/sca/implementation/spring/provider/stub/SpringInvoker.java
@@ -0,0 +1,125 @@
+/*
+ * 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.sca.implementation.spring.provider.stub;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * Initial implementation of a Spring bean invoker
+ * @version $Rev$ $Date$
+ */
+public class SpringInvoker implements Invoker {
+
+ private Method theMethod = null;
+ private Object bean;
+ private SpringBeanElement beanElement;
+ private boolean badInvoker = false;
+
+ private SpringContextStub springContext;
+ private Operation operation;
+
+ /**
+ * SpringInvoker constructor
+ * @param component - the Spring component to invoke
+ * @param service - the service to invoke
+ * @param operation - the operation to invoke
+ */
+ public SpringInvoker(RuntimeComponent component,
+ SpringContextStub springContext,
+ RuntimeComponentService service,
+ Operation operation) {
+
+ this.springContext = springContext;
+ this.operation = operation;
+
+ // From the component and the service, identify the Spring Bean which is the target
+ SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
+ beanElement = theImplementation.getBeanFromService(service.getService());
+
+ if (beanElement == null) {
+ badInvoker = true;
+ return;
+ }
+
+ } // end constructor SpringInvoker
+
+ // Lazy-load the method to avoid timing problems with the Spring Context
+ private void setupMethod() throws SpringInvocationException {
+ try {
+ bean = springContext.getBean(beanElement.getId());
+ Class<?> beanClass = bean.getClass();
+ theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
+ //System.out.println("SpringInvoker - found method " + theMethod.getName() );
+ } catch (NoSuchMethodException e) {
+ throw new SpringInvocationException(e);
+ }
+ }
+
+ private Object doInvoke(Object payload) throws SpringInvocationException {
+ if (theMethod == null)
+ setupMethod();
+
+ if (badInvoker)
+ throw new SpringInvocationException("Spring invoker incorrectly configured");
+ // Invoke the method on the Spring bean using the payload, returning the results
+ try {
+ Object ret;
+
+ if (payload != null && !payload.getClass().isArray()) {
+ ret = theMethod.invoke(bean, payload);
+ } else {
+ ret = theMethod.invoke(bean, (Object[])payload);
+ }
+ return ret;
+ } catch (InvocationTargetException e) {
+ throw new SpringInvocationException("Spring invoker invoke method '" + theMethod.getName() + "' error.",
+ e.getCause());
+ } catch (Exception e) {
+ throw new SpringInvocationException("Spring invoker invoke method '" + theMethod.getName() + "' error.", e);
+ }
+
+ } // end method doInvoke
+
+ /**
+ * @param msg the message to invoke on the target bean
+ */
+ public Message invoke(Message msg) {
+ try {
+ Object resp = doInvoke(msg.getBody());
+ msg.setBody(resp);
+ } catch (SpringInvocationException e) {
+ msg.setFaultBody(e.getCause());
+ } catch (Throwable e) {
+ msg.setFaultBody(e);
+ }
+ //System.out.println("Spring Invoker - invoke called");
+ return msg;
+ } // end method invoke
+
+} // end class SpringInvoker
diff --git a/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader b/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader
new file mode 100644
index 0000000..0a46baa
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org.apache.tuscany.sca.implementation.spring.processor.stub.SpringXMLBeanDefinitionLoaderStub;ranking=50
\ No newline at end of file
diff --git a/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
new file mode 100644
index 0000000..e037ea6
--- /dev/null
+++ b/modules/implementation-spring-stub/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the implementation extension
+org.apache.tuscany.sca.implementation.spring.provider.stub.SpringImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.spring.SpringImplementation;ranking=50
+
diff --git a/modules/binding-rss-runtime/LICENSE b/modules/implementation-spring-tie/LICENSE
similarity index 100%
copy from modules/binding-rss-runtime/LICENSE
copy to modules/implementation-spring-tie/LICENSE
diff --git a/modules/implementation-spring-tie/META-INF/MANIFEST.MF b/modules/implementation-spring-tie/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5d45224
--- /dev/null
+++ b/modules/implementation-spring-tie/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Spring Implementation Runtime Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Spring Implementation Runtime Model
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.spring.tie
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Import-Package: org.oasisopen.sca;version="2.0.0",
+ org.oasisopen.sca.annotation;version="2.0.0",
+ org.springframework.beans;version="3.0.2.RELEASE",
+ org.springframework.beans.factory;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.annotation;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.config;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.support;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.xml;version="3.0.2.RELEASE",
+ org.springframework.context;version="3.0.2.RELEASE",
+ org.springframework.context.support;version="3.0.2.RELEASE",
+ org.springframework.core;version="3.0.2.RELEASE",
+ org.springframework.core.io;version="3.0.2.RELEASE",
+ org.springframework.util;version="3.0.2.RELEASE"
+
diff --git a/modules/implementation-spring-tie/NOTICE b/modules/implementation-spring-tie/NOTICE
new file mode 100644
index 0000000..1325efd
--- /dev/null
+++ b/modules/implementation-spring-tie/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/modules/implementation-spring/README b/modules/implementation-spring-tie/README
similarity index 100%
copy from modules/implementation-spring/README
copy to modules/implementation-spring-tie/README
diff --git a/modules/implementation-spring-tie/pom.xml b/modules/implementation-spring-tie/pom.xml
new file mode 100644
index 0000000..9217068
--- /dev/null
+++ b/modules/implementation-spring-tie/pom.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-spring-tie</artifactId>
+ <name>Apache Tuscany SCA Spring Implementation Runtime Tie</name>
+
+ <dependencies>
+
+ <!-- **************************************** -->
+ <!-- * * -->
+ <!-- * DONT ADD ANY TUSCANY DEPENDENCIES!!! * -->
+ <!-- * * -->
+ <!-- * See the README for details why not * -->
+ <!-- * * -->
+ <!-- * * -->
+ <!-- **************************************** -->
+
+ <!-- SCA API dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Spring dependencies... -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>3.0.2.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>3.0.2.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.0.2.RELEASE</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java
new file mode 100644
index 0000000..69e2ee2
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAGenericApplicationContext.java
@@ -0,0 +1,176 @@
+/*
+ * 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.sca.implementation.spring.context.tie;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringConstructorArgElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringElementTie;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAServiceElement;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanReference;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+public class SCAGenericApplicationContext extends GenericApplicationContext {
+
+ private ClassLoader classloader = null;
+ private List<SpringSCAPropertyElement> propertyElements = new ArrayList<SpringSCAPropertyElement>();
+ private List<SpringSCAServiceElement> serviceElements = new ArrayList<SpringSCAServiceElement>();
+ private List<SpringSCAReferenceElement> referenceElements = new ArrayList<SpringSCAReferenceElement>();
+ private List<SpringBeanElement> beanElements;
+
+ public SCAGenericApplicationContext(DefaultListableBeanFactory beanFactory,
+ ApplicationContext parent,
+ ClassLoader classloader) {
+ super(beanFactory, parent);
+ this.classloader = classloader;
+ }
+
+ public SCAGenericApplicationContext(ApplicationContext parent, ClassLoader classloader) {
+ super(parent);
+ this.classloader = classloader;
+ }
+
+ @Override
+ protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
+ beanFactory.setBeanClassLoader(classloader);
+ }
+
+ public void addSCAPropertyElement(SpringSCAPropertyElement propertyElement) {
+ propertyElements.add(propertyElement);
+ }
+
+ public void addSCAServiceElement(SpringSCAServiceElement serviceElement) {
+ serviceElements.add(serviceElement);
+ }
+
+ public void addSCAReferenceElement(SpringSCAReferenceElement referenceElement) {
+ referenceElements.add(referenceElement);
+ }
+
+ public synchronized List<SpringBeanElement> getBeanElements() {
+ if (beanElements == null) {
+ beanElements = new ArrayList<SpringBeanElement>();
+ for (String name : getBeanDefinitionNames()) {
+ BeanDefinition def = getBeanDefinition(name);
+ SpringBeanElement beanElement = new SpringBeanElement(name, def.getBeanClassName());
+ beanElements.add(beanElement);
+ beanElement.setAbstractBean(def.isAbstract());
+ beanElement.setFactoryBeanAttribute(def.getFactoryBeanName() != null);
+ beanElement.setFactoryMethodAttribute(def.getFactoryMethodName() != null);
+ beanElement.setParentAttribute(def.getParentName() != null);
+ beanElement.setInnerBean(beanElement.getId() == null);
+
+ ConstructorArgumentValues args = def.getConstructorArgumentValues();
+ for (Map.Entry<Integer, ValueHolder> e: args.getIndexedArgumentValues().entrySet()) {
+ ValueHolder holder = e.getValue();
+ SpringConstructorArgElement arg = new SpringConstructorArgElement(holder.getType());
+ arg.setIndex(e.getKey());
+ beanElement.addCustructorArgs(arg);
+ }
+
+ MutablePropertyValues values = def.getPropertyValues();
+ for (PropertyValue p : values.getPropertyValueList()) {
+ SpringPropertyElement propertyElement = new SpringPropertyElement(p.getName());
+ Object value = p.getValue();
+ configurePropertyElement(propertyElement, value);
+ beanElement.getProperties().add(propertyElement);
+ }
+ }
+ }
+ return beanElements;
+ }
+
+ public void configurePropertyElement(SpringPropertyElement propertyElement, Object value) {
+ if (value instanceof BeanReference) {
+ BeanReference beanRef = (BeanReference)value;
+ propertyElement.addRef(beanRef.getBeanName());
+ } else if (value instanceof Collection) {
+ Collection collection = (Collection)value;
+ for (Object item : collection) {
+ configurePropertyElement(propertyElement, item);
+ }
+ } else if (value instanceof TypedStringValue) {
+ TypedStringValue stringValue = (TypedStringValue)value;
+ propertyElement.addValue(stringValue.getValue());
+ } else {
+ if (value != null) {
+ propertyElement.addValue(value.toString());
+ }
+ }
+ }
+
+ public List<SpringSCAPropertyElement> getPropertyElements() {
+ return propertyElements;
+ }
+
+ public List<SpringSCAServiceElement> getServiceElements() {
+ return serviceElements;
+ }
+
+ public List<SpringSCAReferenceElement> getReferenceElements() {
+ return referenceElements;
+ }
+
+ public <T> T[] getElements(Class<T> type) {
+ if (type.getSimpleName().equals(SpringSCAPropertyElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getPropertyElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getPropertyElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringSCAReferenceElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getReferenceElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getReferenceElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringSCAServiceElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getServiceElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getServiceElements().get(i), type, type);
+ }
+ return elements;
+ } else if (type.getSimpleName().equals(SpringBeanElement.class.getSimpleName())) {
+ T[] elements = (T[])Array.newInstance(type, getBeanElements().size());
+ for (int i = 0; i < elements.length; i++) {
+ elements[i] = SpringElementTie.copy(getBeanElements().get(i), type, type);
+ }
+ return elements;
+ } else {
+ throw new IllegalArgumentException(type + " is not supported");
+ }
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java
new file mode 100644
index 0000000..d2b35ce
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SCAParentApplicationContext.java
@@ -0,0 +1,212 @@
+/*
+ * 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.sca.implementation.spring.context.tie;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.MessageSourceResolvable;
+import org.springframework.context.NoSuchMessageException;
+import org.springframework.core.io.Resource;
+
+/**
+ * A Spring ParentApplicationContext for a given Spring Implementation
+ *
+ * The Parent application context is responsible for handling those entities within a Spring
+ * application context that actually belong to SCA rather than to Spring. The principal things
+ * are Properties and References. These may be present either through explicit <sca:property/>
+ * and <sca:reference/> elements in the application context or they may be implicit through
+ * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
+ * context that must provide Spring beans that correspond to the property or reference, as derived
+ * from the SCA composite in which the Spring application context is an implementation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCAParentApplicationContext implements ApplicationContext {
+
+ // The Spring implementation for which this is the parent application context
+ private SpringImplementationStub implementation;
+
+ private static final String[] EMPTY_ARRAY = new String[0];
+
+ public SCAParentApplicationContext(SpringImplementationStub implementation) {
+ this.implementation = implementation;
+ } // end constructor
+
+ public Object getBean(String name) throws BeansException {
+ return getBean(name, (Class)null);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class requiredType) throws BeansException {
+ Object bean = implementation.getBean(name, requiredType);
+ if (bean == null && getParent() != null) {
+ bean = getParent().getBean(name, requiredType);
+ }
+ if (bean == null) {
+ throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
+ } else {
+ return bean;
+ }
+ } // end method getBean( String, Class )
+
+ public Object getBean(String name, Object[] args) throws BeansException {
+ return getBean(name, ((Class)null));
+ }
+
+ public <T> T getBean(Class<T> clazz) throws BeansException {
+ return clazz.cast(getBean(clazz.getName(), clazz));
+ }
+
+ public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> clazz) throws BeansException {
+ return null;
+ }
+
+ public <A extends Annotation> A findAnnotationOnBean(String arg0, Class<A> clazz) {
+ return null;
+ }
+
+ public boolean containsBean(String name) {
+ // TODO
+ return false;
+ }
+
+ public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
+ // TODO
+ return false;
+ }
+
+ public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Class getType(String name) throws NoSuchBeanDefinitionException {
+ return null;
+ }
+
+ public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
+ return EMPTY_ARRAY;
+ }
+
+ public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
+ return null;
+ }
+
+ public String getId() {
+ return this.toString();
+ }
+
+ public String getDisplayName() {
+ return implementation.getURI();
+ }
+
+ public long getStartupDate() {
+ return 0;
+ }
+
+ public boolean containsBeanDefinition(String beanName) {
+ return false;
+ }
+
+ public int getBeanDefinitionCount() {
+ return 0;
+ }
+
+ public String[] getBeanDefinitionNames() {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type) {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
+ return new String[0];
+ }
+
+ public Map getBeansOfType(Class type) throws BeansException {
+ return null;
+ }
+
+ public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
+ return null;
+ }
+
+ public boolean isPrototype(String theString) {
+ return false;
+ }
+
+ public BeanFactory getParentBeanFactory() {
+ return null;
+ }
+
+ public boolean containsLocalBean(String name) {
+ return false;
+ }
+
+ public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
+ return null;
+ }
+
+ public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public void publishEvent(ApplicationEvent event) {
+
+ }
+
+ public Resource[] getResources(String locationPattern) throws IOException {
+ return new Resource[0];
+ }
+
+ public Resource getResource(String location) {
+ return null;
+ }
+
+ public ClassLoader getClassLoader() {
+ // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
+ // resource loading mechanism is exposed right now.
+ return this.getClass().getClassLoader();
+ }
+
+ @Override
+ public ApplicationContext getParent() {
+ return implementation.getParentApplicationContext();
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java
new file mode 100644
index 0000000..8bcdc81
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringContextTie.java
@@ -0,0 +1,130 @@
+/*
+ * 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.sca.implementation.spring.context.tie;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ComponentNameAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ComponentStub;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ConstructorAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.InitDestroyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.PropertyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.PropertyValueStub;
+import org.apache.tuscany.sca.implementation.spring.processor.tie.ReferenceAnnotationProcessor;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+/**
+ * This is the runtime side tie for the corresponding tuscany side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextStub class
+ * in the implementation-spring module for what the stub does.
+ */
+public class SpringContextTie {
+
+ private AbstractApplicationContext springContext;
+ private SpringImplementationStub implementation;
+
+ public SpringContextTie(SpringImplementationStub implementation, List<URL> resource) {
+ this.implementation = implementation;
+ SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
+ springContext = createApplicationContext(scaParentContext, resource);
+ }
+
+ public ApplicationContext getApplicationContext() {
+ return springContext;
+ }
+
+ public void start() {
+ // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
+ springContext.refresh();
+ springContext.start();
+ }
+
+ public void close() {
+ springContext.close();
+ if (springContext instanceof GenericApplicationContext) {
+ springContext.stop();
+ }
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+ private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext,
+ List<URL> resources) {
+
+ GenericApplicationContext appCtx =
+ new SCAGenericApplicationContext(scaParentContext, implementation.getClassLoader());
+ XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
+
+ // REVIEW: [rfeng] How do we control the schema validation
+ xmlReader.setValidating(false);
+
+ for (URL resource : resources) {
+ xmlReader.loadBeanDefinitions(new UrlResource(resource));
+ }
+ xmlReader.setBeanClassLoader(implementation.getClassLoader());
+ includeAnnotationProcessors(appCtx.getBeanFactory());
+ return appCtx;
+
+ }
+
+ public Object getBean(String id) throws BeansException {
+ return springContext.getBean(id);
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+ private void includeAnnotationProcessors(ConfigurableListableBeanFactory beanFactory) {
+
+ // Processor to deal with @Init and @Destroy SCA Annotations
+ BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(initDestroyProcessor);
+
+ // Processor to deal with @Reference SCA Annotations
+ ComponentStub component = new ComponentStub(implementation.getComponentTie());
+ BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
+ beanFactory.addBeanPostProcessor(referenceProcessor);
+
+ // Processor to deal with @Property SCA Annotations
+ PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueTie());
+ BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
+ beanFactory.addBeanPostProcessor(propertyProcessor);
+
+ // Processor to deal with @ComponentName SCA Annotations
+ BeanPostProcessor componentNameProcessor =
+ new ComponentNameAnnotationProcessor(implementation.getComponentName());
+ beanFactory.addBeanPostProcessor(componentNameProcessor);
+
+ // Processor to deal with @Constructor SCA Annotations
+ BeanPostProcessor constructorProcessor = new ConstructorAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(constructorProcessor);
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java
new file mode 100644
index 0000000..5ce52e6
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/context/tie/SpringImplementationStub.java
@@ -0,0 +1,146 @@
+/*
+ * 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.sca.implementation.spring.context.tie;
+
+import java.lang.reflect.Method;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * This is the runtime side stub for the corresponding Tuscany-side stub class.
+ * It enables the Spring code in the runtime module to invoke methods on a
+ * Tuscany SpringImplementation without the Spring runtime module
+ * needing to know about any Tuscany classes. See the SpringImplementationTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class SpringImplementationStub {
+
+ Object tie;
+ Method getURI;
+ Method getBean;
+ Method getComponentName;
+ Method getComponentTie;
+ Method getPropertyValueTie;
+ Method getClassLoader;
+ Method getParentApplicationContext;
+
+ public SpringImplementationStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getURI = tieClass.getMethod("getURI", new Class<?>[] {});
+ getBean = tieClass.getMethod("getBean", new Class<?>[] {String.class, Class.class});
+ getComponentName = tieClass.getMethod("getComponentName");
+ getComponentTie = tieClass.getMethod("getComponentTie");
+ getPropertyValueTie = tieClass.getMethod("getPropertyValueTie");
+ getClassLoader = tieClass.getMethod("getClassLoader");
+ getParentApplicationContext = tieClass.getMethod("getParentApplicationContext");
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String getURI() {
+ try {
+
+ return (String)getURI.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class<?> requiredType) throws BeansException {
+ try {
+
+ Object bean = getBean.invoke(tie, new Object[] {name, requiredType});
+// if (bean == null) {
+// throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
+// }
+ return bean;
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String getComponentName() {
+ try {
+
+ return (String)getComponentName.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getComponentTie() {
+ try {
+
+ return getComponentTie.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getPropertyValueTie() {
+ try {
+
+ return getPropertyValueTie.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public ClassLoader getClassLoader() {
+ try {
+
+ return (ClassLoader)getClassLoader.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Get the parent Spring application context set by the Tuscany runtime
+ * @return
+ */
+ public ApplicationContext getParentApplicationContext() {
+ try {
+
+ return (ApplicationContext)getParentApplicationContext.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java
new file mode 100644
index 0000000..020e001
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringBeanElement.java
@@ -0,0 +1,129 @@
+/*
+ * 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.sca.implementation.spring.elements.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <bean> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringBeanElement {
+
+ private String id;
+ private String className = null;
+ private boolean innerBean = false;
+ private boolean abstractBean = false;
+ private boolean parentAttribute = false;
+ private boolean factoryBeanAttribute = false;
+ private boolean factoryMethodAttribute = false;
+
+ private List<SpringPropertyElement> properties = new ArrayList<SpringPropertyElement>();
+ private List<SpringConstructorArgElement> constructorargs = new ArrayList<SpringConstructorArgElement>();
+
+ public SpringBeanElement(String id, String className) {
+ this.id = id;
+ this.className = className;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public List<SpringPropertyElement> getProperties() {
+ return properties;
+ }
+
+ public void addProperty(SpringPropertyElement property) {
+ properties.add(property);
+ }
+
+ public List<SpringConstructorArgElement> getCustructorArgs() {
+ return constructorargs;
+ }
+
+ public void addCustructorArgs(SpringConstructorArgElement args) {
+ constructorargs.add(args);
+ }
+
+ public boolean isInnerBean() {
+ return innerBean;
+ }
+
+ public void setInnerBean(boolean innerBean) {
+ this.innerBean = innerBean;
+ }
+
+ public boolean isAbstractBean() {
+ return abstractBean;
+ }
+
+ public void setAbstractBean(boolean abstractBean) {
+ this.abstractBean = abstractBean;
+ }
+
+ public boolean hasParentAttribute() {
+ return parentAttribute;
+ }
+
+ public void setParentAttribute(boolean parentAttribute) {
+ this.parentAttribute = parentAttribute;
+ }
+
+ public boolean hasFactoryBeanAttribute() {
+ return factoryBeanAttribute;
+ }
+
+ public void setFactoryBeanAttribute(boolean factoryBeanAttribute) {
+ this.factoryBeanAttribute = factoryBeanAttribute;
+ }
+
+ public boolean hasFactoryMethodAttribute() {
+ return factoryMethodAttribute;
+ }
+
+ public void setFactoryMethodAttribute(boolean factoryMethodAttribute) {
+ this.factoryMethodAttribute = factoryMethodAttribute;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringBeanElement [id=").append(id).append(", className=").append(className)
+ .append(", innerBean=").append(innerBean).append(", abstractBean=").append(abstractBean)
+ .append(", parentAttribute=").append(parentAttribute).append(", factoryBeanAttribute=")
+ .append(factoryBeanAttribute).append(", factoryMethodAttribute=").append(factoryMethodAttribute)
+ .append(", properties=").append(properties).append(", constructorargs=").append(constructorargs)
+ .append("]");
+ return builder.toString();
+ }
+
+} // end class SpringBeanElement
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java
new file mode 100644
index 0000000..53a972b
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringConstructorArgElement.java
@@ -0,0 +1,77 @@
+/*
+ * 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.sca.implementation.spring.elements.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <constructor-arg> element in a Spring application-context
+ * - this has ref attribute
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringConstructorArgElement {
+
+ private String type;
+ private int autoIndex = -1;
+ private int index = -1;
+ private List<String> refs = new ArrayList<String>();
+ private List<String> values = new ArrayList<String>();
+
+ public SpringConstructorArgElement(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return this.type;
+ }
+
+ public List<String> getRefs() {
+ return this.refs;
+ }
+
+ public void addRef(String ref) {
+ this.refs.add(ref);
+ }
+
+ public int getIndex() {
+ return this.index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public int getAutoIndex() {
+ return this.autoIndex;
+ }
+
+ public void setAutoIndex(int index) {
+ this.autoIndex = index;
+ }
+
+ public List<String> getValues() {
+ return this.values;
+ }
+
+ public void addValue(String value) {
+ this.values.add(value);
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java
new file mode 100644
index 0000000..c088e5d
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringElementTie.java
@@ -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 org.apache.tuscany.sca.implementation.spring.elements.tie;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A hacking utility to copy beans field by field between two class loaders
+ */
+public class SpringElementTie {
+ public static <T> T copy(Object source, Class<T> cls, Type genericType) {
+ if (source == null) {
+ return null;
+ }
+ if (cls.isPrimitive()) {
+ return (T)source;
+ }
+ if (Collection.class.isAssignableFrom(cls)) {
+ ParameterizedType pType = (ParameterizedType)genericType;
+ Type itemType = pType.getActualTypeArguments()[0];
+ Collection col = (Collection)source;
+ List target = new ArrayList();
+ for (Object item : col) {
+ target.add(copy(item, (Class<?>)itemType, itemType));
+ }
+ return (T)target;
+ }
+ if (cls.isInstance(source)) {
+ return cls.cast(source);
+ }
+ try {
+ Class<?> sourceClass = source.getClass();
+ T target = cls.newInstance();
+ for (Field sourceField : sourceClass.getDeclaredFields()) {
+ sourceField.setAccessible(true);
+ Field targetField = cls.getDeclaredField(sourceField.getName());
+ targetField.setAccessible(true);
+ Object sourceFieldValue = sourceField.get(source);
+ Object targetFieldValue = copy(sourceFieldValue, targetField.getType(), targetField.getGenericType());
+ targetField.set(target, targetFieldValue);
+ }
+ return target;
+ } catch (Throwable e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java
new file mode 100644
index 0000000..c0a1f21
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringPropertyElement.java
@@ -0,0 +1,68 @@
+/*
+ * 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.sca.implementation.spring.elements.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <property> element in a Spring application-context
+ * - this has name and ref attributes
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringPropertyElement {
+
+ private String name;
+ private List<String> refs = new ArrayList<String>();
+ private List<String> values = new ArrayList<String>();
+
+ public SpringPropertyElement(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public List<String> getRefs() {
+ return this.refs;
+ }
+
+ public void addRef(String ref) {
+ this.refs.add(ref);
+ }
+
+ public List<String> getValues() {
+ return this.values;
+ }
+
+ public void addValue(String value) {
+ this.values.add(value);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringPropertyElement [name=").append(name).append(", refs=").append(refs).append(", values=")
+ .append(values).append("]");
+ return builder.toString();
+ }
+
+} // end class SpringPropertyElement
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java
new file mode 100644
index 0000000..3f9901a
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAPropertyElement.java
@@ -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.sca.implementation.spring.elements.tie;
+
+/**
+ * Represents an <sca:property> element in a Spring application-context
+ * - this has name and type attributes
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAPropertyElement {
+
+ private String name;
+ private String type;
+
+ public SpringSCAPropertyElement(String name, String type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAPropertyElement [name=").append(name).append(", type=").append(type).append("]");
+ return builder.toString();
+ }
+
+} // end class SpringPropertyElement
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java
new file mode 100644
index 0000000..0bcbb73
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAReferenceElement.java
@@ -0,0 +1,91 @@
+/*
+ * 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.sca.implementation.spring.elements.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Represents a <sca:reference> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAReferenceElement {
+
+ private String name;
+ private String type;
+ private String defaultBean;
+
+ private List<QName> intentNames = new ArrayList<QName>();
+ private List<QName> policySetNames = new ArrayList<QName>();
+
+
+ public SpringSCAReferenceElement(String name, String type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setDefaultBean(String defaultBean) {
+ this.defaultBean = defaultBean;
+ }
+
+ public String getDefaultBean() {
+ return defaultBean;
+ }
+
+ public List<QName> getIntentNames() {
+ return intentNames;
+ }
+
+ public List<QName> getPolicySetNames() {
+ return policySetNames;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAReferenceElement [name=").append(name).append(", type=").append(type)
+ .append(", defaultBean=").append(defaultBean).append(", intentNames=").append(intentNames)
+ .append(", policySetNames=").append(policySetNames).append("]");
+ return builder.toString();
+ }
+
+
+} // end class SpringSCAReferenceElement
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java
new file mode 100644
index 0000000..2322d19
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/elements/tie/SpringSCAServiceElement.java
@@ -0,0 +1,91 @@
+/*
+ * 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.sca.implementation.spring.elements.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * Represents a <sca:service> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAServiceElement {
+
+ private String name;
+ private String type;
+ private String target;
+
+ private List<QName> intentNames = new ArrayList<QName>();
+ private List<QName> policySetNames = new ArrayList<QName>();
+
+
+ public SpringSCAServiceElement(String name, String target) {
+ this.name = name;
+ this.target = target;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public String getTarget() {
+ return target;
+ }
+
+ public List<QName> getIntentNames() {
+ return intentNames;
+ }
+
+ public List<QName> getPolicySetNames() {
+ return policySetNames;
+ }
+
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAServiceElement [name=").append(name).append(", type=").append(type)
+ .append(", target=").append(target).append(", intentNames=").append(intentNames)
+ .append(", policySetNames=").append(policySetNames).append("]");
+ return builder.toString();
+ }
+
+} // end class SpringSCAServiceElement
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java
new file mode 100644
index 0000000..07c7c6a
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/SCANamespaceHandlerResolver.java
@@ -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.sca.implementation.spring.namespace.tie;
+
+import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
+import org.springframework.beans.factory.xml.NamespaceHandler;
+
+/**
+ * Overrides the default Spring namespace resolver to automatically register
+ * {@link ScaNamespaceHandler} instead of requiring a value to be supplied in a
+ * Spring configuration
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCANamespaceHandlerResolver extends DefaultNamespaceHandlerResolver {
+ private static final String SCA_NAMESPACE = "http://www.springframework.org/schema/sca";
+
+ private ScaNamespaceHandler handler;
+
+ public SCANamespaceHandlerResolver(ClassLoader classLoader) {
+ super(classLoader);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ public SCANamespaceHandlerResolver(String handlerMappingsLocation, ClassLoader classLoader) {
+ super(classLoader, handlerMappingsLocation);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ @Override
+ public NamespaceHandler resolve(String namespaceUri) {
+ if (SCA_NAMESPACE.equals(namespaceUri)) {
+ return handler;
+ }
+ return super.resolve(namespaceUri);
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java
new file mode 100644
index 0000000..27b1811
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaNamespaceHandler.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.sca.implementation.spring.namespace.tie;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Handler for the <sca:> namespace in an application context
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaNamespaceHandler extends NamespaceHandlerSupport {
+
+ public ScaNamespaceHandler() {
+ }
+
+ @Override
+ public void init() {
+ registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
+ registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
+ registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
+ }
+
+ private static String getNamespaceURI(Element element, String prefix) {
+ if (element == null) {
+ return null;
+ }
+ String name = ("".equals(prefix)) ? "xmlns" : "xmlns:" + prefix;
+ String ns = element.getAttribute(name);
+ if (ns != null && !"".equals(ns)) {
+ return ns;
+ }
+ Node parent = element.getParentNode();
+ if (parent instanceof Element) {
+ return getNamespaceURI((Element)parent, prefix);
+ } else {
+ return null;
+ }
+ }
+
+ public static List<QName> resolve(Element element, String listOfNames) {
+ List<QName> qnames = new ArrayList<QName>();
+ StringTokenizer tokenizer = new StringTokenizer(listOfNames);
+ while (tokenizer.hasMoreTokens()) {
+ String qname = tokenizer.nextToken();
+ String prefix = "";
+ String local = qname;
+ int index = qname.indexOf(':');
+ if (index != -1) {
+ local = qname.substring(index + 1);
+ prefix = qname.substring(0, index);
+ }
+ String ns = getNamespaceURI(element, prefix);
+ if (ns != null) {
+ qnames.add(new QName(ns, local, prefix));
+ } else {
+ throw new IllegalArgumentException("Prefix " + prefix + "is not bound to a namespace");
+ }
+ }
+ return qnames;
+ }
+
+ public static String getAttribute(Element element, String name) {
+ String attr = element.getAttributeNS(null, name);
+ if ("".equals(attr)) {
+ return null;
+ } else {
+ return attr;
+ }
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java
new file mode 100644
index 0000000..ad11a30
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaPropertyBeanDefinitionParser.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.sca.implementation.spring.namespace.tie;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAPropertyElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:reference> element
+ * @version $Rev$ $Date$
+ */
+public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAPropertyElement propertyElement =
+ new SpringSCAPropertyElement(element.getAttributeNS(null, "name"), element.getAttributeNS(null, "type"));
+ context.addSCAPropertyElement(propertyElement);
+ }
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java
new file mode 100644
index 0000000..8470d2f
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaReferenceBeanDefinitionParser.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.sca.implementation.spring.namespace.tie;
+
+import static org.apache.tuscany.sca.implementation.spring.namespace.tie.ScaNamespaceHandler.getAttribute;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAReferenceElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:reference> element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAReferenceElement referenceElement =
+ new SpringSCAReferenceElement(getAttribute(element, "name"), getAttribute(element, "type"));
+ referenceElement.setDefaultBean(getAttribute(element, "default"));
+
+ String requires = getAttribute(element, "requires");
+ if (requires != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, requires);
+ referenceElement.getIntentNames().addAll(qnames);
+ }
+
+ String policySets = getAttribute(element, "policySets");
+ if (policySets != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, policySets);
+ referenceElement.getPolicySetNames().addAll(qnames);
+ }
+
+ context.addSCAReferenceElement(referenceElement);
+ }
+
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java
new file mode 100644
index 0000000..9003566
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/tie/ScaServiceBeanDefinitionParser.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed 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.sca.implementation.spring.namespace.tie;
+
+import static org.apache.tuscany.sca.implementation.spring.namespace.tie.ScaNamespaceHandler.getAttribute;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.apache.tuscany.sca.implementation.spring.elements.tie.SpringSCAServiceElement;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the <sca:service/> element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ BeanDefinitionRegistry registry = parserContext.getRegistry();
+ if (registry instanceof SCAGenericApplicationContext) {
+ SCAGenericApplicationContext context = (SCAGenericApplicationContext)registry;
+ SpringSCAServiceElement serviceElement =
+ new SpringSCAServiceElement(getAttribute(element, "name"), getAttribute(element, "target"));
+ serviceElement.setType(getAttribute(element, "type"));
+
+ String requires = getAttribute(element, "requires");
+ if (requires != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, requires);
+ serviceElement.getIntentNames().addAll(qnames);
+ }
+
+ String policySets = getAttribute(element, "policySets");
+ if (policySets != null) {
+ List<QName> qnames = ScaNamespaceHandler.resolve(element, policySets);
+ serviceElement.getPolicySetNames().addAll(qnames);
+ }
+
+ context.addSCAServiceElement(serviceElement);
+ }
+ // do nothing, handled by Tuscany
+ return null;
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java
new file mode 100644
index 0000000..77f9f30
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentNameAnnotationProcessor.java
@@ -0,0 +1,151 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.ref.Reference;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.ComponentName;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class ComponentNameAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> componentNameAnnotationType = ComponentName.class;
+
+ private String componentName;
+
+ public ComponentNameAnnotationProcessor(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ * Gets componentName annotation type.
+ */
+ protected Class<? extends Annotation> getComponentNameAnnotationType() {
+ return this.componentNameAnnotationType;
+ }
+
+ /**
+ * Sets componentName annotation type.
+ */
+ public void setComponentNameAnnotationType(Class<? extends Annotation> componentNameAnnotationType) {
+ Assert.notNull(componentNameAnnotationType, "'componentNameAnnotationType' type must not be null.");
+ this.componentNameAnnotationType = componentNameAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+ Annotation annotation = field.getAnnotation(getComponentNameAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static fields");
+ }
+
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private fields");
+ }
+
+ ReflectionUtils.makeAccessible(field);
+
+ if (field.getType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null)
+ ReflectionUtils.setField(field, bean, nameObj);
+ } else {
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+ Annotation annotation = method.getAnnotation(getComponentNameAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static methods");
+ }
+
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private methods");
+ }
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException(
+ "ComponentName annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+
+ if (pd.getPropertyType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {nameObj});
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
+ }
+ }
+ } else {
+ throw new IllegalStateException(
+ "ComponentName annotation is supported only on java.lang.String field type.");
+ }
+ }
+ }
+ });
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java
new file mode 100644
index 0000000..7511ac4
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ComponentStub.java
@@ -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.sca.implementation.spring.processor.tie;
+
+import java.lang.reflect.Method;
+
+/**
+ * This is the Spring runtime side stub for the corresponding Tuscany tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the ComponentTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class ComponentStub {
+
+ private Object tie;
+ private Method getService;
+
+ public ComponentStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getService = tieClass.getMethod("getService", new Class<?>[] {Class.class, String.class});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getService(Class<?> type, String name) {
+ try {
+
+ return getService.invoke(tie, type, name);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java
new file mode 100644
index 0000000..503307c
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ConstructorAnnotationProcessor.java
@@ -0,0 +1,112 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
+import org.springframework.util.Assert;
+
+public class ConstructorAnnotationProcessor extends InstantiationAwareBeanPostProcessorAdapter {
+
+ private Class<? extends Annotation> constructorAnnotationType = org.oasisopen.sca.annotation.Constructor.class;
+
+ private Class<? extends Annotation> autowiredAnnotationType = Autowired.class;
+
+ public ConstructorAnnotationProcessor() {
+ // Default constructor.
+ }
+
+ /**
+ * Set the 'autowired' annotation type, to be used on constructors, fields,
+ * setter methods and arbitrary config methods.
+ */
+ public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType) {
+ Assert.notNull(autowiredAnnotationType, "'autowiredAnnotationType' must not be null");
+ this.autowiredAnnotationType = autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'autowired' annotation type.
+ */
+ protected Class<? extends Annotation> getAutowiredAnnotationType() {
+ return this.autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'constructor' annotation type.
+ */
+ protected Class<? extends Annotation> getConstructorAnnotationType() {
+ return this.constructorAnnotationType;
+ }
+
+ /**
+ * Sets the 'constructor' annotation type.
+ */
+ public void setConstructorAnnotationType(Class<? extends Annotation> constructorAnnotationType) {
+ Assert.notNull(constructorAnnotationType, "'constructorAnnotationType' type must not be null.");
+ this.constructorAnnotationType = constructorAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
+ /*Constructor[] declaredConstructors = beanClass.getDeclaredConstructors();
+ Method[] declaredMethods = beanClass.getDeclaredMethods();
+ List candidates = new ArrayList(declaredConstructors.length);
+
+ for (int i = 0; i < declaredMethods.length; i++) {
+ Method method = declaredMethods[i];
+ Annotation annotation = method.getAnnotation(getConstructorAnnotationType());
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Constructor annotation is not supported on static methods");
+ }
+
+ if (candidates.size() == 1) {
+ throw new IllegalStateException("Only one method is allowed to have constructor annotation in a bean: " + method);
+ }
+
+ candidates.add(method);
+ }
+ }
+
+ return (Constructor[]) candidates.toArray(new Constructor[candidates.size()]);*/
+ return null;
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java
new file mode 100644
index 0000000..390ee04
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/InitDestroyAnnotationProcessor.java
@@ -0,0 +1,75 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.lang.annotation.Annotation;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor;
+
+public class InitDestroyAnnotationProcessor extends InitDestroyAnnotationBeanPostProcessor {
+
+ private static final long serialVersionUID = 0;
+
+ private Class<? extends Annotation> initAnnotationType = Init.class;
+ private Class<? extends Annotation> destroyAnnotationType = Destroy.class;
+
+ /**
+ * Gets init annotation type.
+ */
+ protected Class<? extends Annotation> getInitAnnotationType() {
+ return this.initAnnotationType;
+ }
+
+ /**
+ * Sets init annotation type.
+ */
+ /*
+ * public void setInitAnnotationType(Class<? extends Annotation>
+ * initAnnotationType) { Assert.notNull(initAnnotationType,
+ * "Init annotation type must not be null."); this.initAnnotationType =
+ * initAnnotationType; }
+ */
+
+ /**
+ * Gets destroy annotation type.
+ */
+ protected Class<? extends Annotation> getDestroyAnnotationType() {
+ return this.destroyAnnotationType;
+ }
+
+ /**
+ * Sets destroy annotation type.
+ */
+ /*
+ * public void setDestroyAnnotationType(Class<? extends Annotation>
+ * destroyAnnotationType) { Assert.notNull(destroyAnnotationType,
+ * "Destroy annotation type must not be null."); this.destroyAnnotationType
+ * = destroyAnnotationType; }
+ */
+
+ public InitDestroyAnnotationProcessor() {
+ // Set the @Init annotation type
+ setInitAnnotationType(initAnnotationType);
+
+ // Set the @Destroy annotation type
+ setDestroyAnnotationType(destroyAnnotationType);
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java
new file mode 100644
index 0000000..ce3aafd
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyAnnotationProcessor.java
@@ -0,0 +1,163 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.Property;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class PropertyAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> propertyAnnotationType = Property.class;
+
+ private PropertyValueStub propertyValue;
+
+ public PropertyAnnotationProcessor(PropertyValueStub propertyValue) {
+ this.propertyValue = propertyValue;
+ }
+
+ /**
+ * Gets property annotation type.
+ */
+ protected Class<? extends Annotation> getPropertyAnnotationType() {
+ return this.propertyAnnotationType;
+ }
+
+ /**
+ * Sets property annotation type.
+ */
+ public void setPropertyAnnotationType(Class<? extends Annotation> propertyAnnotationType) {
+ Assert.notNull(propertyAnnotationType, "'propertyAnnotationType' type must not be null.");
+ this.propertyAnnotationType = propertyAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Property} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+
+ Property annotation = (Property)method.getAnnotation(getPropertyAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on static methods");
+ }
+
+ /*
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on private methods");
+ }
+ */
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException("Property annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+ if (pd != null) {
+ String propName = annotation.name();
+ if ("".equals(propName)) {
+ injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), pd.getName()));
+ } else {
+ injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), propName));
+ }
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+
+ Property annotation = (Property)field.getAnnotation(getPropertyAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on static fields");
+ }
+
+ /*
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on private fields");
+ }
+ */
+
+ ReflectionUtils.makeAccessible(field);
+
+ Object propertyObj = null;
+ String propName = annotation.name();
+ if ("".equals(propName)) {
+ propertyObj = propertyValue.getPropertyObj(field.getType(), field.getName());
+ } else {
+ propertyObj = propertyValue.getPropertyObj(field.getType(), propName);
+ }
+
+ if (propertyObj != null)
+ ReflectionUtils.setField(field, bean, propertyObj);
+ }
+ }
+ });
+ }
+
+ public void injectProperty(Object bean, PropertyDescriptor pd, Object propertyObj) {
+
+ if (propertyObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {propertyObj});
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting property: " + e.getMessage(), e);
+ }
+ }
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java
new file mode 100644
index 0000000..5a4b57c
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/PropertyValueStub.java
@@ -0,0 +1,55 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.lang.reflect.Method;
+
+/**
+ * This is the Spring runtime side stub for the corresponding Tuscany tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the PropertyValueTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class PropertyValueStub {
+
+ private Object tie;
+ private Method getPropertyObj;
+
+ public PropertyValueStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getPropertyObj = tieClass.getMethod("getPropertyObj", new Class<?>[] {Class.class, String.class});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getPropertyObj(Class<?> propertyType, String name) {
+ try {
+
+ return getPropertyObj.invoke(tie, propertyType, name);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java
new file mode 100644
index 0000000..24761d2
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/ReferenceAnnotationProcessor.java
@@ -0,0 +1,167 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class ReferenceAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> referenceAnnotationType = Reference.class;
+ private ComponentStub component;
+
+ public ReferenceAnnotationProcessor(ComponentStub component) {
+ this.component = component;
+ }
+
+ /**
+ * Gets referece annotation type.
+ */
+ protected Class<? extends Annotation> getReferenceAnnotationType() {
+ return this.referenceAnnotationType;
+ }
+
+ /**
+ * Sets referece annotation type.
+ */
+ public void setReferenceAnnotationType(Class<? extends Annotation> referenceAnnotationType) {
+ Assert.notNull(referenceAnnotationType, "'referenceAnnotationType' type must not be null.");
+ this.referenceAnnotationType = referenceAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+
+ Reference annotation = (Reference)method.getAnnotation(getReferenceAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on static methods");
+ }
+
+ /*
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on private methods");
+ }
+ */
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException(
+ "Reference annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+ if (pd != null) {
+ String refName = annotation.name();
+ if ("".equals(refName)) {
+ injectReference(bean, pd, pd.getName());
+ } else {
+ injectReference(bean, pd, refName);
+ }
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+
+ Reference annotation = (Reference)field.getAnnotation(getReferenceAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on static fields");
+ }
+
+ /*
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on private fields");
+ }
+ */
+
+ ReflectionUtils.makeAccessible(field);
+
+ Object referenceObj = null;
+ String refName = annotation.name();
+ if ("".equals(refName)) {
+ referenceObj = component.getService(field.getType(), field.getName());
+ } else {
+ referenceObj = component.getService(field.getType(), refName);
+ }
+
+ if (referenceObj != null)
+ ReflectionUtils.setField(field, bean, referenceObj);
+ }
+ }
+ });
+ }
+
+ /**
+ * Processes a property descriptor to inject a service.
+ */
+ public void injectReference(Object bean, PropertyDescriptor pd, String name) {
+
+ Object referenceObj = component.getService(pd.getPropertyType(), name);
+
+ if (referenceObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] {referenceObj});
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
+ }
+ }
+ }
+}
diff --git a/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java
new file mode 100644
index 0000000..82aa176
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/tie/SpringXMLLoaderTie.java
@@ -0,0 +1,57 @@
+/*
+ * 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.sca.implementation.spring.processor.tie;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.implementation.spring.context.tie.SCAGenericApplicationContext;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+/**
+ * A tie that allows Tuscany to call Spring library to load the application context for the purpose of introspection
+ */
+public class SpringXMLLoaderTie {
+
+ public static ApplicationContext createApplicationContext(Object scaParentContext,
+ ClassLoader classLoader,
+ List<URL> resources) {
+ if (classLoader == null) {
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+
+ SCAGenericApplicationContext appCtx =
+ new SCAGenericApplicationContext((ApplicationContext)scaParentContext, classLoader);
+ XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(appCtx);
+
+ // REVIEW: [rfeng] How do we control the schema validation
+ xmlReader.setValidating(false);
+
+ for (URL resource : resources) {
+ xmlReader.loadBeanDefinitions(new UrlResource(resource));
+ }
+
+ return appCtx;
+
+ }
+
+}
diff --git a/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers b/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers
new file mode 100644
index 0000000..e7b61bf
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers
@@ -0,0 +1 @@
+http\://www.springframework.org/schema/sca=org.apache.tuscany.sca.implementation.spring.namespace.tie.ScaNamespaceHandler
diff --git a/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas b/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas
new file mode 100644
index 0000000..249cc21
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas
@@ -0,0 +1 @@
+http\://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd=org/springframework/sca/xml/spring-sca.xsd
diff --git a/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd b/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
new file mode 100644
index 0000000..dfa0b93
--- /dev/null
+++ b/modules/implementation-spring-tie/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
@@ -0,0 +1,84 @@
+<?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.
+-->
+<xsd:schema xmlns="http://www.springframework.org/schema/sca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ attributeFormDefault="unqualified" elementFormDefault="qualified"
+ targetNamespace="http://www.springframework.org/schema/sca">
+
+ <xsd:element name="reference">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="default" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="property">
+ <xsd:complexType>
+ <xsd:attribute name="id" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="service">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="target" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
diff --git a/modules/binding-rss-runtime/LICENSE b/modules/implementation-spring-webapp/LICENSE
similarity index 100%
copy from modules/binding-rss-runtime/LICENSE
copy to modules/implementation-spring-webapp/LICENSE
diff --git a/modules/implementation-spring-webapp/META-INF/MANIFEST.MF b/modules/implementation-spring-webapp/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..42c577b
--- /dev/null
+++ b/modules/implementation-spring-webapp/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Spring Implementation WebApp Integration
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Spring Implementation Runtime Model
+Bundle-SymbolicName: org.apache.tuscany.sca.implementation.spring.webapp
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
+Import-Package: javax.servlet,
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.extensibility;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring.context;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.springframework.beans;version="3.0.2.RELEASE",
+ org.springframework.beans.factory;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.annotation;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.config;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.support;version="3.0.2.RELEASE",
+ org.springframework.beans.factory.xml;version="3.0.2.RELEASE",
+ org.springframework.context;version="3.0.2.RELEASE",
+ org.springframework.context.support;version="3.0.2.RELEASE",
+ org.springframework.core.io;version="3.0.2.RELEASE",
+ org.springframework.util;version="3.0.2.RELEASE"
+
diff --git a/modules/implementation-spring-webapp/NOTICE b/modules/implementation-spring-webapp/NOTICE
new file mode 100644
index 0000000..1325efd
--- /dev/null
+++ b/modules/implementation-spring-webapp/NOTICE
@@ -0,0 +1,6 @@
+${pom.name}
+Copyright (c) 2005 - 2008 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/modules/implementation-spring-webapp/pom.xml b/modules/implementation-spring-webapp/pom.xml
new file mode 100644
index 0000000..cbaf1cb
--- /dev/null
+++ b/modules/implementation-spring-webapp/pom.xml
@@ -0,0 +1,60 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-spring-webapp</artifactId>
+ <name>Apache Tuscany SCA Spring Implementation WebApp Integration</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- Spring dependencies... -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>3.0.2.RELEASE</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorBean.java b/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorBean.java
new file mode 100644
index 0000000..a54ef8d
--- /dev/null
+++ b/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorBean.java
@@ -0,0 +1,43 @@
+/*
+ * 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.sca.implementation.spring.webapp;
+
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.support.ApplicationObjectSupport;
+
+/**
+ * A singleton utility class that can be added to the Spring application context to receive injection of the containing
+ * Spring application context.
+ *
+ * The Spring bean definition file is: org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml
+ */
+public class ApplicationContextAccessorBean extends ApplicationObjectSupport implements ApplicationContextAware {
+ public final static String BEAN_ID = "tuscanySpringApplicationContextAccessor";
+ private final static ApplicationContextAccessorBean INSTANCE = new ApplicationContextAccessorBean();
+
+ private ApplicationContextAccessorBean() {
+ }
+
+ // Spring static factory method to create the singleton instance
+ public static ApplicationContextAccessorBean getInstance() {
+ return INSTANCE;
+ }
+
+}
diff --git a/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/SpringWebApplicationContextAccessor.java b/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/SpringWebApplicationContextAccessor.java
new file mode 100644
index 0000000..f95ba27
--- /dev/null
+++ b/modules/implementation-spring-webapp/src/main/java/org/apache/tuscany/sca/implementation/spring/webapp/SpringWebApplicationContextAccessor.java
@@ -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 org.apache.tuscany.sca.implementation.spring.webapp;
+
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.LifeCycleListener;
+import org.apache.tuscany.sca.host.http.ExtensibleServletHost;
+import org.apache.tuscany.sca.implementation.spring.context.SpringApplicationContextAccessor;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+public class SpringWebApplicationContextAccessor implements SpringApplicationContextAccessor, LifeCycleListener {
+ private static Logger log = Logger.getLogger(SpringWebApplicationContextAccessor.class.getName());
+ private ExtensionPointRegistry registry;
+ private ApplicationContext parentApplicationContext;
+
+ public SpringWebApplicationContextAccessor(ExtensionPointRegistry registry) {
+ super();
+ this.registry = registry;
+ }
+
+ @Override
+ public void start() {
+ ExtensibleServletHost servletHost = ExtensibleServletHost.getInstance(registry);
+
+ ServletContext servletContext = servletHost.getServletContext();
+ if (servletContext != null) {
+ parentApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
+ if (parentApplicationContext != null) {
+ log.info("Spring WebApplicationContext is now injected on Tuscany");
+ }
+ }
+
+ if (parentApplicationContext == null) {
+ parentApplicationContext = ApplicationContextAccessorBean.getInstance().getApplicationContext();
+ }
+ }
+
+ @Override
+ public void stop() {
+ parentApplicationContext = null;
+ }
+
+ public ApplicationContext getParentApplicationContext() {
+ return parentApplicationContext;
+ }
+
+ public void setParentApplicationContext(ApplicationContext parentApplicationContext) {
+ this.parentApplicationContext = parentApplicationContext;
+ }
+
+}
diff --git a/modules/implementation-spring-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.context.SpringApplicationContextAccessor b/modules/implementation-spring-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.context.SpringApplicationContextAccessor
new file mode 100644
index 0000000..506b02c
--- /dev/null
+++ b/modules/implementation-spring-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.spring.context.SpringApplicationContextAccessor
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+org.apache.tuscany.sca.implementation.spring.webapp.SpringWebApplicationContextAccessor
\ No newline at end of file
diff --git a/modules/implementation-spring-webapp/src/main/resources/org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml b/modules/implementation-spring-webapp/src/main/resources/org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml
new file mode 100644
index 0000000..b98374a
--- /dev/null
+++ b/modules/implementation-spring-webapp/src/main/resources/org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+ <bean id="tuscanySpringApplicationContextAccessor"
+ class="org.apache.tuscany.sca.implementation.spring.webapp.ApplicationContextAccessorBean"
+ scope="singleton" factory-method="getInstance">
+ </bean>
+
+</beans>
diff --git a/modules/implementation-spring-webapp/src/test/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorTestCase.java b/modules/implementation-spring-webapp/src/test/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorTestCase.java
new file mode 100644
index 0000000..6a5ae88
--- /dev/null
+++ b/modules/implementation-spring-webapp/src/test/java/org/apache/tuscany/sca/implementation/spring/webapp/ApplicationContextAccessorTestCase.java
@@ -0,0 +1,41 @@
+/*
+ * 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.sca.implementation.spring.webapp;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class ApplicationContextAccessorTestCase {
+
+ @Test
+ public void testContext() {
+ ApplicationContext context =
+ new ClassPathXmlApplicationContext(
+ new String[] {"org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml"});
+ Object accessor = context.getBean(ApplicationContextAccessorBean.BEAN_ID);
+ Assert.assertSame(ApplicationContextAccessorBean.getInstance(), accessor);
+ ApplicationContextAccessorBean contextAccessor = (ApplicationContextAccessorBean)accessor;
+ Assert.assertSame(context, contextAccessor.getApplicationContext());
+
+ }
+
+}
diff --git a/modules/implementation-spring/META-INF/MANIFEST.MF b/modules/implementation-spring/META-INF/MANIFEST.MF
index 988718b..9226b04 100644
--- a/modules/implementation-spring/META-INF/MANIFEST.MF
+++ b/modules/implementation-spring/META-INF/MANIFEST.MF
@@ -13,6 +13,7 @@
org.apache.tuscany.sca.assembly.builder;version="2.0.0",
org.apache.tuscany.sca.assembly.impl;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.context;version="2.0.0",
org.apache.tuscany.sca.contribution;version="2.0.0",
org.apache.tuscany.sca.contribution.processor;version="2.0.0",
org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
@@ -39,15 +40,11 @@
Bundle-SymbolicName: org.apache.tuscany.sca.implementation.spring
Bundle-DocURL: http://www.apache.org/
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
-Export-Package: org.apache.tuscany.sca.implementation.spring;version="2.0.0";
- uses:="org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.assembly.impl,
- org.apache.tuscany.sca.interfacedef,
- javax.xml.namespace",
- org.apache.tuscany.sca.implementation.spring.introspect;version="2.0.0";
- uses:="org.apache.tuscany.sca.assembly,
- org.apache.tuscany.sca.implementation.java.introspect,
+Export-Package: org.apache.tuscany.sca.implementation.spring;version="2.0.0",
+ org.apache.tuscany.sca.implementation.spring.xml;version="2.0.0";
+ uses:="javax.xml.stream,
+ org.apache.tuscany.sca.contribution.resolver,
org.apache.tuscany.sca.implementation.spring,
- org.apache.tuscany.sca.implementation.java,
- org.apache.tuscany.sca.policy,
- org.apache.tuscany.sca.interfacedef.java"
+ org.apache.tuscany.sca.contribution.processor,
+ org.apache.tuscany.sca.core,
+ javax.xml.namespace"
diff --git a/modules/implementation-spring/pom.xml b/modules/implementation-spring/pom.xml
index c08378e..215f3b2 100644
--- a/modules/implementation-spring/pom.xml
+++ b/modules/implementation-spring/pom.xml
@@ -28,17 +28,7 @@
<artifactId>tuscany-implementation-spring</artifactId>
<name>Apache Tuscany SCA Spring Implementation Model</name>
- <dependencies>
-
- <!-- **************************************** -->
- <!-- * * -->
- <!-- * DONT ADD ANY SPRING DEPENDENCIES!!! * -->
- <!-- * * -->
- <!-- * See the README for details why not * -->
- <!-- * * -->
- <!-- * * -->
- <!-- **************************************** -->
-
+ <dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-assembly</artifactId>
@@ -61,7 +51,7 @@
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <artifactId>tuscany-implementation-java</artifactId>
<version>2.0-Beta1</version>
</dependency>
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
index f64c5f9..64b36a0 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
@@ -37,10 +37,13 @@
private boolean parentAttribute = false;
private boolean factoryBeanAttribute = false;
private boolean factoryMethodAttribute = false;
-
+
private List<SpringPropertyElement> properties = new ArrayList<SpringPropertyElement>();
private List<SpringConstructorArgElement> constructorargs = new ArrayList<SpringConstructorArgElement>();
+ public SpringBeanElement() {
+ }
+
public SpringBeanElement(String id, String className) {
this.id = id;
this.className = className;
@@ -53,7 +56,7 @@
public String getId() {
return id;
}
-
+
public void setId(String id) {
this.id = id;
}
@@ -65,7 +68,7 @@
public void addProperty(SpringPropertyElement property) {
properties.add(property);
}
-
+
public List<SpringConstructorArgElement> getCustructorArgs() {
return constructorargs;
}
@@ -73,45 +76,57 @@
public void addCustructorArgs(SpringConstructorArgElement args) {
constructorargs.add(args);
}
-
+
public boolean isInnerBean() {
return innerBean;
}
-
+
public void setInnerBean(boolean innerBean) {
this.innerBean = innerBean;
}
-
+
public boolean isAbstractBean() {
return abstractBean;
}
-
+
public void setAbstractBean(boolean abstractBean) {
this.abstractBean = abstractBean;
}
-
+
public boolean hasParentAttribute() {
return parentAttribute;
}
-
+
public void setParentAttribute(boolean parentAttribute) {
this.parentAttribute = parentAttribute;
}
-
+
public boolean hasFactoryBeanAttribute() {
return factoryBeanAttribute;
}
-
+
public void setFactoryBeanAttribute(boolean factoryBeanAttribute) {
this.factoryBeanAttribute = factoryBeanAttribute;
}
-
+
public boolean hasFactoryMethodAttribute() {
return factoryMethodAttribute;
}
-
+
public void setFactoryMethodAttribute(boolean factoryMethodAttribute) {
this.factoryMethodAttribute = factoryMethodAttribute;
}
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringBeanElement [id=").append(id).append(", className=").append(className)
+ .append(", innerBean=").append(innerBean).append(", abstractBean=").append(abstractBean)
+ .append(", parentAttribute=").append(parentAttribute).append(", factoryBeanAttribute=")
+ .append(factoryBeanAttribute).append(", factoryMethodAttribute=").append(factoryMethodAttribute)
+ .append(", properties=").append(properties).append(", constructorargs=").append(constructorargs)
+ .append("]");
+ return builder.toString();
+ }
+
} // end class SpringBeanElement
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
index 9ae1273..1de0595 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
@@ -28,45 +28,49 @@
* @version $Rev$ $Date$
*/
public class SpringConstructorArgElement {
-
- private String type;
+
+ private String type;
private int autoIndex = -1;
private int index = -1;
private List<String> refs = new ArrayList<String>();
private List<String> values = new ArrayList<String>();
+ public SpringConstructorArgElement() {
+
+ }
+
public SpringConstructorArgElement(String type) {
this.type = type;
}
-
+
public String getType() {
return this.type;
}
-
+
public List<String> getRefs() {
return this.refs;
}
-
+
public void addRef(String ref) {
this.refs.add(ref);
}
-
+
public int getIndex() {
return this.index;
}
-
+
public void setIndex(int index) {
this.index = index;
}
-
+
public int getAutoIndex() {
return this.autoIndex;
}
-
+
public void setAutoIndex(int index) {
this.autoIndex = index;
}
-
+
public List<String> getValues() {
return this.values;
}
@@ -74,4 +78,13 @@
public void addValue(String value) {
this.values.add(value);
}
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringConstructorArgElement [type=").append(type).append(", autoIndex=").append(autoIndex)
+ .append(", index=").append(index).append(", refs=").append(refs).append(", values=").append(values)
+ .append("]");
+ return builder.toString();
+ }
}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
index 7a73f79..a5d4adb 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
@@ -19,8 +19,9 @@
package org.apache.tuscany.sca.implementation.spring;
import java.net.URL;
-import java.util.Hashtable;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.xml.namespace.QName;
@@ -33,8 +34,6 @@
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
/**
* Represents a Spring implementation.
@@ -49,11 +48,11 @@
private List<URL> resource;
private ComponentType componentType;
// Mapping of Services to Beans
- private Hashtable<String, SpringBeanElement> serviceMap;
+ private Map<String, SpringBeanElement> serviceMap;
// Mapping of property names to Java class
- private Hashtable<String, Class<?>> propertyMap;
+ private Map<String, Class<?>> propertyMap;
// List of unresolved bean property references
- private Hashtable<String, Reference> unresolvedBeanRef;
+ private Map<String, Reference> unresolvedBeanRef;
private ClassLoader classLoader;
public SpringImplementation() {
@@ -61,9 +60,9 @@
this.location = null;
this.resource = null;
setUnresolved(true);
- serviceMap = new Hashtable<String, SpringBeanElement>();
- propertyMap = new Hashtable<String, Class<?>>();
- unresolvedBeanRef = new Hashtable<String, Reference>();
+ serviceMap = new HashMap<String, SpringBeanElement>();
+ propertyMap = new HashMap<String, Class<?>>();
+ unresolvedBeanRef = new HashMap<String, Reference>();
} // end method SpringImplementation
/* Returns the location attribute for this Spring implementation */
@@ -168,30 +167,24 @@
return unresolvedBeanRef.get(refName);
} // end method getUnresolvedBeanRef
-
/**
* Use preProcess to validate and map the references and properties dynamically
*/
public void build(Component component) {
- if (!(component instanceof RuntimeComponent))
- return;
- RuntimeComponent rtc = (RuntimeComponent) component;
-
- for (Reference reference : rtc.getReferences()) {
+ for (Reference reference : component.getReferences()) {
if (unresolvedBeanRef.containsKey(reference.getName())) {
- Reference ref = unresolvedBeanRef.get(reference.getName());
- componentType.getReferences().add(
- createReference(reference, ref.getInterfaceContract()));
- unresolvedBeanRef.remove(reference.getName());
+ Reference ref = unresolvedBeanRef.get(reference.getName());
+ componentType.getReferences().add(createReference(reference, ref.getInterfaceContract()));
+ unresolvedBeanRef.remove(reference.getName());
}
}
- for (Property property : rtc.getProperties()) {
- if (unresolvedBeanRef.containsKey(property.getName())) {
- componentType.getProperties().add(createProperty(property));
- this.setPropertyClass(property.getName(), property.getClass());
- unresolvedBeanRef.remove(property.getName());
+ for (Property property : component.getProperties()) {
+ if (unresolvedBeanRef.containsKey(property.getName())) {
+ componentType.getProperties().add(createProperty(property));
+ this.setPropertyClass(property.getName(), property.getClass());
+ unresolvedBeanRef.remove(property.getName());
}
}
}
@@ -201,7 +194,7 @@
try {
newReference = (Reference)reference.clone();
if (newReference.getInterfaceContract() == null)
- newReference.setInterfaceContract(interfaze);
+ newReference.setInterfaceContract(interfaze);
} catch (CloneNotSupportedException e) {
throw new AssertionError(e); // should not ever happen
}
@@ -217,13 +210,13 @@
}
return newProperty;
}
-
+
public ClassLoader getClassLoader() {
- return classLoader;
+ return classLoader;
}
public void setClassLoader(ClassLoader classLoader) {
- this.classLoader = classLoader;
+ this.classLoader = classLoader;
}
@Override
@@ -255,4 +248,12 @@
}
return true;
}
-}
\ No newline at end of file
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringImplementation [location=").append(location).append(", resource=").append(resource)
+ .append("]");
+ return builder.toString();
+ }
+}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
index caae72f..27c09c1 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
@@ -25,47 +25,47 @@
* Constants used in Spring Application Context XML files.
*/
public interface SpringImplementationConstants {
-
+
String SCA_NS = "http://www.springframework.org/schema/sca";
String SPRING_NS = "http://www.springframework.org/schema/beans";
-
+
String PROPERTY = "property";
QName SCA_PROPERTY_ELEMENT = new QName(SCA_NS, PROPERTY);
QName PROPERTY_ELEMENT = new QName(SPRING_NS, PROPERTY);
-
+
String SCASERVICE = "service";
QName SCA_SERVICE_ELEMENT = new QName(SCA_NS, SCASERVICE);
-
+
String SCAREFERENCE = "reference";
QName SCA_REFERENCE_ELEMENT = new QName(SCA_NS, SCAREFERENCE);
-
+
String BEANS = "beans";
QName BEANS_ELEMENT = new QName(SPRING_NS, BEANS);
-
+
String IMPORT = "import";
QName IMPORT_ELEMENT = new QName(SPRING_NS, IMPORT);
-
+
String BEAN = "bean";
QName BEAN_ELEMENT = new QName(SPRING_NS, BEAN);
-
+
String CONSTRUCTORARG = "constructor-arg";
QName CONSTRUCTORARG_ELEMENT = new QName(SPRING_NS, CONSTRUCTORARG);
-
+
String LIST = "list";
- QName LIST_ELEMENT = new QName(SPRING_NS, LIST);
-
+ QName LIST_ELEMENT = new QName(SPRING_NS, LIST);
+
String SET = "set";
QName SET_ELEMENT = new QName(SPRING_NS, SET);
-
+
String MAP = "map";
QName MAP_ELEMENT = new QName(SPRING_NS, MAP);
-
+
String VALUE = "value";
QName VALUE_ELEMENT = new QName(SPRING_NS, VALUE);
-
+
String REF = "ref";
QName REF_ELEMENT = new QName(SPRING_NS, REF);
-
+
String ENTRY = "entry";
QName ENTRY_ELEMENT = new QName(SPRING_NS, ENTRY);
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
index 37b8ef3..8de3a4c 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
@@ -33,6 +33,9 @@
private List<String> refs = new ArrayList<String>();
private List<String> values = new ArrayList<String>();
+ public SpringPropertyElement() {
+ }
+
public SpringPropertyElement(String name) {
this.name = name;
}
@@ -44,11 +47,11 @@
public List<String> getRefs() {
return this.refs;
}
-
+
public void addRef(String ref) {
this.refs.add(ref);
}
-
+
public List<String> getValues() {
return this.values;
}
@@ -56,5 +59,13 @@
public void addValue(String value) {
this.values.add(value);
}
-
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringPropertyElement [name=").append(name).append(", refs=").append(refs).append(", values=")
+ .append(values).append("]");
+ return builder.toString();
+ }
+
} // end class SpringPropertyElement
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
index b192580..f27506f 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
@@ -28,11 +28,15 @@
private String name;
private String type;
+ public SpringSCAPropertyElement() {
+ super();
+ }
+
public SpringSCAPropertyElement(String name, String type) {
this.name = name;
this.type = type;
}
-
+
public void setName(String name) {
this.name = name;
}
@@ -40,7 +44,7 @@
public String getName() {
return name;
}
-
+
public void setType(String type) {
this.type = type;
}
@@ -49,4 +53,11 @@
return type;
}
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAPropertyElement [name=").append(name).append(", type=").append(type).append("]");
+ return builder.toString();
+ }
+
} // end class SpringPropertyElement
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
index bc01022..f06f05a 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
@@ -20,6 +20,9 @@
import java.util.ArrayList;
import java.util.List;
+
+import javax.xml.namespace.QName;
+
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -38,11 +41,18 @@
private List<Intent> intents = new ArrayList<Intent>();
private List<PolicySet> policySets = new ArrayList<PolicySet>();
+ private List<QName> intentNames = new ArrayList<QName>();
+ private List<QName> policySetNames = new ArrayList<QName>();
+
+ public SpringSCAReferenceElement() {
+
+ }
+
public SpringSCAReferenceElement(String name, String type) {
this.name = name;
this.type = type;
}
-
+
public void setName(String name) {
this.name = name;
}
@@ -50,7 +60,7 @@
public String getName() {
return name;
}
-
+
public void setType(String type) {
this.type = type;
}
@@ -58,7 +68,7 @@
public String getType() {
return type;
}
-
+
public void setDefaultBean(String defaultBean) {
this.defaultBean = defaultBean;
}
@@ -66,13 +76,31 @@
public String getDefaultBean() {
return defaultBean;
}
-
+
public List<Intent> getRequiredIntents() {
return intents;
}
-
- public List<PolicySet> getPolicySets() {
- return policySets;
+
+ public List<PolicySet> getPolicySets() {
+ return policySets;
+ }
+
+ public List<QName> getIntentNames() {
+ return intentNames;
+ }
+
+ public List<QName> getPolicySetNames() {
+ return policySetNames;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAReferenceElement [name=").append(name).append(", type=").append(type)
+ .append(", defaultBean=").append(defaultBean).append(", intents=").append(intents).append(", policySets=")
+ .append(policySets).append(", intentNames=").append(intentNames).append(", policySetNames=")
+ .append(policySetNames).append("]");
+ return builder.toString();
}
} // end class SpringSCAReferenceElement
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
index dbddc00..38c124c 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
@@ -20,6 +20,9 @@
import java.util.ArrayList;
import java.util.List;
+
+import javax.xml.namespace.QName;
+
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicySet;
@@ -37,12 +40,18 @@
private String target;
private List<Intent> intents = new ArrayList<Intent>();
private List<PolicySet> policySets = new ArrayList<PolicySet>();
+ private List<QName> intentNames = new ArrayList<QName>();
+ private List<QName> policySetNames = new ArrayList<QName>();
+
+ public SpringSCAServiceElement() {
+
+ }
public SpringSCAServiceElement(String name, String target) {
this.name = name;
this.target = target;
}
-
+
public void setName(String name) {
this.name = name;
}
@@ -50,7 +59,7 @@
public String getName() {
return name;
}
-
+
public void setType(String type) {
this.type = type;
}
@@ -58,7 +67,7 @@
public String getType() {
return type;
}
-
+
public void setTarget(String target) {
this.target = target;
}
@@ -66,13 +75,31 @@
public String getTarget() {
return target;
}
-
+
public List<Intent> getRequiredIntents() {
return intents;
}
-
- public List<PolicySet> getPolicySets() {
- return policySets;
+
+ public List<PolicySet> getPolicySets() {
+ return policySets;
+ }
+
+ public List<QName> getIntentNames() {
+ return intentNames;
+ }
+
+ public List<QName> getPolicySetNames() {
+ return policySetNames;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("SpringSCAServiceElement [name=").append(name).append(", type=").append(type)
+ .append(", target=").append(target).append(", intents=").append(intents).append(", policySets=")
+ .append(policySets).append(", intentNames=").append(intentNames).append(", policySetNames=")
+ .append(policySetNames).append("]");
+ return builder.toString();
}
} // end class SpringSCAServiceElement
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
index 3aa2576..5eaf27a 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
@@ -28,6 +28,7 @@
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
/**
* Provides introspection functions for Spring beans
@@ -47,8 +48,7 @@
* @param javaFactory The Java Interface Factory to use
* @param policyFactory The Policy Factory to use.
*/
- public SpringBeanIntrospector(ExtensionPointRegistry registry,
- List<SpringConstructorArgElement> conArgs) {
+ public SpringBeanIntrospector(ExtensionPointRegistry registry, List<SpringConstructorArgElement> conArgs) {
FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
javaImplementationFactory = factories.getFactory(JavaImplementationFactory.class);
@@ -64,13 +64,15 @@
* Spring Bean or its componentType
*
*/
- public JavaImplementation introspectBean(Class<?> beanClass, ComponentType componentType) throws ContributionResolveException
- {
+ public JavaImplementation introspectBean(Class<?> beanClass, ComponentType componentType)
+ throws ContributionResolveException {
if (componentType == null)
throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");
// Create a Java implementation ready for the introspection
JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation();
+ // Set the type to be implementation.spring to avoid heuristic introspection
+ javaImplementation.setType(SpringImplementation.TYPE);
try {
// Introspect the bean...the results of the introspection are placed into the Java implementation
@@ -81,17 +83,11 @@
componentType.getServices().addAll(javaImplementation.getServices());
componentType.getReferences().addAll(javaImplementation.getReferences());
componentType.getProperties().addAll(javaImplementation.getProperties());
-
+
} catch (IntrospectionException e) {
throw new ContributionResolveException(e);
} // end try
- /* List<Service> services = javaImplementation.getServices();
- for (Service service : services) {
- String name = service.getName();
- System.out.println("Spring Bean: found service with name: " + name);
- } // end for */
-
return javaImplementation;
} // end method introspectBean
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
deleted file mode 100644
index 3a8eec9..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * 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.sca.implementation.spring.introspect;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getPrivateFields;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.toPropertyName;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jws.WebService;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceTypeException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.Resource;
-import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Heuristically evaluates an un-annotated Java implementation type to determine
- * services, references, and properties according to the algorithm described in
- * the SCA Java Client and Implementation Model Specification <p/> TODO
- * Implement: <p/> When no service interface is annotated, need to calculate a
- * single service comprising all public methods that are not reference or
- * property injection sites. If that service can be exactly mapped to an
- * interface implemented by the class then the service interface will be defined
- * in terms of that interface.
- *
- * @version $Rev$ $Date$
- */
-public class SpringBeanPojoProcessor extends BaseJavaClassVisitor {
- private List<SpringConstructorArgElement> conArgs;
-
- public SpringBeanPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, List<SpringConstructorArgElement> conArgs) {
- super(assemblyFactory);
- this.javaInterfaceFactory = javaFactory;
- this.conArgs = conArgs;
- }
-
- public SpringBeanPojoProcessor(ExtensionPointRegistry registry) {
- super(registry);
- }
-
- @Override
- public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- List<org.apache.tuscany.sca.assembly.Service> services = type.getServices();
- if (services.isEmpty()) {
- // heuristically determine the service
- /**
- * The following is quoted from Java Specification 1.2.1.3. Introspecting services offered by a Java implementation
- * In the cases described below, the services offered by a Java implementation class may be determined
- * through introspection, eliding the need to specify them using @Service. The following algorithm is used
- * to determine how services are introspected from an implementation class:
- *
- * If the interfaces of the SCA services are not specified with the @Service annotation on the
- * implementation class, it is assumed that all implemented interfaces that have been annotated
- * as @Remotable are the service interfaces provided by the component. If none of the implemented
- * interfaces is remotable, then by default the implementation offers a single service whose type
- * is the implementation class.
- */
- Set<Class<?>> interfaces = getAllInterfaces(clazz);
- for (Class<?> i : interfaces) {
- if (i.isAnnotationPresent(Remotable.class) || i.isAnnotationPresent(WebService.class)) {
- addService(type, i);
- }
- }
- if (services.isEmpty()) {
- // class is the interface
- addService(type, clazz);
- }
- }
- Set<Method> methods = getAllUniquePublicProtectedMethods(clazz, false);
- if (!type.getReferenceMembers().isEmpty() || !type.getPropertyMembers().isEmpty()) {
- // references and properties have been explicitly defined
- // if (type.getServices().isEmpty()) {
- // calculateServiceInterface(clazz, type, methods);
- // if (type.getServices().isEmpty()) {
- // throw new ServiceTypeNotFoundException(clazz.getName());
- // }
- // }
- evaluateConstructor(type, clazz);
- return;
- }
- calcPropRefs(methods, services, type, clazz);
- evaluateConstructor(type, clazz);
- }
-
- private void addService(JavaImplementation type, Class<?> clazz) throws IntrospectionException {
- try {
- org.apache.tuscany.sca.assembly.Service service = createService(clazz);
- type.getServices().add(service);
- } catch (InvalidInterfaceException e) {
- throw new IntrospectionException(e);
- }
- }
-
- private boolean isPublicSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- private boolean isProtectedSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isProtected(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- private <T> void calcPropRefs(Set<Method> methods,
- List<org.apache.tuscany.sca.assembly.Service> services,
- JavaImplementation type,
- Class<T> clazz) throws IntrospectionException {
- // heuristically determine the properties references
- // make a first pass through all public methods with one param
- Set<String> setters = new HashSet<String>();
- Set<String> others = new HashSet<String>();
- for (Method method : methods) {
- if (!isPublicSetter(method)) {
- continue;
- }
- if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
- // Add the property name as others
- others.add(toPropertyName(method.getName()));
- continue;
- }
- if (!isInServiceInterface(method, services)) {
- // Not part of the service interface
- String name = toPropertyName(method.getName());
- setters.add(name);
- // avoid duplicate property or ref names
- if (!type.getPropertyMembers().containsKey(name) && !type.getReferenceMembers().containsKey(name)) {
- Class<?> param = method.getParameterTypes()[0];
- Type genericType = method.getGenericParameterTypes()[0];
- if (isReferenceType(param, genericType)) {
- type.getReferences().add(createReference(name, param));
- type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
- } else {
- type.getProperties().add(createProperty(name, param));
- type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
- }
- }
- }
- }
- // second pass for protected methods with one param
- for (Method method : methods) {
- if (!isProtectedSetter(method)) {
- continue;
- }
- if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
- // Add the property name as others
- others.add(toPropertyName(method.getName()));
- continue;
- }
- Class<?> param = method.getParameterTypes()[0];
- String name = toPropertyName(method.getName());
- setters.add(name);
- // avoid duplicate property or ref names
- if (isReferenceType(param, method.getGenericParameterTypes()[0])) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, param));
- type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, param));
- type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
- }
- }
- }
-
- // Public or protected fields unless there is a public or protected
- // setter method
- // for the same name
- Set<Field> fields = getAllPublicAndProtectedFields(clazz, false);
- for (Field field : fields) {
- if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
- continue;
- }
- if (setters.contains(field.getName()) || others.contains(field.getName())) {
- continue;
- }
- String name = field.getName();
- Class<?> paramType = field.getType();
- if (isReferenceType(paramType, field.getGenericType())) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, paramType));
- type.getReferenceMembers().put(name, new JavaElementImpl(field));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, paramType));
- type.getPropertyMembers().put(name, new JavaElementImpl(field));
- }
- }
- }
-
- // Private fields unless there is a public or protected
- // setter method for the same name
- Set<Field> privateFields = getPrivateFields(clazz);
- for (Field field : privateFields) {
- if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
- continue;
- }
- if (setters.contains(field.getName()) || others.contains(field.getName())) {
- continue;
- }
- String name = field.getName();
- Class<?> paramType = field.getType();
- if (isReferenceType(paramType, field.getGenericType())) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, paramType));
- type.getReferenceMembers().put(name, new JavaElementImpl(field));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, paramType));
- type.getPropertyMembers().put(name, new JavaElementImpl(field));
- }
- }
- }
- }
-
- /**
- * Determines the constructor to use based on the component type's
- * references and properties
- *
- * @param type the component type
- * @param clazz the implementation class corresponding to the component type
- * @throws NoConstructorException if no suitable constructor is found
- * @throws AmbiguousConstructorException if the parameters of a constructor
- * cannot be unambiguously mapped to references and properties
- */
- @SuppressWarnings("unchecked")
- private <T> void evaluateConstructor(JavaImplementation type, Class<T> clazz) throws IntrospectionException {
- // determine constructor if one is not annotated
- JavaConstructorImpl<?> definition = type.getConstructor();
- Map<String, JavaElementImpl> props = type.getPropertyMembers();
- Map<String, JavaElementImpl> refs = type.getReferenceMembers();
- Constructor constructor;
- boolean explict = false;
- if (definition != null && definition.getConstructor()
- .isAnnotationPresent(org.oasisopen.sca.annotation.Constructor.class)) {
- // the constructor was already defined explicitly
- return;
- } else if (definition != null) {
- explict = true;
- constructor = definition.getConstructor();
- } else {
- // no definition, heuristically determine constructor
- Constructor[] constructors = clazz.getConstructors();
- if (constructors.length == 0) {
- throw new NoConstructorException("No public constructor for class");
- } else if (constructors.length == 1) {
- // Only one constructor, take it
- constructor = constructors[0];
- } else {
- // multiple constructors scenario
- Constructor<T> selected = null;
- for (Constructor<T> ctor : constructors) {
- if (ctor.getParameterTypes().length == 0) {
- selected = ctor;
- } else if (ctor.getParameterTypes().length == conArgs.size()) {
- // we will find a constructor which has atleast one
- // reference or property as its parameter types.
- Class<?>[] parametersTypes = ctor.getParameterTypes();
- for (Class<?> pType: parametersTypes) {
- for (JavaElementImpl property : props.values()) {
- if (pType.equals(property.getType()))
- selected = ctor;
- }
- for (JavaElementImpl reference : refs.values()) {
- if (pType.equals(reference.getType()))
- selected = ctor;
- }
- }
- }
- }
- if (selected == null) {
- throw new NoConstructorException();
- }
- constructor = selected;
- }
- definition = type.getConstructors().get(constructor);
- type.setConstructor(definition);
- }
-
- JavaParameterImpl[] parameters = definition.getParameters();
- if (parameters.length == 0) {
- return;
- }
-
- Annotation[][] annotations = constructor.getParameterAnnotations();
- if (!explict) {
- // the constructor wasn't defined by an annotation, so check to see
- // if any of the params have an annotation
- // which we can impute as explicitly defining the constructor, e.g.
- // @Property, @Reference, or @Autowire
- explict = injectionAnnotationsPresent(annotations);
- }
- if (explict) {
- for (int i = 0; i < parameters.length; i++) {
- if (isAnnotated(parameters[i])) {
- continue;
- } else if (!findReferenceOrProperty(parameters[i], props, refs)) {
- throw new AmbiguousConstructorException(parameters[i].toString());
- }
- }
- } else {
- if (!areUnique(parameters)) {
- throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
- }
- if (!calcPropRefUniqueness(props.values(), refs.values())) {
- throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
- }
- if (!(props.isEmpty() && refs.isEmpty())) {
- calcParamNames(parameters, props, refs);
- } else {
- heuristicParamNames(type, parameters);
-
- }
- }
- }
-
- private void calcParamNames(JavaParameterImpl[] parameters,
- Map<String, JavaElementImpl> props,
- Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
- // the constructor param types must unambiguously match defined
- // reference or property types
- for (JavaParameterImpl param : parameters) {
- if (!findReferenceOrProperty(param, props, refs)) {
- throw new AmbiguousConstructorException(param.getName());
- }
- }
- }
-
- private void heuristicParamNames(JavaImplementation type, JavaParameterImpl[] parameters)
- throws IntrospectionException {
- // heuristically determine refs and props from the parameter types
- for (JavaParameterImpl p : parameters) {
- String name = p.getType().getSimpleName().toLowerCase();
- if (isReferenceType(p.getType(), p.getGenericType())) {
- type.getReferences().add(createReference(name, p.getType()));
- p.setClassifer(Reference.class);
- type.getReferenceMembers().put(name, p);
- } else {
- type.getProperties().add(createProperty(name, p.getType()));
- p.setClassifer(Property.class);
- type.getPropertyMembers().put(name, p);
- }
- p.setName(name);
- }
- }
-
- private static boolean areUnique(Class[] collection) {
- Set<Class> set = new HashSet<Class>(Arrays.asList(collection));
- return set.size() == collection.length;
- }
-
- /**
- * Returns true if the union of the given collections of properties and
- * references have unique Java types
- */
- private boolean calcPropRefUniqueness(Collection<JavaElementImpl> props, Collection<JavaElementImpl> refs) {
-
- Class[] classes = new Class[props.size() + refs.size()];
- int i = 0;
- for (JavaElementImpl property : props) {
- classes[i] = property.getType();
- i++;
- }
- for (JavaElementImpl reference : refs) {
- classes[i] = reference.getType();
- i++;
- }
- return areUnique(classes);
- }
-
- /**
- * Unambiguously finds the reference or property associated with the given
- * type
- *
- * @return the name of the reference or property if found, null if not
- * @throws AmbiguousConstructorException if the constructor parameter cannot
- * be resolved to a property or reference
- */
- private boolean findReferenceOrProperty(JavaParameterImpl parameter,
- Map<String, JavaElementImpl> props,
- Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
-
- boolean found = false;
- if (!"".equals(parameter.getName())) {
- // Match by name
- JavaElementImpl prop = props.get(parameter.getName());
- if (prop != null && prop.getType() == parameter.getType()) {
- parameter.setClassifer(Property.class);
- return true;
- }
- JavaElementImpl ref = refs.get(parameter.getName());
- if (ref != null && ref.getType() == parameter.getType()) {
- parameter.setClassifer(Reference.class);
- return true;
- }
- }
- for (JavaElementImpl property : props.values()) {
- if (property.getType() == parameter.getType()) {
- if (found) {
- throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
- (Member)parameter.getAnchor());
- }
- parameter.setClassifer(Property.class);
- parameter.setName(property.getName());
- found = true;
- // do not break since ambiguities must be checked, i.e. more
- // than one prop or ref of the same type
- }
- }
- for (JavaElementImpl reference : refs.values()) {
- if (reference.getType() == parameter.getType()) {
- if (found) {
- throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
- (Member)parameter.getAnchor());
- }
- parameter.setClassifer(Reference.class);
- parameter.setName(reference.getName());
- found = true;
- // do not break since ambiguities must be checked, i.e. more
- // than one prop or ref of the same type
- }
- }
- return found;
- }
-
- /**
- * Returns true if a given type is reference according to the SCA
- * specification rules for determining reference types The following rules
- * are used to determine whether an unannotated field or setter method is a
- * property or reference:
- * <ol>
- * <li>If its type is simple, then it is a property.
- * <li>If its type is complex, then if the type is an interface marked by
- *
- * @Remotable, then it is a reference; otherwise, it is a property.
- * <li>Otherwise, if the type associated with the member is an
- * array or a java.util.Collection, the basetype is the element
- * type of the array or the parameterized type of the
- * Collection; otherwise the basetype is the member type. If the
- * basetype is an interface with an
- * @Remotable or
- * @Service annotation then the member is defined as a reference. Otherwise,
- * it is defined as a property.
- * </ol>
- * <p>
- * The name of the reference or of the property is derived from the
- * name found on the setter method or on the field.
- */
- private boolean isReferenceType(Class<?> cls, Type genericType) {
- Class<?> baseType = JavaIntrospectionHelper.getBaseType(cls, genericType);
- return baseType.isInterface() && baseType.isAnnotationPresent(Remotable.class);
- }
-
- /**
- * Returns true if the given operation is defined in the collection of
- * service interfaces
- */
- private boolean isInServiceInterface(Method operation, List<org.apache.tuscany.sca.assembly.Service> services) {
- for (org.apache.tuscany.sca.assembly.Service service : services) {
- Interface interface1 = service.getInterfaceContract().getInterface();
- if (interface1 instanceof JavaInterface) {
- Class<?> clazz = ((JavaInterface)interface1).getJavaClass();
- if (isMethodMatched(clazz, operation)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Test if the class declares a method which matches the signature of the
- * given method
- *
- * @param clazz
- * @param method
- * @return
- */
- private boolean isMethodMatched(Class<?> clazz, Method method) {
- if (method.getDeclaringClass() == clazz) {
- return true;
- }
- Method[] methods = clazz.getMethods();
- for (Method m : methods) {
- if (JavaIntrospectionHelper.exactMethodMatch(method, m)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Creates a mapped property.
- *
- * @param name the property name
- * @param paramType the property type
- */
- private org.apache.tuscany.sca.assembly.Property createProperty(String name, Class<?> paramType) {
- org.apache.tuscany.sca.assembly.Property property = assemblyFactory.createProperty();
- property.setName(name);
- property.setXSDType(JavaXMLMapper.getXMLType(paramType));
- return property;
- }
-
- private boolean isAnnotated(JavaParameterImpl parameter) {
- for (Annotation annotation : parameter.getAnnotations()) {
- Class<? extends Annotation> annotType = annotation.annotationType();
- if (annotType.equals(Property.class) || annotType.equals(Reference.class)
- || annotType.equals(Resource.class)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean areUnique(JavaParameterImpl[] parameters) {
- Set<Class> set = new HashSet<Class>(parameters.length);
- for (JavaParameterImpl p : parameters) {
- if (!set.add(p.getType())) {
- return false;
- }
- }
- return true;
- }
-
- public org.apache.tuscany.sca.assembly.Reference createReference(String name, Class<?> paramType)
- throws IntrospectionException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- reference.setName(name);
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
- try {
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(paramType);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- reference.setMultiplicity(Multiplicity.ZERO_ONE);
- } catch (InvalidInterfaceException e1) {
- throw new IntrospectionException(e1);
- }
-
- // FIXME: This part seems to have already been taken care above!!
- try {
- processCallback(paramType, reference);
- } catch (InvalidServiceTypeException e) {
- throw new IntrospectionException(e);
- }
- return reference;
- }
-
- public org.apache.tuscany.sca.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
- org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService();
- service.setName(interfaze.getSimpleName());
-
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(interfaze);
- service.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- Interface javaInterface = service.getInterfaceContract().getInterface();
- javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
- service.getInterfaceContract().setInterface(javaInterface);
- return service;
- }
-
- public void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
- Callback callback = interfaze.getAnnotation(Callback.class);
- if (callback != null && !Void.class.equals(callback.value())) {
- Class<?> callbackClass = callback.value();
- JavaInterface javaInterface;
- try {
- javaInterface = javaInterfaceFactory.createJavaInterface(callbackClass);
- contract.getInterfaceContract().setCallbackInterface(javaInterface);
- } catch (InvalidInterfaceException e) {
- throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
- }
- } else if (callback != null && Void.class.equals(callback.value())) {
- throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
- }
- }
-
- public boolean injectionAnnotationsPresent(Annotation[][] annots) {
- for (Annotation[] annotations : annots) {
- for (Annotation annotation : annotations) {
- Class<? extends Annotation> annotType = annotation.annotationType();
- if (annotType.equals(Property.class) || annotType.equals(Reference.class)
- || annotType.equals(Resource.class)) {
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
index bd3134c..4fbe5da 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
@@ -18,9 +18,6 @@
*/
package org.apache.tuscany.sca.implementation.spring.introspect;
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -32,18 +29,19 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.ComponentType;
@@ -51,16 +49,15 @@
import org.apache.tuscany.sca.assembly.Property;
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.ContributionFactory;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
import org.apache.tuscany.sca.contribution.resolver.ClassReference;
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -68,11 +65,11 @@
import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementationConstants;
import org.apache.tuscany.sca.implementation.spring.SpringPropertyElement;
import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.apache.tuscany.sca.implementation.spring.xml.SpringXMLBeanDefinitionLoader;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
@@ -81,7 +78,9 @@
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
+import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySet;
/**
* Introspects a Spring XML application-context configuration file to create <implementation-spring../>
@@ -90,42 +89,27 @@
* @version $Rev$ $Date$
*/
public class SpringXMLComponentTypeLoader {
+ private final static Logger log = Logger.getLogger(SpringXMLComponentTypeLoader.class.getName());
+
private ExtensionPointRegistry registry;
- private XMLInputFactory xmlInputFactory;
private ContributionFactory contributionFactory;
private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
private PolicyFactory policyFactory;
- private PolicySubjectProcessor policyProcessor;
- private Monitor monitor;
+ private JavaInterfaceFactory javaFactory;
private SpringBeanIntrospector beanIntrospector;
- public SpringXMLComponentTypeLoader(ExtensionPointRegistry registry,
- Monitor monitor) {
+ private SpringXMLBeanDefinitionLoader xmlBeanDefinitionLoader;
+
+ public SpringXMLComponentTypeLoader(ExtensionPointRegistry registry) {
super();
this.registry = registry;
FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
- this.javaFactory = factories.getFactory(JavaInterfaceFactory.class);
this.policyFactory = factories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicySubjectProcessor(policyFactory);
+ this.javaFactory = factories.getFactory(JavaInterfaceFactory.class);
this.contributionFactory = factories.getFactory(ContributionFactory.class);
- this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
+ this.xmlBeanDefinitionLoader =
+ registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(SpringXMLBeanDefinitionLoader.class);
}
/**
@@ -135,13 +119,37 @@
* @param message
* @param model
*/
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
+ private void error(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ "impl-spring-validation-messages",
+ Severity.ERROR,
+ model,
+ message,
+ (Object[])messageParameters);
+ monitor.problem(problem);
+ }
}
-
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void warning(Monitor monitor, String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ "impl-spring-validation-messages",
+ Severity.WARNING,
+ model,
+ message,
+ (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
protected Class<SpringImplementation> getImplementationClass() {
return SpringImplementation.class;
}
@@ -151,9 +159,10 @@
* Spring implementation
*
*/
- public void load(SpringImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionReadException {
+ public void load(SpringImplementation implementation, ModelResolver resolver, ProcessorContext context)
+ throws ContributionReadException {
//System.out.println("Spring TypeLoader - load method start");
- ComponentType componentType = implementation.getComponentType();
+ ComponentType componentType = implementation.getComponentType();
/* Check that there is a component type object already set */
if (componentType == null) {
throw new ContributionReadException("SpringXMLLoader load: implementation has no ComponentType object");
@@ -164,10 +173,11 @@
if (!componentType.isUnresolved())
implementation.setUnresolved(false);
} // end if
- //System.out.println("Spring TypeLoader - load method complete");
+ //System.out.println("Spring TypeLoader - load method complete");
} // end method load
- private Class<?> resolveClass(ModelResolver resolver, String className, ProcessorContext context) throws ClassNotFoundException {
+ private Class<?> resolveClass(ModelResolver resolver, String className, ProcessorContext context)
+ throws ClassNotFoundException {
ClassReference classReference = new ClassReference(className);
classReference = resolver.resolveModel(ClassReference.class, classReference, context);
if (classReference.isUnresolved()) {
@@ -184,8 +194,8 @@
* @param implementation SpringImplementation into which to load the component type information
* @throws ContributionReadException Failed to read the contribution
*/
- private void loadFromXML(SpringImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionReadException {
- XMLStreamReader reader;
+ private void loadFromXML(SpringImplementation implementation, ModelResolver resolver, ProcessorContext context)
+ throws ContributionReadException {
List<SpringBeanElement> beans = new ArrayList<SpringBeanElement>();
List<SpringSCAServiceElement> services = new ArrayList<SpringSCAServiceElement>();
List<SpringSCAReferenceElement> references = new ArrayList<SpringSCAReferenceElement>();
@@ -195,35 +205,37 @@
List<URL> contextResources = new ArrayList<URL>();
String contextPath = implementation.getLocation();
- try {
+ try {
resource = resolveLocation(resolver, contextPath, context);
contextResources = getApplicationContextResource(resource);
-
+
implementation.setClassLoader(new ContextClassLoader(resolver, context));
implementation.setResource(contextResources);
// The URI is used to uniquely identify the Implementation
implementation.setURI(resource.toString());
-
- for (URL contextResource : contextResources) {
- List<SpringBeanElement> appCxtBeans = new ArrayList<SpringBeanElement>();
- List<SpringSCAServiceElement> appCxtServices = new ArrayList<SpringSCAServiceElement>();
- List<SpringSCAReferenceElement> appCxtReferences = new ArrayList<SpringSCAReferenceElement>();
- List<SpringSCAPropertyElement> appCxtProperties = new ArrayList<SpringSCAPropertyElement>();
- reader = xmlInputFactory.createXMLStreamReader(contextResource.openStream());
- // Read the beans, services, references and properties for individual application context
- readContextDefinition(resolver, reader, contextPath, appCxtBeans, appCxtServices, appCxtReferences, appCxtProperties, context);
- // Validate the beans from individual application context for uniqueness
- validateBeans(appCxtBeans, appCxtServices, appCxtReferences, appCxtProperties);
- // Add all the validated beans to the generic list
- beans.addAll(appCxtBeans);
- services.addAll(appCxtServices);
- references.addAll(appCxtReferences);
- scaproperties.addAll(appCxtProperties);
- reader.close();
+
+ List<SpringBeanElement> appCxtBeans = new ArrayList<SpringBeanElement>();
+ List<SpringSCAServiceElement> appCxtServices = new ArrayList<SpringSCAServiceElement>();
+ List<SpringSCAReferenceElement> appCxtReferences = new ArrayList<SpringSCAReferenceElement>();
+ List<SpringSCAPropertyElement> appCxtProperties = new ArrayList<SpringSCAPropertyElement>();
+
+ if (xmlBeanDefinitionLoader != null) {
+ xmlBeanDefinitionLoader.load(contextResources,
+ appCxtServices,
+ appCxtReferences,
+ appCxtProperties,
+ appCxtBeans,
+ context);
+ populatePolicies(appCxtServices, appCxtReferences);
}
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
+ // Validate the beans from individual application context for uniqueness
+ validateBeans(appCxtBeans, appCxtServices, appCxtReferences, appCxtProperties, context.getMonitor());
+ // Add all the validated beans to the generic list
+ beans.addAll(appCxtBeans);
+ services.addAll(appCxtServices);
+ references.addAll(appCxtReferences);
+ scaproperties.addAll(appCxtProperties);
+ } catch (Throwable e) {
throw new ContributionReadException(e);
}
@@ -235,18 +247,61 @@
return;
} // end method loadFromXML
- private URL resolveLocation(ModelResolver resolver, String contextPath, ProcessorContext context) throws MalformedURLException,
- ContributionReadException {
+ public void populatePolicies(List<SpringSCAServiceElement> appCxtServices,
+ List<SpringSCAReferenceElement> appCxtReferences) {
+ for (SpringSCAReferenceElement e : appCxtReferences) {
+ for (QName qn : e.getIntentNames()) {
+ Intent intent = policyFactory.createIntent();
+ intent.setName(qn);
+ e.getRequiredIntents().add(intent);
+ }
+ for (QName qn : e.getPolicySetNames()) {
+ PolicySet ps = policyFactory.createPolicySet();
+ ps.setName(qn);
+ e.getPolicySets().add(ps);
+ }
+ }
+
+ for (SpringSCAServiceElement e : appCxtServices) {
+ for (QName qn : e.getIntentNames()) {
+ Intent intent = policyFactory.createIntent();
+ intent.setName(qn);
+ e.getRequiredIntents().add(intent);
+ }
+ for (QName qn : e.getPolicySetNames()) {
+ PolicySet ps = policyFactory.createPolicySet();
+ ps.setName(qn);
+ e.getPolicySets().add(ps);
+ }
+ }
+ }
+
+ private URL resolveLocation(ModelResolver resolver, String contextPath, ProcessorContext context)
+ throws MalformedURLException, ContributionReadException {
URL resource = null;
URI uri = URI.create(contextPath);
if (!uri.isAbsolute()) {
+ Artifact parent = context.getArtifact();
+ if (parent != null && parent.getURI() != null) {
+ URI base = URI.create("/" + parent.getURI());
+ uri = base.resolve(uri);
+ // Remove the leading / to make artifact resolver happy
+ if (uri.toString().startsWith("/")) {
+ uri = URI.create(uri.toString().substring(1));
+ }
+ }
Artifact artifact = contributionFactory.createArtifact();
artifact.setUnresolved(true);
- artifact.setURI(contextPath);
+ artifact.setURI(uri.toString());
artifact = resolver.resolveModel(Artifact.class, artifact, context);
if (!artifact.isUnresolved()) {
resource = new URL(artifact.getLocation());
} else {
+ // The resource can be out of scope of the contribution root
+ if (parent != null && parent.getLocation() != null) {
+ resource = new URL(new URL(parent.getLocation()), contextPath);
+ return resource;
+ }
throw new ContributionReadException("Location cannot be resloved: " + contextPath);
}
} else {
@@ -256,282 +311,6 @@
}
/**
- * Method which returns the XMLStreamReader for the Spring application-context.xml file
- * specified in the location attribute
- */
- private XMLStreamReader getApplicationContextReader(ModelResolver resolver, String location, ProcessorContext context) throws ContributionReadException {
-
- try {
- URL resource = getApplicationContextResource(resolveLocation(resolver, location, context)).get(0);
- XMLStreamReader reader =
- xmlInputFactory.createXMLStreamReader(resource.openStream());
- return reader;
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Method which reads the spring context definitions from Spring application-context.xml
- * file and identifies the defined beans, properties, services and references
- * @param context
- */
- private void readContextDefinition(ModelResolver resolver,
- XMLStreamReader reader,
- String contextPath,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties, ProcessorContext context) throws ContributionReadException {
-
- SpringBeanElement bean = null;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- //System.out.println("Spring TypeLoader - found element with name: " + qname.toString());
- if (SpringImplementationConstants.IMPORT_ELEMENT.equals(qname)) {
- //FIXME - put the sequence of code below which gets the ireader into a subsidiary method
- String location = reader.getAttributeValue(null, "resource");
- if (location != null) {
- // FIXME - need to find a right way of generating this path
- String resourcePath = contextPath.substring(0, contextPath.lastIndexOf("/")+1) + location;
- XMLStreamReader ireader = getApplicationContextReader(resolver, resourcePath, context);
- // Read the context definition for the identified imported resource
- readContextDefinition(resolver, ireader, contextPath, beans, services, references, scaproperties, context);
- }
- } else if (SpringImplementationConstants.SCA_SERVICE_ELEMENT.equals(qname)) {
- // The value of the @name attribute of an <sca:service/> subelement of a <beans/>
- // element MUST be unique amongst the <sca:service/> subelements of the <beans/> element.
- if (!services.isEmpty() && (services.contains(reader.getAttributeValue(null, "name"))))
- error("ScaServiceNameNotUnique", resolver);
-
- SpringSCAServiceElement service =
- new SpringSCAServiceElement(reader.getAttributeValue(null, "name"),
- reader.getAttributeValue(null, "target"));
- if (reader.getAttributeValue(null, "type") != null)
- service.setType(reader.getAttributeValue(null, "type"));
- policyProcessor.readPolicies(service, reader);
- services.add(service);
- } else if (SpringImplementationConstants.SCA_REFERENCE_ELEMENT.equals(qname)) {
- // The value of the @name attribute of an <sca:reference/> subelement of a <beans/>
- // element MUST be unique amongst the @name attributes of the <sca:reference/> subelements,
- // of the <beans/> element.
- if (!references.isEmpty() && (references.contains(reader.getAttributeValue(null, "name"))))
- error("ScaReferenceNameNotUnique", resolver);
-
- SpringSCAReferenceElement reference =
- new SpringSCAReferenceElement(reader.getAttributeValue(null, "name"),
- reader.getAttributeValue(null, "type"));
- if (reader.getAttributeValue(null, "default") != null)
- reference.setDefaultBean(reader.getAttributeValue(null, "default"));
- policyProcessor.readPolicies(reference, reader);
- references.add(reference);
- } else if (SpringImplementationConstants.SCA_PROPERTY_ELEMENT.equals(qname)) {
- // The value of the @name attribute of an <sca:property/> subelement of a <beans/>
- // element MUST be unique amongst the @name attributes of the <sca:property/> subelements,
- // of the <beans/> element.
- if (!scaproperties.isEmpty() && (scaproperties.contains(reader.getAttributeValue(null, "name"))))
- error("ScaPropertyNameNotUnique", resolver);
-
- SpringSCAPropertyElement scaproperty =
- new SpringSCAPropertyElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"));
- scaproperties.add(scaproperty);
- } else if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
- bean = new SpringBeanElement(reader.getAttributeValue(null, "id"),
- reader.getAttributeValue(null, "class"));
- if (reader.getAttributeValue(null, "abstract") != null)
- if (reader.getAttributeValue(null, "abstract").equals("true"))
- bean.setAbstractBean(true);
- if (reader.getAttributeValue(null, "parent") != null)
- if (!reader.getAttributeValue(null, "parent").equals(""))
- bean.setParentAttribute(true);
- if (reader.getAttributeValue(null, "factory-bean") != null)
- if (!reader.getAttributeValue(null, "factory-bean").equals(""))
- bean.setFactoryBeanAttribute(true);
- if (reader.getAttributeValue(null, "factory-method") != null)
- if (!reader.getAttributeValue(null, "factory-method").equals(""))
- bean.setFactoryMethodAttribute(true);
- // Set the first name as bean name, when the @id attribute is absent.
- if (reader.getAttributeValue(null, "id") == null) {
- if (reader.getAttributeValue(null, "name") != null) {
- String[] names = (reader.getAttributeValue(null, "name")).split(",");
- bean.setId(names[0]);
- }
- }
- beans.add(bean);
- // Read the <bean> element and its child elements
- readBeanDefinition(reader, bean, beans);
- } // end if
- break;
- case END_ELEMENT:
- if (SpringImplementationConstants.BEANS_ELEMENT.equals(reader.getName())) {
- //System.out.println("Spring TypeLoader - finished read of context file");
- completed = true;
- break;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
-
- /**
- * Method which reads the bean definitions from Spring application-context.xml file and identifies
- * the defined beans, properties, services and references
- */
- private void readBeanDefinition(XMLStreamReader reader,
- SpringBeanElement bean,
- List<SpringBeanElement> beans) throws ContributionReadException {
-
- SpringBeanElement innerbean = null;
- SpringPropertyElement property = null;
- SpringConstructorArgElement constructorArg = null;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
- innerbean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
- .getAttributeValue(null, "class"));
- // Set the first name as bean name, when the @id attribute is absent.
- if (reader.getAttributeValue(null, "id") == null) {
- if (reader.getAttributeValue(null, "name") != null) {
- String[] names = (reader.getAttributeValue(null, "name")).split(",");
- innerbean.setId(names[0]);
- }
- }
- innerbean.setInnerBean(true);
- beans.add(innerbean);
- readBeanDefinition(reader, innerbean, beans);
- } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(qname)) {
- property = new SpringPropertyElement(reader.getAttributeValue(null, "name"));
- if (reader.getAttributeValue(null, "ref") != null)
- property.addRef(reader.getAttributeValue(null, "ref"));
- bean.addProperty(property);
- } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(qname)) {
- constructorArg = new SpringConstructorArgElement(reader.getAttributeValue(null, "type"));
- if (reader.getAttributeValue(null, "ref") != null)
- constructorArg.addRef(reader.getAttributeValue(null, "ref"));
- if (reader.getAttributeValue(null, "index") != null)
- constructorArg.setIndex((new Integer(reader.getAttributeValue(null, "index"))).intValue());
- if (reader.getAttributeValue(null, "value") != null)
- constructorArg.addValue(reader.getAttributeValue(null, "value"));
- bean.addCustructorArgs(constructorArg);
- } else if (SpringImplementationConstants.REF_ELEMENT.equals(qname)) {
- String ref = reader.getAttributeValue(null, "bean");
- // Check if the parent element is a property
- if (property != null) property.addRef(ref);
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) constructorArg.addRef(ref);
- } else if (SpringImplementationConstants.VALUE_ELEMENT.equals(qname)) {
- String value = reader.getElementText();
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) constructorArg.addValue(value);
- } else if (SpringImplementationConstants.LIST_ELEMENT.equals(qname) ||
- SpringImplementationConstants.SET_ELEMENT.equals(qname) ||
- SpringImplementationConstants.MAP_ELEMENT.equals(qname)) {
- if (property != null)
- readCollections(reader, bean, beans, property, null);
- if (constructorArg != null)
- readCollections(reader, bean, beans, null, constructorArg);
- } // end if
- break;
- case END_ELEMENT:
- if (SpringImplementationConstants.BEAN_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(reader.getName())) {
- property = null;
- } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(reader.getName())) {
- constructorArg = null;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
-
- /**
- * Method which reads the collection elements from Spring application-context.xml file and identifies
- * the defined beans, list, maps and sets
- */
- private void readCollections(XMLStreamReader reader,
- SpringBeanElement bean,
- List<SpringBeanElement> beans,
- SpringPropertyElement property,
- SpringConstructorArgElement constructorArg) throws ContributionReadException {
-
- SpringBeanElement innerbean = null;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
- innerbean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
- .getAttributeValue(null, "class"));
- // Set the first name as bean name, when the @id attribute is absent.
- if (reader.getAttributeValue(null, "id") == null)
- if (reader.getAttributeValue(null, "name") != null) {
- String[] names = (reader.getAttributeValue(null, "name")).split(",");
- innerbean.setId(names[0]);
- }
- innerbean.setInnerBean(true);
- beans.add(innerbean);
- readBeanDefinition(reader, innerbean, beans);
- } else if (SpringImplementationConstants.REF_ELEMENT.equals(qname)) {
- String ref = reader.getAttributeValue(null, "bean");
- if (property != null) property.addRef(ref);
- if (constructorArg != null) constructorArg.addRef(ref);
- } else if (SpringImplementationConstants.LIST_ELEMENT.equals(qname) ||
- SpringImplementationConstants.SET_ELEMENT.equals(qname) ||
- SpringImplementationConstants.MAP_ELEMENT.equals(qname)) {
- if (property != null)
- readCollections(reader, innerbean, beans, property, null);
- if (constructorArg != null)
- readCollections(reader, innerbean, beans, null, constructorArg);
- } else if (SpringImplementationConstants.ENTRY_ELEMENT.equals(qname)) {
- String keyRef = reader.getAttributeValue(null, "key-ref");
- String valueRef = reader.getAttributeValue(null, "value-ref");
- if (property != null) {property.addRef(keyRef); property.addRef(valueRef);}
- if (constructorArg != null) {constructorArg.addRef(keyRef); constructorArg.addRef(valueRef);}
- } // end if
- break;
- case END_ELEMENT:
- if (SpringImplementationConstants.LIST_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } else if (SpringImplementationConstants.SET_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } else if (SpringImplementationConstants.MAP_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
* Generates the Spring implementation component type from the configuration contained in the
* lists of beans, services, references and scaproperties derived from the application context
*/
@@ -553,14 +332,14 @@
* at another bean in the application context becomes a property in the component type
*/
- JavaImplementation javaImplementation = null;
+ JavaImplementation javaImplementation = null;
ComponentType componentType = implementation.getComponentType();
try {
// Deal with the services first....
Iterator<SpringSCAServiceElement> its = services.iterator();
while (its.hasNext()) {
- SpringSCAServiceElement serviceElement = its.next();
+ SpringSCAServiceElement serviceElement = its.next();
Class<?> interfaze = resolveClass(resolver, serviceElement.getType(), context);
Service theService = createService(interfaze, serviceElement.getName());
// Spring allows duplication of bean definitions in multiple context scenario,
@@ -568,25 +347,35 @@
// we will remove any older definition and use the latest.
Service duplicate = null;
for (Service service : componentType.getServices()) {
- if (service.getName().equals(theService.getName()))
- duplicate = service;
+ if (service.getName().equals(theService.getName()))
+ duplicate = service;
}
if (duplicate != null)
- componentType.getServices().remove(duplicate);
-
+ componentType.getServices().remove(duplicate);
+
componentType.getServices().add(theService);
// Add this service to the Service / Bean map
String beanName = serviceElement.getTarget();
+ boolean found = false;
for (SpringBeanElement beanElement : beans) {
if (beanName.equals(beanElement.getId())) {
- if (isvalidBeanForService(beanElement)) {
- // add the required intents and policySets for the service
+ if (isValidBeanForService(beanElement)) {
+ // add the required intents and policySets for the service
theService.getRequiredIntents().addAll(serviceElement.getRequiredIntents());
theService.getPolicySets().addAll(serviceElement.getPolicySets());
implementation.setBeanForService(theService, beanElement);
- }
+ found = true;
+ break;
+ }
}
} // end for
+
+ if (!found) {
+ // REVIEW: Adding a SpringBeanElement "proxy" so that the bean id can be used at runtime to look
+ // up the bean instance from the parent context
+ implementation.setBeanForService(theService,
+ new SpringBeanElement(serviceElement.getTarget(), null));
+ }
} // end while
// Next handle the references
@@ -599,12 +388,12 @@
// for the duplicate definitions found.
Reference duplicate = null;
for (Reference reference : componentType.getReferences()) {
- if (reference.getName().equals(theReference.getName()))
- duplicate = reference;
+ if (reference.getName().equals(theReference.getName()))
+ duplicate = reference;
}
if (duplicate != null)
- componentType.getReferences().remove(duplicate);
-
+ componentType.getReferences().remove(duplicate);
+
// add the required intents and policySets for this reference
theReference.getRequiredIntents().addAll(referenceElement.getRequiredIntents());
theReference.getPolicySets().addAll(referenceElement.getPolicySets());
@@ -627,12 +416,12 @@
// for the duplicate definitions found.
Property duplicate = null;
for (Property property : componentType.getProperties()) {
- if (property.getName().equals(theProperty.getName()))
- duplicate = property;
+ if (property.getName().equals(theProperty.getName()))
+ duplicate = property;
}
if (duplicate != null)
- componentType.getProperties().remove(duplicate);
-
+ componentType.getProperties().remove(duplicate);
+
componentType.getProperties().add(theProperty);
// Remember the Java Class (ie the type) for this property
implementation.setPropertyClass(theProperty.getName(), propType);
@@ -647,25 +436,34 @@
// Loop through all the beans found
while (itb.hasNext()) {
SpringBeanElement beanElement = itb.next();
+
// If its not a valid bean for service, ignore it
- if (!isvalidBeanForService(beanElement)) continue;
- // Load the Spring bean class
- Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(), context);
- // Introspect the bean
- beanIntrospector =
- new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
- ComponentType beanComponentType = assemblyFactory.createComponentType();
- javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
- // Set the service name as bean name
- for (Service componentService : beanComponentType.getServices())
- componentService.setName(beanElement.getId());
- // Get the service interface defined by this Spring Bean and add to
- // the component type of the Spring Assembly
- List<Service> beanServices = beanComponentType.getServices();
- componentType.getServices().addAll(beanServices);
- // Add these services to the Service / Bean map
- for (Service beanService : beanServices) {
- implementation.setBeanForService(beanService, beanElement);
+ if (!isValidBeanForService(beanElement)) {
+ continue;
+ }
+ try {
+ // Load the Spring bean class
+ Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(), context);
+ // Introspect the bean
+ beanIntrospector = new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
+ ComponentType beanComponentType = assemblyFactory.createComponentType();
+ javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
+ // Set the service name as bean name
+ for (Service componentService : beanComponentType.getServices()) {
+ componentService.setName(beanElement.getId());
+ }
+ // Get the service interface defined by this Spring Bean and add to
+ // the component type of the Spring Assembly
+ List<Service> beanServices = beanComponentType.getServices();
+ componentType.getServices().addAll(beanServices);
+ // Add these services to the Service / Bean map
+ for (Service beanService : beanServices) {
+ implementation.setBeanForService(beanService, beanElement);
+ }
+ } catch (Throwable e) {
+ // [rfeng] FIXME: Some Spring beans have constructors that take pararemters injected by Spring and
+ // Tuscany is not happy with that during the introspection
+ log.log(Level.SEVERE, e.getMessage(), e);
}
} // end while
} // end if
@@ -673,16 +471,28 @@
itb = beans.iterator();
while (itb.hasNext()) {
SpringBeanElement beanElement = itb.next();
+
+ // If its not a valid bean for service, ignore it
+ if (!isValidBeanForService(beanElement)) {
+ continue;
+ }
// Ignore if the bean has no properties and constructor arguments
if (beanElement.getProperties().isEmpty() && beanElement.getCustructorArgs().isEmpty())
- continue;
+ continue;
- Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(), context);
- // Introspect the bean
- beanIntrospector =
- new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
ComponentType beanComponentType = assemblyFactory.createComponentType();
- javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
+
+ try {
+ Class<?> beanClass = resolveClass(resolver, beanElement.getClassName(), context);
+ // Introspect the bean
+ beanIntrospector = new SpringBeanIntrospector(registry, beanElement.getCustructorArgs());
+ javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
+ } catch (Exception e) {
+ // [rfeng] FIXME: Some Spring beans have constructors that take pararemters injected by Spring and
+ // Tuscany is not happy with that during the introspection
+ log.log(Level.SEVERE, e.getMessage(), e);
+ continue;
+ }
Map<String, JavaElementImpl> propertyMap = javaImplementation.getPropertyMembers();
JavaConstructorImpl constructor = javaImplementation.getConstructor();
// Get the references by this Spring Bean and add the unresolved ones to
@@ -690,66 +500,85 @@
List<Reference> beanReferences = beanComponentType.getReferences();
List<Property> beanProperties = beanComponentType.getProperties();
+ Set<String> excludedNames = new HashSet<String>();
Iterator<SpringPropertyElement> itp = beanElement.getProperties().iterator();
while (itp.hasNext()) {
SpringPropertyElement propertyElement = itp.next();
+ // Exclude the reference that is also known as a spring property
+ excludedNames.add(propertyElement.getName());
for (String propertyRef : propertyElement.getRefs()) {
- if (propertyRefUnresolved(propertyRef, beans, references, scaproperties)) {
- // This means an unresolved reference from the spring bean...
- for (Reference reference : beanReferences) {
- if (propertyElement.getName().equals(reference.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- reference.setName(propertyRef);
- componentType.getReferences().add(reference);
- } // end if
- } // end for
-
- // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
- for (Property scaproperty : beanProperties) {
- if (propertyElement.getName().equals(scaproperty.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- Class<?> interfaze = resolveClass(resolver, (propertyMap.get(propertyElement.getName()).getType()).getName(), context);
- Reference theReference = createReference(interfaze, propertyRef);
- implementation.setUnresolvedBeanRef(propertyRef, theReference);
- } // end if
- } // end for
- } // end if
+ if (propertyRefUnresolved(propertyRef, beans, references, scaproperties)) {
+ // This means an unresolved reference from the spring bean...
+ for (Reference reference : beanReferences) {
+ if (propertyElement.getName().equals(reference.getName())) {
+ // The name of the reference in this case is the string in
+ // the @ref attribute of the Spring property element, NOT the
+ // name of the field in the Spring bean....
+ reference.setName(propertyRef);
+ componentType.getReferences().add(reference);
+ break;
+ } // end if
+ } // end for
+
+ // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
+ for (Property scaproperty : beanProperties) {
+ if (propertyElement.getName().equals(scaproperty.getName())) {
+ // The name of the reference in this case is the string in
+ // the @ref attribute of the Spring property element, NOT the
+ // name of the field in the Spring bean....
+ Class<?> interfaze =
+ resolveClass(resolver,
+ (propertyMap.get(propertyElement.getName()).getType()).getName(),
+ context);
+ Reference theReference = createReference(interfaze, propertyRef);
+ implementation.setUnresolvedBeanRef(propertyRef, theReference);
+ break;
+ } // end if
+ } // end for
+ } // end if
} // end for
} // end while
Iterator<SpringConstructorArgElement> itcr = beanElement.getCustructorArgs().iterator();
while (itcr.hasNext()) {
- SpringConstructorArgElement conArgElement = itcr.next();
- for (String constructorArgRef : conArgElement.getRefs()) {
- if (propertyRefUnresolved(constructorArgRef, beans, references, scaproperties)) {
- for (JavaParameterImpl parameter : constructor.getParameters()) {
- String paramType = parameter.getType().getName();
- Class<?> interfaze = resolveClass(resolver, paramType, context);
- // Create a component type reference/property if the constructor-arg element has a
- // type attribute OR index attribute declared...
- if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) ||
- (conArgElement.getIndex() != -1 && (conArgElement.getIndex() == parameter.getIndex())))
- {
- if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Reference")) {
- Reference theReference = createReference(interfaze, constructorArgRef);
- componentType.getReferences().add(theReference);
- }
- if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Property")) {
- // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
- // we might need to verify with the component definition later.
- Reference theReference = createReference(interfaze, constructorArgRef);
- implementation.setUnresolvedBeanRef(constructorArgRef, theReference);
- }
- }
- } // end for
- } // end if
- } // end for
+ SpringConstructorArgElement conArgElement = itcr.next();
+ for (String constructorArgRef : conArgElement.getRefs()) {
+ if (propertyRefUnresolved(constructorArgRef, beans, references, scaproperties)) {
+ for (JavaParameterImpl parameter : constructor.getParameters()) {
+ String paramType = parameter.getType().getName();
+ Class<?> interfaze = resolveClass(resolver, paramType, context);
+ // Create a component type reference/property if the constructor-arg element has a
+ // type attribute OR index attribute declared...
+ if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) || (conArgElement
+ .getIndex() != -1 && (conArgElement.getIndex() == parameter.getIndex()))) {
+ // [rfeng] Commenting out the following code as the constructor parameter based SCA
+ // references are added already
+ /*
+ if (parameter.getClassifer() == org.oasisopen.sca.annotation.Reference.class) {
+ Reference theReference = createReference(interfaze, constructorArgRef);
+ componentType.getReferences().add(theReference);
+ }
+ */
+ if (parameter.getClassifer() == org.oasisopen.sca.annotation.Property.class) {
+ // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
+ // we might need to verify with the component definition later.
+ Reference theReference = createReference(interfaze, constructorArgRef);
+ implementation.setUnresolvedBeanRef(constructorArgRef, theReference);
+ }
+ }
+ } // end for
+ } // end if
+ } // end for
} // end while
+ // [rfeng] Add the remaining introspected references (w/ @Reference but without Spring property ref)
+ for (Reference ref : beanReferences) {
+ if (!excludedNames.contains(ref.getName()) && componentType.getReference(ref.getName()) == null) {
+ // Only add the ones that not listed by sca:reference
+ componentType.getReferences().add(ref);
+ }
+ }
+
} // end while
} catch (ClassNotFoundException e) {
@@ -757,8 +586,6 @@
throw new ContributionReadException(e);
} catch (InvalidInterfaceException e) {
throw new ContributionReadException(e);
- } catch (ContributionResolveException e) {
-
} // end try
// If we get here, the Spring assembly component type is resolved
@@ -793,7 +620,7 @@
break;
} // end if
} // end while
- // Scan over the SCA reference elements looking for a match
+ // Scan over the SCA reference elements looking for a match
if (unresolved) {
Iterator<SpringSCAReferenceElement> itr = references.iterator();
while (itr.hasNext()) {
@@ -804,7 +631,7 @@
} // end if
} // end while
} // end if
- // Scan over the SCA property elements looking for a match
+ // Scan over the SCA property elements looking for a match
if (unresolved) {
Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
while (itsp.hasNext()) {
@@ -824,35 +651,39 @@
return unresolved;
} // end method propertyRefUnresolved
-
+
/**
* Validates whether the <sca:service>, <sca:reference> and <sca:property> elements
* has unique names within the application context.
*/
private void validateBeans(List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
-
- // The @target attribute of a <service/> subelement of a <beans/> element
- // MUST have the value of the @name attribute of one of the <bean/>
- // subelements of the <beans/> element.
- Iterator<SpringSCAServiceElement> its = services.iterator();
+ List<SpringSCAServiceElement> services,
+ List<SpringSCAReferenceElement> references,
+ List<SpringSCAPropertyElement> scaproperties,
+ Monitor monitor) throws ContributionReadException {
+
+ // The @target attribute of a <service/> subelement of a <beans/> element
+ // MUST have the value of the @name attribute of one of the <bean/>
+ // subelements of the <beans/> element.
+ Iterator<SpringSCAServiceElement> its = services.iterator();
while (its.hasNext()) {
- SpringSCAServiceElement serviceElement = its.next();
- boolean targetBeanExists = false;
- Iterator<SpringBeanElement> itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- if (serviceElement.getTarget().equals(beanElement.getId()))
- targetBeanExists = true;
- }
- if (!targetBeanExists)
- error("TargetBeanDoesNotExist", beans);
+ SpringSCAServiceElement serviceElement = its.next();
+ boolean targetBeanExists = false;
+ Iterator<SpringBeanElement> itb = beans.iterator();
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ if (serviceElement.getTarget().equals(beanElement.getId()))
+ targetBeanExists = true;
+ }
+ if (!targetBeanExists) {
+ // REVIEW: [rfeng] The target bean can exist in the parent Spring application context which we don't know
+ // until runtime
+ warning(monitor, "TargetBeanDoesNotExist", beans);
+ }
} // end while
-
- // The value of the @name attribute of an <sca:reference/> subelement of a <beans/>
- // element MUST be unique amongst the @name attributes of the <sca:property/>
+
+ // The value of the @name attribute of an <sca:reference/> subelement of a <beans/>
+ // element MUST be unique amongst the @name attributes of the <sca:property/>
// subelements and the <bean/> subelements of the <beans/> element.
// AND
// The @default attribute of a <sca:reference/> subelement of a <beans/>
@@ -860,213 +691,219 @@
// subelements of the <beans/> element.
Iterator<SpringSCAReferenceElement> itr = references.iterator();
while (itr.hasNext()) {
- SpringSCAReferenceElement referenceElement = itr.next();
- boolean defaultBeanExists = true;
- boolean isUniqueReferenceName = true;
- Iterator<SpringBeanElement> itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- if (referenceElement.getDefaultBean() != null)
- if (referenceElement.getDefaultBean().equals(beanElement.getId()))
- defaultBeanExists = false;
- if (referenceElement.getName().equals(beanElement.getId()))
- isUniqueReferenceName = false;
- }
- Iterator<SpringSCAPropertyElement> itp = scaproperties.iterator();
- while (itp.hasNext()) {
- SpringSCAPropertyElement propertyElement = itp.next();
- if (referenceElement.getName().equals(propertyElement.getName()))
- isUniqueReferenceName = false;
- }
- if (!defaultBeanExists)
- error("DefaultBeanDoesNotExist", beans);
- if (!isUniqueReferenceName)
- error("ScaReferenceNameNotUnique", beans);
+ SpringSCAReferenceElement referenceElement = itr.next();
+ boolean defaultBeanExists = true;
+ boolean isUniqueReferenceName = true;
+ Iterator<SpringBeanElement> itb = beans.iterator();
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ if (referenceElement.getDefaultBean() != null)
+ if (referenceElement.getDefaultBean().equals(beanElement.getId()))
+ defaultBeanExists = false;
+ if (referenceElement.getName().equals(beanElement.getId()))
+ isUniqueReferenceName = false;
+ }
+ Iterator<SpringSCAPropertyElement> itp = scaproperties.iterator();
+ while (itp.hasNext()) {
+ SpringSCAPropertyElement propertyElement = itp.next();
+ if (referenceElement.getName().equals(propertyElement.getName()))
+ isUniqueReferenceName = false;
+ }
+ if (!defaultBeanExists)
+ error(monitor, "DefaultBeanDoesNotExist", beans);
+ if (!isUniqueReferenceName)
+ error(monitor, "ScaReferenceNameNotUnique", beans);
} // end while
-
- // The value of the @name attribute of an <sca:property/> subelement of a <beans/>
- // element MUST be unique amongst the @name attributes of the <sca:reference/>
+
+ // The value of the @name attribute of an <sca:property/> subelement of a <beans/>
+ // element MUST be unique amongst the @name attributes of the <sca:reference/>
// subelements and the <bean/> subelements of the <beans/> element.
Iterator<SpringSCAPropertyElement> itp = scaproperties.iterator();
while (itp.hasNext()) {
- SpringSCAPropertyElement propertyElement = itp.next();
- boolean isUniquePropertyName = true;
- Iterator<SpringBeanElement> itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- if (propertyElement.getName().equals(beanElement.getId()))
- isUniquePropertyName = false;
- }
- Iterator<SpringSCAReferenceElement> itrp = references.iterator();
- while (itrp.hasNext()) {
- SpringSCAReferenceElement referenceElement = itrp.next();
- if (propertyElement.getName().equals(referenceElement.getName()))
- isUniquePropertyName = false;
+ SpringSCAPropertyElement propertyElement = itp.next();
+ boolean isUniquePropertyName = true;
+ Iterator<SpringBeanElement> itb = beans.iterator();
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ if (propertyElement.getName().equals(beanElement.getId()))
+ isUniquePropertyName = false;
}
- if (!isUniquePropertyName)
- error("ScaPropertyNameNotUnique", beans);
+ Iterator<SpringSCAReferenceElement> itrp = references.iterator();
+ while (itrp.hasNext()) {
+ SpringSCAReferenceElement referenceElement = itrp.next();
+ if (propertyElement.getName().equals(referenceElement.getName()))
+ isUniquePropertyName = false;
+ }
+ if (!isUniquePropertyName)
+ error(monitor, "ScaPropertyNameNotUnique", beans);
} // end while
}
-
+
/**
* Validates whether a bean definition is valid for exposing as service.
*/
- private boolean isvalidBeanForService(SpringBeanElement beanElement) {
-
- if (beanElement.isInnerBean())
- return false;
- if (beanElement.hasParentAttribute())
- return false;
- if (beanElement.hasFactoryMethodAttribute())
- return false;
- if (beanElement.hasFactoryBeanAttribute())
- return false;
- if (beanElement.getClassName() == null)
- return false;
- if (beanElement.getClassName().startsWith("org.springframework"))
- return false;
+ private boolean isValidBeanForService(SpringBeanElement beanElement) {
+
+ if (beanElement.isInnerBean())
+ return false;
+ if (beanElement.hasParentAttribute())
+ return false;
+ if (beanElement.hasFactoryMethodAttribute())
+ return false;
+ if (beanElement.hasFactoryBeanAttribute())
+ return false;
+ if (beanElement.getClassName() == null)
+ return false;
+ if (beanElement.getClassName().startsWith("org.springframework"))
+ return false;
// return true otherwise
- return true;
+ return true;
}
-
-
+
/**
* Gets hold of the application-context.xml file as a Spring resource
* @param locationAttr - the location attribute from the <implementation.spring../> element
* @param cl - the ClassLoader for the Spring implementation
*/
- protected List<URL> getApplicationContextResource(URL url)
- throws ContributionReadException {
+ protected List<URL> getApplicationContextResource(URL url) throws ContributionReadException {
File manifestFile = null;
File appXmlFile;
File appXmlFolder;
File locationFile = null;
List<URL> appCtxResources = new ArrayList<URL>();
-
+
if (url != null) {
String path = url.getPath();
locationFile = new File(path);
} else {
- throw new ContributionReadException("SpringXMLComponentTypeLoader getApplicationContextResource: "
- + "unable to find resource file " + url);
+ throw new ContributionReadException(
+ "SpringXMLComponentTypeLoader getApplicationContextResource: " + "unable to find resource file "
+ + url);
}
if (locationFile.isDirectory()) {
try {
- manifestFile = new File(locationFile, "META-INF"+ File.separator +"MANIFEST.MF");
+ manifestFile = new File(locationFile, "META-INF" + File.separator + "MANIFEST.MF");
if (manifestFile.exists()) {
Manifest mf = new Manifest(new FileInputStream(manifestFile));
Attributes mainAttrs = mf.getMainAttributes();
String appCtxPath = mainAttrs.getValue("Spring-Context");
if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- appXmlFile = new File(locationFile, path.trim());
- if (appXmlFile.exists()) {
- appCtxResources.add(appXmlFile.toURI().toURL());
- }
- }
- return appCtxResources;
+ String[] cxtPaths = appCtxPath.split(";");
+ for (String path : cxtPaths) {
+ appXmlFile = new File(locationFile, path.trim());
+ if (appXmlFile.exists()) {
+ appCtxResources.add(appXmlFile.toURI().toURL());
+ }
+ }
+ return appCtxResources;
}
- }
+ }
// No MANIFEST.MF file OR no manifest-specified Spring context , then read all the
// xml files available in the META-INF/spring folder.
appXmlFolder = new File(locationFile, "META-INF" + File.separator + "spring");
if (appXmlFolder.exists()) {
- File[] files = appXmlFolder.listFiles();
- for (File appFile: files) {
- if (appFile.getName().endsWith(".xml")) {
- appCtxResources.add(appFile.toURI().toURL());
- }
- }
- return appCtxResources;
+ File[] files = appXmlFolder.listFiles();
+ for (File appFile : files) {
+ if (appFile.getName().endsWith(".xml")) {
+ appCtxResources.add(appFile.toURI().toURL());
+ }
+ }
+ return appCtxResources;
}
} catch (IOException e) {
throw new ContributionReadException("Error reading manifest " + manifestFile);
}
} else {
- if (locationFile.isFile() && locationFile.getName().endsWith(".jar")) {
+ if (locationFile.isFile() && locationFile.getName().endsWith(".jar")) {
try {
- JarFile jf = new JarFile(locationFile);
+ JarFile jf = new JarFile(locationFile);
JarEntry je;
Manifest mf = jf.getManifest();
if (mf != null) {
Attributes mainAttrs = mf.getMainAttributes();
String appCtxPath = mainAttrs.getValue("Spring-Context");
if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- je = jf.getJarEntry(path.trim());
- if (je != null)
- appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath));
- }
- return appCtxResources;
+ String[] cxtPaths = appCtxPath.split(";");
+ for (String path : cxtPaths) {
+ je = jf.getJarEntry(path.trim());
+ if (je != null)
+ appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL()
+ + "!/"
+ + appCtxPath));
+ }
+ return appCtxResources;
}
}
// No MANIFEST.MF file OR no manifest-specified Spring context , then read all the
// .xml files available in the META-INF/spring folder.
Enumeration<JarEntry> entries = jf.entries();
while (entries.hasMoreElements()) {
- je = entries.nextElement();
- if (je.getName().startsWith("META-INF/spring/") && je.getName().endsWith(".xml")) {
- appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL() + "!/" + je.getName()));
- }
+ je = entries.nextElement();
+ if (je.getName().startsWith("META-INF/spring/") && je.getName().endsWith(".xml")) {
+ appCtxResources.add(new URL("jar:" + locationFile.toURI().toURL() + "!/" + je.getName()));
+ }
}
return appCtxResources;
} catch (IOException e) {
// TODO: create a more appropriate exception type
- throw new ContributionReadException("SpringXMLComponentTypeLoader getApplicationContextResource: "
- + " IO exception reading context file.", e);
+ throw new ContributionReadException(
+ "SpringXMLComponentTypeLoader getApplicationContextResource: " + " IO exception reading context file.",
+ e);
}
- }
- else {
- if (locationFile.getName().endsWith(".xml")) {
- appCtxResources.add(url);
- return appCtxResources;
- }
- else {
- // Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
- try {
- if (locationFile.getPath().indexOf(".jar") > 0) {
- String jarPath = url.getPath().substring(5, url.getPath().indexOf("!"));
- JarFile jf = new JarFile(jarPath);
- JarEntry je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2)
- + "/" + "META-INF" + "/" + "MANIFEST.MF");
- if (je != null) {
- Manifest mf = new Manifest(jf.getInputStream(je));
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- String[] cxtPaths = appCtxPath.split(";");
- for (String path : cxtPaths) {
- je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" + path.trim());
- if (je != null) {
- appCtxResources.add(new URL("jar:" + url.getPath() + "/" + path.trim()));
- }
- }
- return appCtxResources;
- }
- }
- // No MANIFEST.MF file OR no manifest-specified Spring context , then read all the
- // .xml files available in the META-INF/spring folder.
- Enumeration<JarEntry> entries = jf.entries();
- while (entries.hasMoreElements()) {
- je = entries.nextElement();
- if (je.getName().startsWith("META-INF/spring/") && je.getName().endsWith(".xml")) {
- appCtxResources.add(new URL("jar:" + url.getPath() + "/" + je.getName()));
- }
- }
+ } else {
+ if (locationFile.getName().endsWith(".xml")) {
+ appCtxResources.add(url);
+ return appCtxResources;
+ } else {
+ // Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
+ try {
+ if (locationFile.getPath().indexOf(".jar") > 0) {
+ String jarPath = url.getPath().substring(5, url.getPath().indexOf("!"));
+ JarFile jf = new JarFile(jarPath);
+ JarEntry je =
+ jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/") + 2) + "/"
+ + "META-INF"
+ + "/"
+ + "MANIFEST.MF");
+ if (je != null) {
+ Manifest mf = new Manifest(jf.getInputStream(je));
+ Attributes mainAttrs = mf.getMainAttributes();
+ String appCtxPath = mainAttrs.getValue("Spring-Context");
+ if (appCtxPath != null) {
+ String[] cxtPaths = appCtxPath.split(";");
+ for (String path : cxtPaths) {
+ je =
+ jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/") + 2) + "/"
+ + path.trim());
+ if (je != null) {
+ appCtxResources.add(new URL("jar:" + url.getPath() + "/" + path.trim()));
+ }
+ }
+ return appCtxResources;
+ }
+ }
+ // No MANIFEST.MF file OR no manifest-specified Spring context , then read all the
+ // .xml files available in the META-INF/spring folder.
+ Enumeration<JarEntry> entries = jf.entries();
+ while (entries.hasMoreElements()) {
+ je = entries.nextElement();
+ if (je.getName().startsWith("META-INF/spring/") && je.getName().endsWith(".xml")) {
+ appCtxResources.add(new URL("jar:" + url.getPath() + "/" + je.getName()));
+ }
+ }
return appCtxResources;
- }
- } catch (IOException e) {
+ }
+ } catch (IOException e) {
throw new ContributionReadException("Error reading manifest " + manifestFile);
}
- }
- }
+ }
+ }
}
- throw new ContributionReadException("SpringXMLComponentTypeLoader getApplicationContextResource: "
- + "unable to read resource file " + url);
+ throw new ContributionReadException(
+ "SpringXMLComponentTypeLoader getApplicationContextResource: " + "unable to read resource file "
+ + url);
} // end method getApplicationContextResource
/**
@@ -1114,40 +951,40 @@
return reference;
}
-
- private class ContextClassLoader extends ClassLoader {
- public ContextClassLoader(ModelResolver resolver, ProcessorContext context) {
- super();
- this.resolver = resolver;
- this.context = context;
- }
- private ModelResolver resolver;
- private ProcessorContext context;
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- return SpringXMLComponentTypeLoader.this.resolveClass(resolver, name, context);
- }
-
- @Override
- protected URL findResource(String name) {
- try {
- return resolveLocation(resolver, name, context);
- } catch (Exception e) {
- return null;
- }
- }
-
- @Override
- protected Enumeration<URL> findResources(String name) throws IOException {
- URL url = findResource(name);
- if (url != null) {
- return Collections.enumeration(Arrays.asList(url));
- } else {
- Collection<URL> urls = Collections.emptyList();
- return Collections.enumeration(urls);
- }
- }
+ private class ContextClassLoader extends ClassLoader {
+ public ContextClassLoader(ModelResolver resolver, ProcessorContext context) {
+ super();
+ this.resolver = resolver;
+ this.context = context;
+ }
+
+ private ModelResolver resolver;
+ private ProcessorContext context;
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ return SpringXMLComponentTypeLoader.this.resolveClass(resolver, name, context);
+ }
+
+ @Override
+ protected URL findResource(String name) {
+ try {
+ return resolveLocation(resolver, name, context);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ @Override
+ protected Enumeration<URL> findResources(String name) throws IOException {
+ URL url = findResource(name);
+ if (url != null) {
+ return Collections.enumeration(Arrays.asList(url));
+ } else {
+ Collection<URL> urls = Collections.emptyList();
+ return Collections.enumeration(urls);
+ }
+ }
}
-} // end class SpringXMLComponentTypeLoader
\ No newline at end of file
+} // end class SpringXMLComponentTypeLoader
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java
deleted file mode 100644
index b97c02d..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-/**
- * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the ComponentStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-public class ComponentTie {
-
- private RuntimeComponent component;
-
- public ComponentTie(RuntimeComponent component) {
- this.component = component;
- }
-
- public Object getService(Class<?> type, String name) {
- return component.getComponentContext().getService(type, name);
- }
-}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java
deleted file mode 100644
index 89d1496..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the PropertyValueStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-public class PropertyValueTie {
-
- private RuntimeComponent component;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- public PropertyValueTie(RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
- this.component = component;
- this.propertyFactory = propertyFactory;
- }
-
- public Object getPropertyObj(Class<?> type, String name) {
- List<ComponentProperty> props = component.getProperties();
- for (ComponentProperty prop : props) {
- if (prop.getName().equals(name)) {
- return propertyFactory.createValueFactory(prop, prop.getValue(), type).getInstance();
- }
- }
- return null; // property name not found
- }
-}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
deleted file mode 100644
index dcb9a53..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side stub for the corresponding runtime tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the SpringContextTie class
- * in the implementation-spring-runtime module for what the tie does.
- */
-public class SpringContextStub {
-
- private Object tie;
- private Method startMethod;
- private Method closeMethod;
- private Method getBeanMethod;
-
- public SpringContextStub(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
-
- initTie(component, implementation, propertyValueObjectFactory);
-
- }
-
- private void initTie(RuntimeComponent component,
- SpringImplementation implementation,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
-
- // TODO: what class loader to use?
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- try {
-
- Class<?> stubClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringImplementationStub", true, cl);
- Constructor<?> stubConstructor = stubClass.getConstructor(new Class<?>[]{Object.class});
- Object stub = stubConstructor.newInstance(new SpringImplementationTie(implementation, component, propertyValueObjectFactory));
-
- Class<?> tieClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie", true, cl);
- Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass, List.class});
- this.tie = tieConstructor.newInstance(stub, implementation.getResource());
-
- this.startMethod = tieClass.getMethod("start");
- this.closeMethod = tieClass.getMethod("close");
- this.getBeanMethod = tieClass.getMethod("getBean", String.class);
-
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (SecurityException e) {
- throw new RuntimeException(e);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public void start() {
- try {
- startMethod.invoke(tie);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public void close() {
- try {
- closeMethod.invoke(tie);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
- public Object getBean(String id) throws SpringInvocationException {
- try {
-
- return getBeanMethod.invoke(tie, id);
-
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
- }
-
-}
\ No newline at end of file
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
deleted file mode 100644
index 0ecd00d..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * A provider class for runtime Spring implementation instances
- * @version $Rev$ $Date$
- */
-public class SpringImplementationProvider implements ImplementationProvider {
- private RuntimeComponent component;
-
- // A Spring application context object
- private SpringContextStub springContext;
-
- private SpringImplementation implementation;
-
- private JavaPropertyValueObjectFactory propertyValueObjectFactory;
-
- /**
- * Constructor for the provider - takes a component definition and a Spring implementation
- * description
- * @param component - the component in the assembly
- * @param implementation - the implementation
- */
- public SpringImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
- super();
- this.implementation = implementation;
- this.component = component;
- this.propertyValueObjectFactory = propertyValueObjectFactory;
-
- springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory);
-
- } // end constructor
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- return new SpringInvoker(component, springContext, service, operation);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- /**
- * Start this Spring implementation instance
- */
- public void start() {
- springContext.start();
- }
-
- /**
- * Stop this implementation instance
- */
- public void stop() {
- springContext.close();
- }
-
-} // end class SpringImplementationProvider
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
deleted file mode 100644
index 01b458d..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * ImplementationProviderFactory for Spring implementation type
- * @version $Rev$ $Date$
- *
- */
-public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
-
- private ProxyFactory proxyFactory;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- /**
- * Simple constructor
- *
- */
- public SpringImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- super();
-
- proxyFactory = ExtensibleProxyFactory.getInstance(extensionPoints);
-
- // TODO: could the runtime have a default PropertyValueObjectFactory?
- propertyFactory = new JavaPropertyValueObjectFactory(new MediatorImpl(extensionPoints));
- }
-
- /**
- * Returns a SpringImplementationProvider for a given component and Spring implementation
- * @param component the component for which implementation instances are required
- * @param implementation the Spring implementation with details of the component
- * implementation
- * @return the SpringImplementationProvider for the specified component
- */
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation) {
- return new SpringImplementationProvider(component,
- implementation,
- proxyFactory,
- propertyFactory);
- }
-
- /**
- * Returns the class of the Spring implementation
- */
- public Class<SpringImplementation> getModelType() {
- return SpringImplementation.class;
- }
-} // end class SpringImplementationProviderFactory
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java
deleted file mode 100644
index a65db51..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side tie for the corresponding runtime stub class.
- * It enables the Sping code in the runtime module to invoke methods on a
- * Tuscany SpringImplementation without the Spring runtime module
- * needing to know about any Tuscany classes. See the SpringImplementationStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-public class SpringImplementationTie {
-
- private SpringImplementation implementation;
- private RuntimeComponent component;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- public SpringImplementationTie(SpringImplementation implementation, RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
- this.implementation = implementation;
- this.component = component;
- this.propertyFactory = propertyFactory;
- }
-
- public String getURI() {
- return implementation.getURI();
- }
-
- public String getComponentName() {
- return component.getName();
- }
- /**
- * Method to create a Java Bean for a Property value
- * @param <B> the class type of the Bean
- * @param requiredType - a Class object for the required type
- * @param name - the Property name
- * @return - a Bean of the specified property, with value set
- */
- private <B> B getPropertyBean(Class<?> requiredType, String name) {
- B propertyObject = null;
- // Get the component's list of properties
- List<ComponentProperty> props = component.getProperties();
- for (ComponentProperty prop : props) {
- if (prop.getName().equals(name)) {
- // On finding the property, create a factory for it and create a Bean using
- // the factory
- ObjectFactory<?> factory = propertyFactory.createValueFactory(prop, prop.getValue(), requiredType);
- propertyObject = (B)factory.getInstance();
- } // end if
- } // end for
-
- return propertyObject;
- }
-
- /**
- * Creates a proxy Bean for a reference
- * @param <B> the Business interface type for the reference
- * @param businessInterface - the business interface as a Class
- * @param referenceName - the name of the Reference
- * @return an Bean of the type defined by <B>
- */
- private <B> B getService(Class<B> businessInterface, String referenceName) {
- return component.getComponentContext().getService(businessInterface, referenceName);
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class<?> requiredType) {
- // The expectation is that the requested Bean is either a reference or a property
- // from the Spring context
- for (Reference reference : implementation.getReferences()) {
- if (reference.getName().equals(name)) {
- // Extract the Java interface for the reference (it can't be any other interface type
- // for a Spring application context)
- if (requiredType == null) {
- JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
- requiredType = javaInterface.getJavaClass();
- }
- // Create and return the proxy for the reference
- return getService(requiredType, reference.getName());
- } // end if
- } // end for
-
- // For a property, get the name and the required Java type and create a Bean
- // of that type with the value inserted.
- for (Property property : implementation.getProperties()) {
- if (property.getName().equals(name)) {
- if (requiredType == null) {
- // The following code only deals with a subset of types and was superceded
- // by the information from the implementation (which uses Classes as found
- // in the Spring implementation itself.
- //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
- requiredType = implementation.getPropertyClass(name);
- }
- return getPropertyBean(requiredType, property.getName());
- } // end if
- } // end for
- // TODO: NoSuchBeanException
- throw new RuntimeException("Unable to find Bean with name " + name);
-
- } // end method getBean( String, Class )
-
- public Object getComponentTie() {
- return new ComponentTie(component);
- }
-
- public Object getPropertyValueTie() {
- return new PropertyValueTie(component, propertyFactory);
- }
-
- public ClassLoader getClassLoader() {
- return implementation.getClassLoader();
- }
-
-}
\ No newline at end of file
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java
deleted file mode 100644
index 6a23830..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SpringInvocationException extends Exception {
-
- private static final long serialVersionUID = -1157790036638157513L;
-
- public SpringInvocationException(String msg) {
- super(msg);
- }
-
- public SpringInvocationException(Throwable e) {
- super(e);
- }
-
- public SpringInvocationException(String msg,Throwable e) {
- super(msg,e);
- }
-
-}
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java
deleted file mode 100644
index 1f9796c..0000000
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * 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.sca.implementation.spring.invocation;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Initial implementation of a Spring bean invoker
- * @version $Rev$ $Date$
- */
-public class SpringInvoker implements Invoker {
-
- private Method theMethod = null;
- private Object bean;
- private SpringBeanElement beanElement;
- private boolean badInvoker = false;
-
- private SpringContextStub springContext;
- private Operation operation;
-
- /**
- * SpringInvoker constructor
- * @param component - the Spring component to invoke
- * @param service - the service to invoke
- * @param operation - the operation to invoke
- */
- public SpringInvoker(RuntimeComponent component,
- SpringContextStub springContext,
- RuntimeComponentService service,
- Operation operation) {
-
- this.springContext = springContext;
- this.operation = operation;
-
- // From the component and the service, identify the Spring Bean which is the target
- SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
- beanElement = theImplementation.getBeanFromService(service.getService());
-
- if (beanElement == null) {
- badInvoker = true;
- return;
- }
-
- } // end constructor SpringInvoker
-
- // Lazy-load the method to avoid timing problems with the Spring Context
- private void setupMethod() throws SpringInvocationException{
- try {
- bean = springContext.getBean(beanElement.getId());
- Class<?> beanClass = bean.getClass();
- theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
- //System.out.println("SpringInvoker - found method " + theMethod.getName() );
- } catch (NoSuchMethodException e) {
- throw new SpringInvocationException(e);
- }
- }
-
- private Object doInvoke(Object payload) throws SpringInvocationException {
- if (theMethod == null)
- setupMethod();
-
- if (badInvoker)
- throw new SpringInvocationException("Spring invoker incorrectly configured");
- // Invoke the method on the Spring bean using the payload, returning the results
- try {
- Object ret;
-
- if (payload != null && !payload.getClass().isArray()) {
- ret = theMethod.invoke(bean, payload);
- } else {
- ret = theMethod.invoke(bean, (Object[])payload);
- }
- return ret;
- } catch (InvocationTargetException e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e.getCause());
- } catch (Exception e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e);
- }
-
- } // end method doInvoke
-
- /**
- * @param msg the message to invoke on the target bean
- */
- public Message invoke(Message msg) {
- try {
- Object resp = doInvoke(msg.getBody());
- msg.setBody(resp);
- } catch (SpringInvocationException e) {
- msg.setFaultBody(e.getCause());
- }catch (Throwable e) {
- msg.setFaultBody(e);
- }
- //System.out.println("Spring Invoker - invoke called");
- return msg;
- } // end method invoke
-
-} // end class SpringInvoker
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
index d553011..4b4144f 100644
--- a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
@@ -51,7 +51,8 @@
*
* @version $Rev$ $Date$
*/
-public class SpringImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SpringImplementation> {
+public class SpringImplementationProcessor extends BaseStAXArtifactProcessor implements
+ StAXArtifactProcessor<SpringImplementation> {
private static final String LOCATION = "location";
private static final String IMPLEMENTATION_SPRING = "implementation.spring";
@@ -61,7 +62,6 @@
private ExtensionPointRegistry registry;
private AssemblyFactory assemblyFactory;
private PolicySubjectProcessor policyProcessor;
-
private FactoryExtensionPoint factories;
@@ -80,10 +80,16 @@
* @param model
*/
private void error(Monitor monitor, String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ "impl-spring-validation-messages",
+ Severity.ERROR,
+ model,
+ message,
+ ex);
+ monitor.problem(problem);
+ }
}
/**
@@ -94,10 +100,16 @@
* @param model
*/
private void error(Monitor monitor, String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
+ if (monitor != null) {
+ Problem problem =
+ monitor.createProblem(this.getClass().getName(),
+ "impl-spring-validation-messages",
+ Severity.ERROR,
+ model,
+ message,
+ (Object[])messageParameters);
+ monitor.problem(problem);
+ }
}
/*
@@ -117,9 +129,10 @@
* specified in the header identify the context configuration files.
* If there is no MANIFEST.MF file or no Spring-Context header within that file,
* then the default behaviour is to build an application context using all the *.xml files
- * in the METAINF/spring directory.
+ * in the META-INF/spring directory.
*/
- public SpringImplementation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
+ public SpringImplementation read(XMLStreamReader reader, ProcessorContext context)
+ throws ContributionReadException, XMLStreamException {
// Create the Spring implementation
SpringImplementation springImplementation = null;
@@ -127,12 +140,12 @@
// Read the location attribute for the spring implementation
String springLocation = getURIString(reader, LOCATION);
if (springLocation != null) {
- springImplementation = new SpringImplementation();
- springImplementation.setLocation(springLocation);
- springImplementation.setUnresolved(true);
+ springImplementation = new SpringImplementation();
+ springImplementation.setLocation(springLocation);
+ springImplementation.setUnresolved(true);
processComponentType(springImplementation);
} else {
- error(context.getMonitor(), "LocationAttributeMissing", reader);
+ error(context.getMonitor(), "LocationAttributeMissing", reader);
//throw new ContributionReadException(MSG_LOCATION_MISSING);
}
@@ -167,7 +180,8 @@
* Write out the XML representation of the Spring implementation
* <implementation.spring location="..." />
*/
- public void write(SpringImplementation springImplementation, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {
+ public void write(SpringImplementation springImplementation, XMLStreamWriter writer, ProcessorContext context)
+ throws ContributionWriteException, XMLStreamException {
// Write <implementation.spring>
writer.writeStartElement(Constants.SCA11_NS, IMPLEMENTATION_SPRING);
@@ -188,19 +202,18 @@
public void resolve(SpringImplementation springImplementation, ModelResolver resolver, ProcessorContext context)
throws ContributionResolveException {
- if (springImplementation == null)
- return;
+ if (springImplementation == null)
+ return;
- Monitor monitor = context.getMonitor();
+ Monitor monitor = context.getMonitor();
/* Load the Spring component type by reading the Spring application context */
- SpringXMLComponentTypeLoader springLoader =
- new SpringXMLComponentTypeLoader(registry, monitor);
+ SpringXMLComponentTypeLoader springLoader = new SpringXMLComponentTypeLoader(registry);
try {
// Load the Spring Implementation information from its application context file...
springLoader.load(springImplementation, resolver, context);
} catch (ContributionReadException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error(monitor, "ContributionResolveException", resolver, ce);
+ ContributionResolveException ce = new ContributionResolveException(e);
+ error(monitor, "ContributionResolveException", resolver, ce);
throw ce;
}
@@ -209,12 +222,12 @@
// If the introspection fails to resolve, try to find a side file...
ComponentType componentType = resolver.resolveModel(ComponentType.class, ct, context);
if (componentType.isUnresolved()) {
- error(monitor, "UnableToResolveComponentType", resolver);
+ error(monitor, "UnableToResolveComponentType", resolver);
//throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
} else {
springImplementation.setComponentType(componentType);
springImplementation.setUnresolved(false);
- }
+ }
} // end if
diff --git a/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLBeanDefinitionLoader.java b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLBeanDefinitionLoader.java
new file mode 100644
index 0000000..a3dc353
--- /dev/null
+++ b/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringXMLBeanDefinitionLoader.java
@@ -0,0 +1,50 @@
+/*
+ * 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.sca.implementation.spring.xml;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+
+/**
+ * The utility interface to load Spring XML bean definitions into an application context
+ */
+public interface SpringXMLBeanDefinitionLoader {
+ /**
+ * @param resources
+ * @param serviceElements
+ * @param referenceElements
+ * @param propertyElements
+ * @param beanElements
+ * @param context
+ * @return
+ */
+ Object load(List<URL> resources,
+ List<SpringSCAServiceElement> serviceElements,
+ List<SpringSCAReferenceElement> referenceElements,
+ List<SpringSCAPropertyElement> propertyElements,
+ List<SpringBeanElement> beanElements,
+ ProcessorContext context);
+}
diff --git a/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
deleted file mode 100644
index edd3d2e..0000000
--- a/modules/implementation-spring/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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.
-
-# Implementation class for the implementation extension
-org.apache.tuscany.sca.implementation.spring.invocation.SpringImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.spring.SpringImplementation
-
diff --git a/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/GeneratedClassLoader.java b/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/GeneratedClassLoader.java
index b679f34..5d296df 100644
--- a/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/GeneratedClassLoader.java
+++ b/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/GeneratedClassLoader.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.interfacedef.java.jaxrs;
@@ -67,4 +67,20 @@
}
return cls.getGeneratedClass();
}
+
+ @Override
+ public String toString() {
+ if( getParent() != null ) {
+ return "java.net.URLClassLoader:\n"
+ + "hashcode: " + hashCode() + "\n"
+ + "URLs: " + java.util.Arrays.asList(
+ getURLs() ) + "\n"
+ + "parent { " + getParent() + " }\n";
+ } else {
+ return "java.net.URLClassLoader:\n"
+ + "hashcode: " + hashCode() + "\n"
+ + "URLs: " + java.util.Arrays.asList(
+ getURLs() ) + "\n";
+ }
+ }
}
diff --git a/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java b/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
index 8ee34e7..c3d1ec4 100644
--- a/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
+++ b/modules/interface-java-jaxrs/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxrs/RootResourceClassGenerator.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.interfacedef.java.jaxrs;
@@ -45,7 +45,7 @@
String className =
interfaceName.substring(0, index) + ".Generated" + interfaceName.substring(index + 1) + "Impl";
- byte[] content = generate(interfaze, path, consumes, produces);
+ final byte[] content = generate(interfaze, path, consumes, produces);
Class<?> cls = classLoader.getGeneratedClass(className, content);
return cls;
}
diff --git a/modules/interface-java-jaxws/META-INF/MANIFEST.MF b/modules/interface-java-jaxws/META-INF/MANIFEST.MF
index ca45f82..5c36422 100644
--- a/modules/interface-java-jaxws/META-INF/MANIFEST.MF
+++ b/modules/interface-java-jaxws/META-INF/MANIFEST.MF
@@ -38,6 +38,7 @@
org.apache.tuscany.sca.interfacedef.java.introspect;version="2.0.0",
org.apache.tuscany.sca.interfacedef.java.jaxws;version="2.0.0",
org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
org.apache.tuscany.sca.policy;version="2.0.0",
org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional,
diff --git a/modules/interface-java-jaxws/pom.xml b/modules/interface-java-jaxws/pom.xml
index 935e617..afa387b 100644
--- a/modules/interface-java-jaxws/pom.xml
+++ b/modules/interface-java-jaxws/pom.xml
@@ -213,11 +213,35 @@
<wsdlFiles>
<wsdlFile>StockExceptionTest.wsdl</wsdlFile>
</wsdlFiles>
+ <staleFile>${project.build.directory}/wsimport-sync.stale</staleFile>
<sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
<verbose>false</verbose>
<xnocompile>true</xnocompile>
</configuration>
</execution>
+
+ <execution>
+ <id>wsimport-async</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <packageName>com.example.stock.async</packageName>
+ <wsdlDirectory>${basedir}/src/test/resources/wsdl</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>StockExceptionTest.wsdl</wsdlFile>
+ </wsdlFiles>
+ <bindingDirectory>${basedir}/src/test/resources/wsdl</bindingDirectory>
+ <bindingFiles>
+ <bindingFile>bindings.xml</bindingFile>
+ </bindingFiles>
+ <staleFile>${project.build.directory}/wsimport-async.stale</staleFile>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <verbose>false</verbose>
+ <xnocompile>true</xnocompile>
+ </configuration>
+ </execution>
<!--
<execution>
diff --git a/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
index 155c89c..a866c5b 100644
--- a/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
+++ b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java
@@ -20,48 +20,54 @@
package org.apache.tuscany.sca.interfacedef.java.jaxws;
import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.Future;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor {
private static String ASYNC = "Async";
public JAXWSAsyncInterfaceProcessor(ExtensionPointRegistry registry) {
-
}
-
+
public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
List<Operation> validOperations = new ArrayList<Operation>();
List<Operation> asyncOperations = new ArrayList<Operation>();
-
+
validOperations.addAll(javaInterface.getOperations());
- for(Operation o : javaInterface.getOperations()) {
- if (! o.getName().endsWith(ASYNC)) {
- Operation op = o;
-
- for(Operation asyncOp : getAsyncOperations(javaInterface.getOperations(), o.getName()) ) {
- if (isJAXWSAsyncPoolingOperation(op, asyncOp) ||
- isJAXWSAsyncCallbackOperation(op, asyncOp)) {
+ for (Operation o : javaInterface.getOperations()) {
+ if (!o.getName().endsWith(ASYNC)) {
+ JavaOperation op = (JavaOperation)o;
+ if (op.getJavaMethod().getName().endsWith(ASYNC)) {
+ continue;
+ }
+ for (Operation asyncOp : getAsyncOperations(javaInterface.getOperations(), op)) {
+ if (isJAXWSAsyncPoolingOperation(op, asyncOp) || isJAXWSAsyncCallbackOperation(op, asyncOp)) {
validOperations.remove(asyncOp);
asyncOperations.add(asyncOp);
- }
+ }
}
- }
+ }
}
-
+
javaInterface.getOperations().clear();
javaInterface.getOperations().addAll(validOperations);
-
+
javaInterface.getAttributes().put("JAXWS-ASYNC-OPERATIONS", asyncOperations);
}
-
+
/**
* The additional client-side asynchronous polling and callback methods defined by JAX-WS are recognized in a Java interface as follows:
* For each method M in the interface, if another method P in the interface has
@@ -75,53 +81,59 @@
* @return
*/
private static boolean isJAXWSAsyncPoolingOperation(Operation operation, Operation asyncOperation) {
- //a method name that is M's method name with the characters "Async" appended
- if (operation.getName().endsWith(ASYNC)) {
+
+ if (asyncOperation.getOutputType() == null || Response.class != asyncOperation.getOutputType().getPhysical()) {
+ // The return type is not Response<T>
return false;
}
- if (! asyncOperation.getName().endsWith(ASYNC)) {
- return false;
- }
-
- if(! asyncOperation.getName().equals(operation.getName() + ASYNC)) {
- return false;
- }
-
//the same parameter signature as M
List<DataType> operationInputType = operation.getInputType().getLogical();
List<DataType> asyncOperationInputType = asyncOperation.getInputType().getLogical();
int size = operationInputType.size();
+ if (asyncOperationInputType.size() != size) {
+ return false;
+ }
for (int i = 0; i < size; i++) {
if (!isCompatible(operationInputType.get(i), asyncOperationInputType.get(i))) {
return false;
}
}
-
+
//a return type of Response<R> where R is the return type of M
DataType<?> operationOutputType = operation.getOutputType();
DataType<?> asyncOperationOutputType = asyncOperation.getOutputType();
-
+
if (operationOutputType != null && asyncOperationOutputType != null) {
- ParameterizedType asyncReturnType = (ParameterizedType) asyncOperationOutputType.getGenericType();
- Class<?> asyncReturnTypeClass = (Class<?>)asyncReturnType.getRawType();
- if(asyncReturnTypeClass.getName().equals("javax.xml.ws.Response")) {
+ Class<?> asyncReturnTypeClass = (Class<?>)asyncOperationOutputType.getPhysical();
+ if (asyncReturnTypeClass == Response.class) {
//now check the actual type of the Response<R> with R
- Class<?> returnType = operationOutputType.getPhysical();
- Class<?> asyncActualReturnTypeClass = (Class<?>) asyncReturnType.getActualTypeArguments()[0];
-
- if(returnType == asyncActualReturnTypeClass ||
- returnType.isPrimitive() && primitiveAssignable(returnType,asyncActualReturnTypeClass)) {
- //valid
- } else {
- return false;
+ Class<?> returnType = operationOutputType.getPhysical();
+ Class<?> asyncActualReturnTypeClass = Object.class;
+ if (asyncOperationOutputType.getGenericType() instanceof ParameterizedType) {
+ ParameterizedType asyncReturnType = (ParameterizedType)asyncOperationOutputType.getGenericType();
+ asyncActualReturnTypeClass = (Class<?>)asyncReturnType.getActualTypeArguments()[0];
+ }
+
+ if (operation.getWrapper() != null) {
+ // The return type could be the wrapper type per JAX-WS spec
+ Class<?> wrapperClass = operation.getWrapper().getOutputWrapperClass();
+ if (wrapperClass == asyncActualReturnTypeClass) {
+ return true;
+ }
+ }
+ if (returnType == asyncActualReturnTypeClass || returnType.isPrimitive()
+ && primitiveAssignable(returnType, asyncActualReturnTypeClass)) {
+ return true;
+ } else {
+ return false;
}
}
}
-
+
return true;
}
-
+
/**
* For each method M in the interface, if another method C in the interface has
* a) a method name that is M's method name with the characters "Async" appended, and
@@ -136,71 +148,57 @@
* @return
*/
private static boolean isJAXWSAsyncCallbackOperation(Operation operation, Operation asyncOperation) {
- //a method name that is M's method name with the characters "Async" appended
- if (operation.getName().endsWith(ASYNC)) {
+
+ if (asyncOperation.getOutputType() == null || Future.class != asyncOperation.getOutputType().getPhysical()) {
+ // The return type is not Future<?>
return false;
}
- if (! asyncOperation.getName().endsWith(ASYNC)) {
- return false;
- }
-
- if(! asyncOperation.getName().equals(operation.getName() + ASYNC)) {
- return false;
- }
-
//a parameter signature that is M's parameter signature
//with an additional final parameter of type AsyncHandler<R> where R is the return type of M, and
List<DataType> operationInputType = operation.getInputType().getLogical();
List<DataType> asyncOperationInputType = asyncOperation.getInputType().getLogical();
int size = operationInputType.size();
+ if (asyncOperationInputType.size() != size + 1) {
+ return false;
+ }
for (int i = 0; i < size; i++) {
if (!isCompatible(operationInputType.get(i), asyncOperationInputType.get(i))) {
return false;
}
}
-
- if(asyncOperationInputType.size() == size + 1) {
- ParameterizedType asyncLastParameterType = (ParameterizedType) asyncOperationInputType.get(size + 1).getGenericType();
- Class<?> asyncLastParameterTypeClass = (Class<?>)asyncLastParameterType.getRawType();
- if(asyncLastParameterTypeClass.getName().equals("javax.xml.ws.AsyncHandler")) {
- //now check the actual type of the AsyncHandler<R> with R
- Class<?> returnType = operation.getOutputType().getPhysical();
- Class<?> asyncActualLastParameterTypeClass = (Class<?>) asyncLastParameterType.getActualTypeArguments()[0];
-
- if(returnType == asyncActualLastParameterTypeClass ||
- returnType.isPrimitive() && primitiveAssignable(returnType,asyncActualLastParameterTypeClass)) {
- //valid
- } else {
- return false;
- }
- }
- }
-
- //a return type of Response<R> where R is the return type of M
- DataType<?> operationOutputType = operation.getOutputType();
- DataType<?> asyncOperationOutputType = asyncOperation.getOutputType();
-
- if (operationOutputType != null && asyncOperationOutputType != null) {
- ParameterizedType asyncReturnType = (ParameterizedType) asyncOperationOutputType.getGenericType();
- Class<?> asyncReturnTypeClass = (Class<?>)asyncReturnType.getRawType();
- if(asyncReturnTypeClass.getName().equals("javax.xml.ws.Response")) {
- //now check the actual type of the Response<R> with R
- Class<?> returnType = operationOutputType.getPhysical();
- Class<?> asyncActualReturnTypeClass = (Class<?>) asyncReturnType.getActualTypeArguments()[0];
-
- if(returnType == asyncActualReturnTypeClass ||
- returnType.isPrimitive() && primitiveAssignable(returnType,asyncActualReturnTypeClass)) {
- //valid
- } else {
- return false;
+
+ Type genericParamType = asyncOperationInputType.get(size).getGenericType();
+
+ Class<?> asyncLastParameterTypeClass = asyncOperationInputType.get(size).getPhysical();
+ if (asyncLastParameterTypeClass == AsyncHandler.class) {
+ //now check the actual type of the AsyncHandler<R> with R
+ Class<?> returnType = operation.getOutputType().getPhysical();
+ Class<?> asyncActualLastParameterTypeClass = Object.class;
+ if (genericParamType instanceof ParameterizedType) {
+ ParameterizedType asyncLastParameterType = (ParameterizedType)genericParamType;
+ asyncActualLastParameterTypeClass = (Class<?>)asyncLastParameterType.getActualTypeArguments()[0];
+ }
+
+ if (operation.getWrapper() != null) {
+ // The return type could be the wrapper type per JAX-WS spec
+ Class<?> wrapperClass = operation.getWrapper().getOutputWrapperClass();
+ if (wrapperClass == asyncActualLastParameterTypeClass) {
+ return true;
}
}
+
+ if (returnType == asyncActualLastParameterTypeClass || returnType.isPrimitive()
+ && primitiveAssignable(returnType, asyncActualLastParameterTypeClass)) {
+ return true;
+ } else {
+ return false;
+ }
}
-
+
return true;
- }
-
+ }
+
/**
* Get operation by name
*
@@ -208,18 +206,30 @@
* @param operationName
* @return
*/
- private static List<Operation> getAsyncOperations(List<Operation> operations, String operationName) {
+ private static List<Operation> getAsyncOperations(List<Operation> operations, JavaOperation op) {
List<Operation> returnOperations = new ArrayList<Operation>();
- for(Operation o : operations) {
- if(o.getName().equals(operationName + ASYNC)) {
+ for (Operation o : operations) {
+ if (o == op) {
+ continue;
+ }
+ String operationName = op.getName();
+ if (o.getName().equals(operationName)) {
+ // Async operations have the same name when @WebMethod is present
+ /*
+ JavaOperation jop = (JavaOperation)o;
+ if (op.getJavaMethod().getName().equals(jop.getJavaMethod().getName() + ASYNC)) {
+ returnOperations.add(o);
+ }
+ */
+ returnOperations.add(o);
+ } else if (o.getName().equals(operationName + ASYNC)) {
returnOperations.add(o);
}
}
-
+
return returnOperations;
}
-
/**
* Check if two operation parameters are compatible
diff --git a/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
index 1d6b002..735f8cf 100644
--- a/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
+++ b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
@@ -31,8 +31,8 @@
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
import javax.jws.WebResult;
-import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.namespace.QName;
@@ -40,6 +40,7 @@
import javax.xml.ws.ResponseWrapper;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint;
import org.apache.tuscany.sca.databinding.javabeans.JavaExceptionDataBinding;
@@ -49,15 +50,17 @@
import org.apache.tuscany.sca.interfacedef.FaultExceptionMapper;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor;
import org.apache.tuscany.sca.interfacedef.util.ElementInfo;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
/**
* Introspect the java class/interface with JSR-181 and JAXWS annotations
@@ -70,28 +73,35 @@
private DataBindingExtensionPoint dataBindingExtensionPoint;
private FaultExceptionMapper faultExceptionMapper;
private XMLAdapterExtensionPoint xmlAdapterExtensionPoint;
+ protected JavaInterfaceFactory javaInterfaceFactory;
+ private WSDLFactory wsdlFactory;
public JAXWSJavaInterfaceProcessor(ExtensionPointRegistry registry) {
dataBindingExtensionPoint = registry.getExtensionPoint(DataBindingExtensionPoint.class);
faultExceptionMapper = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(FaultExceptionMapper.class);
xmlAdapterExtensionPoint = registry.getExtensionPoint(XMLAdapterExtensionPoint.class);
- }
-
-
- public JAXWSJavaInterfaceProcessor(DataBindingExtensionPoint dataBindingExtensionPoint,
- FaultExceptionMapper faultExceptionMapper,
- XMLAdapterExtensionPoint xmlAdapters) {
- super();
- this.dataBindingExtensionPoint = dataBindingExtensionPoint;
- this.faultExceptionMapper = faultExceptionMapper;
- this.xmlAdapterExtensionPoint = xmlAdapters;
+
+ FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
+ this.wsdlFactory = factories.getFactory(WSDLFactory.class);
}
+
public JAXWSJavaInterfaceProcessor() {
super();
}
+ private ParameterMode getParameterMode(WebParam.Mode mode) {
+ if (mode == Mode.INOUT) {
+ return ParameterMode.INOUT;
+ } else if (mode == Mode.OUT) {
+ return ParameterMode.OUT;
+ } else {
+ return ParameterMode.IN;
+ }
+ }
+
private static String capitalize(String name) {
if (name == null || name.length() == 0) {
return name;
@@ -103,16 +113,10 @@
public void visitInterface(JavaInterface contract) throws InvalidInterfaceException {
final Class<?> clazz = contract.getJavaClass();
- WebService webService = clazz.getAnnotation(WebService.class);
- String tns = JavaXMLMapper.getNamespace(clazz);
- String localName = clazz.getSimpleName();
- if (webService != null) {
- tns = getValue(webService.targetNamespace(), tns);
- localName = getValue(webService.name(), localName);
- contract.setQName(new QName(tns, localName));
- // Mark SEI as Remotable
- contract.setRemotable(true);
- }
+
+ contract = JAXWSUtils.configureJavaInterface(contract, clazz);
+ String tns = contract.getQName().getNamespaceURI();
+
if (!contract.isRemotable()) {
return;
}
@@ -178,6 +182,7 @@
if (logical instanceof XMLType) {
((XMLType)logical).setElementName(element);
}
+ operation.getParameterModes().set(i, getParameterMode(param.mode()));
}
}
WebResult result = method.getAnnotation(WebResult.class);
@@ -287,6 +292,9 @@
type = ((XMLType)logical).getTypeName();
}
inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null)));
+ if (param != null) {
+ operation.getParameterModes().set(i, getParameterMode(param.mode()));
+ }
}
List<ElementInfo> outputElements = new ArrayList<ElementInfo>();
diff --git a/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSUtils.java b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSUtils.java
new file mode 100644
index 0000000..011d746
--- /dev/null
+++ b/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSUtils.java
@@ -0,0 +1,104 @@
+/*
+ * 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.sca.interfacedef.java.jaxws;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceProvider;
+
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
+
+
+/**
+ * A set of utility methods for processing JAXWS annotations that are
+ * shared between Java inteface and implementation processing
+ */
+public class JAXWSUtils {
+
+ /**
+ * JAXWS annotations may identify a service interface via either
+ * - an interface class name, e.g. @WebService(endpointInterface="my.service.ServiceImpl")
+ * - a wsdl file name, e.g. @WebService(wsdlLocation="some.wsdl")
+ * - a Java class/interface, e.g. @WebService
+ * This operation configures the Java interface based on these separate pieces
+ * of information. The resulting interface contract must be subsequently resolved in order that
+ * the named endpoint interface class or wsdl file is found
+ *
+ * @param javaInterface the Tuscany representation of the Java interface
+ * @param clazz the Java class that the interface refers to (may have JAXWS annotations)
+ * @return
+ */
+ public static JavaInterface configureJavaInterface(JavaInterface javaInterface,
+ Class<?> clazz){
+
+ String servineNamespace = JavaXMLMapper.getNamespace(clazz);
+ String serviceName = clazz.getSimpleName();
+ QName serviceQName = null;
+ String serviceInterfaceClassName = null;
+ String wsdlFileName = null;
+
+ WebService webServiceAnnotation = clazz.getAnnotation(WebService.class);
+ if (webServiceAnnotation != null) {
+ servineNamespace = getValue(webServiceAnnotation.targetNamespace(), servineNamespace);
+ serviceName = getValue(webServiceAnnotation.name(), serviceName);
+ serviceInterfaceClassName = webServiceAnnotation.endpointInterface();
+ wsdlFileName = webServiceAnnotation.wsdlLocation();
+ javaInterface.setRemotable(true);
+ }
+
+ WebServiceProvider webServiceProviderAnnotation = clazz.getAnnotation(WebServiceProvider.class);
+ if (webServiceProviderAnnotation != null) {
+ servineNamespace = getValue(webServiceProviderAnnotation.targetNamespace(), servineNamespace);
+ serviceName = getValue(webServiceProviderAnnotation.serviceName(), serviceName);
+ wsdlFileName = webServiceProviderAnnotation.wsdlLocation();
+ javaInterface.setRemotable(true);
+ }
+
+ serviceQName = new QName(servineNamespace, serviceName);
+ javaInterface.setQName(serviceQName);
+
+ // use the provided Java interface name to overwrite
+ // any Java interface created from an implemented interfaces
+ if (serviceInterfaceClassName != null &&
+ serviceInterfaceClassName.length() > 0){
+ javaInterface.setName(serviceInterfaceClassName);
+ javaInterface.setJAXWSJavaInterfaceName(serviceInterfaceClassName);
+ javaInterface.setUnresolved(true);
+ }
+
+ // Store the WSDL location if it's specified in
+ // the @WebService annotation. Later this is resolved and is attached
+ // to the Java interface contract in the normalized space so that effectively the contract
+ // has both Java and WSDL interfaces. This allows databinding to
+ // operate correctly as it still expects a Java interface for a Java implementation
+ if (wsdlFileName != null &&
+ wsdlFileName.length() > 0){
+ javaInterface.setJAXWSWSDLLocation(wsdlFileName);
+ }
+
+ return javaInterface;
+ }
+
+ private static String getValue(String value, String defaultValue) {
+ return "".equals(value) ? defaultValue : value;
+ }
+}
diff --git a/modules/interface-java-jaxws/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor b/modules/interface-java-jaxws/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor
index 86255f4..05b1cce 100644
--- a/modules/interface-java-jaxws/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor
+++ b/modules/interface-java-jaxws/src/main/resources/META-INF/services/org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor
@@ -13,7 +13,11 @@
# "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.
+# under the License.
+#
+# first one, set remotable flag
org.apache.tuscany.sca.interfacedef.java.jaxws.WebServiceInterfaceProcessor;ranking=400
+# second one, introspect the JAXWS annotations
org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSJavaInterfaceProcessor;ranking=100
-org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSAsyncInterfaceProcessor;ranking=900
+# third one, introspect JAXWS async methods
+org.apache.tuscany.sca.interfacedef.java.jaxws.JAXWSAsyncInterfaceProcessor;ranking=50
diff --git a/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessorTestCase.java b/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessorTestCase.java
index ec73ad4..c53521d 100644
--- a/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessorTestCase.java
+++ b/modules/interface-java-jaxws/src/test/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessorTestCase.java
@@ -33,6 +33,8 @@
import org.junit.Before;
import org.junit.Test;
+import com.example.stock.async.StockExceptionTest;
+
public class JAXWSAsyncInterfaceProcessorTestCase {
private ExtensionPointRegistry registry;
@@ -64,4 +66,24 @@
}
}
+
+ @Test
+ public final void testProcessorGenerated() throws Exception {
+ DefaultJavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(registry);
+ JavaInterface contract = iFactory.createJavaInterface(StockExceptionTest.class);
+
+ assertTrue(contract.isRemotable());
+
+ Assert.assertEquals(1,contract.getOperations().size());
+
+ List<Operation> asyncOperations = (List<Operation>) contract.getAttributes().get("JAXWS-ASYNC-OPERATIONS");
+ Assert.assertEquals(2,asyncOperations.size());
+
+ //list operation
+ System.out.println(">>> Filtered Operations");
+ for(Operation o : contract.getOperations()) {
+ System.out.println(">>>>>>" + o);
+ }
+
+ }
}
diff --git a/modules/interface-java-jaxws/src/test/resources/wsdl/bindings.xml b/modules/interface-java-jaxws/src/test/resources/wsdl/bindings.xml
new file mode 100644
index 0000000..078abb5
--- /dev/null
+++ b/modules/interface-java-jaxws/src/test/resources/wsdl/bindings.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="StockExceptionTest.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions">
+ <enableAsyncMapping>true</enableAsyncMapping>
+ </bindings>
+</bindings>
diff --git a/modules/interface-java/META-INF/MANIFEST.MF b/modules/interface-java/META-INF/MANIFEST.MF
index 41dd68e..a374cfc 100644
--- a/modules/interface-java/META-INF/MANIFEST.MF
+++ b/modules/interface-java/META-INF/MANIFEST.MF
@@ -19,11 +19,14 @@
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA Java Interface Model
-Import-Package: javax.xml.namespace,
+Import-Package: javax.jws,
+ javax.jws.soap,
+ javax.xml.namespace,
javax.xml.stream,
- org.oasisopen.sca;version="2.0.0",
+ javax.xml.ws,
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
+ org.apache.tuscany.sca.contribution;version="2.0.0",
org.apache.tuscany.sca.contribution.processor;version="2.0.0",
org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
org.apache.tuscany.sca.core;version="2.0.0",
@@ -35,8 +38,10 @@
org.apache.tuscany.sca.interfacedef.java.impl;version="2.0.0",
org.apache.tuscany.sca.interfacedef.java.introspect;version="2.0.0",
org.apache.tuscany.sca.interfacedef.util;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef.wsdl;version="2.0.0",
org.apache.tuscany.sca.monitor;version="2.0.0",
org.apache.tuscany.sca.policy;version="2.0.0",
+ org.oasisopen.sca;version="2.0.0",
org.oasisopen.sca.annotation;version="2.0.0"
Bundle-SymbolicName: org.apache.tuscany.sca.interface.java
Bundle-DocURL: http://www.apache.org/
diff --git a/modules/interface-java/pom.xml b/modules/interface-java/pom.xml
index 28489af..2dbe6fe 100644
--- a/modules/interface-java/pom.xml
+++ b/modules/interface-java/pom.xml
@@ -52,6 +52,12 @@
<artifactId>tuscany-contribution</artifactId>
<version>2.0-Beta1</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
</dependencies>
diff --git a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java
index 8edd94b..e042d86 100644
--- a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java
+++ b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java
@@ -21,6 +21,7 @@
import javax.xml.namespace.QName;
import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.interfacedef.Interface;
/**
@@ -86,4 +87,48 @@
* @param callbackClass the callback class specified in an @Callback annotation
*/
void setCallbackClass(Class<?> callbackClass);
+
+ /**
+ * A Java interface may have JAXWS annotations that refer to a
+ * a WSDL document. The resulting WSDL location is stored here
+ * so that is can be resolved after the Java interface itself
+ * has been resolved
+ *
+ * @return WSDL interface
+ */
+ String getJAXWSWSDLLocation();
+
+ /**
+ * A Java interface may have JAXWS annotations that refer to a
+ * a WSDL document. The resulting WSDL location is stored here
+ * so that is can be resolved after the Java interface itself
+ * has been resolved
+ *
+ * @param wsdlInterface
+ */
+ void setJAXWSWSDLLocation(String wsdlLocation);
+
+ /**
+ * A Java interface may have JAXWS annotations that refer to a
+ * a Java interface by name. The resulting class name is stored here
+ * so that is can be resolved after this Java interface
+ * has been resolved
+ *
+ * @return
+ */
+ String getJAXWSJavaInterfaceName();
+
+ /**
+ * A Java interface may have JAXWS annotations that refer to a
+ * a Java interface by name. The resulting class name is stored here
+ * so that is can be resolved after this Java interface
+ * has been resolved
+ *
+ * @return
+ */
+ void setJAXWSJavaInterfaceName(String javaInterfaceName);
+
+ public Contribution getContributionContainingClass();
+
+ public void setContributionContainingClass(Contribution contributionContainingClass);
}
diff --git a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
index 54946a9..a217f3e 100644
--- a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
+++ b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java
@@ -28,6 +28,7 @@
import javax.xml.namespace.QName;
import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.interfacedef.DataType;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
@@ -50,6 +51,9 @@
private WeakReference<Class<?>> javaClass;
private Class<?> callbackClass;
private QName qname;
+ private String jaxwsWSDLLocation;
+ private String jaxwsJavaInterfaceName;
+ private Contribution contributionContainingClass;
protected JavaInterfaceImpl() {
super();
@@ -321,5 +325,36 @@
} // end for
return false;
} // end method isAsyncServer
-
+
+ public String getJAXWSWSDLLocation() {
+ return jaxwsWSDLLocation;
+ }
+
+ public void setJAXWSWSDLLocation(String wsdlLocation) {
+ this.jaxwsWSDLLocation = wsdlLocation;
+ }
+
+ public String getJAXWSJavaInterfaceName() {
+ return jaxwsJavaInterfaceName;
+ }
+
+ public void setJAXWSJavaInterfaceName(String javaInterfaceName) {
+ this.jaxwsJavaInterfaceName = javaInterfaceName;
+ }
+
+ /**
+ * A Java class may reference a WSDL file via a JAXWS annotation. We need to resolve
+ * the WSDL file location in the context of the same contribution that holds the
+ * Java file. In order to do this we need to remember the actual contribution that
+ * was used to resolve a Java class.
+ *
+ * @return
+ */
+ public Contribution getContributionContainingClass() {
+ return contributionContainingClass;
+ }
+
+ public void setContributionContainingClass(Contribution contributionContainingClass) {
+ this.contributionContainingClass = contributionContainingClass;
+ }
}
diff --git a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
index de32136..7f33b05 100644
--- a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
+++ b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceIntrospectorImpl.java
@@ -35,6 +35,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Holder;
import javax.xml.ws.Response;
import org.apache.tuscany.sca.interfacedef.DataType;
@@ -44,6 +45,7 @@
import org.apache.tuscany.sca.interfacedef.InvalidOperationException;
import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.OverloadedOperationException;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
@@ -220,6 +222,9 @@
}
}
+ JavaOperation operation = new JavaOperationImpl();
+ operation.setName(name);
+
// Set outputType to null for void
XMLType xmlReturnType = new XMLType(new QName(ns, "return"), null);
DataType<XMLType> returnDataType =
@@ -229,10 +234,24 @@
Type[] genericParamTypes = method.getGenericParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
Class<?> paramType = parameterTypes[i];
- XMLType xmlParamType = new XMLType(new QName(ns, "arg" + i), null);
- paramDataTypes.add(new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, paramType, genericParamTypes[i],
- xmlParamType));
+ XMLType xmlParamType = new XMLType(new QName(ns, "arg" + i), null);
+
+ DataTypeImpl<XMLType> xmlDataType = new DataTypeImpl<XMLType>(
+ UNKNOWN_DATABINDING, paramType, genericParamTypes[i],xmlParamType);
+ ParameterMode mode = ParameterMode.IN;
+ // Holder pattern. Physical types of Holder<T> classes are updated to <T> to aid in transformations.
+ if ( Holder.class == paramType) {
+ Type firstActual = getFirstActualType( genericParamTypes[ i ] );
+ if ( firstActual != null ) {
+ xmlDataType.setPhysical( (Class<?>)firstActual );
+ mode = ParameterMode.INOUT;
+ }
+ }
+ paramDataTypes.add( xmlDataType);
+ operation.getParameterModes().add(mode);
}
+
+ // Fault types
List<DataType> faultDataTypes = new ArrayList<DataType>(faultTypes.length);
Type[] genericFaultTypes = method.getGenericExceptionTypes();
if( method.isAnnotationPresent(AsyncFault.class) ) {
@@ -254,8 +273,7 @@
DataType<List<DataType>> inputType =
new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, paramDataTypes);
- JavaOperation operation = new JavaOperationImpl();
- operation.setName(name);
+
operation.setInputType(inputType);
operation.setOutputType(returnDataType);
operation.setFaultTypes(faultDataTypes);
@@ -290,20 +308,35 @@
private boolean jaxwsAsyncMethod(Method method) {
if (method.getName().endsWith("Async")) {
- if (method.getName().endsWith("Async")) {
- if (method.getReturnType().isAssignableFrom(Future.class)) {
- if (method.getParameterTypes().length > 0) {
- if (method.getParameterTypes()[method.getParameterTypes().length-1].isAssignableFrom(AsyncHandler.class)) {
- return true;
- }
+ if (method.getReturnType().isAssignableFrom(Future.class)) {
+ if (method.getParameterTypes().length > 0) {
+ if (method.getParameterTypes()[method.getParameterTypes().length-1].isAssignableFrom(AsyncHandler.class)) {
+ return true;
}
}
- if (method.getReturnType().isAssignableFrom(Response.class)) {
- return true;
- }
+ }
+ if (method.getReturnType().isAssignableFrom(Response.class)) {
+ return true;
}
}
return false;
}
+
+
+ /**
+ * Given a Class<T>, returns T, otherwise null.
+ * @param testClass
+ * @return
+ */
+ protected static Type getFirstActualType(Type genericType) {
+ if (genericType instanceof ParameterizedType) {
+ ParameterizedType pType = (ParameterizedType)genericType;
+ Type[] actualTypes = pType.getActualTypeArguments();
+ if ((actualTypes != null) && (actualTypes.length > 0)) {
+ return actualTypes[0];
+ }
+ }
+ return null;
+ }
}
diff --git a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
index 1610a2e..1c0333f 100644
--- a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
+++ b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/PolicyJavaInterfaceVisitor.java
@@ -20,13 +20,18 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.soap.SOAPBinding;
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
@@ -37,6 +42,7 @@
import org.apache.tuscany.sca.policy.Intent;
import org.apache.tuscany.sca.policy.PolicyFactory;
import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySubject;
import org.oasisopen.sca.annotation.PolicySets;
import org.oasisopen.sca.annotation.Qualifier;
import org.oasisopen.sca.annotation.Requires;
@@ -74,7 +80,7 @@
* @param clazz
* @param requiredIntents
*/
- private void readIntentsAndPolicySets(Class<?> clazz, List<Intent> requiredIntents, List<PolicySet> policySets) {
+ private void readIntentsAndPolicySets(Class<?> clazz, PolicySubject subject) {
Requires intentAnnotation = clazz.getAnnotation(Requires.class);
if (intentAnnotation != null) {
String[] intentNames = intentAnnotation.value();
@@ -84,12 +90,12 @@
// Add each intent to the list
Intent intent = policyFactory.createIntent();
intent.setName(getQName(intentName));
- requiredIntents.add(intent);
+ subject.getRequiredIntents().add(intent);
}
}
}
- readSpecificIntents(clazz.getAnnotations(), requiredIntents);
+ readSpecificIntents(clazz.getAnnotations(), subject.getRequiredIntents());
PolicySets policySetAnnotation = clazz.getAnnotation(PolicySets.class);
if (policySetAnnotation != null) {
@@ -100,10 +106,19 @@
// Add each intent to the list
PolicySet policySet = policyFactory.createPolicySet();
policySet.setName(getQName(policySetName));
- policySets.add(policySet);
+ subject.getPolicySets().add(policySet);
}
}
}
+
+ if ( clazz.isAnnotationPresent(SOAPBinding.class) ) {
+ // add soap intent
+ Intent intent = policyFactory.createIntent();
+ intent.setName(Constants.SOAP_INTENT);
+ subject.getRequiredIntents().add(intent);
+ }
+
+
}
private void readIntents(Requires intentAnnotation, List<Intent> requiredIntents) {
@@ -146,25 +161,78 @@
}
}
+ public void readWebServicesAnnotations(Method m, Class<?> clazz, List<Intent> requiredIntents) {
+
+ WebResult webResultAnnotation = m.getAnnotation(WebResult.class);
+ if (webResultAnnotation != null) {
+ if (webResultAnnotation.header()) {
+ // Add SOAP intent
+ Intent intent = policyFactory.createIntent();
+ intent.setName(Constants.SOAP_INTENT);
+ requiredIntents.add(intent);
+ return;
+ }
+ }
+
+ Annotation[][] parameterAnnotations = m.getParameterAnnotations();
+ for ( int i=0; i < parameterAnnotations.length; i++ ) {
+ for ( int j=0; j < parameterAnnotations[i].length; j++) {
+ if ( parameterAnnotations[i][j] instanceof WebParam ) {
+ WebParam webParam = (WebParam)parameterAnnotations[i][j];
+ if ( webParam.header() ) {
+ // Add SOAP intent
+ Intent intent = policyFactory.createIntent();
+ intent.setName(Constants.SOAP_INTENT);
+ requiredIntents.add(intent);
+ return;
+ }
+ }
+ }
+ }
+
+ }
public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException {
if (javaInterface.getJavaClass() != null) {
- readIntentsAndPolicySets(javaInterface.getJavaClass(), javaInterface.getRequiredIntents(), javaInterface
- .getPolicySets());
+ readIntentsAndPolicySets(javaInterface.getJavaClass(), javaInterface);
// Read intents on the service interface methods
List<Operation> operations = javaInterface.getOperations();
for (Operation op : operations) {
JavaOperation operation = (JavaOperation)op;
Method method = operation.getJavaMethod();
+
readIntents(method.getAnnotation(Requires.class), op.getRequiredIntents());
readSpecificIntents(method.getAnnotations(), op.getRequiredIntents());
readPolicySets(method.getAnnotation(PolicySets.class), op.getPolicySets());
+ readWebServicesAnnotations(method, javaInterface.getJavaClass(), javaInterface.getRequiredIntents());
+ inherit(javaInterface, op);
}
}
+
+
+
+
}
- private void readSpecificIntents(Annotation[] annotations, List<Intent> requiredIntents) {
+ private void inherit(JavaInterface javaInterface, Operation op) {
+ List<Intent> interfaceIntents = new ArrayList<Intent>(javaInterface.getRequiredIntents());
+ for ( Intent intent : javaInterface.getRequiredIntents() ) {
+
+ for ( Intent operationIntent : op.getRequiredIntents() ) {
+ if ( intent.getExcludedIntents().contains(operationIntent) ||
+ operationIntent.getExcludedIntents().contains(intent) ) {
+ interfaceIntents.remove(intent);
+ continue;
+ }
+ }
+ }
+ op.getRequiredIntents().addAll(interfaceIntents);
+
+ op.getPolicySets().addAll(javaInterface.getPolicySets());
+ }
+
+ private void readSpecificIntents(Annotation[] annotations, List<Intent> requiredIntents) {
for (Annotation a : annotations) {
org.oasisopen.sca.annotation.Intent intentAnnotation =
a.annotationType().getAnnotation(org.oasisopen.sca.annotation.Intent.class);
diff --git a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
index 805e691..9e01374 100644
--- a/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
+++ b/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java
@@ -31,6 +31,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.WebServiceClient;
import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
@@ -42,10 +43,17 @@
import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.Compatibility;
+import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
+import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
@@ -76,13 +84,20 @@
private ExtensionPointRegistry extensionPoints;
private PolicyFactory policyFactory;
private PolicySubjectProcessor policyProcessor;
+ private WSDLFactory wsdlFactory;
+ private StAXArtifactProcessor<Object> extensionProcessor;
+ private transient InterfaceContractMapper interfaceContractMapper;
- public JavaInterfaceProcessor(ExtensionPointRegistry extensionPoints) {
+ public JavaInterfaceProcessor(ExtensionPointRegistry extensionPoints, StAXArtifactProcessor<?> staxProcessor) {
this.extensionPoints = extensionPoints;
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
this.policyProcessor = new PolicySubjectProcessor(policyFactory);
this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+ this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
+ this.extensionProcessor = (StAXArtifactProcessor<Object>)staxProcessor;
+ UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
+ this.interfaceContractMapper = utilities.getUtility(InterfaceContractMapper.class);
}
/**
@@ -211,6 +226,10 @@
// Introspect the Java interface and populate the interface and
// operations
javaFactory.createJavaInterface(javaInterface, javaClass);
+
+ // cache the contribution that was used to resolve the Java interface
+ // in case we need it to reolve a referenced WSDL file
+ javaInterface.setContributionContainingClass(classReference.getContributionContainingClass());
} catch (InvalidInterfaceException e) {
ContributionResolveException ce = new ContributionResolveException("Resolving Java interface " + javaInterface.getName(), e);
@@ -242,6 +261,8 @@
JavaInterface javaCallbackInterface =
resolveJavaInterface((JavaInterface)javaInterfaceContract.getCallbackInterface(), resolver, context);
javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
+
+ postJAXWSProcessorResolve(javaInterfaceContract, resolver, context);
checkForbiddenAnnotations(monitor, javaInterfaceContract);
@@ -279,6 +300,11 @@
error(monitor, "ForbiddenAnnotationJCA30008", javaInterfaceContract, a.annotationType(), ifc.getName());
}
}
+
+ if ( a.annotationType().equals(WebServiceClient.class) ) {
+ error(monitor, "ForbiddenAnnotationJCA100018", javaInterfaceContract, a.annotationType(), ifc.getName());
+ }
+
}
for (Method m : ifc.getMethods()) {
for (Annotation a : m.getAnnotations()) {
@@ -361,4 +387,59 @@
public Class<JavaInterfaceContract> getModelType() {
return JavaInterfaceContract.class;
}
+
+ private void postJAXWSProcessorResolve(JavaInterfaceContract javaInterfaceContract, ModelResolver resolver, ProcessorContext context)
+ throws ContributionResolveException, IncompatibleInterfaceContractException {
+
+ JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
+
+ // the Java interface may now be marked as unresolved due to a new Java interface
+ // name retrieved from JAXWS annotations. Resolve it again if it is.
+ if (javaInterface != null && javaInterface.isUnresolved()){
+ javaInterface = resolveJavaInterface(javaInterface, resolver, context);
+ javaInterfaceContract.setInterface(javaInterface);
+ }
+
+ JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
+ // the Java callback interface may now be marked as unresolved due to a new Java interface
+ // name retrieved from JAXWS annotations. Resolve it again if it is.
+ if (javaCallbackInterface != null && javaCallbackInterface.isUnresolved()){
+ javaCallbackInterface = resolveJavaInterface(javaCallbackInterface, resolver, context);
+ javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
+ }
+
+ // the Java interface may be replaced by a WSDL contract picked up from JAXWS annotation
+ // if so we need to fluff up a WSDL contract and set it to be the normalized contract
+ // for the Java interface so it's used during contract mapping
+ if (javaInterface != null && javaInterface.getJAXWSWSDLLocation() != null){
+ WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface();
+ wsdlInterface.setUnresolved(true);
+ wsdlInterface.setRemotable(true);
+
+ WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
+ wsdlInterfaceContract.setInterface(wsdlInterface);
+ wsdlInterfaceContract.setLocation(javaInterface.getJAXWSWSDLLocation());
+ javaInterfaceContract.setNormailizedWSDLContract(wsdlInterfaceContract);
+
+ ProcessorContext wsdlContext = new ProcessorContext(javaInterface.getContributionContainingClass(),
+ context.getMonitor());
+ extensionProcessor.resolve(wsdlInterfaceContract, resolver, wsdlContext);
+
+ // check that the Java and WSDL contracts are compatible
+ interfaceContractMapper.checkCompatibility(wsdlInterfaceContract,
+ javaInterfaceContract,
+ Compatibility.SUBSET,
+ false,
+ false);
+
+ // copy policy from the WSDL interface to the Java interface
+ javaInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
+ javaInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
+
+ // TODO - is there anything else to be copied from the user specified WSDL?
+
+ }
+
+ // TODO - how to handle callbacks as the location is stored at the contract level?
+ }
}
diff --git a/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties b/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
index 73a2555..329f55e 100644
--- a/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
+++ b/modules/interface-java/src/main/resources/interface-javaxml-validation-messages.properties
@@ -24,4 +24,5 @@
ForbiddenAnnotationJCA30006 = [JCA30006] Forbidden annotation {0} found on service interface in class {1}
ForbiddenAnnotationJCA30007 = [JCA30007] Forbidden annotation {0} found on callback interface in class {1}
ForbiddenAnnotationJCA30008 = [JCA30008] Forbidden annotation {0} found in class {1}
+ForbiddenAnnotationJCA100018 = [JCA100018] Forbidden annotation {0} found in class {1}
diff --git a/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java b/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java
index 88ef90e..41facdb 100644
--- a/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java
+++ b/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/PolicyProcessorTestCase.java
@@ -64,11 +64,11 @@
JavaInterface type = factory.createJavaInterface(Interface3.class);
// policyProcessor.visitInterface(type);
assertEquals(2, type.getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(0).getRequiredIntents().size());
- assertEquals(1, type.getOperations().get(1).getRequiredIntents().size());
+ assertEquals(3, type.getOperations().get(0).getRequiredIntents().size());
+ assertEquals(3, type.getOperations().get(1).getRequiredIntents().size());
assertEquals(1, type.getPolicySets().size());
- assertEquals(1, type.getOperations().get(0).getPolicySets().size());
- assertEquals(1, type.getOperations().get(1).getPolicySets().size());
+ assertEquals(2, type.getOperations().get(0).getPolicySets().size());
+ assertEquals(2, type.getOperations().get(1).getPolicySets().size());
}
@Before
diff --git a/modules/interface-wsdl/META-INF/MANIFEST.MF b/modules/interface-wsdl/META-INF/MANIFEST.MF
index 75ad681..51c25ca 100644
--- a/modules/interface-wsdl/META-INF/MANIFEST.MF
+++ b/modules/interface-wsdl/META-INF/MANIFEST.MF
@@ -20,6 +20,7 @@
javax.wsdl.xml,
javax.xml.namespace,
javax.xml.stream,
+ javax.xml.transform,
org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.assembly.xml;version="2.0.0",
org.apache.tuscany.sca.common.java.io;version="2.0.0",
diff --git a/modules/interface-wsdl/pom.xml b/modules/interface-wsdl/pom.xml
index 3b0d3ac..4ec8904 100644
--- a/modules/interface-wsdl/pom.xml
+++ b/modules/interface-wsdl/pom.xml
@@ -59,12 +59,12 @@
<version>2.0-Beta1</version>
</dependency>
- <dependency>
+ <!-- dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-sca-runtime</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
- </dependency>
+ </dependency-->
</dependencies>
diff --git a/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
index 4f838e9..3c550d9 100644
--- a/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ b/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
@@ -21,13 +21,18 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import java.net.URI;
+import java.util.List;
+
import javax.wsdl.PortType;
+import javax.wsdl.WSDLElement;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
+import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
@@ -362,8 +367,99 @@
*/
public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
Monitor monitor = context.getMonitor();
+
+ WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
+
+ // if the contract has a location but no WSDL definition yet we need to read the WSDL
+ // from the specified location and create an interface based on the first port type
+ // this is required if the user uses the @WebService(wsdlLocation="") or
+ // @WebServiceProvider(wsdlLocation="") annotation in a Java component implementation.
+ if (wsdlInterfaceContract.getLocation() != null &&
+ wsdlInterface.getWsdlDefinition() == null){
+
+ WSDLDefinition wsdlDefinition = null;
+
+ URI wsdlFileURI = null;
+
+ try {
+ wsdlFileURI = new URI(wsdlInterfaceContract.getLocation());
+ } catch (Exception ex) {
+ Monitor.error(context.getMonitor(),
+ WSDLInterfaceProcessor.class.getName(),
+ "interface-wsdlxml-validation-messages",
+ "wsdliLocationException",
+ ex.getMessage() );
+ return;
+ }
+
+ // We need to find a portType from the user specified WSDL (the first one?) from which to defined
+ // the service interface. We can't just use the Tuscany resolution mechanism to find the WSDL file
+ // as that lumps together all WSDL in the same namespace. That's fine if you already know what portType
+ // your after. In this case we don't so we have to get the WSDL specified, find out what it's first portType
+ // is and then go from there with the usual Tuscany resolution mechanism
+ try {
+ if (wsdlFileURI.isAbsolute()){
+ // use the wsdli:wsdlLocation mechanism in the WSDLModelResolver to
+ // load the WSDL from an absolute location
+ wsdlDefinition = wsdlFactory.createWSDLDefinition();
+ wsdlDefinition.setUnresolved(true);
+ wsdlDefinition.setNamespace("nonamespace");
+ wsdlDefinition.getWsdliLocations().put("nonamespace", wsdlInterfaceContract.getLocation());
+ wsdlDefinition.setLocation(new URI(wsdlInterfaceContract.getLocation()));
+ } else {
+ // Find the wsdl in the contribution ready for further resolution
+ for (Artifact artifact : context.getContribution().getArtifacts()) {
+ if (artifact.getLocation().endsWith(wsdlInterfaceContract.getLocation())){
+ WSDLDefinition artifactWSDLDefinition = artifact.getModel();
+ wsdlDefinition = wsdlFactory.createWSDLDefinition();
+ wsdlDefinition.setUnresolved(true);
+ wsdlDefinition.setNamespace(artifactWSDLDefinition.getNamespace());
+ wsdlDefinition.getWsdliLocations().put(artifactWSDLDefinition.getNamespace(),
+ artifact.getLocation());
+ wsdlDefinition.setLocation(new URI(artifact.getLocation()));
+ break;
+ }
+ }
+
+ if (wsdlDefinition == null){
+ Monitor.error(context.getMonitor(),
+ WSDLInterfaceProcessor.class.getName(),
+ "interface-wsdlxml-validation-messages",
+ "wsdliLocationException",
+ "WSDL not found inside contribution at relative URI " + wsdlFileURI );
+ return;
+ }
+ }
+ } catch (Exception ex) {
+ Monitor.error(context.getMonitor(),
+ WSDLInterfaceProcessor.class.getName(),
+ "interface-wsdlxml-validation-messages",
+ "wsdliLocationException",
+ ex.getMessage() );
+ return;
+ }
+
+ wsdlDefinition.setUnresolved(true);
+ wsdlDefinition = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition, context);
+ // create the interface based on the first port type
+ PortType portType = (PortType)wsdlDefinition.getDefinition().getAllPortTypes().values().iterator().next();
+ try {
+ WSDLInterface newWSDLInterface = wsdlFactory.createWSDLInterface(portType, wsdlDefinition, resolver, monitor);
+ newWSDLInterface.getRequiredIntents().addAll(wsdlInterface.getRequiredIntents());
+ newWSDLInterface.getPolicySets().addAll(wsdlInterface.getPolicySets());
+ wsdlInterface = newWSDLInterface;
+ } catch (InvalidInterfaceException e) {
+ ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
+ portType.toString(), e);
+ error(monitor, "ContributionResolveException", wsdlFactory, ce);
+ }
+
+ wsdlInterface.setWsdlDefinition(wsdlDefinition);
+ wsdlInterfaceContract.setInterface(wsdlInterface);
+ }
+
// Resolve the interface and callback interface
- WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver, context);
+ wsdlInterface = resolveWSDLInterface(wsdlInterface, resolver, context);
wsdlInterfaceContract.setInterface(wsdlInterface);
// The forward interface (portType) may have a callback interface declared on it using an sca:callback attribute
diff --git a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java
index 2d2df84..95d1adc 100644
--- a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java
+++ b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFactory.java
@@ -609,6 +609,13 @@
* @return The SCA node
*/
public abstract Node createNode(NodeConfiguration configuration);
+
+ /**
+ * Create an SCA node from a list of pre-built o.a.t.sca.contribution.Contribution objects.
+ * Pass java.lang.Objects for now as this class doesn't have direct dependencies on
+ * o.a.t.sca.contribution.Contribution.
+ */
+ public abstract Node createNode(List<?> contributions);
/**
* Create the node configuration from the XML document
diff --git a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
index 05c718d..ee790f5 100644
--- a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
+++ b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
@@ -99,4 +99,43 @@
* @return
*/
ContributionConfiguration addDeploymentComposite(InputStream content);
+
+ /**
+ * Set if the deployable composites should be started when the contribution is installed
+ * @param startDeployables whether or not deployable composites should be started. The default is false.
+ */
+ void setStartDeployables(boolean startDeployables);
+
+ /**
+ * Tests if the deployable composites should be started when the contribution is installed
+ */
+ boolean isStartDeployables();
+
+ /**
+ * Gets the URIs of any dependent contributions. The dependent contributions are the
+ * contributions that will be used to resolve any imports used by this contribution.
+ * @return the URIs of any dependent contribution
+ */
+ List<String> getDependentContributionURIs();
+
+ /**
+ * Sets the dependent contribution URIs for this contribution. The dependent contributions are the
+ * contributions that will be used to resolve any imports used by this contribution.
+ * @param dependentContributionURIs
+ */
+ void setDependentContributionURIs(List<String> dependentContributionURIs);
+
+ /**
+ * Get the contribution meta data url. This is sca-contribution.xml data that is added to any
+ * existing meta-inf/sca-contribution.xml file within the contribution.
+ * @return the metadata url string
+ */
+ String getMetaDataURL();
+
+ /**
+ * Set the contribution meta data url. This is sca-contribution.xml data that is added to any
+ * existing meta-inf/sca-contribution.xml file within the contribution.
+ * @param metaDataURL the url string to the metadata file.
+ */
+ void setMetaDataURL(String metaDataURL);
}
diff --git a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
index 5229801..f6e4621 100644
--- a/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
+++ b/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
@@ -39,6 +39,9 @@
private List<DeploymentComposite> deploymentComposites = new ArrayList<DeploymentComposite>();
private String uri;
private String location;
+ private boolean startDeployables;
+ private List<String> dependentContributionURIs;
+ private String metaDataURL;
public ContributionConfigurationImpl() {
super();
@@ -152,4 +155,34 @@
composite.setLocation(location.toString());
return addDeploymentComposite(composite);
}
+
+ @Override
+ public void setStartDeployables(boolean startDeployables) {
+ this.startDeployables = startDeployables;
+ }
+
+ @Override
+ public boolean isStartDeployables() {
+ return startDeployables;
+ }
+
+ @Override
+ public List<String> getDependentContributionURIs() {
+ return dependentContributionURIs;
+ }
+
+ @Override
+ public void setDependentContributionURIs(List<String> dependentContributionURIs) {
+ this.dependentContributionURIs = dependentContributionURIs;
+ }
+
+ @Override
+ public String getMetaDataURL() {
+ return metaDataURL;
+ }
+
+ @Override
+ public void setMetaDataURL(String metaDataURL) {
+ this.metaDataURL = metaDataURL;
+ }
}
diff --git a/modules/node-impl-osgi/pom.xml b/modules/node-impl-osgi/pom.xml
index fa36384..192ca51 100644
--- a/modules/node-impl-osgi/pom.xml
+++ b/modules/node-impl-osgi/pom.xml
@@ -110,12 +110,14 @@
<scope>test</scope>
</dependency>
+<!--
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-binding-rmi-runtime</artifactId>
<version>2.0-Beta1</version>
<scope>test</scope>
</dependency>
+-->
</dependencies>
</project>
diff --git a/modules/node-impl/pom.xml b/modules/node-impl/pom.xml
index 131e1c5..3d86771 100644
--- a/modules/node-impl/pom.xml
+++ b/modules/node-impl/pom.xml
@@ -102,6 +102,13 @@
<version>2.0-Beta1</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
index 46f46a3..663129b 100644
--- a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
+++ b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
@@ -22,6 +22,7 @@
import java.io.StringReader;
import java.io.StringWriter;
+import java.util.Arrays;
import java.util.StringTokenizer;
import javax.xml.namespace.QName;
@@ -107,6 +108,15 @@
contribution = nodeConfigurationFactory.createContributionConfiguration();
contribution.setURI(reader.getAttributeValue(null, "uri"));
contribution.setLocation(reader.getAttributeValue(null, "location"));
+ contribution.setMetaDataURL(reader.getAttributeValue(null, "metaDataURL"));
+ String startDeployables = reader.getAttributeValue(null, "startDeployables");
+ if (startDeployables != null) {
+ contribution.setStartDeployables(Boolean.parseBoolean(startDeployables));
+ }
+ String dependentURIs = reader.getAttributeValue(null, "dependentURIs");
+ if (dependentURIs != null) {
+ contribution.setDependentContributionURIs(Arrays.asList(dependentURIs.split(",")));
+ }
node.getContributions().add(contribution);
} else if (BINDING.equals(name)) {
binding = nodeConfigurationFactory.createBindingConfiguration();
diff --git a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
index fc975c0..5497acd 100644
--- a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
+++ b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
@@ -75,8 +75,10 @@
import org.apache.tuscany.sca.node.NodeFactory;
import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.DefaultNodeConfigurationFactory;
import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -123,6 +125,13 @@
return node;
}
+ @SuppressWarnings("unchecked")
+ @Override
+ public Node createNode(List<?> contributions) {
+ NodeConfigurationFactory nodeConfigurationFactory = new DefaultNodeConfigurationFactory();
+ return new NodeImpl(this, nodeConfigurationFactory.createNodeConfiguration(), new ArrayList<Contribution>((List<Contribution>)contributions));
+ }
+
protected void addNode(NodeConfiguration configuration, Node node) {
nodes.put(getNodeKey(configuration), node);
}
diff --git a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
index c767c94..8eecca1 100644
--- a/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
+++ b/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
@@ -134,7 +134,6 @@
configuration.getURI(),
nodeFactory.getDeployer().getSystemDefinitions());
- CompositeContext.setThreadCompositeContext(compositeContext);
} finally {
// Reset the thread context monitor
nodeFactory.monitorFactory.setContextMonitor(tcm);
@@ -213,7 +212,6 @@
this.compositeContext = null;
ThreadMessageContext.removeMessageContext();
- CompositeContext.removeCompositeContext();
} catch (ActivationException e) {
throw new IllegalStateException(e);
@@ -375,7 +373,7 @@
return result;
}
- List<Contribution> getContributions() {
+ public List<Contribution> getContributions() {
return contributions;
}
diff --git a/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
index f82e855..ae7aa57 100644
--- a/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
+++ b/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java
@@ -320,7 +320,7 @@
}
if ((launcherBundle.getState() & Bundle.ACTIVE) == 0) {
if (logger.isLoggable(Level.FINE)) {
- logger.fine("Starting bundle: " + string(launcherBundle, false));
+ logger.fine("Starting launcher bundle: " + string(launcherBundle, false));
}
launcherBundle.start();
} else if (logger.isLoggable(Level.FINE)) {
@@ -514,7 +514,7 @@
}
bundle = bundleContext.installBundle(location);
if (logger.isLoggable(Level.FINE)) {
- logger.fine("Bundle installed in " + (currentTimeMillis() - installStart)
+ logger.fine("Bundle " + bundleFile + " installed in " + (currentTimeMillis() - installStart)
+ " ms: "
+ string(bundle, false));
}
diff --git a/modules/osgi-runtime-pom/pom.xml b/modules/osgi-runtime-pom/pom.xml
new file mode 100644
index 0000000..54f8b06
--- /dev/null
+++ b/modules/osgi-runtime-pom/pom.xml
@@ -0,0 +1,65 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <name>Apache Tuscany SCA OSGi Runtime POM</name>
+ <packaging>pom</packaging>
+
+ <!--
+ The dependencies required to run in an OSGi environment
+ also requires core and base runtimes
+ -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-osgi</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-extensibility-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/shades/base-nodep/src/main/resources/LICENSE b/modules/osgi-runtime-pom/src/main/resources/LICENSE
similarity index 100%
copy from shades/base-nodep/src/main/resources/LICENSE
copy to modules/osgi-runtime-pom/src/main/resources/LICENSE
diff --git a/shades/base-nodep/src/main/resources/NOTICE b/modules/osgi-runtime-pom/src/main/resources/NOTICE
similarity index 100%
copy from shades/base-nodep/src/main/resources/NOTICE
copy to modules/osgi-runtime-pom/src/main/resources/NOTICE
diff --git a/shades/base/src/main/resources/README.txt b/modules/osgi-runtime-pom/src/main/resources/README.txt
similarity index 100%
copy from shades/base/src/main/resources/README.txt
copy to modules/osgi-runtime-pom/src/main/resources/README.txt
diff --git a/modules/policy-security/pom.xml b/modules/policy-security/pom.xml
index f184c35..d5420b2 100644
--- a/modules/policy-security/pom.xml
+++ b/modules/policy-security/pom.xml
@@ -29,22 +29,13 @@
<name>Apache Tuscany SCA Policy Security Model</name>
<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
<version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/modules/policy-transaction-runtime-geronimo/pom.xml b/modules/policy-transaction-runtime-geronimo/pom.xml
index 3528f1a..89cc838 100644
--- a/modules/policy-transaction-runtime-geronimo/pom.xml
+++ b/modules/policy-transaction-runtime-geronimo/pom.xml
@@ -56,13 +56,13 @@
<dependency>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-transaction</artifactId>
- <version>2.1.3</version>
+ <version>2.1.4</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-connector</artifactId>
- <version>2.1.3</version>
+ <version>2.1.4</version>
</dependency>
</dependencies>
diff --git a/modules/policy-transaction-runtime-geronimo/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/geronimo/TransactionModuleActivator.java b/modules/policy-transaction-runtime-geronimo/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/geronimo/TransactionModuleActivator.java
index 3f43cac..e5ff21f 100644
--- a/modules/policy-transaction-runtime-geronimo/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/geronimo/TransactionModuleActivator.java
+++ b/modules/policy-transaction-runtime-geronimo/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/geronimo/TransactionModuleActivator.java
@@ -53,7 +53,7 @@
}
}
try {
- wrapper = new TransactionManagerWrapper();
+ wrapper = new TransactionManagerWrapper();
wrapper.start();
} catch (Exception e) {
throw new IllegalStateException(e);
diff --git a/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml b/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml
index 0c8ab75..99ab300 100644
--- a/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml
+++ b/modules/policy-transaction/src/main/resources/org/apache/tuscany/sca/policy/transaction/definitions.xml
@@ -22,7 +22,7 @@
xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <policySet name="ManagedTransactionPolicySet" provides="managedTransaction" appliesTo="implementation" attachTo="IntentRefs('sca:managedTransaction') | IntentRefs('sca:managedTransaction.local') | IntentRefs('sca:managedTransaction.global')">
+ <policySet name="ManagedTransactionPolicySet" provides="managedTransaction" appliesTo="//*[starts-with(name(.),'implementation')]" attachTo="IntentRefs('sca:managedTransaction') | IntentRefs('sca:managedTransaction.local') | IntentRefs('sca:managedTransaction.global')">
<intentMap provides="managedTransaction">
<qualifier name="global"> <!-- default="true" -->
<tuscany:transactionPolicy transactionTimeout="1200" action="REQUIRE_GLOBAL" />
@@ -34,23 +34,23 @@
</policySet>
<policySet name="NoManagedTransactionPolicySet" provides="noManagedTransaction"
- appliesTo="implementation" attachTo="IntentRefs('sca:noManagedTransaction')">
+ appliesTo="//*[starts-with(name(.),'implementation')]" attachTo="IntentRefs('sca:noManagedTransaction')">
<tuscany:transactionPolicy action="REQUIRE_NONE" />
</policySet>
- <policySet name="TransactedOneWayPolicySet" provides="transactedOneWay" appliesTo="binding" attachTo="IntentRefs('sca:transactedOneWay')">
+ <policySet name="TransactedOneWayPolicySet" provides="transactedOneWay" appliesTo="//*[starts-with(name(.),'binding')]" attachTo="IntentRefs('sca:transactedOneWay')">
<tuscany:transactionPolicy action="PROPAGATE" />
</policySet>
- <policySet name="ImmediateOneWayPolicySet" provides="immediateOneWay" appliesTo="binding" attachTo="IntentRefs('sca:immediateOneWay')">
+ <policySet name="ImmediateOneWayPolicySet" provides="immediateOneWay" appliesTo="//*[starts-with(name(.),'binding')]" attachTo="IntentRefs('sca:immediateOneWay')">
<tuscany:transactionPolicy action="SUSPEND" />
</policySet>
- <policySet name="PropagatesTransactionPolicySet" provides="propagatesTransaction" attachTo="IntentRefs('sca:propagatesTransaction')" appliesTo="binding">
+ <policySet name="PropagatesTransactionPolicySet" provides="propagatesTransaction" attachTo="IntentRefs('sca:propagatesTransaction')" appliesTo="//*[starts-with(name(.),'binding')]">
<tuscany:transactionPolicy action="PROPAGATE" />
</policySet>
- <policySet name="SuspendsTransactionPolicySet" provides="suspendsTransaction" appliesTo="binding" attachTo="IntentRefs('sca:suspendsTransaction')">
+ <policySet name="SuspendsTransactionPolicySet" provides="suspendsTransaction" appliesTo="//*[starts-with(name(.),'binding')]" attachTo="IntentRefs('sca:suspendsTransaction')">
<tuscany:transactionPolicy action="SUSPEND" />
</policySet>
diff --git a/modules/policy-wspolicy/pom.xml b/modules/policy-wspolicy/pom.xml
index c891e8c..0660043 100644
--- a/modules/policy-wspolicy/pom.xml
+++ b/modules/policy-wspolicy/pom.xml
@@ -31,8 +31,10 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <artifactId>tuscany-core-runtime-pom</artifactId>
+ <type>pom</type>
<version>2.0-Beta1</version>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -109,7 +111,7 @@
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
+ <version>3.2.6</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
diff --git a/modules/pom.xml b/modules/pom.xml
index fed1425..f6c6b73 100644
--- a/modules/pom.xml
+++ b/modules/pom.xml
@@ -36,9 +36,10 @@
<module>binding-atom</module>
<module>binding-atom-js-dojo</module>
<module>binding-atom-runtime</module>
+ <module>binding-comet</module>
+ <module>binding-comet-runtime</module>
<module>binding-ejb</module>
<module>binding-ejb-runtime</module>
- <module>binding-hazelcast-runtime</module>
<module>binding-http</module>
<module>binding-http-runtime</module>
<module>binding-jms</module>
@@ -49,11 +50,10 @@
<module>binding-jsonrpc-js-dojo</module>
<module>binding-jsonrpc-runtime</module>
<module>binding-rest</module>
+ <module>binding-rest-js-dojo</module>
<module>binding-rest-runtime</module>
<module>binding-rmi</module>
<module>binding-rmi-runtime</module>
- <module>binding-rss</module>
- <module>binding-rss-runtime</module>
<module>binding-sca-runtime</module>
<module>binding-ws</module>
<module>binding-ws-runtime-axis2</module>
@@ -65,6 +65,7 @@
<module>common-java</module>
<module>common-xml</module>
<module>contribution</module>
+ <module>contribution-resource</module>
<module>core</module>
<module>core-databinding</module>
<module>core-spi</module>
@@ -77,10 +78,9 @@
<module>databinding-sdo-axiom</module>
<module>databinding-json</module>
<module>deployment</module>
+ <module>domain-hazelcast</module>
<module>domain-node</module>
<module>endpoint-tribes</module>
- <module>endpoint-hazelcast</module>
- <module>endpoint-hazelcast-client</module>
<module>extensibility</module>
<module>extensibility-equinox</module>
<module>host-http</module>
@@ -91,8 +91,17 @@
<module>implementation-bpel-runtime</module>
<module>implementation-java</module>
<module>implementation-java-runtime</module>
+ <module>implementation-jaxrs</module>
+ <module>implementation-jaxrs-runtime</module>
+ <module>implementation-python</module>
+ <module>implementation-python-runtime</module>
+ <module>implementation-script</module>
+ <module>implementation-script-runtime</module>
<module>implementation-spring</module>
<module>implementation-spring-runtime</module>
+ <module>implementation-spring-webapp</module>
+ <module>implementation-spring-stub</module>
+ <module>implementation-spring-tie</module>
<module>implementation-web</module>
<module>implementation-web-client</module>
<module>implementation-web-runtime</module>
@@ -140,10 +149,20 @@
<module>binding-corba</module>
<module>binding-corba-runtime</module>
- <module>implementation-script</module>
- <module>implementation-script-runtime</module>
- <module>implementation-jaxrs</module>
- <module>implementation-jaxrs-runtime</module>
+ <!--
+ Runtime collection features
+
+ Non-overallapping groups of Tuscany modules that define the
+ core runtime modules, containing the Tuscany extension SPI,
+ and the base runtime that defines the minimal Tuscany runtime
+ to which other extensions can be added
+
+ Extensions are included using maven dependencies on the *-runtime
+ modules in the /modules directory
+ -->
+ <module>core-runtime-pom</module>
+ <module>base-runtime-pom</module>
+ <module>osgi-runtime-pom</module>
</modules>
diff --git a/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java b/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
index 8626927..95e2381 100644
--- a/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
+++ b/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl2.java
@@ -22,6 +22,7 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.net.URI;
+import java.util.List;
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.node.Node;
@@ -41,9 +42,20 @@
public SCAClientFactoryImpl2(URI domainURI) throws NoSuchDomainException {
super(domainURI);
+ checkDomainURI(domainURI);
}
- @SuppressWarnings("unchecked")
+ private void checkDomainURI(URI domainURI) throws NoSuchDomainException {
+ for ( NodeFactory nodeFactory : NodeFactory.getNodeFactories()) {
+ String domainName = getDomainName();
+ List<Node> nodes = ((NodeFactoryImpl)nodeFactory).getNodesInDomain(domainName);
+ if ( !nodes.isEmpty() )
+ return;
+ }
+ throw new NoSuchDomainException(getDomainName());
+ }
+
+ @SuppressWarnings("unchecked")
@Override
public <T> T getService(Class<T> serviceInterface, String serviceName) throws NoSuchServiceException, NoSuchDomainException {
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
index 2987b1f..d0cfc25 100644
--- a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
@@ -23,19 +23,17 @@
import static java.lang.System.out;
import java.io.BufferedReader;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.StringReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.Callable;
-import javax.xml.stream.XMLStreamException;
-
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.common.java.io.IOHelper;
import org.apache.tuscany.sca.contribution.Artifact;
@@ -52,15 +50,17 @@
* A little SCA command shell.
*/
public class Shell {
-
- public Node node;
+
private boolean useJline;
final List<String> history = new ArrayList<String>();
private NodeFactory factory;
- public static final String[] COMMANDS = new String[] {"addDeploymentComposite", "help",
- "install", "installed",
- "printDomainLevelComposite",
- "remove", "start", "status", "stop"};
+ private String currentDomain = "";
+ private Map<String, Node> standaloneNodes = new HashMap<String, Node>();
+ private Map<String, Node> nodes = new HashMap<String, Node>();
+
+ public static final String[] COMMANDS = new String[] {"bye", "domain", "domains", "help", "install", "installed",
+ "load", "remove", "run", "save", "start", "status",
+ "stop"};
public static void main(final String[] args) throws Exception {
boolean useJline = true;
@@ -77,33 +77,58 @@
public Shell(String domainURI, boolean useJLine) {
this.factory = NodeFactory.newInstance();
- this.node = factory.createNode(domainURI);
this.useJline = useJLine;
+ if (domainURI != null) {
+ domain(domainURI);
+ }
}
- boolean addDeploymentComposite(final String curi, String contentURL) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException, IOException {
- node.addDeploymentComposite(curi, new StringReader(readContents(contentURL)));
+ boolean domain(final String domainURI) {
+ if (domainURI.length() < 1) {
+ currentDomain = "";
+ } else {
+ for (Node node : nodes.values()) {
+ if (domainURI.equals(node.getDomainName())) {
+ currentDomain = node.getDomainName();
+ return true;
+ }
+ }
+ Node node = factory.createNode(domainURI);
+ currentDomain = node.getDomainName();
+ nodes.put(currentDomain, node);
+ }
+ return true;
+ }
+
+ boolean domains() {
+ for (Node node : nodes.values()) {
+ System.out.println(node.getDomainName());
+ }
return true;
}
boolean install(final List<String> toks) throws ContributionReadException, ActivationException, ValidationException {
- boolean runDeployables = !toks.contains("-norun");
+ if (getNode() == null) {
+ out.println("not in domain, use domain command first");
+ return true;
+ }
+ boolean startDeployables = toks.contains("-start");
String metaDataURL = null;
if (toks.contains("-metadata")) {
- metaDataURL = toks.get(toks.indexOf("-metadata")+1);
+ metaDataURL = toks.get(toks.indexOf("-metadata") + 1);
}
List<String> duris = null;
if (toks.contains("-duris")) {
- duris = Arrays.asList(toks.get(toks.indexOf("-duris")+1).split(","));
+ duris = Arrays.asList(toks.get(toks.indexOf("-duris") + 1).split(","));
}
String first = null;
String second = null;
- for (int i=1; i<toks.size();i++) {
+ for (int i = 1; i < toks.size(); i++) {
if (toks.get(i).startsWith("-")) {
- if (!toks.get(i).equals("-norun")) {
- i++;
- }
+ if (!toks.get(i).equals("-start")) {
+ i++;
+ }
} else {
if (first == null) {
first = toks.get(i);
@@ -113,7 +138,7 @@
}
}
}
-
+
String curi = null;
String curl = null;
if (second != null) {
@@ -121,35 +146,43 @@
curl = second;
} else {
curl = first;
- curi = getDefaultURI(curl);
- out.println("installing at: " + curi);
}
- node.installContribution(curi, curl, metaDataURL, duris, runDeployables);
+ String uri = getNode().installContribution(curi, curl, metaDataURL, duris, startDeployables);
+ out.println("installed at: " + uri);
return true;
}
boolean installed(final List<String> toks) {
List<String> curis;
if (toks.size() > 1) {
- curis = Arrays.asList(new String[]{toks.get(1)});
+ curis = Arrays.asList(new String[] {toks.get(1)});
} else {
- curis =node.getInstalledContributions();
+ if (getNode() == null) {
+ return true;
+ }
+ curis = getNode().getInstalledContributions();
}
for (String curi : curis) {
- out.println(curi + " " + node.getInstalledContribution(curi).getLocation());
- Contribution c = node.getInstalledContribution(curi);
+ out.println(curi + " " + getNode().getInstalledContribution(curi).getLocation());
+ Contribution c = getNode().getInstalledContribution(curi);
+ List<String> deployeds = getNode().getDeployedComposites(curi);
for (Artifact a : c.getArtifacts()) {
if (a.getModel() instanceof Composite) {
- Composite composite = (Composite) a.getModel();
- out.println(" " + composite.getURI() + " " + composite.getName());
+ Composite composite = (Composite)a.getModel();
+ String running = deployeds.contains(composite.getURI()) ? "***running***" : "";
+ out.println(" " + composite.getURI() + " " + composite.getName() + " " + running);
}
}
}
return true;
}
+
boolean listComposites(final String curi) {
- Contribution c = node.getInstalledContribution(curi);
+ if (getNode() == null) {
+ return true;
+ }
+ Contribution c = getNode().getInstalledContribution(curi);
for (Artifact a : c.getArtifacts()) {
if (a.getModel() instanceof Composite) {
out.println(((Composite)a.getModel()).getName());
@@ -158,91 +191,152 @@
return true;
}
-
- private String getDefaultURI(String contributionURL) {
- String uri = null;
- try {
- File f = new File(contributionURL);
- if ("classes".equals(f.getName()) && "target".equals(f.getParentFile().getName())) {
- uri = f.getParentFile().getParentFile().getName();
- } else {
- uri = f.getName();
- }
- } catch (Exception e) {
- // ignore
- }
- if (uri == null) {
- uri = contributionURL;
- }
- int lastDot = uri.lastIndexOf('.');
- if (lastDot > -1) {
- uri = uri.substring(0, lastDot);
- }
- return uri;
- }
-
- boolean printDomainLevelComposite() throws ContributionReadException, ActivationException, ValidationException {
- out.println("TODO");
- //out.println(node.getDomainLevelCompositeAsString());
- return true;
- }
-
- boolean getQNameDefinition(final String curi, String definintion, String symbolSpace) throws ContributionReadException, ActivationException, ValidationException {
- // TODO:
+ boolean load(final String configXmlUrl) throws ContributionReadException, ActivationException, ValidationException {
+ Node node = factory.createNodeFromXML(configXmlUrl);
+ currentDomain = node.getDomainName();
+ nodes.put(currentDomain, node);
return true;
}
boolean remove(final String curi) throws ContributionReadException, ActivationException, ValidationException {
- node.removeContribution(curi);
+ if (getNode() == null) {
+ out.println("not in domain, use domain command first");
+ return true;
+ }
+ getNode().removeContribution(curi);
+ return true;
+ }
+
+ boolean run(final String commandsFileURL) throws IOException {
+ BufferedReader r = new BufferedReader(new InputStreamReader(IOHelper.getLocationAsURL(commandsFileURL).openStream()));
+ String l;
+ try {
+ while ((l = r.readLine()) != null) {
+ out.println(l);
+ String[] toks = l != null ? l.trim().split(" ") : "".split(" ");
+ List<String> toksList = new ArrayList<String>();
+ for (String s : toks) {
+ if (s != null && s.trim().length() > 0) {
+ toksList.add(s);
+ }
+ }
+ apply(eval(toksList));
+ }
+ } finally {
+ r.close();
+ }
+ return true;
+ }
+
+ boolean save(final String directory) throws IOException {
+ out.println("TODO: not yet implemented");
return true;
}
public boolean stop(List<String> toks) throws ActivationException {
- if (toks == null || toks.size() < 2) {
- node.stop();
- factory.stop();
- return false;
- }
String curi = toks.get(1);
if (toks.size() > 2) {
- node.removeFromDomainLevelComposite(curi + "/" + toks.get(2));
+ getNode().removeFromDomainLevelComposite(curi, toks.get(2));
} else {
- for (String compositeURI : node.getDeployedCompostes(curi)) {
- node.removeFromDomainLevelComposite(curi + "/" + compositeURI);
+ if (standaloneNodes.containsKey(curi)) {
+ standaloneNodes.remove(curi).stop();
+ } else if (nodes.containsKey(curi)) {
+ Node n = nodes.remove(curi);
+ n.stop();
+ if (n.getDomainName().equals(currentDomain)) {
+ currentDomain = "";
+ }
+ } else {
+ for (String compositeURI : getNode().getDeployedComposites(curi)) {
+ getNode().removeFromDomainLevelComposite(curi, compositeURI);
+ }
}
}
-
return true;
}
+ public boolean bye() {
+ for (Node node : nodes.values()) {
+ node.stop();
+ }
+ factory.stop();
+ for (Node node : standaloneNodes.values()) {
+ node.stop();
+ }
+ return false;
+ }
+
boolean start(String curi, String compositeURI) throws ActivationException, ValidationException {
- node.addToDomainLevelComposite(curi + "/" + compositeURI);
- return true;
- }
-
- boolean status(final List<String> toks) {
- out.println("Domain: " + node.getDomainName());
- List<String> ics;
- if (toks.size()>1) {
- ics = new ArrayList<String>();
- ics.add(toks.get(1));
- } else {
- ics = node.getInstalledContributions();
+ Contribution c = getNode().getInstalledContribution(curi);
+ for (Artifact a : c.getArtifacts()) {
+ if (compositeURI.equals(a.getURI())) {
+ getNode().addToDomainLevelComposite(curi, compositeURI);
+ return true;
+ }
+ }
+ // external composite file ('composite by value')
+ try {
+ URL url = IOHelper.getLocationAsURL(compositeURI);
+ InputStream is = IOHelper.openStream(url);
+ BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ getNode().addDeploymentComposite(curi, br);
+ } catch (Exception e) {
+ System.out.println(e);
}
- for (String curi : ics) {
- Contribution c = node.getInstalledContribution(curi);
- List<String> dcs = node.getDeployedCompostes(curi);
- if (toks.size()>2) {
- dcs = new ArrayList<String>();
- dcs.add(toks.get(2));
- } else {
- dcs = node.getDeployedCompostes(curi);
+ return true;
+ }
+
+ boolean start(String nodeName, String compositeURI, String contributionURL, String... dependentContributionURLs)
+ throws ActivationException, ValidationException {
+ Node node = NodeFactory.newStandaloneNode(compositeURI, contributionURL, dependentContributionURLs);
+ standaloneNodes.put(nodeName, node);
+ return true;
+ }
+
+ boolean status(final List<String> toks) {
+ if (standaloneNodes.size() > 0) {
+ out.println("Standalone Nodes:");
+ for (String nodeName : standaloneNodes.keySet()) {
+ Node node = standaloneNodes.get(nodeName);
+ for (String curi : node.getInstalledContributions()) {
+ for (String dc : node.getDeployedComposites(curi)) {
+ out.println(" " + nodeName + " " + dc);
+ }
+ }
}
- for (String compositeUri : dcs) {
- for (Artifact a : c.getArtifacts()) {
- if (compositeUri.equals(a.getURI())) {
- out.println(" " + curi + " " + compositeUri + " " + ((Composite)a.getModel()).getName());
+ out.println();
+ }
+ if (nodes.size() > 0) {
+ for (Node node : nodes.values()) {
+ out.println("Domain: " + node.getDomainName());
+ List<String> ics;
+ if (toks.size() > 1) {
+ ics = new ArrayList<String>();
+ ics.add(toks.get(1));
+ } else {
+ ics = node.getInstalledContributions();
+ }
+
+ for (String curi : ics) {
+ Contribution c = node.getInstalledContribution(curi);
+ List<String> dcs = node.getDeployedComposites(curi);
+ if (toks.size() > 2) {
+ dcs = new ArrayList<String>();
+ dcs.add(toks.get(2));
+ } else {
+ dcs = node.getDeployedComposites(curi);
+ }
+ for (String compositeUri : dcs) {
+ for (Artifact a : c.getArtifacts()) {
+ if (compositeUri.equals(a.getURI())) {
+ out.println(" " + curi
+ + " "
+ + compositeUri
+ + " "
+ + ((Composite)a.getModel()).getName());
+ }
+ }
}
}
}
@@ -251,13 +345,17 @@
}
boolean history() {
- for (String l: history)
+ for (String l : history)
out.println(l);
return true;
}
-
+
+ public Node getNode() {
+ return nodes.get(currentDomain);
+ }
+
List<String> read(Object r) throws IOException {
- out.print("=> ");
+ out.print(currentDomain + "> ");
final String l;
if (useJline) {
l = JLine.readLine(r);
@@ -265,10 +363,10 @@
l = ((BufferedReader)r).readLine();
history.add(l);
}
- String[] toks = l != null? l.trim().split(" ") : "stop".split(" ");
+ String[] toks = l != null ? l.trim().split(" ") : "bye".split(" ");
List<String> toksList = new ArrayList<String>();
for (String s : toks) {
- if (s != null && s.trim().length()>0) {
+ if (s != null && s.trim().length() > 0) {
toksList.add(s);
}
}
@@ -278,49 +376,122 @@
Callable<Boolean> eval(final List<String> toks) {
final String op = toks.size() > 0 ? toks.get(0) : "";
- if (op.equalsIgnoreCase("addDeploymentComposite")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return addDeploymentComposite(toks.get(1), toks.get(2));
- }};
- if (op.equalsIgnoreCase("install")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return install(toks);
- }};
- if (op.equalsIgnoreCase("installed")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return installed(toks);
- }};
- if (op.equalsIgnoreCase("printDomainLevelComposite")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return printDomainLevelComposite();
- }};
- if (op.equalsIgnoreCase("getQNameDefinition")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return getQNameDefinition(toks.get(1), toks.get(2), toks.get(3));
- }};
- if (op.equalsIgnoreCase("remove")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return remove(toks.get(1));
- }};
- if (op.equalsIgnoreCase("help")) return new Callable<Boolean>() { public Boolean call() {
- return help(toks);
- }};
- if (op.equalsIgnoreCase("stop")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return stop(toks);
- }};
- if (op.equalsIgnoreCase("bye")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return stop(null);
- }};
- if (op.equalsIgnoreCase("start")) return new Callable<Boolean>() { public Boolean call() throws Exception {
- return start(toks.get(1), toks.get(2));
- }};
- if (op.equalsIgnoreCase("status")) return new Callable<Boolean>() { public Boolean call() {
- return status(toks);
- }};
- if (op.equalsIgnoreCase("history")) return new Callable<Boolean>() { public Boolean call() {
- return history();
- }};
- if (op.equalsIgnoreCase("")) return new Callable<Boolean>() { public Boolean call() {
- return true;
- }};
- return new Callable<Boolean>() { public Boolean call() {
- out.println("unknown command");
- return true;
- }};
+ if (op.equalsIgnoreCase("domain"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return domain(toks.size() > 1 ? toks.get(1) : "");
+ }
+ };
+ if (op.equalsIgnoreCase("domains"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return domains();
+ }
+ };
+ if (op.equalsIgnoreCase("install"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return install(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("installed"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return installed(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("load"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return load(toks.get(1));
+ }
+ };
+ if (op.equalsIgnoreCase("remove"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return remove(toks.get(1));
+ }
+ };
+ if (op.equalsIgnoreCase("run"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return run(toks.get(1));
+ }
+ };
+ if (op.equalsIgnoreCase("help"))
+ return new Callable<Boolean>() {
+ public Boolean call() {
+ return help(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("save"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return save(toks.get(1));
+ }
+ };
+ if (op.equalsIgnoreCase("stop"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return stop(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("bye"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return bye();
+ }
+ };
+ if (op.equalsIgnoreCase("start"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ if (currentDomain.length() > 0) {
+ return start(toks.get(1), toks.get(2));
+ } else {
+ String[] duris = null;
+ if (toks.contains("-duris")) {
+ int i = toks.indexOf("-duris");
+ duris = toks.get(i + 1).split(",");
+ toks.remove(i); toks.remove(i+1);
+ }
+ String name = toks.get(1);
+ String contributionURL;
+ String compositeURI;
+ if (toks.size() > 3) {
+ compositeURI = toks.get(2);
+ contributionURL = toks.get(3);
+ } else {
+ compositeURI = null;
+ contributionURL = toks.get(2);
+ }
+ return start(name, compositeURI, contributionURL, duris);
+ }
+ }
+ };
+ if (op.equalsIgnoreCase("status"))
+ return new Callable<Boolean>() {
+ public Boolean call() {
+ return status(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("history"))
+ return new Callable<Boolean>() {
+ public Boolean call() {
+ return history();
+ }
+ };
+ if (op.equalsIgnoreCase("") || op.startsWith("#"))
+ return new Callable<Boolean>() {
+ public Boolean call() {
+ return true;
+ }
+ };
+ return new Callable<Boolean>() {
+ public Boolean call() {
+ out.println("unknown command");
+ return true;
+ }
+ };
}
boolean apply(final Callable<Boolean> func) {
@@ -340,72 +511,73 @@
} else {
reader = new BufferedReader(new InputStreamReader(in));
}
- while(apply(eval(read(reader))));
+ while (apply(eval(read(reader))))
+ ;
}
- String readContents(String location) throws IOException {
- URL url = IOHelper.getLocationAsURL(location);
- InputStream is = IOHelper.openStream(url);
- try {
- BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- StringBuilder builder = new StringBuilder(8192);
- for(String line=br.readLine(); line!=null; line=br.readLine()) {
- builder.append(line);
- builder.append('\n');
- }
- return builder.toString();
- } finally {
- IOHelper.close(is);
- }
- }
-
boolean help(List<String> toks) {
String command = (toks == null || toks.size() < 2) ? null : toks.get(1);
if (command == null) {
helpOverview();
- } else if ("help".equalsIgnoreCase(command)){
+ } else if ("help".equalsIgnoreCase(command)) {
helpHelp();
} else if ("install".equalsIgnoreCase(command)) {
helpInstall();
} else if ("installed".equalsIgnoreCase(command)) {
helpInstalled();
+ } else if ("load".equalsIgnoreCase(command)) {
+ helpLoad();
} else if ("remove".equalsIgnoreCase(command)) {
helpRemove();
- } else if ("addDeploymentComposite".equalsIgnoreCase(command)) {
- helpAddDeploymentComposite();
- } else if ("printDomainLevelComposite".equalsIgnoreCase(command)) {
- helpPrintDomainLevelComposite();
+ } else if ("run".equalsIgnoreCase(command)) {
+ helpRun();
+ } else if ("save".equalsIgnoreCase(command)) {
+ helpSave();
} else if ("start".equalsIgnoreCase(command)) {
helpStart();
} else if ("status".equalsIgnoreCase(command)) {
helpStatus();
} else if ("stop".equalsIgnoreCase(command)) {
helpStop();
- } else if ("startup".equalsIgnoreCase(command)){
+ } else if ("startup".equalsIgnoreCase(command)) {
helpStartUp();
+ } else if ("bye".equalsIgnoreCase(command)) {
+ helpBye();
}
return true;
}
boolean helpOverview() {
- out.println("Apache Tuscany Shell (" + Version.getVersion() + " " + Version.getRevsion() + " " + Version.getBuildTime() + ")");
+ out.println("Apache Tuscany Shell (" + Version.getVersion()
+ + " "
+ + Version.getRevsion()
+ + " "
+ + Version.getBuildTime()
+ + ")");
out.println("Commands:");
out.println();
out.println(" help");
- out.println(" install [<uri>] <contributionURL> [-norun -metadata <url> -duris <uri,uri,...>]");
+ out.println(" domain <domainURI>");
+ out.println(" domains");
+ out.println(" install [<uri>] <contributionURL> [-start] [-metadata <url>] [-duris <uri,uri,...>]");
out.println(" installed [<contributionURI>]");
+ out.println(" load <configXmlURL>");
out.println(" remove <contributionURI>");
- out.println(" addDeploymentComposite <contributionURI> <contentURL>");
- out.println(" printDomainLevelComposite");
- out.println(" start <curi> <compositeUri>");
- out.println(" status [<curi> <compositeUri>]");
- out.println(" stop [<curi> <compositeUri>]");
+ out.println(" run <commandsFileURL>");
+ out.println(" save <directoryPath>");
+ out.println(" start <curi> <compositeUri>|<contentURL>");
+ out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
+ out.println(" status [<curi> [<compositeUri>]]");
+ out.println(" stop [<curi> [<compositeUri>]]");
+ out.println(" bye");
out.println();
- if (useJline) out.println("Use Tab key for command and argument completion");
+ if (useJline)
+ out.println("Use Tab key for command and argument completion");
out.println("For detailed help on each command do 'help <command>', for help of startup options do 'help startup'");
out.println();
return true;
}
+
void helpHelp() {
out.println(" help [<command>]");
out.println();
@@ -419,25 +591,27 @@
out.println(" <command> - (optional) the command to get detailed help on");
}
- void helpAddDeploymentComposite() {
- out.println(" addDeploymentComposite <contributionURI> <contentURL>");
+ void helpDomain() {
+ out.println(" domain [<domainURI>]");
out.println();
- out.println(" Adds a deployment composite using a supplied composite ('composite by value' - a data");
- out.println(" structure, not an existing resource in the Domain) to the contribution identified by a");
- out.println(" supplied contribution URI. The added deployment composite is given a relative URI that");
- out.println(" matches the @name attribute of the composite, with a '.composite' suffix. Since all composites");
- out.println(" run within the context of an installed contribution (any component implementations or other");
- out.println(" definitions are resolved within that contribution), this functionality makes it possible");
- out.println(" for the deployer to create a composite with final configuration and wiring decisions and add");
- out.println(" it to an installed contribution without having to modify the contents of the root contribution.");
+ out.println(" Starts or connects to a domain for the given domain URI.");
+ out.println(" If no domain URI is specified switch to standalone mode.");
out.println();
out.println(" Arguments:");
- out.println(" <contributionURI> - (required) the URI of an installed contribution");
- out.println(" <contentURL> - (required) the location of the composite");
+ out.println(" <domainURI> - (optional) the domain URI of the domain");
+ }
+
+ void helpDomains() {
+ out.println(" domains");
+ out.println();
+ out.println(" Shows the currently defined domain URIs");
+ out.println();
+ out.println(" Arguments:");
+ out.println(" none");
}
void helpInstall() {
- out.println(" install [<uri>] <contributionURL> [-norun -metadata <url> -duris <uri,uri,...>]");
+ out.println(" install [<uri>] <contributionURL> [-start] [-metadata <url>] [-duris <uri,uri,...>]");
out.println();
out.println(" Creates an installed contribution with a supplied root contribution, installed at abase URI.");
out.println();
@@ -445,7 +619,7 @@
out.println(" uri - (optional) the URI (name) to use for the contribution. When no uri is specified");
out.println(" a default URI is used derived from the contribution URL");
out.println(" contributionURL - (required) the URL to the contribution to install");
- out.println(" -norun - (optional) do not start any composites listed as deployable in the sca-contribution.xml file");
+ out.println(" -start - (optional) start any composites listed as deployable in the sca-contribution.xml file");
out.println(" -metadata <url> - (optional) the URL to an external contribution meta data document that should be");
out.println(" merged into any existing sca-contributions.xml file within the contribution.");
out.println(" -duris <uri,uri,...> - (optional) specifies the URIs of contributions that are used to resolve the");
@@ -464,6 +638,17 @@
out.println(" contributionURI - (optional) the URI of an installed contribution");
}
+ void helpLoad() {
+ out.println(" load <configXmlUrl>");
+ out.println();
+ out.println(" Shows information about the contributions installed on this node,");
+ out.println(" including the contribution URI and location along with the URI");
+ out.println(" and QName of any composites within the contribution");
+ out.println();
+ out.println(" Arguments:");
+ out.println(" configXmlUrl - (required) the URL of the config file to load");
+ }
+
void helpRemove() {
out.println(" remove <contributionURI>");
out.println();
@@ -473,17 +658,31 @@
out.println(" contributionURI - (required) the URI of an installed contribution");
}
- void helpPrintDomainLevelComposite() {
- out.println(" printDomainLevelComposite");
+ void helpRun() {
+ out.println(" run <commandsFileURL>");
out.println();
- out.println(" Not yet implemented");
+ out.println(" Runs shell commands stored in file.");
+ out.println(" The file should be a text file with one shell command per line. Blank lines and ");
+ out.println(" lines starting with # will be ignored.");
out.println();
out.println(" Arguments:");
- out.println(" none");
+ out.println(" commandsFileURL - (required) the URL of the commands file to run");
+ }
+
+ void helpSave() {
+ out.println(" save <directoryPath>");
+ out.println();
+ out.println(" Saves the current Node state to directory.");
+ out.println(" This will include a node-config.xml file and copies of all artifacts");
+ out.println(" being used by the Node.");
+ out.println();
+ out.println(" Arguments:");
+ out.println(" directoryPath - (required) the URL of a directory to be used to store the state.");
}
void helpStart() {
- out.println(" start <curi> <compositeUri>");
+ out.println(" start <curi> <compositeUri>|<contentURL>");
+ out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
out.println();
out.println(" Starts a composite.");
out.println(" The composite is added to the domain composite with semantics that correspond to the domain-level");
@@ -491,13 +690,22 @@
out.println(" components become top-level components and the component services become externally visible");
out.println(" services (eg. they would be present in a WSDL description of the Domain).");
out.println();
- out.println(" Arguments:");
+ out.println(" The second form of the start command starts in standalone mode not part of any SCA domain.");
+ out.println();
+ out.println(" Arguments (form1):");
out.println(" curi - (required) the URI of an installed contribution");
- out.println(" compositeUri - (required) the URI of a composite");
+ out.println(" compositeUri or contentURL - (required) either the URI of a composite within the contribution");
+ out.println(" or a URL to an external composite file.");
+ out.println(" Arguments (form2):");
+ out.println(" name - (required) a name for the started composite/contribution");
+ out.println(" compositeUri - (optional) the URI of a composite within the contribution");
+ out.println(" contributionURL - (required) the URL to the contribution");
+ out.println(" -duris <uri,uri,...> - (optional) specifies the URIs of contributions that are used to resolve the");
+ out.println(" dependencies of the root contribution and other dependent contributions.");
}
void helpStatus() {
- out.println(" status [<curi> <compositeUri>]");
+ out.println(" status [<curi> [<compositeUri>]]");
out.println();
out.println(" Shows the status of the Node, listing for each deployed composite its");
out.println(" contribution URI, the composite URI, and the composite QName.");
@@ -508,18 +716,28 @@
}
void helpStop() {
- out.println(" stop [<curi> <compositeUri>]");
+ out.println(" stop [<curi> [<compositeUri>]]");
+ out.println(" stop <name>");
out.println();
- out.println(" Stops this Node or individual composites and contributions in the Node.");
+ out.println(" Stops a domain or standalone node or individual composites and contributions in a Domain.");
out.println(" If a composite URI is specified then the composite is removed from the Domain Level composite");
out.println(" This means that the removal of the components, wires, services and references originally added");
out.println(" to the domain level composite by the identified composite. If a contribution URI is specified");
out.println(" without a composite URI then all deployed composites composites in the contribution are stopped.");
- out.println(" If no contribution URI is specified then the entire Node is stopped and the Shell exits.");
out.println();
out.println(" Arguments:");
- out.println(" curi - (optional) the URI of an installed contribution");
+ out.println(" curi - (required) the URI of an installed contribution");
out.println(" compositeUri - (optional) the URI of a composite");
+ out.println(" name - (required) the name of a standalon node or domain to stop");
+ }
+
+ void helpBye() {
+ out.println(" bye");
+ out.println();
+ out.println(" All deployed composites are stopped and the Shell exists.");
+ out.println();
+ out.println(" Arguments:");
+ out.println(" none");
}
void helpStartUp() {
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/CompositeURICompletor.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/CompositeURICompletor.java
index fcfd5f0..c07c3ac 100644
--- a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/CompositeURICompletor.java
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/CompositeURICompletor.java
@@ -27,7 +27,7 @@
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.contribution.Artifact;
import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.node2.Node;
+import org.apache.tuscany.sca.shell.Shell;
/**
* A Completor that uses the composite URIs within a Contribution
@@ -35,16 +35,19 @@
*/
public class CompositeURICompletor extends SimpleCompletor {
- private Node node;
+ private Shell shell;
- public CompositeURICompletor(Node node) {
+ public CompositeURICompletor(Shell shell) {
super("");
- this.node = node;
+ this.shell = shell;
}
@Override
public int complete(final String buffer, final int cursor, final List clist) {
- Contribution c = node.getInstalledContribution(getContributionURI());
+ if (shell.getNode() == null) {
+ return -1;
+ }
+ Contribution c = shell.getNode().getInstalledContribution(getContributionURI());
if (c == null) {
return -1;
}
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/ICURICompletor.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/ICURICompletor.java
index c027332..b197bc9 100644
--- a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/ICURICompletor.java
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/ICURICompletor.java
@@ -23,24 +23,26 @@
import jline.SimpleCompletor;
-import org.apache.tuscany.sca.node2.Node;
+import org.apache.tuscany.sca.shell.Shell;
/**
* An Installed Contribution URI Completor
*/
public class ICURICompletor extends SimpleCompletor {
- private Node node;
+ private Shell shell;
- public ICURICompletor(Node node) {
+ public ICURICompletor(Shell shell) {
super("");
- this.node = node;
+ this.shell = shell;
}
@Override
public int complete(final String buffer, final int cursor, final List clist) {
- List<String> ics = node.getInstalledContributions();
- setCandidateStrings(ics.toArray(new String[ics.size()]));
+ if (shell.getNode() != null) {
+ List<String> ics = shell.getNode().getInstalledContributions();
+ setCandidateStrings(ics.toArray(new String[ics.size()]));
+ }
return super.complete(buffer, cursor, clist);
}
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/InstallCompletor.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/InstallCompletor.java
new file mode 100644
index 0000000..f615fe6
--- /dev/null
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/InstallCompletor.java
@@ -0,0 +1,123 @@
+/*
+ * 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.sca.shell.jline;
+
+import java.io.File;
+import java.util.List;
+
+import jline.FileNameCompletor;
+
+import org.apache.tuscany.sca.shell.Shell;
+
+/**
+ * A Completor for the install command.
+ * The command format is: install [<uri>] <contributionURL> [-start] [-metadata <url>] [-duris <uri,uri,...>]
+ *
+ * TODO: doesn't seem to complete the -xxx parameters properly yet
+ *
+ */
+public class InstallCompletor extends FileNameCompletor {
+
+ ICURICompletor icuriCompletor;
+
+ public InstallCompletor(Shell shell) {
+ icuriCompletor = new ICURICompletor(shell);
+ }
+
+ public int complete(final String buf, final int cursor,
+ final List candidates) {
+
+// System.err.println("buf:" + buf);
+// System.err.println("candidates:" + candidates);
+
+ if ("-duris".equals(TShellCompletor.lastArg)) {
+ return icuriCompletor.complete(buf, cursor, candidates);
+ }
+ if ("-metadata".equals(TShellCompletor.lastArg)) {
+ return super.complete(buf, cursor, candidates);
+ }
+
+ return super.complete(buf, cursor, candidates);
+ }
+
+ @Override
+ public int matchFiles(String buffer, String translated, File[] entries,
+ List candidates) {
+ if (entries == null) {
+ return -1;
+ }
+
+ int matches = 0;
+
+ // first pass: just count the matches
+ for (int i = 0; i < entries.length; i++) {
+ if (entries[i].getAbsolutePath().startsWith(translated)) {
+ matches++;
+ }
+ }
+ if ("-metadata".startsWith(buffer)) {
+ matches++;
+ }
+ if ("-duris".startsWith(buffer)) {
+ matches++;
+ }
+ if ("-start".startsWith(buffer)) {
+ matches++;
+ }
+
+ // green - executable
+ // blue - directory
+ // red - compressed
+ // cyan - symlink
+ for (int i = 0; i < entries.length; i++) {
+ if (entries[i].getAbsolutePath().startsWith(translated)) {
+ String name =
+ entries[i].getName()
+ + (((matches == 1) && entries[i].isDirectory())
+ ? File.separator : " ");
+
+ /*
+ if (entries [i].isDirectory ())
+ {
+ name = new ANSIBuffer ().blue (name).toString ();
+ }
+ */
+ candidates.add(name);
+ }
+ }
+
+ if ("-metadata".startsWith(buffer) && !TShellCompletor.allArgs.contains("-metadata")) {
+ candidates.add("-metadata" + (matches == 1 ? " " : ""));
+ }
+ if ("-duris".startsWith(buffer) && !TShellCompletor.allArgs.contains("-duris")) {
+ candidates.add("-duris" + (matches == 1 ? " " : ""));
+ }
+ if ("-start".startsWith(buffer) && !TShellCompletor.allArgs.contains("-start")) {
+ candidates.add("-start" + (matches == 1 ? " " : ""));
+ }
+
+ final int index = buffer.lastIndexOf(File.separator);
+
+ int x= index + File.separator.length();
+// System.out.println("x="+x);
+ return x;
+// return index + File.separator.length();
+ }
+}
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/JLine.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/JLine.java
index 3acf69b..e8fcd62 100644
--- a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/JLine.java
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/JLine.java
@@ -26,13 +26,9 @@
import java.util.LinkedList;
import java.util.List;
-import jline.ArgumentCompletor;
import jline.Completor;
import jline.ConsoleReader;
-import jline.FileNameCompletor;
-import jline.SimpleCompletor;
-import org.apache.tuscany.sca.runtime.ActivationException;
import org.apache.tuscany.sca.shell.Shell;
/**
@@ -51,11 +47,7 @@
// Add a Ctrl-c listener
reader.addTriggeredAction((char)3, new ActionListener() {
public void actionPerformed(ActionEvent e) {
- try {
- shell.stop(null);
- } catch (ActivationException e1) {
- e1.printStackTrace();
- }
+ shell.bye();
System.exit(0);
}
});
@@ -66,7 +58,7 @@
// completors.add(new ICURICompletor(shell.node));
// completors.add(new FileNameCompletor());
// reader.addCompletor(new ArgumentCompletor(completors));
- reader.addCompletor(new TShellCompletor(shell.node));
+ reader.addCompletor(new TShellCompletor(shell));
return reader;
}
diff --git a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
index ad6fb74..83d292a 100644
--- a/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
+++ b/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
@@ -19,6 +19,7 @@
package org.apache.tuscany.sca.shell.jline;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -31,7 +32,6 @@
import jline.NullCompletor;
import jline.SimpleCompletor;
-import org.apache.tuscany.sca.node2.Node;
import org.apache.tuscany.sca.shell.Shell;
/**
@@ -43,24 +43,25 @@
Map<String, Completor[]> completors;
final Completor commandCompletor = new SimpleCompletor(Shell.COMMANDS);
final ArgumentDelimiter delim = new WhitespaceArgumentDelimiter();
- final Node node;
+ final Shell shell;
static String lastArg;
+ static List<String> allArgs;
- public TShellCompletor(Node node) {
+ public TShellCompletor(Shell shell) {
super((Completor)null);
- this.node = node;
+ this.shell = shell;
completors = new HashMap<String, Completor[]>();
completors.put("help", new Completor[]{commandCompletor, commandCompletor, new NullCompletor()});
-// completors.put("install", new Completor[]{commandCompletor, new InstallCompletor(), new NullCompletor()});
- completors.put("install", new Completor[]{commandCompletor, new FileNameCompletor(), new FileNameCompletor(), new NullCompletor()});
- completors.put("installed", new Completor[]{commandCompletor, new ICURICompletor(node), new NullCompletor()});
- completors.put("remove", new Completor[]{commandCompletor, new ICURICompletor(node), new NullCompletor()});
- completors.put("addDeploymentComposite", new Completor[]{commandCompletor, new ICURICompletor(node), new FileNameCompletor(), new NullCompletor()});
- completors.put("printDomainLevelComposite", new Completor[]{commandCompletor, new NullCompletor()});
- completors.put("start", new Completor[]{commandCompletor, new ICURICompletor(node), new CompositeURICompletor(node), new NullCompletor()});
- completors.put("status", new Completor[]{commandCompletor, new ICURICompletor(node), new CompositeURICompletor(node), new NullCompletor()});
- completors.put("stop", new Completor[]{commandCompletor, new ICURICompletor(node), new CompositeURICompletor(node), new NullCompletor()});
+ completors.put("install", new Completor[]{commandCompletor, new InstallCompletor(shell)});
+ completors.put("installed", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()});
+ completors.put("load", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()});
+ completors.put("remove", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()});
+ completors.put("run", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()});
+ completors.put("save", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()});
+ completors.put("start", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});
+ completors.put("status", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});
+ completors.put("stop", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});
}
@Override
@@ -70,6 +71,7 @@
*/
public int complete(final String buffer, final int cursor,
final List candidates) {
+
ArgumentList list = delim.delimit(buffer, cursor);
int argpos = list.getArgumentPosition();
int argIndex = list.getCursorArgumentIndex();
@@ -83,6 +85,7 @@
lastArg = list.getArguments()[argIndex-1];
if (lastArg != null) lastArg = lastArg.trim();
}
+ allArgs = Arrays.asList(list.getArguments());
final Completor comp;
diff --git a/modules/stripes/pom.xml b/modules/stripes/pom.xml
index b26b498..5990b1f 100644
--- a/modules/stripes/pom.xml
+++ b/modules/stripes/pom.xml
@@ -35,17 +35,20 @@
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-webapp</artifactId>
<version>2.0-Beta1</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-implementation-web-runtime</artifactId>
<version>2.0-Beta1</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.stripes</groupId>
<artifactId>stripes</artifactId>
<version>1.5.2</version>
+ <scope>provided</scope>
</dependency>
<dependency>
diff --git a/modules/web-javascript-dojo/src/main/resources/tuscany/RestService.js b/modules/web-javascript-dojo/src/main/resources/tuscany/RestService.js
new file mode 100644
index 0000000..132b930
--- /dev/null
+++ b/modules/web-javascript-dojo/src/main/resources/tuscany/RestService.js
@@ -0,0 +1,141 @@
+/*
+ * 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.
+ */
+dojo.provide("tuscany.RestService");
+dojo.declare("tuscany.RestService", null, {
+ url:null,
+ contentType: "application/xml" /*application/json*/,
+ contentHandler: "xml" /*json*/,
+
+ constructor: function(args){
+ //summary:
+ //url : Take a string as a url that points to the rest endpoint
+ //contentType : Take the contentType to use when retrieving the rest endpoint
+
+ if(args){
+ var argUrl;
+ var argContentType;
+
+ if( dojo.isArray(args) ) {
+ argUrl = args[0];
+ argContentType = args[1];
+ } else {
+ argUrl = args;
+ }
+
+ //if the arg is a string, we assume it is a url to the atom feed
+ if( (dojo.isString(argUrl)) || (argUrl instanceof dojo._Url)){
+ if (argUrl instanceof dojo._Url){
+ this.url = argUrl + "";
+ }else{
+ this.url = argUrl;
+ }
+ }
+
+ if(argContentType) {
+ if(dojo.isString(argContentType)) {
+ if (argContentType == "application/xml") {
+ this.contentType = argContentType;
+ this.contentHandler = "xml";
+ } else if (argContentType == "application/json") {
+ this.contentType = argContentType;
+ this.contentHandler = "json";
+ }
+ }
+ }
+ }
+ },
+
+ get: function(id /*string*/) {
+ //The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
+ var xhrArgs = {
+ url: this.url + "/" + id,
+ handleAs: this.contentHandler,
+ headers: {"Accept": this.contentType}
+ };
+
+ //Call the asynchronous xhrGet
+ var deferred = dojo.xhrGet(xhrArgs);
+
+ deferred.addErrback(function(error){
+ alert("An unexpected error occurred: " + error);
+ });
+
+ return deferred;
+ },
+
+
+ post: function( entry /*entry object*/) {
+ //The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
+ var xhrArgs = {
+ url: this.url,
+ handleAs: this.contentHandler,
+ headers: {"Accept": this.contentType,
+ "Content-Type": this.contentType},
+ postData: entry
+ };
+
+ //Call the asynchronous xhrGet
+ var deferred = dojo.xhrPost(xhrArgs);
+
+ deferred.addErrback(function(error){
+ alert("An unexpected error occurred: " + error);
+ });
+
+ return deferred;
+ },
+
+ put: function(id /*string*/, entry /*entry object*/) {
+ //The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
+ var xhrArgs = {
+ url: this.url + "/" + id,
+ handleAs: this.contentHandler,
+ headers: {"Accept": this.contentType,
+ "Content-Type": this.contentType},
+ postData: entry
+ };
+
+ //Call the asynchronous xhrGet
+ var deferred = dojo.xhrPut(xhrArgs);
+
+ deferred.addErrback(function(error){
+ alert("An unexpected error occurred: " + error);
+ });
+
+ return deferred;
+ },
+
+ del: function(id /*string*/) {
+ //The parameters to pass to xhrGet, the url, how to handle it, and the callbacks.
+ var xhrArgs = {
+ url: this.url + "/" + id,
+ handleAs: this.contentHandler,
+ headers: {"Accept": this.contentType}
+ };
+
+ //Call the asynchronous xhrGet
+ var deferred = dojo.xhrDelete(xhrArgs);
+
+ deferred.addErrback(function(error){
+ alert("An unexpected error occurred: " + error);
+ });
+
+
+ return deferred;
+ }
+});
diff --git a/modules/wink/META-INF/MANIFEST.MF b/modules/wink/META-INF/MANIFEST.MF
index 3e6c92d..17bef26 100644
--- a/modules/wink/META-INF/MANIFEST.MF
+++ b/modules/wink/META-INF/MANIFEST.MF
@@ -7,11 +7,11 @@
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA Wink
Import-Package: javax.servlet,
- org.apache.wink.common,
- org.apache.wink.common.internal.registry,
- org.apache.wink.server.internal,
- org.apache.wink.server.internal.registry,
org.apache.tuscany.sca.implementation.web.runtime.utils;version="2.0",
+ org.apache.wink.common;version="1.1.1.incubating",
+ org.apache.wink.common.internal.registry;version="1.1.1.incubating",
+ org.apache.wink.server.internal;version="1.1.1.incubating",
+ org.apache.wink.server.internal.registry;version="1.1.1.incubating",
org.oasisopen.sca.annotation;version="2.0"
Bundle-SymbolicName: org.apache.tuscany.sca.wink
Bundle-DocURL: http://www.apache.org/
diff --git a/pom.xml b/pom.xml
index 7ad5e4b..f5a6e26 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
- <version>4</version>
+ <version>7</version>
</parent>
<!-- ====================================================================== -->
@@ -211,6 +211,7 @@
</pluginRepository>
<!-- Codehaus SNAPSHOT repository -->
+ <!--
<pluginRepository>
<id>codehaus-snapshot</id>
<name>Codehaus Snapshot Repository</name>
@@ -219,6 +220,7 @@
<enabled>true</enabled>
</snapshots>
</pluginRepository>
+ -->
<!-- Maven central repository -->
<pluginRepository>
@@ -272,12 +274,11 @@
<module>maven/maven-tuscany-plugin</module>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
- <module>shades</module>
<module>distribution</module>
- <module>archetypes</module>
- <module>compliance-tests</module>
+ <module>maven/archetypes</module>
+ <module>testing/compliance-tests</module>
</modules>
</profile>
<!-- ====================================================================== -->
@@ -298,12 +299,11 @@
<module>maven/maven-tuscany-plugin</module>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
- <module>shades</module>
<module>distribution</module>
- <module>archetypes</module>
- <module>compliance-tests</module>
+ <module>maven/archetypes</module>
+ <module>testing/compliance-tests</module>
</modules>
</profile>
@@ -315,7 +315,7 @@
<modules>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
<module>distribution</module>
</modules>
@@ -353,7 +353,7 @@
<modules>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
<module>distribution</module>
</modules>
@@ -388,12 +388,11 @@
<module>maven/maven-tuscany-plugin</module>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
- <module>shades</module>
<module>distribution</module>
- <module>archetypes</module>
- <module>compliance-tests</module>
+ <module>maven/archetypes</module>
+ <module>testing/compliance-tests</module>
</modules>
<build>
<plugins>
@@ -404,7 +403,7 @@
<profile>
<id>compliance</id>
<modules>
- <module>compliance-tests</module>
+ <module>testing/compliance-tests</module>
</modules>
</profile>
@@ -480,9 +479,9 @@
<id>dependencies</id>
<modules>
<module>modules</module>
- <!--module>samples</module>
+ <module>samples</module>
<module>tutorials</module>
- <module>demos</module-->
+ <module>demos</module>
</modules>
<build>
<plugins>
@@ -506,7 +505,7 @@
<profile>
<id>security</id>
<modules>
- <module>itest</module>
+ <module>testing/itest</module>
</modules>
<activation>
<property>
@@ -564,6 +563,11 @@
</build>
</profile>
+ <!--
+ to test this profile you may like to run mvn with arguments ...
+ -DaltDeploymentRepository=id::default::file:target/deploy -Prelease -Dgpg.skip
+ then look in the target/deploy directory for a locally deployed repository of artifacts
+ -->
<profile>
<id>release</id>
<properties>
@@ -573,16 +577,14 @@
<modules>
<module>maven/maven-tuscany-plugin</module>
<module>modules</module>
- <module>shades</module>
<module>features</module>
<module>distribution</module>
- <module>archetypes</module>
+ <module>maven/archetypes</module>
</modules>
<build>
<defaultGoal>deploy</defaultGoal>
<plugins>
<plugin>
- <inherited>true</inherited>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<configuration>
@@ -621,6 +623,47 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.6.1</version>
+ <configuration>
+ <maxmemory>1024m</maxmemory>
+ <tags>
+ <tag>
+ <name>tuscany.spi.extension.inheritfrom</name>
+ <!-- extension spi by inheritance tag for placing in classes /interfaces -->
+ <placement>t</placement>
+ <head>Provides part of the Tuscany SPI for Extension Developers by specialization of this class/interface
+ </head>
+ </tag>
+ <tag>
+ <name>tuscany.spi.extension.asclient</name>
+ <!-- extension spi by client access tag for placing in classes / interfaces. The term client here is used
+ in the OO design sense of any class that calls the methods of another is a client of the latter -->
+ <placement>t</placement>
+ <head>Provides part of the Tuscany SPI for Extension Developers by calling methods on this interface/class.</head>
+ </tag>
+ <tag>
+ <name>tuscany.spi.extension</name>
+ <!-- extension spi indicator for overviews, packages -->
+ <placement>a</placement>
+ <head>Elements of the Tuscany SPI for Extension developers are provided.</head>
+ </tag>
+ </tags>
+
+
+
+ <groups>
+ <!-- beware: this group stanza results in a grouping of pages that contains a superset of the spi, until we complete identification and then refactor out non spi code from listed packages-->
+ <group>
+ <title>Extension Developer's SPIs (Work in Progress)</title>
+ <packages>
+org.apache.tuscany.sca.assembly:org.apache.tuscany.sca.assembly.builder:org.apache.tuscany.sca.assembly.impl:org.apache.tuscany.sca.assembly.xml:org.apache.tuscany.sca.common.http:org.apache.tuscany.sca.common.xml:org.apache.tuscany.sca.common.xml.dom:org.apache.tuscany.sca.common.xml.stax:org.apache.tuscany.sca.context:org.apache.tuscany.sca.contribution:org.apache.tuscany.sca.contribution.namespace:org.apache.tuscany.sca.contribution.processor:org.apache.tuscany.sca.contribution.resolver:org.apache.tuscany.sca.core:org.apache.tuscany.sca.core.assembly:org.apache.tuscany.sca.core.factory:org.apache.tuscany.sca.core.invocation:org.apache.tuscany.sca.core.scope:org.apache.tuscany.sca.data.collection:org.apache.tuscany.sca.databinding:org.apache.tuscany.sca.databinding.impl:org.apache.tuscany.sca.databinding.javabeans:org.apache.tuscany.sca.databinding.xml:org.apache.tuscany.sca.extensibility:org.apache.tuscany.sca.host.http:org.apache.tuscany.sca.interfacedef:org.apache.tuscany.sca.interfacedef.impl:org.apache.tuscany.sca.interfacedef.util:org.apache.tuscany.sca.interfacedef.wsdl:org.apache.tuscany.sca.invocation:org.apache.tuscany.sca.monitor:org.apache.tuscany.sca.policy:org.apache.tuscany.sca.policy.authentication.token:org.apache.tuscany.sca.policy.security:org.apache.tuscany.sca.policy.util:org.apache.tuscany.sca.provider:org.apache.tuscany.sca.runtime:org.apache.tuscany.sca.web.javascript:org.apache.tuscany.sca.work:org.apache.tuscany.sca.xsd</packages>
+ </group>
+ </groups> <!-- -->
+ </configuration>
+ </plugin>
</plugins>
</build>
</profile>
@@ -650,8 +693,7 @@
<module>modules/databinding-jaxb</module>
<module>modules/deployment</module>
<module>modules/domain-node</module>
- <module>modules/endpoint-hazelcast</module>
- <module>modules/endpoint-hazelcast-client</module>
+ <module>modules/domain-hazelcast</module>
<module>modules/extensibility</module>
<module>modules/host-http</module>
<module>modules/host-jetty</module>
@@ -673,9 +715,7 @@
<module>modules/sca-client-impl</module>
<module>modules/wink</module>
<module>modules/xsd</module>
- <module>shades/base</module>
- <module>shades/base-nodep</module>
- <module>compliance-tests</module>
+ <module>testing/compliance-tests</module>
</modules>
</profile>
<profile>
@@ -684,7 +724,7 @@
<module>modules/binding-jms</module>
<module>modules/binding-jms-runtime</module>
<module>samples/webapps/helloworld-jms</module>
- <module>itest/jms</module>
+ <module>testing/itest/jms</module>
</modules>
</profile>
@@ -695,12 +735,11 @@
<modules>
<module>modules</module>
<module>samples</module>
- <module>itest</module>
+ <module>testing/itest</module>
<module>features</module>
- <module>shades</module>
<module>distribution</module>
- <module>archetypes</module>
- <!-- module>compliance-tests</module -->
+ <module>maven/archetypes</module>
+ <!-- module>testing/compliance-tests</module -->
</modules>
<build>
<plugins>
@@ -790,7 +829,8 @@
<message>Best Practice is to always define released plugin versions!</message>
<banLatest>true</banLatest>
<banRelease>true</banRelease>
- <banSnapshots>true</banSnapshots>
+<!-- TUSCANY-3674 -->
+ <banSnapshots>false</banSnapshots>
<phases>clean,deploy,site</phases>
<additionalPlugins>
</additionalPlugins>
@@ -841,6 +881,11 @@
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-5</version>
+ </plugin>
<!-- compiler plugin configuration -->
<plugin>
diff --git a/samples/README b/samples/README
index 43b7cb3..e7b8af8 100644
--- a/samples/README
+++ b/samples/README
@@ -1,202 +1,129 @@
The Apache Tuscany SCA Samples
==============================
-New Samples Structure
----------------------
+Welcome to the Apache Tuscany SCA Java runtime. You can find more general
+documentation about the runtime at:
-For the Milestone 5 release of Tuscany SCA Java 2.x we are beginning
-the process of moving to a new structure for samples. Milestone 5 is
-delivered in a state of partial change over to this new emphasis, and hence
-this README reflects that hybrid state.
+http://tuscany.apache.org/documentation-2x/.
-There are primarily 3 types of sample; those which focus on pure SCA
-concepts, those which demonstrate features of Tuscany and the last group
-is of samples which give a flavour of more complete, realistic applications.
+Here we give a short overview of what you can find in the samples directory.
+More detail on the individual sample contributions can be found at:
-The new structure primarily focusses separating contributions from the way that
-contributions are launched. The samples demonstrate the way in which contributions are used by
-launchers to execute tuscany SCA applications.
+http://tuscany.apache.org/documentation-2x/2.0-beta-Samples+documentation
-In this way you can explore the samples by chosing which launcher you wish
-to invoke which contribution. In the old style of sample this distinction was not clear;
-any given sample contained both launcher and contribution, and the set of samples provided
-represented a small subset of the combinations possible by the new approach.
+There are several samples subdirectories in the distribution;
+
+getting-started
+===============
+
+This is a good place to start if you've not tried Tuscany SCA Java before. This
+directory contains a number of simple "SCA Contributions" that can be run using
+the Tuscany SCA runtime. An SCA Contribution is the way that SCA composite
+applications are packaged so they can be run. For general information on SCA
+see http://tuscany.apache.org/documentation-2x/sca-introduction.html
-Within the SCA category of samples, most of the calculator samples, have been
-migrated to this new structure as follows.
+learning-more
+=============
-SCA Samples
- binding-rmi-calculator
- contribution-calculator-reference
- contribution-calculator-service
- binding-sca
- contribution-calculator
- contribution-binding-ws-calculator
- contribution-implementation-java-calculator
- calculator-sca-client
- launcher-command-line
- launcher-embedded-jse
- launcher-embedded-osgi
- launcher-mvn
+This directory contains many more SCA Contributions that you can try with
+the Tuscany SCA Java runtime. Some demonstrate particular features of the
+runtime, or example, the contributions under the async directory demonstrate
+the asynchronous programming model that the runtime supports.
-Please visit the 2.x documentation in our website [1] to get a better understanding of SCA
-and Tuscany 2.x
+SCA is extensible. You can plug in extensions to support many different types
+of technology. The Tuscany SCA Java runtime comes with lots of extensions
+and the majority of contributions here demonstrate these extensions. They are
+organized under directories following the name of the extension, for example,
+contributions that demonstrate the web services binding in operation can
+be found in the binding-ws directory. When you want to use the web service
+binding with an SCA service a reference it appears in the composite XML in
+the following way:
-Running the New Style samples
------------------------------
+<service>
+ <binding.ws/>
+</service>
-To run a new style sample there are 3 basic steps
+Hence it should be easy to map between extensions, as they appear in
+composite files and other samples that demonstrate various features of the
+extension.
-1) build the contribution: using either the command "mvn", "ant run" or your usual steps to build a
- module in your IDE
-2) unit test the contribution: if you used mvn or ant in step 1 then you will already have done this;
- if you used an IDE follow your usual steps to run the unit test in the contribution's module
-3) launch the contribution: go to one of the launcher* subdirectories of the samples root directory
- and follow the instructions there to use a launcher to launch your chosen contribution
+The contributions here can be run with using the approach that you find
+most convenient from the running-tuscany directory.
-I the case where you want to exercise the sample contribution with a separate client program, such as
-an application using the SCA client API then there is a 4th step of starting that client application
+running-tuscany
+===============
-[1] http://tuscany.apache.org/documentation-2x/
+The Tuscany SCA Java runtime can be used directly from the command line. It can
+also be embedded in other programs. As such there are many different ways that
+you can start the Tuscany SCA runtime and deploy contributions to it. Each
+directory here describes a different way of running Tuscany. In most cases these
+different approaches can be used to run any of the contributions from the
+getting-started or learning-more directories.
-Running the Old Style Samples
-------------------------------
-The Apache Tuscany SCA samples are built as part of the main Maven build and
-run, using the provided JUnit test cases, as tests in the Maven build.
+applications
+============
-In the binary distribution of Apache Tuscany most samples can also
-be run using the provided Ant build.xml files. These show the samples running
-from a simple main() method without the need for a JUnit test case.
+The contributions here demonstrate more fully formed applications when
+compared to the contributions found the getting-started or learning-more
+directories.
-In these notes text that appears in angled brackets like this <example> means
-that you need to make a choice and provide your own text at that point.
+extending-tuscany
+=================
-These simple samples have been created with the intention of illustrating the
-usage of the SCA API and annotations and certainly not to levels of SCA component
-abstraction. In real life situations you should use SCA to assemble real and
-usually bigger components, and when you do that you'll get all the benefits of
-SCA, bindings, policies, integration in an SOA environment etc..
+Once you're familiar with Tuscany and SCA you're likely to find that to
+implement you're application you need particular bindings, implementation
+types, policies or databindings. The examples in this directory show you
+how to extend the Tuscany runtime to include the technologies you need to use.
-Sample Layout
--------------
-Generally sample directories are organized in the same way based on the default
-project template provided by Maven. For example, take a look at the calculator
-sample;
+Running samples
+---------------
-calculator/
- src/ - Holds all of the source files for the sample
- main/ - Groups together the files that implement the sample
- java/ - Java source files
- resources/ - Non java resource files such as composte files
- test/ - Groups together files that provide sample tests
- java - Java test sources files. Usually JUnit test cases
- target/ - Holds the files generated when the sample is built
- classes/ - For example, Java class files
- test-classes/ - classes from src/test and other test files
+Running a samples contribution involves 3 basic steps
-Getting Ready To Build
-----------------------
-You will need to install the following software before you start.
+1) build the contribution
-J2SE Development Kit (JDK) 5.0
-Apache Ant 1.7.1 - if you are going to use Ant
-Apache Maven 2.0.9 - if you are going to use Maven
+Using ant, maven or eclipse (see below)
-Java and Ant and/or Maven binary directories must be present in your PATH so
-that their executable programs are available in your environment. You may
-find it useful to use a script to set up your environment, for example;
+2) launch the contribution
-For UNIX:
- JAVA_HOME=/<installation_directory>
- ANT_HOME=/<installation_directory>/apache-ant-1.7.0
- MAVEN_HOME=/<installation_directory>/maven-2.0.6
- export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
+Using one of the approaches described in the running-tuscany directory
-For Windows:
- set JAVA_HOME=C:\<installation_directory>
- set ANT_HOME=C:\<installation_directory>\apache-ant-1.7.0
- set MAVEN_HOME=C:\<installation_directory>\maven-2.0.6
- set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
+3) send a test message to the a component service
+When you want to exercise an SCA composite application you have to send a
+message to a component service. There are several ways of doing this depending
+on how the sample contribution has been configured. For example, you could
+send a SOAP message using the Web Services explorer in Eclipse, you could
+use a separate client program that uses the SCA client API, the sample
+contribution itself may even include initialization code that sends a test
+message when the contribution is started. The documentation for each sample
+describes what to do to send a test message.
-Building And Running The SCA Samples Using Ant
-----------------------------------------------
-The build.xml files provided with the Apache Tuscany SCA samples are designed
-to work with the binary distribution. They rely on the tuscany-sca-manifest.jar
-to describe the class path and this jar is only provided as part of the
-binary distribution.
+Building the sample contributions using Ant
+--------------------------------------------
+Most sample contributions are provided with a build.xml file. When you see one
+you can build it using Ant.
-The binary distribution of SCA also includes precompiled versions of each sample.
-If you look in the target directory of each sample you will see this jar file. To
-run a sample based on all of the precompiled artifacts all you have to do is:
+These build.xml files are designed to work with the Tuscany SCA Java binary
+distribution and build a classpath that, by various means, refers to the
+jars that are shipped in the modules directory. For them to work properly
+they should be run from the directory in which you find the build.xml file.
cd <sampledir>
-ant run
+ant
-Check each <sampledir>/README file as some samples require that two progams are
-run to get the desired result, for example, the two samples that show how
-to build extensions are run from their associated application samples.
-
-If you want to rebuild a sample, for example, if you have changed it, do the
-following:
-
-cd <sampledir>
-ant compile
+The result of this process will be the built contribution (a jar file) in the
+target subdirectory of the sample contribution directory.
Once the sample is built you have the option of running the sample in whatever
-way best suits you. Two alternatives are provided in the ant build files.
+way best suits you.
-The compile target builds the class files and then builds the jar so you can use
-the same command as before:
+Building SCA Samples Using Maven
+--------------------------------
+All sample contributions are provided with a pom.xml Maven build file. The
+Maven build process will work from both source and binary distributions.
-ant run
-
-This will use the generated jar to run the samples. The command line version of
-this is:
-
-on Windows
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\<sample jar file> <sample runnable class>
-
-for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\sample-calculator.jar calculator.CalculatorClient
-
-on *nix
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/<sample jar file> <sample runnable class>
-
-for example : java -cp ../../features/tuscany-sca-manifest.jar:target/sample-calculator.jar calculator.CalculatorClient
-
-
-You can use the compiled classes directly using
-
-ant run-classes
-
-The command line version of this is:
-
-on Windows
-
-java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes <sample runnable class>
-
-for example : java -cp ..\..\features\tuscany-sca-manifest.jar;target\classes calculator.CalculatorClient
-
-on *nix
-
-java -cp ../../features/tuscany-sca-manifest.jar:target/classes <sample runnable class>
-
-for example : java -cp ../../features/tuscany-sca-manifest.jar:target/classes calculator.CalculatorClient
-
-The class specified on the command of course depends on which sample you want to
-run. In the examples we have used we are running the CalculatorClient from the calculator sample.
-
-
-Building And Running The SCA Samples Using Maven
-------------------------------------------------
-
-The Maven build process will work from both source and binary distributions.
-To build and test all of the Apache Tuscany SCA sources, including the samples,
-do the following.
-
-cd sca
+cd <sampledir>
mvn
This will take a little while to complete. Experience with Maven tells us that
@@ -204,66 +131,24 @@
SCA requires. If Maven reports that it cannot download required dependencies
try running the Maven build again.
-Once you have all of the source built you can build and run each sample
-independently if required.
+When using Maven the samples are unit tested using JUnit test cases and so you
+will sometimes see test output during the build process.
-cd <sampledir>
-mvn
+The result of this process will be the built contribution (a jar file) in the
+target subdirectory of the sample contribution directory.
-When using Maven the samples are run within JUnit test cases and so you will
-sometimes not see any test output. You will always see an indication of test
-success or failure.
+Once the sample is built you have the option of running the sample in whatever
+way best suits you.
-Using The Samples In An IDE
----------------------------------------------
+Building Samples In An IDE
+---------------------------
+
The easiest way to use the samples in an IDE is to use Maven to generate all
-of the IDE project files for you automatically. This works best if you
-generate IDE projects for all of the Apache Tuscany modules. You can then
-include the ones you are interested in working with in you IDE.
+of the IDE project files for you automatically. You don't have to do this
+though and can use a series of manual steps in order to import the Tuscany
+samples into an IDE.
-To build IDE project files for all of the modules in Apache Tuscany SCA;
+Both approaches to importing SCA contribution projects into Eclipse are
+documented at:
-cd sca
-
-If you are an Eclipse user do the following
-
-mvn -Peclipse
-
-If you are an IDEA user do the following
-
-mvn idea:idea
-
-These commands generate project files for each module in Apache Tuscany SCA.
-The modules you are interested in can now be included in your IDE, for example,
-in Eclipse, if you create a new Java project and use the option to "create a
-new project from existing source" you can specify an SCA module directory,
-which includes the generated project files, and Eclipse will treat it like any
-other Java project.
-
-Using The Samples In An IDE Without Maven
------------------------------------------
-We don't provide any IDE project files with our distributions so you will have to
-import the sample files into your IDE manually. Here's an example of how it can be
-done using Eclipse.
-
-In a new or existing workspace
- Create a new java project to represent the sample you want to work on, e.g.
- launcher-embedded-jse
- Import all of the sample code and resources into this project, e.g.
- File, Import and then select tuscany-sca-1.0-incubating\samples\launcher-embedded-jse from the filesystem
- Configure the source path to include
- src/main/java
- src/main/resources
- Configure the output folder to be
- target
- Configure the build path to include the manifest jar tuscany-sca-manifiest.jar provided in
- features
- For here you have run;
- the unit test (loads a sequence of contributions and runs them)
- SampleJSELauncher (you'll need to add the name of the contribution to run as a parameter)
- build.xml (you'll need to set tuscany.home to point to distribution\all\target\apache-tuscany-sca-all-2.0-SNAPSHOT.dir\tuscany-sca-2.0-SNAPSHOT)
-
-The details of how to do this for other development environments will
-vary but the process will be similar.
-
-
+http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html
diff --git a/samples/logging-scribe/README b/samples/applications/logging-scribe/helloworld-scribe/README
similarity index 100%
rename from samples/logging-scribe/README
rename to samples/applications/logging-scribe/helloworld-scribe/README
diff --git a/samples/applications/logging-scribe/helloworld-scribe/pom.xml b/samples/applications/logging-scribe/helloworld-scribe/pom.xml
new file mode 100644
index 0000000..ee1f305
--- /dev/null
+++ b/samples/applications/logging-scribe/helloworld-scribe/pom.xml
@@ -0,0 +1,96 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>jar</packaging>
+ <artifactId>sample-logging-scribe</artifactId>
+ <name>Apache Tuscany SCA Scribe Logging Sample</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.thrift</groupId>
+ <artifactId>libthrift</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/logging-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java
diff --git a/samples/logging-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java
diff --git a/samples/logging-scribe/src/main/java/generated/scribe/thrift/LogEntry.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/generated/scribe/thrift/LogEntry.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java
diff --git a/samples/logging-scribe/src/main/java/generated/scribe/thrift/ResultCode.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/generated/scribe/thrift/ResultCode.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java
diff --git a/samples/logging-scribe/src/main/java/generated/scribe/thrift/scribe.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/generated/scribe/thrift/scribe.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java
diff --git a/samples/logging-scribe/src/main/java/sample/HelloWorld.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/sample/HelloWorld.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java
diff --git a/samples/logging-scribe/src/main/java/sample/HelloWorldImpl.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/sample/HelloWorldImpl.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java
diff --git a/samples/logging-scribe/src/main/java/sample/Logger.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/sample/Logger.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java
diff --git a/samples/logging-scribe/src/main/java/sample/ScribeLoggerImpl.java b/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java
similarity index 100%
rename from samples/logging-scribe/src/main/java/sample/ScribeLoggerImpl.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java
diff --git a/samples/logging-scribe/src/main/resources/META-INF/sca-contribution.xml b/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/logging-scribe/src/main/resources/META-INF/sca-contribution.xml
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/logging-scribe/src/main/resources/fb303.thrift b/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift
similarity index 100%
rename from samples/logging-scribe/src/main/resources/fb303.thrift
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift
diff --git a/samples/logging-scribe/src/main/resources/scribe.composite b/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite
similarity index 100%
rename from samples/logging-scribe/src/main/resources/scribe.composite
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite
diff --git a/samples/logging-scribe/src/main/resources/scribe.thrift b/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift
similarity index 100%
rename from samples/logging-scribe/src/main/resources/scribe.thrift
rename to samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift
diff --git a/samples/logging-scribe/src/test/java/sample/LoggingTest.java b/samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java
similarity index 100%
rename from samples/logging-scribe/src/test/java/sample/LoggingTest.java
rename to samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java
diff --git a/samples/applications/logging-scribe/pom.xml b/samples/applications/logging-scribe/pom.xml
new file mode 100644
index 0000000..ea5854e
--- /dev/null
+++ b/samples/applications/logging-scribe/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-logging-scribe</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample Logging Scribe</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <!--module>helloworld-scribe</module-->
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/applications/pom.xml b/samples/applications/pom.xml
new file mode 100644
index 0000000..cdd34b6
--- /dev/null
+++ b/samples/applications/pom.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-applications</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany Sample Applications</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>logging-scribe</module>
+ <module>store</module>
+ <module>store-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/store-webapp/README b/samples/applications/store-webapp/README
similarity index 100%
rename from samples/store-webapp/README
rename to samples/applications/store-webapp/README
diff --git a/samples/applications/store-webapp/pom.xml b/samples/applications/store-webapp/pom.xml
new file mode 100644
index 0000000..047271b
--- /dev/null
+++ b/samples/applications/store-webapp/pom.xml
@@ -0,0 +1,84 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-store-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample Getting Started Online Store as WebApp</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-web20</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <!-- Key used for configuring access to server in settings.xml-->
+
+ <server>tomcat</server>
+ <!-- context for the webapp, as finalName is not being honored -->
+ <path>/${artifactId}</path>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/store-webapp/src/main/java/services/Cart.java b/samples/applications/store-webapp/src/main/java/services/Cart.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/Cart.java
rename to samples/applications/store-webapp/src/main/java/services/Cart.java
diff --git a/samples/store-webapp/src/main/java/services/Catalog.java b/samples/applications/store-webapp/src/main/java/services/Catalog.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/Catalog.java
rename to samples/applications/store-webapp/src/main/java/services/Catalog.java
diff --git a/samples/store-webapp/src/main/java/services/CurrencyConverter.java b/samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/CurrencyConverter.java
rename to samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java
diff --git a/samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java b/samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/CurrencyConverterImpl.java
rename to samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java
diff --git a/samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java b/samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/FruitsCatalogImpl.java
rename to samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java
diff --git a/samples/store-webapp/src/main/java/services/Item.java b/samples/applications/store-webapp/src/main/java/services/Item.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/Item.java
rename to samples/applications/store-webapp/src/main/java/services/Item.java
diff --git a/samples/store-webapp/src/main/java/services/ShoppingCartImpl.java b/samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/ShoppingCartImpl.java
rename to samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java
diff --git a/samples/store-webapp/src/main/java/services/Total.java b/samples/applications/store-webapp/src/main/java/services/Total.java
similarity index 100%
rename from samples/store-webapp/src/main/java/services/Total.java
rename to samples/applications/store-webapp/src/main/java/services/Total.java
diff --git a/samples/store-webapp/src/main/resources/store.composite b/samples/applications/store-webapp/src/main/resources/store.composite
similarity index 100%
rename from samples/store-webapp/src/main/resources/store.composite
rename to samples/applications/store-webapp/src/main/resources/store.composite
diff --git a/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml b/samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
rename to samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
diff --git a/samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
similarity index 100%
rename from samples/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
rename to samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml
diff --git a/samples/store-webapp/src/main/webapp/WEB-INF/web.xml b/samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/store-webapp/src/main/webapp/WEB-INF/web.xml
rename to samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/store-webapp/src/main/webapp/store.html b/samples/applications/store-webapp/src/main/webapp/store.html
similarity index 100%
rename from samples/store-webapp/src/main/webapp/store.html
rename to samples/applications/store-webapp/src/main/webapp/store.html
diff --git a/samples/store-webapp/store.png b/samples/applications/store-webapp/store.png
similarity index 100%
rename from samples/store-webapp/store.png
rename to samples/applications/store-webapp/store.png
Binary files differ
diff --git a/samples/store-webapp/store.svg b/samples/applications/store-webapp/store.svg
similarity index 100%
rename from samples/store-webapp/store.svg
rename to samples/applications/store-webapp/store.svg
diff --git a/samples/store/README b/samples/applications/store/README
similarity index 100%
rename from samples/store/README
rename to samples/applications/store/README
diff --git a/samples/applications/store/build.xml b/samples/applications/store/build.xml
new file mode 100644
index 0000000..e28e7c8
--- /dev/null
+++ b/samples/applications/store/build.xml
@@ -0,0 +1,82 @@
+<!--
+ * 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 name="store" default="compile">
+ <property name="tuscany.home" value="../../.."/>
+ <property name="test.class" value="launch.Launch" />
+ <property name="test.jar" value="sample-store.jar" />
+
+ <import file="${tuscany.home}/features/tuscany-base-runtime-pom/build-path.xml"/>
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-base-*.jar"/>
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${test.jar}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${test.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="run-classes">
+ <java classname="${test.class}"
+ fork="true">
+ <classpath>
+ <pathelement path="target/classes"/>
+ <fileset dir="${tuscany.home}/features">
+ <include name="tuscany-sca-manifest.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="run">
+ <java classname="${test.class}"
+ fork="true">
+ <classpath>
+ <pathelement path="target/${test.jar}"/>
+ <fileset dir="${tuscany.home}/features">
+ <include name="tuscany-sca-manifest.jar"/>
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+</project>
diff --git a/samples/applications/store/pom.xml b/samples/applications/store/pom.xml
new file mode 100644
index 0000000..24628a6
--- /dev/null
+++ b/samples/applications/store/pom.xml
@@ -0,0 +1,70 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-store</artifactId>
+ <name>Apache Tuscany SCA Sample Getting Started Online Store</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-web20</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/samples/store/src/main/java/launch/Launch.java b/samples/applications/store/src/main/java/launch/Launch.java
similarity index 100%
rename from samples/store/src/main/java/launch/Launch.java
rename to samples/applications/store/src/main/java/launch/Launch.java
diff --git a/samples/store/src/main/java/services/Cart.java b/samples/applications/store/src/main/java/services/Cart.java
similarity index 100%
rename from samples/store/src/main/java/services/Cart.java
rename to samples/applications/store/src/main/java/services/Cart.java
diff --git a/samples/store/src/main/java/services/Catalog.java b/samples/applications/store/src/main/java/services/Catalog.java
similarity index 100%
rename from samples/store/src/main/java/services/Catalog.java
rename to samples/applications/store/src/main/java/services/Catalog.java
diff --git a/samples/store/src/main/java/services/CurrencyConverter.java b/samples/applications/store/src/main/java/services/CurrencyConverter.java
similarity index 100%
rename from samples/store/src/main/java/services/CurrencyConverter.java
rename to samples/applications/store/src/main/java/services/CurrencyConverter.java
diff --git a/samples/store/src/main/java/services/CurrencyConverterImpl.java b/samples/applications/store/src/main/java/services/CurrencyConverterImpl.java
similarity index 100%
rename from samples/store/src/main/java/services/CurrencyConverterImpl.java
rename to samples/applications/store/src/main/java/services/CurrencyConverterImpl.java
diff --git a/samples/store/src/main/java/services/FruitsCatalogImpl.java b/samples/applications/store/src/main/java/services/FruitsCatalogImpl.java
similarity index 100%
rename from samples/store/src/main/java/services/FruitsCatalogImpl.java
rename to samples/applications/store/src/main/java/services/FruitsCatalogImpl.java
diff --git a/samples/store/src/main/java/services/Item.java b/samples/applications/store/src/main/java/services/Item.java
similarity index 100%
rename from samples/store/src/main/java/services/Item.java
rename to samples/applications/store/src/main/java/services/Item.java
diff --git a/samples/store/src/main/java/services/ShoppingCartImpl.java b/samples/applications/store/src/main/java/services/ShoppingCartImpl.java
similarity index 100%
rename from samples/store/src/main/java/services/ShoppingCartImpl.java
rename to samples/applications/store/src/main/java/services/ShoppingCartImpl.java
diff --git a/samples/store/src/main/java/services/Total.java b/samples/applications/store/src/main/java/services/Total.java
similarity index 100%
rename from samples/store/src/main/java/services/Total.java
rename to samples/applications/store/src/main/java/services/Total.java
diff --git a/samples/store/src/main/resources/store.composite b/samples/applications/store/src/main/resources/store.composite
similarity index 100%
rename from samples/store/src/main/resources/store.composite
rename to samples/applications/store/src/main/resources/store.composite
diff --git a/samples/applications/store/src/main/resources/uiservices/store.html b/samples/applications/store/src/main/resources/uiservices/store.html
new file mode 100644
index 0000000..be3efea
--- /dev/null
+++ b/samples/applications/store/src/main/resources/uiservices/store.html
@@ -0,0 +1,162 @@
+<!--
+ * 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.
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="../dojo/dojo.js"></script>
+<script type="text/javascript" src="store.js"></script>
+
+<script language="JavaScript">
+
+ //@Reference
+ var catalog = new tuscany.sca.Reference("catalog");
+
+ //@Reference
+ var shoppingCart = new tuscany.sca.Reference("shoppingCart");
+
+ //@Reference
+ var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
+
+ var catalogItems;
+
+ function catalog_getResponse(items,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
+ var catalog = "";
+
+ for (var i=0; i<items.length; i++) {
+ var item = items[i].name + ' - ' + items[i].price;
+ catalog += '<input name="items" type="checkbox" value="' +
+ item + '">' + item + ' <br>';
+ }
+ document.getElementById('catalog').innerHTML=catalog;
+ catalogItems = items;
+ }
+
+ function shoppingCart_getResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var list = "";
+ for (var i=0; i<entries.length; i++) {
+ var content = entries[i].getElementsByTagName("content")[0];
+ var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
+ var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
+ list += name + ' - ' + price + ' <br>';
+ }
+ document.getElementById("shoppingCart").innerHTML = list;
+
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal().addCallback(shoppingTotal_getTotalResponse);
+ }
+ catch(e){
+ alert(e);
+ }
+ }
+ }
+ }
+
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception) {
+ alert(exception.message);
+ return;
+ }
+ document.getElementById('total').innerHTML = total;
+ }
+
+ function shoppingCart_postResponse(entry) {
+ shoppingCart.get("").addCallback(shoppingCart_getResponse);
+ }
+
+ function addToCart() {
+ var items = document.catalogForm.items;
+ var j = 0;
+ for (var i=0; i<items.length; i++) {
+ if (items[i].checked) {
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
+ '<Item xmlns="http://services/">' +
+ '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
+ '</Item>' + '</content></entry>';
+ shoppingCart.post(entry).addCallback(shoppingCart_postResponse);
+ items[i].checked = false;
+ }
+ }
+ }
+ function checkoutCart() {
+ document.getElementById('store').innerHTML='<h2>' +
+ 'Thanks for Shopping With Us!</h2>'+
+ '<h2>Your Order</h2>'+
+ '<form name="orderForm">'+
+ document.getElementById('shoppingCart').innerHTML+
+ '<br>'+
+ document.getElementById('total').innerHTML+
+ '<br>'+
+ '<br>'+
+ '<input type="submit" value="Continue Shopping">'+
+ '</form>';
+ shoppingCart.del("");
+ }
+ function deleteCart() {
+ shoppingCart.del("");
+ document.getElementById('shoppingCart').innerHTML = "";
+ document.getElementById('total').innerHTML = "";
+ }
+
+ function init() {
+ try {
+ catalog.get().addCallback(catalog_getResponse);
+ shoppingCart.get("").addCallback(shoppingCart_getResponse);
+ }
+ catch(e){
+ alert(e);
+ }
+ }
+
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Store</h1>
+ <div id="store">
+ <h2>Catalog</h2>
+ <form name="catalogForm">
+ <div id="catalog" ></div>
+ <br>
+ <input type="button" onClick="addToCart()" value="Add to Cart">
+ </form>
+
+ <br>
+
+ <h2>Your Shopping Cart</h2>
+ <form name="shoppingCartForm">
+ <div id="shoppingCart"></div>
+ <br>
+ <div id="total"></div>
+ <br>
+ <input type="button" onClick="checkoutCart()" value="Checkout">
+ <input type="button" onClick="deleteCart()" value="Empty">
+ <a href="../ShoppingCart/Cart/">(feed)</a>
+ </form>
+ </div>
+</body>
+</html>
diff --git a/samples/store/src/test/java/client/Shopper.java b/samples/applications/store/src/test/java/client/Shopper.java
similarity index 100%
rename from samples/store/src/test/java/client/Shopper.java
rename to samples/applications/store/src/test/java/client/Shopper.java
diff --git a/samples/store/src/test/java/client/ShopperImpl.java b/samples/applications/store/src/test/java/client/ShopperImpl.java
similarity index 100%
rename from samples/store/src/test/java/client/ShopperImpl.java
rename to samples/applications/store/src/test/java/client/ShopperImpl.java
diff --git a/samples/store/src/test/java/store/StoreTestCase.java b/samples/applications/store/src/test/java/store/StoreTestCase.java
similarity index 100%
rename from samples/store/src/test/java/store/StoreTestCase.java
rename to samples/applications/store/src/test/java/store/StoreTestCase.java
diff --git a/samples/store/src/test/resources/store-client.composite b/samples/applications/store/src/test/resources/store-client.composite
similarity index 100%
rename from samples/store/src/test/resources/store-client.composite
rename to samples/applications/store/src/test/resources/store-client.composite
diff --git a/samples/store/store.png b/samples/applications/store/store.png
similarity index 100%
rename from samples/store/store.png
rename to samples/applications/store/store.png
Binary files differ
diff --git a/samples/store/store.svg b/samples/applications/store/store.svg
similarity index 100%
rename from samples/store/store.svg
rename to samples/applications/store/store.svg
diff --git a/samples/binding-rmi/contribution-calculator-reference/build.xml b/samples/binding-rmi/contribution-calculator-reference/build.xml
deleted file mode 100644
index fe28a46..0000000
--- a/samples/binding-rmi/contribution-calculator-reference/build.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<!--
- * 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 name="contribution-binding-rmi-calculator-reference" default="compile">
-
- <property name="tuscany.home" value="../../.."/>
- <property name="jar.name" value="contribution-calculator-reference.jar" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-sca-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
-</project>
-
-
diff --git a/samples/binding-rmi/contribution-calculator-reference/pom.xml b/samples/binding-rmi/contribution-calculator-reference/pom.xml
deleted file mode 100644
index b54988a..0000000
--- a/samples/binding-rmi/contribution-calculator-reference/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-contribution-binding-rmi-calculator-reference</artifactId>
- <name>Apache Tuscany SCA Sample Contribution binding-rmi Calculator Reference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/binding-rmi/contribution-calculator-service/build.xml b/samples/binding-rmi/contribution-calculator-service/build.xml
deleted file mode 100644
index 888a1c8..0000000
--- a/samples/binding-rmi/contribution-calculator-service/build.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<!--
- * 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 name="contribution-binding-rmi-calculator-service" default="compile">
-
- <property name="tuscany.home" value="../../.."/>
- <property name="jar.name" value="contribution-calculator-service.jar" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-sca-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
-</project>
-
-
diff --git a/samples/binding-rmi/contribution-calculator-service/pom.xml b/samples/binding-rmi/contribution-calculator-service/pom.xml
deleted file mode 100644
index 21a2bbd..0000000
--- a/samples/binding-rmi/contribution-calculator-service/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-contribution-binding-rmi-calculator-service</artifactId>
- <name>Apache Tuscany SCA Sample Contribution binding-rmi Calculator Service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/AddService.java b/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/AddService.java
deleted file mode 100644
index a235e64..0000000
--- a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the add service
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorServiceImpl.java b/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index bcfd887..0000000
--- a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-}
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/DivideService.java b/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 497dafd..0000000
--- a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the divide service
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/MultiplyService.java b/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605..0000000
--- a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/SubtractService.java b/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index 376b3e5..0000000
--- a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the subtract service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/samples/binding-rmi/pom.xml b/samples/binding-rmi/pom.xml
deleted file mode 100644
index c517900..0000000
--- a/samples/binding-rmi/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-sample-binding-rmi</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Sample binding.rmi</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>contribution-calculator-reference</module>
- <module>contribution-calculator-service</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/samples/binding-sca/contribution-calculator/build.xml b/samples/binding-sca/contribution-calculator/build.xml
deleted file mode 100644
index c109d89..0000000
--- a/samples/binding-sca/contribution-calculator/build.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<!--
- * 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 name="calculator" default="compile">
- <property name="tuscany.home" value="../../.."/>
- <property name="jar.name" value="sample-contribution-binding-sca-calculator.jar" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-sca-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-</project>
-
-
diff --git a/samples/binding-sca/contribution-calculator/pom.xml b/samples/binding-sca/contribution-calculator/pom.xml
deleted file mode 100644
index a11d632..0000000
--- a/samples/binding-sca/contribution-calculator/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-contribution-binding-sca-calculator</artifactId>
- <name>Apache Tuscany SCA Sample Contribution binding-sca Calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/MultiplyService.java b/samples/binding-sca/contribution-calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605..0000000
--- a/samples/binding-sca/contribution-calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/samples/binding-sca/pom.xml b/samples/binding-sca/pom.xml
deleted file mode 100644
index a3ccc88..0000000
--- a/samples/binding-sca/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-sample-binding-sca</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Sample binding.sca</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <modules>
- <module>contribution-calculator</module>
- </modules>
- </profile>
- </profiles>
-</project>
diff --git a/samples/calculator-osgi/build.xml b/samples/calculator-osgi/build.xml
deleted file mode 100644
index 4652221..0000000
--- a/samples/calculator-osgi/build.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<!--
- * 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 name="calculator-osgi" default="run">
- <property name="sample.name" value="${ant.project.name}"/>
- <property name="sample.jar" value="./target/sample-${sample.name}.jar" />
-
- <target name="init">
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5">
- <classpath>
- <fileset dir="../../features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="${sample.jar}" basedir="target/classes">
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <java jar="../../features/tuscany-sca-manifest.jar" fork="true">
- <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
- <!-- optional to set the deployable composite -->
- <arg value="-composite"/>
- <arg value="Calculator.composite"/>
- <!-- stop the node after the application runs -->
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="run-equinox" depends="compile">
- <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true">
- <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
- <arg value="-composite"/>
- <arg value="Calculator.composite"/>
- <arg value="-config"/>
- <arg value="../../features/configuration"/>
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="${sample.jar}"/>
- </java>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-</project>
-
diff --git a/samples/calculator-osgi/pom.xml b/samples/calculator-osgi/pom.xml
deleted file mode 100644
index 5143c74..0000000
--- a/samples/calculator-osgi/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-osgi</artifactId>
- <name>Apache Tuscany SCA Sample Calculator OSGi</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>osgi.configuration.area</name>
- <value>${project.build.directory}/equinox</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/calculator-scaclient/pom.xml b/samples/calculator-scaclient/pom.xml
deleted file mode 100644
index ecce081..0000000
--- a/samples/calculator-scaclient/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-calculator-scaclient</artifactId>
- <name>Apache Tuscany SCA Sample Calcualtor SCAClient</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>sample.CalculatorSCAClient</mainClass>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/contribution-binding-ws-calculator/README b/samples/contribution-binding-ws-calculator/README
deleted file mode 100644
index 14636d0..0000000
--- a/samples/contribution-binding-ws-calculator/README
+++ /dev/null
@@ -1,25 +0,0 @@
-Calculator Contribution Sample
-==============================
-
-This directory contains code which implements a simple calculator SCA contribution.
-
-The contribution can be run as a tuscany application using one of the tuscany launchers
-as described in the README in the root directory of the samples.
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The launcher exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-You should see the following output (depending on the launcher you use, this output
-may be surrounded by other output).
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
-
-
diff --git a/samples/contribution-binding-ws-calculator/build.xml b/samples/contribution-binding-ws-calculator/build.xml
deleted file mode 100644
index b0401d7..0000000
--- a/samples/contribution-binding-ws-calculator/build.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
- * 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 name="binding-ws-calculator" default="compile">
- <property name="tuscany.home" value="../.."/>
- <property name="jar.name" value="contribution-binding-ws-calculator.jar" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-sca-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
-</project>
diff --git a/samples/contribution-binding-ws-calculator/pom.xml b/samples/contribution-binding-ws-calculator/pom.xml
deleted file mode 100644
index 9f822a3..0000000
--- a/samples/contribution-binding-ws-calculator/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-contribution-binding-ws-calculator</artifactId>
- <name>Apache Tuscany SCA Sample Contribution binding-ws Calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
- </plugins>
- </build>
-</project>
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddService.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddService.java
deleted file mode 100644
index dd7ecb8..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Add service interface
- */
-@Remotable
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb0..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
- return n1 + n2;
- }
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorService.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index 031fa8b..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-
-/**
- * The Calculator service interface.
- */
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7d..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideService.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d2482..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
- return n1 / n2;
- }
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyService.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803b..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
- return n1 * n2;
- }
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractService.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d188..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java b/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
- return n1 - n2;
- }
-
-}
diff --git a/samples/contribution-binding-ws-calculator/src/main/resources/Calculator.composite b/samples/contribution-binding-ws-calculator/src/main/resources/Calculator.composite
deleted file mode 100644
index ac4d732..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" >
- <binding.ws uri="http://localhost:8085/AddServiceComponent"/>
- </reference>
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- <service name="AddService">
- <binding.ws uri="http://localhost:8085/AddServiceComponent"/>
- </service>
- </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>
-
-</composite>
diff --git a/samples/contribution-binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/contribution-binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 8d6012e..0000000
--- a/samples/contribution-binding-ws-calculator/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
-</contribution>
\ No newline at end of file
diff --git a/samples/contribution-binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java b/samples/contribution-binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 9d3024f..0000000
--- a/samples/contribution-binding-ws-calculator/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 calculator;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-/**
- * A unit test of the basic Java implementation classes in this contribution
- * without using SCA
- */
-public class CalculatorTestCase {
-
- @Test
- public void testCalculator() throws Exception {
- AddService add = new AddServiceImpl();
- SubtractService subtract = new SubtractServiceImpl();
- MultiplyService multiply = new MultiplyServiceImpl();
- DivideService divide = new DivideServiceImpl();
-
- CalculatorServiceImpl calculator = new CalculatorServiceImpl();
-
- calculator.setAddService(add);
- calculator.setSubtractService(subtract);
- calculator.setMultiplyService(multiply);
- calculator.setDivideService(divide);
-
- assertEquals(calculator.add(3, 2), 5.0, 0);
- assertEquals(calculator.subtract(3, 2), 1.0, 0);
- assertEquals(calculator.multiply(3, 2), 6.0, 0);
- assertEquals(calculator.divide(3, 2), 1.5, 0);
- }
-}
diff --git a/samples/contribution-implementation-java-calculator/README b/samples/contribution-implementation-java-calculator/README
deleted file mode 100644
index acf18ec..0000000
--- a/samples/contribution-implementation-java-calculator/README
+++ /dev/null
@@ -1,25 +0,0 @@
-Calculator Sample Contribution
-==============================
-
-This sample implements a simple calculator using SCA components.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. ( where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive) Take a look there for instructions on how to launch
-this sample contribution.
-
-Sample Overview
----------------
-The sample provides a single calculator service with a default SCA (java)
-binding. The CalculatorClient exercises this interface by calling add,
-subtract, multiply and divide operations. This results in messages passing to
-the appropriate components in the composite across the local wires.
-
-You should see the following output from the run target.
-
-run:
- [java] 3 + 2=5.0
- [java] 3 - 2=1.0
- [java] 3 * 2=6.0
- [java] 3 / 2=1.5
diff --git a/samples/contribution-implementation-java-calculator/build.xml b/samples/contribution-implementation-java-calculator/build.xml
deleted file mode 100644
index c4b53cc..0000000
--- a/samples/contribution-implementation-java-calculator/build.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<!--
- * 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 name="implementation-java-calculator" default="compile">
-
- <property name="tuscany.home" value="../.."/>
- <property name="jar.name" value="contribution-implementation-java-calculator.jar" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-sca-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-</project>
diff --git a/samples/contribution-implementation-java-calculator/pom.xml b/samples/contribution-implementation-java-calculator/pom.xml
deleted file mode 100644
index 4b12772..0000000
--- a/samples/contribution-implementation-java-calculator/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-contribution-implementation-java-calculator</artifactId>
- <name>Apache Tuscany SCA Sample Contribution Implementation Java Calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddService.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddService.java
deleted file mode 100644
index 188451e..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java
deleted file mode 100644
index 7ca8fb0..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/AddServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
- return n1 + n2;
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorClient.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorClient.java
deleted file mode 100644
index 84c98d7..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorClient.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-@Scope("COMPOSITE") @EagerInit
-public class CalculatorClient {
-
- private CalculatorService calculatorService;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- this.calculatorService = calculatorService;
- }
-
- @Init
- public void calculate() {
-
- // Calculate
- System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
- }
-
- private static String print(ClassLoader cl) {
- StringBuffer buf = new StringBuffer();
- for (; cl != null;) {
- buf.append(cl.toString());
- buf.append(' ');
- cl = cl.getParent();
- }
- return buf.toString();
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorService.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorService.java
deleted file mode 100644
index ce1cdaa..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorService.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java
deleted file mode 100644
index 17fad7d..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/CalculatorServiceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideService.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideService.java
deleted file mode 100644
index 30d2482..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java
deleted file mode 100644
index 1323edf..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/DivideServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
- return n1 / n2;
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyService.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyService.java
deleted file mode 100644
index 5290605..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java
deleted file mode 100644
index 91b803b..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/MultiplyServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
- return n1 * n2;
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractService.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractService.java
deleted file mode 100644
index bf0d188..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java b/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java
deleted file mode 100644
index 58cc4a3..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/java/calculator/SubtractServiceImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
- return n1 - n2;
- }
-
-}
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/Calculator.composite b/samples/contribution-implementation-java-calculator/src/main/resources/Calculator.composite
deleted file mode 100644
index 05bea57..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/resources/Calculator.composite
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <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>
-
-</composite>
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/CalculatorClient.composite b/samples/contribution-implementation-java-calculator/src/main/resources/CalculatorClient.composite
deleted file mode 100644
index dfd3276..0000000
--- a/samples/contribution-implementation-java-calculator/src/main/resources/CalculatorClient.composite
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="CalculatorClient">
-
- <component name="CalculatorClient">
- <implementation.java class="calculator.CalculatorClient"/>
- <reference name="calculatorService" target="CalculatorServiceComponent" />
- </component>
-
-</composite>
diff --git a/samples/contribution-implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java b/samples/contribution-implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index 2e4a700..0000000
--- a/samples/contribution-implementation-java-calculator/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 calculator;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator composition.
- */
-public class CalculatorTestCase {
-
- @Test
- public void testCalculator() throws Exception {
- AddService add = new AddServiceImpl();
- SubtractService subtract = new SubtractServiceImpl();
- MultiplyService multiply = new MultiplyServiceImpl();
- DivideService divide = new DivideServiceImpl();
-
- CalculatorServiceImpl calculator = new CalculatorServiceImpl();
-
- calculator.setAddService(add);
- calculator.setSubtractService(subtract);
- calculator.setMultiplyService(multiply);
- calculator.setDivideService(divide);
-
- assertEquals(calculator.add(3, 2), 5.0, 0);
- assertEquals(calculator.subtract(3, 2), 1.0, 0);
- assertEquals(calculator.multiply(3, 2), 6.0, 0);
- assertEquals(calculator.divide(3, 2), 1.5, 0);
- }
-}
diff --git a/samples/dosgi-calculator-operations/pom.xml b/samples/dosgi-calculator-operations/pom.xml
deleted file mode 100644
index fb938d3..0000000
--- a/samples/dosgi-calculator-operations/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator-operations</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Caculator Operations Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>osgi.configuration.area</name>
- <value>${project.build.directory}/equinox</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
deleted file mode 100644
index 49c5aab..0000000
--- a/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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 calculator.dosgi.operations.test;
-
-import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus;
-
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-import calculator.dosgi.operations.AddService;
-
-/**
- *
- */
-public class OperationsOSGiNodeTestCase {
- private static EquinoxHost host;
- private static BundleContext context;
- private static Bundle operationsBundle;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- try {
- host = new EquinoxHost();
- context = host.start();
-
- for (Bundle b : context.getBundles()) {
- if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
- .startsWith("org.apache.tuscany.sca.")) {
- try {
- if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- // Start the non-fragment bundle
- b.start();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println(bundleStatus(b, false));
- }
- if ("calculator.dosgi.operations".equals(b.getSymbolicName())) {
- operationsBundle = b;
- }
- }
-
- if (operationsBundle != null) {
- operationsBundle.start();
- System.out.println(bundleStatus(operationsBundle, false));
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @Test
- public void testOSGi() throws Exception {
- Registry registry = LocateRegistry.getRegistry(8085);
- Object add = registry.lookup("AddService");
- AddService addService = OSGiTestUtils.cast(add, AddService.class);
- double sum = addService.add(1.0, 2.0);
- Assert.assertEquals(3.0, sum, 0.0);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (host != null) {
- host.stop();
- context = null;
- }
- }
-
-}
diff --git a/samples/dosgi-calculator/pom.xml b/samples/dosgi-calculator/pom.xml
deleted file mode 100644
index 9c66ab5..0000000
--- a/samples/dosgi-calculator/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Calculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>osgi.configuration.area</name>
- <value>${project.build.directory}/equinox</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/dosgi-dynamic-calculator-operations/README b/samples/dosgi-dynamic-calculator-operations/README
deleted file mode 100644
index 77a4cba..0000000
--- a/samples/dosgi-dynamic-calculator-operations/README
+++ /dev/null
@@ -1,196 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Starting calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-4486-
-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-41f0
--b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47b3-
-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
-t
-INFO: Registering calculator.dosgi.operations.DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98 domai
-n: tuscany.apache.org
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
-rvice
-INFO: RMI service registered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-444e-
-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator getB
-undle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic.operations
-
-osgi>
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-44
-4e-b22a-06d347ab7e98#service-binding(DivideService/Divide)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/DivideService
-Nov 4, 2009 5:18:43 PM calculator.dosgi.operations.impl.OperationsActivator stop
-
-INFO: Stopping calculator.dosgi.dynamic.operations_1.0.0 [198]
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-44
-86-87eb-07ece11888f6#service-binding(AddService/Add)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/AddService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-4
-1f0-b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47
-b3-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
-Service
-INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
-Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
-
-osgi>
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator-operations/
- src/
- main/
- java/
- calculator/
- dosgi/
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- impl/
- OperationsActivator.java - OSGi bundle activator
- AddServiceImpl.java - Implementation for Add
- SubtractServiceImpl.java - Implementation for Subtract
- MultiplyServiceImpl.java - Implementation for Multiply
- DivideServiceImpl.java - Implementation for Divide
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- operations-config.xml - The SCA configuration file for OSGi remote services
- test/
- java/
- src/
- calculator/
- dosgi/
- operations/
- test/
- OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-dynamic-calculator-operations
-mvn
-
diff --git a/samples/dosgi-dynamic-calculator-operations/pom.xml b/samples/dosgi-dynamic-calculator-operations/pom.xml
deleted file mode 100644
index 9a5aa6e..0000000
--- a/samples/dosgi-dynamic-calculator-operations/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-dynamic-calculator-operations</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Dynamic Caculator Operations Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>osgi.configuration.area</name>
- <value>${project.build.directory}/equinox</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
deleted file mode 100644
index ded8279..0000000
--- a/samples/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?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.
--->
-<!-- A consumer-side service description file for RFC 119 -->
-<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- Describe a remote OSGi service -->
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.AddService" />
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="sca.reference" value="addService"/>
- <property name="org.osgi.sca.bindings">
- <list>
- <value>{http://sample}Add</value>
- </list>
- </property>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.SubtractService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="subtractService"/>
- <property name="org.osgi.sca.bindings">
- <list>
- <value>{http://sample}Subtract</value>
- </list>
- </property>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.MultiplyService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="multiplyService"/>
- <property name="org.osgi.sca.bindings" value="{http://sample}Multiply"/>
- </endpoint-description>
- <endpoint-description>
- <property name="objectClass" value="calculator.dosgi.operations.DivideService" />
- <property name="service.imported.configs" value="org.osgi.sca"/>
- <property name="remote.configs.supported" value="org.osgi.sca"/>
- <property name="sca.reference" value="divideService"/>
- <property name="org.osgi.sca.bindings" value="{http://sample}Divide"/>
- </endpoint-description>
-</endpoint-descriptions>
\ No newline at end of file
diff --git a/samples/dosgi-dynamic-calculator/README b/samples/dosgi-dynamic-calculator/README
deleted file mode 100644
index e8d3112..0000000
--- a/samples/dosgi-dynamic-calculator/README
+++ /dev/null
@@ -1,145 +0,0 @@
-Distributed OSGi Calculator Sample
-==================================
-This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
-
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-On Windows, run
-java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
-
-On *Unix, run
-java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
-
-You should see the osgi console:
-
-osgi>
-
-osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
-INFO: Equinox-based service discoverer is now configured.
-
-You can run "ss" command under the osgi> to see the status of the bundles.
-osgi> ss
-
-Then you can install and start the calculator.dosgi bundle:
-
-osgi> install file:./target/sample-dosgi-dynamic-calculator.jar
-Bundle id is 198
-
-osgi> start 198
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Starting calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
-INFO: Registering calculator.dosgi.CalculatorService
-Nov 4, 2009 5:20:21 PM org.apache.tuscany.sca.node.impl.NodeImpl start
-INFO: Starting node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869 domai
-n: tuscany.apache.org
-log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
-Utils).
-log4j:WARN Please initialize the log4j system properly.
-Nov 4, 2009 5:20:24 PM org.mortbay.log.Slf4jLog info
-INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
-bay.log.Slf4jLog
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: jetty-6.1.x
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
-INFO: Started SelectChannelConnector@0.0.0.0:8086
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
-apping
-INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
-Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl addEndpoint
-INFO: Add endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-42b3
--9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:20:25 PM calculator.dosgi.impl.CalculatorActivator getBundle
-INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
-gi.dynamic
-
-You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
-the WSDL.
-
-You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
-
-To stop the bundle:
-
-osgi> stop 198
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
-yImpl endpointRemoved
-INFO: Remove endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-4
-2b3-9287-71fe6537c869#service-binding(CalculatorService/Calculator)
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
-etMapping
-INFO: Removed Servlet mapping: /CalculatorService
-Nov 4, 2009 5:21:16 PM calculator.dosgi.impl.CalculatorActivator stop
-INFO: Stopping calculator.dosgi.dynamic_1.0.0 [198]
-Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
-INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
-
-To exit the console, run:
-osgi> exit
-
-Sample Overview
----------------
-The application consists of two OSGi bundles:
- * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
- consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
- * The operations bundle: It provides the add/subtract/multiply/divide services.
- (See ../samples/dosgi-dynamic-calculator-operations)
-
-
-dosgi-dynamic-calculator/
- src/
- main/
- java/
- calculator/
- dosgi/
- CalculatorService.java - The interface for Calculator service
- impl/
- CalculatorActivator.java - OSGi bundle activator for Calculator bundle
- CalculatorServiceDSImpl.java - OSGi declarative service based implementation
- CalculatorServiceImpl.java - Basic OSGi implementation
- operations/
- AddService.java - Interface for Add
- SubtractService.java - Interface for Subtract
- MultiplyService.java - Interface for Multiply
- DivideService.java - Interface for Divide
- rmi/
- OperationsRemote.java - RMI remote interface for operations
- OperationsRMIServer_Stub.java - RMI stub
- OperationsRMIServer.java - RMI server implementation of the operations
- resources/
- META-INF/
- sca-contribution.xml
- OSGI-INF/
- sca-config/
- calculator-config.xml - The SCA configuration file for OSGi remote services
- remote-service/
- calculator-service-descriptions.xml - The OSGi remote service endpoint descriptions
- test/
- java/
- src/
- calculator/
- dosgi/
- test/
- CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
-
- META-INF/
- MANIFEST.MF - The OSGi manifest for this bundle
- dosig-calculator.png - a pictorial representation of the sample
- pom.xml - the Maven build file
-
-
-
-Building And Running The Test Case Using Maven
--------------------------------------------
-With either the binary or source distributions the sample can be built and run
-using Maven as follows.
-
-cd dosgi-calculator
-mvn
-
diff --git a/samples/dosgi-dynamic-calculator/pom.xml b/samples/dosgi-dynamic-calculator/pom.xml
deleted file mode 100644
index 1a6a29d..0000000
--- a/samples/dosgi-dynamic-calculator/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-dynamic-calculator</artifactId>
- <name>Apache Tuscany SCA OSGi Remote Services Dynamic Caculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <version>2.0-Beta1</version>
- <type>pom</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-Beta1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemProperties>
- <property>
- <name>osgi.configuration.area</name>
- <value>${project.build.directory}/equinox</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF b/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..8b328a0
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany SCA Sample Binding
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany SCA Sample Binding
+Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0"
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.sample
+Bundle-DocURL: http://www.apache.org/
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/samples/extending-tuscany/binding-sample/README b/samples/extending-tuscany/binding-sample/README
new file mode 100644
index 0000000..18066b6
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/README
@@ -0,0 +1,9 @@
+Sample Binding Extension
+===============================
+This sample demonstrates how to develop a new binding type for Apache
+Tuscany SCA.
+
+The README in the samples directory (the directory two directories above
+this one) provides instructions about building and running the samples. Take
+a look there.
+
diff --git a/samples/extending-tuscany/binding-sample/pom.xml b/samples/extending-tuscany/binding-sample/pom.xml
new file mode 100644
index 0000000..6ac9cee
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/pom.xml
@@ -0,0 +1,92 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-binding-extension</artifactId>
+ <name>Apache Tuscany SCA Sample Binding Extension</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java
new file mode 100644
index 0000000..174a32f
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java
@@ -0,0 +1,49 @@
+/*
+ * 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 sample.binding;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.provider.BaseBindingImpl;
+
+/**
+ * Represents a binding to a Sample service.
+ */
+public class SampleBinding extends BaseBindingImpl {
+
+ public static final QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.sample");
+
+ private String someAttr;
+
+ public SampleBinding() {
+ }
+
+ public QName getType() {
+ return TYPE;
+ }
+
+ public String getSomeAttr() {
+ return someAttr;
+ }
+
+ public void setSomeAttr(String someAttr) {
+ this.someAttr = someAttr;
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java
new file mode 100644
index 0000000..6f49204
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java
@@ -0,0 +1,32 @@
+/*
+ * 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 sample.binding;
+
+
+/**
+ * Factory implementation to create Sample Models
+ */
+public class SampleBindingFactory {
+
+ public SampleBinding createSampleBinding() {
+ return new SampleBinding();
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java
new file mode 100644
index 0000000..4fb9661
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java
@@ -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 sample.binding.runtime;
+
+import sample.binding.SampleBinding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+public class SampleBindingProviderFactory implements BindingProviderFactory<SampleBinding> {
+
+ public SampleBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
+ }
+
+ public Class<SampleBinding> getModelType() {
+ return SampleBinding.class;
+ }
+
+ public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) {
+ return new SampleReferenceBindingProvider(endpoint);
+ }
+
+ public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
+ return new SampleServiceBindingProvider(endpoint);
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java
new file mode 100644
index 0000000..b1edf6c
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java
@@ -0,0 +1,55 @@
+/*
+ * 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 sample.binding.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+
+public class SampleReferenceBindingProvider implements ReferenceBindingProvider {
+
+ private EndpointReference endpoint;
+ private InterfaceContract contract;
+
+ public SampleReferenceBindingProvider(EndpointReference endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public Invoker createInvoker(Operation operation) {
+ return new SampleReferenceInvoker(operation, endpoint);
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public InterfaceContract getBindingInterfaceContract() {
+ return contract;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java
new file mode 100644
index 0000000..31cb339
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java
@@ -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 sample.binding.runtime;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+public class SampleReferenceInvoker implements Invoker {
+
+ protected Operation operation;
+ protected EndpointReference endpoint;
+
+ public SampleReferenceInvoker(Operation operation, EndpointReference endpoint) {
+ this.operation = operation;
+ this.endpoint = endpoint;
+ }
+
+ public Message invoke(Message msg) {
+ try {
+
+ return doInvoke(msg);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Message doInvoke(Message msg) {
+ // Add some code here to make an invocation over the Sample binding protocol
+ // For this sample we'll just get it from the static stash
+ SampleServiceInvoker fi = SampleStash.getService(endpoint.getBinding().getURI());
+ return fi.invokeService(msg);
+ }
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java
new file mode 100644
index 0000000..f8aab77
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java
@@ -0,0 +1,57 @@
+/*
+ * 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 sample.binding.runtime;
+
+import sample.binding.SampleBinding;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+public class SampleServiceBindingProvider implements ServiceBindingProvider {
+
+ private RuntimeEndpoint endpoint;
+ private InterfaceContract contract;
+
+ public SampleServiceBindingProvider(RuntimeEndpoint endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ public void start() {
+ // add some code here to start the service
+
+ // For this sample we'll just share it in a static
+ SampleStash.addService(endpoint.getBinding().getURI(), new SampleServiceInvoker(endpoint));
+
+ System.out.println("someAttr=" + ((SampleBinding)endpoint.getBinding()).getSomeAttr());
+ }
+
+ public void stop() {
+ SampleStash.removeService(endpoint.getBinding().getURI());
+ }
+
+ public InterfaceContract getBindingInterfaceContract() {
+ return contract;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java
new file mode 100644
index 0000000..bfbfe80
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java
@@ -0,0 +1,40 @@
+/*
+ * 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 sample.binding.runtime;
+
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+public class SampleServiceInvoker {
+
+ private RuntimeEndpoint wire;
+
+ public SampleServiceInvoker(RuntimeEndpoint wire) {
+ this.wire = wire;
+ }
+
+ /**
+ * Send the request down the wire to invoke the service
+ */
+ public Message invokeService(Message msg) {
+ return wire.invoke(msg);
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java
new file mode 100644
index 0000000..cbebe77
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java
@@ -0,0 +1,44 @@
+/*
+ * 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 sample.binding.runtime;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Simplistic static Map to share service endpoints with references
+ */
+public class SampleStash {
+
+ private static Map<String, SampleServiceInvoker> services = new HashMap<String, SampleServiceInvoker>();
+
+ public static void addService(String uri, SampleServiceInvoker SampleServiceInvoker) {
+ services.put(uri, SampleServiceInvoker);
+ }
+
+ public static SampleServiceInvoker getService(String uri) {
+ return services.get(uri);
+ }
+
+ public static void removeService(String uri) {
+ services.remove(uri);
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..91c49a6
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.sample,model=sample.binding.SampleBinding,factory=sample.binding.SampleBindingFactory
+
diff --git a/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
new file mode 100644
index 0000000..dda33eb
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -0,0 +1,19 @@
+# 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.
+#
+binding-sample.xsd
+
diff --git a/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
new file mode 100644
index 0000000..e6b86ac
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the binding extension
+sample.binding.runtime.SampleBindingProviderFactory;model=sample.binding.SampleBinding
+
diff --git a/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory
new file mode 100644
index 0000000..ec8c4b9
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for model factory
+sample.binding.SampleBindingFactory
+
diff --git a/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd b/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd
new file mode 100644
index 0000000..26f4f80
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd
@@ -0,0 +1,37 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" />
+
+ <element name="binding.sample" type="t:SampleBinding" substitutionGroup="sca:binding"/>
+
+ <complexType name="SampleBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <attribute name="someAttr" type="string" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java
new file mode 100644
index 0000000..bafb453
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java
@@ -0,0 +1,33 @@
+/*
+ * 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 helloworld;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldClient implements HelloWorldService {
+
+ @Reference
+ public HelloWorldService ref;
+
+ public String sayHello(String name) {
+ return ref.sayHello(name);
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java
new file mode 100644
index 0000000..98989e6
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java
@@ -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 helloworld;
+
+
+public class HelloWorldImpl implements HelloWorldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java
new file mode 100644
index 0000000..59b4bd0
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java
@@ -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 helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldService {
+
+ String sayHello(String name);
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java b/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java
new file mode 100644
index 0000000..f3274a7
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java
@@ -0,0 +1,52 @@
+/*
+ * 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 test;
+
+import helloworld.HelloWorldService;
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SampleBindingTestCase {
+
+ private static Node node;
+
+ @Test
+ public void testSayHello() {
+ HelloWorldService service = node.getService(HelloWorldService.class, "HelloWorldClient/HelloWorldService");
+ Assert.assertEquals("Hello boo", service.sayHello("boo"));
+ }
+
+ @BeforeClass
+ public static void init() throws Exception {
+ node = NodeFactory.newInstance().createNode("helloworld.composite").start();
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+}
diff --git a/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite b/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite
new file mode 100644
index 0000000..9bb69ba
--- /dev/null
+++ b/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite
@@ -0,0 +1,39 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="HelloWorldComposite">
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ <service name="HelloWorldService" >
+ <tuscany:binding.sample someAttr="bla" />
+ </service>
+ </component>
+
+ <component name="HelloWorldClient">
+ <implementation.java class="helloworld.HelloWorldClient"/>
+ <reference name="ref" >
+ <tuscany:binding.sample uri="HelloWorldComponent/HelloWorldService"/>
+ </reference>
+ </component>
+
+</composite>
diff --git a/samples/extending-tuscany/implementation-sample/README b/samples/extending-tuscany/implementation-sample/README
new file mode 100644
index 0000000..82a04eb
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/README
@@ -0,0 +1,9 @@
+Sample Implementation Extension
+===============================
+This sample demonstrates how to develop a new component implementation type
+for Apache Tuscany SCA.
+
+The README in the samples directory (the directory two directories above
+this one) provides instructions about building and running the samples. Take
+a look there.
+
diff --git a/samples/extending-tuscany/implementation-sample/pom.xml b/samples/extending-tuscany/implementation-sample/pom.xml
new file mode 100644
index 0000000..0817a94
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/pom.xml
@@ -0,0 +1,79 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-implementation-extension</artifactId>
+ <name>Apache Tuscany SCA Sample Implementation Extension</name>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-web20</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java
new file mode 100644
index 0000000..6c92400
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java
@@ -0,0 +1,34 @@
+/*
+ * 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 sample.api;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( {TYPE, FIELD})
+@Retention(RUNTIME)
+public @interface Java {
+
+ Class<?> value();
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java
new file mode 100644
index 0000000..655770e
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java
@@ -0,0 +1,34 @@
+/*
+ * 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 sample.api;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( {TYPE, FIELD})
+@Retention(RUNTIME)
+public @interface WSDL {
+
+ String value();
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java
new file mode 100644
index 0000000..cad8478
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java
@@ -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 sample.api;
+
+import org.w3c.dom.Element;
+
+public interface WSDLReference {
+
+ Element call(String op, Element e);
+
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java
new file mode 100644
index 0000000..0ccbcc9
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java
@@ -0,0 +1,311 @@
+/*
+ * 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 sample.impl;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.Arrays;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
+
+/**
+ * A few utility functions to help embed a Tuscany runtime, and a simple DSL
+ * to help assemble and run SCDL.
+ */
+public class EmbedUtil {
+
+ /**
+ * A runtime embedder context, which conveniently initializes a Node factory
+ * and gets the various registries, factories and extension points we need.
+ */
+ static class Context {
+ final NodeFactory nf;
+ final ExtensionPointRegistry epr;
+ final FactoryExtensionPoint fep;
+ final ContributionFactory cf;
+ final AssemblyFactory af;
+ final JavaInterfaceFactory jif;
+ final WSDLFactory wif;
+ final URLArtifactProcessorExtensionPoint apep;
+ final ExtensibleURLArtifactProcessor aproc;
+ final ModelResolverExtensionPoint mrep;
+ final ProviderFactoryExtensionPoint pfep;
+
+ Context(final NodeFactory nf) {
+ this.nf = nf;
+ epr = nf.getExtensionPointRegistry();
+ fep = epr.getExtensionPoint(FactoryExtensionPoint.class);
+ cf = fep.getFactory(ContributionFactory.class);
+ af = fep.getFactory(AssemblyFactory.class);
+ jif = fep.getFactory(JavaInterfaceFactory.class);
+ wif = fep.getFactory(WSDLFactory.class);
+ apep = epr.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ aproc = new ExtensibleURLArtifactProcessor(apep);
+ mrep = epr.getExtensionPoint(ModelResolverExtensionPoint.class);
+ pfep = epr.getExtensionPoint(ProviderFactoryExtensionPoint.class);
+ }
+ }
+
+ static Context embedContext(NodeFactory nf) {
+ return new Context(nf);
+ }
+
+ /**
+ * A mini DSL to help build and assemble contributions and SCDL composites.
+ */
+ interface Builder<T> {
+ T build(Context ec);
+ }
+
+ static <T> T build(final Builder<T> builder, final Context ec) {
+ return builder.build(ec);
+ }
+
+ /**
+ * Return a contribution builder.
+ */
+ static Builder<Contribution> contrib(final String uri, final String loc, final Builder<Artifact>... artifacts) {
+ return new Builder<Contribution>() {
+ public Contribution build(final Context ec) {
+ final Contribution c = ec.cf.createContribution();
+ c.setURI(uri);
+ c.setLocation(loc);
+ c.setModelResolver(new ExtensibleModelResolver(c, ec.mrep, ec.fep));
+ for(Builder<Artifact> a: artifacts)
+ c.getArtifacts().add(a.build(ec));
+ return c;
+ }
+ };
+ }
+
+ /**
+ * Return an artifact builder.
+ */
+ static Builder<Artifact> artifact(final String uri, final Object model) {
+ return new Builder<Artifact>() {
+ public Artifact build(final Context ec) {
+ final Artifact a = ec.cf.createArtifact();
+ a.setURI(uri);
+ a.setModel(model);
+ return a;
+ }
+ };
+ }
+
+ /**
+ * Return a composite builder.
+ */
+ static Builder<Composite> composite(final String ns, final String name, final Builder<Component>... components) {
+ return new Builder<Composite>() {
+ public Composite build(final Context ec) {
+ final Composite compos = ec.af.createComposite();
+ compos.setName(new QName(ns, name));
+ for(final Builder<Component> c: components)
+ compos.getComponents().add(c.build(ec));
+ return compos;
+ }
+ };
+ }
+
+ /**
+ * Return a component builder.
+ */
+ static Builder<Component> component(final String name, final Builder<Implementation> impl, final Builder<ComponentReference>... references) {
+ return new Builder<Component>() {
+ public Component build(final Context ec) {
+ final Component c = ec.af.createComponent();
+ c.setName(name);
+ c.setImplementation(impl.build(ec));
+ for(Builder<ComponentReference> r: references)
+ c.getReferences().add(r.build(ec));
+ return c;
+ }
+ };
+ }
+
+ /**
+ * Return an implementation builder.
+ */
+ static Builder<Implementation> implementation(final Class<?> clazz, final Builder<Contract>... contracts) {
+ return new Builder<Implementation>() {
+ public SampleImplementation build(final Context ec) {
+ final SampleImplementation impl = ImplUtil.implementation(clazz.getName());
+ impl.clazz = clazz;
+ impl.setUnresolved(false);
+ for(final Builder<Contract> b: contracts) {
+ Contract c = b.build(ec);
+ if(c instanceof Service)
+ impl.getServices().add((Service)c);
+ else
+ impl.getReferences().add((Reference)c);
+ }
+ return impl;
+ }
+ };
+ }
+
+ /**
+ * Return a reference builder.
+ */
+ static Builder<Contract> reference(final String name, final Class<?> c) {
+ return new Builder<Contract>() {
+ public Reference build(final Context ec) {
+ try {
+ return ImplUtil.reference(name, c, ec.jif, ec.af);
+ } catch(InvalidInterfaceException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+
+ static Builder<Contract> reference(final String name, final WSDLInterface c) {
+ return new Builder<Contract>() {
+ public Reference build(final Context ec) {
+ return ImplUtil.reference(name, c, ec.wif, ec.af);
+ }
+ };
+ }
+
+ static Builder<ComponentReference> reference(final String name, final String target) {
+ return new Builder<ComponentReference>() {
+ public ComponentReference build(final Context ec) {
+ final ComponentReference r = ec.af.createComponentReference();
+ r.setName(name);
+ final ComponentService s = ec.af.createComponentService();
+ s.setUnresolved(true);
+ s.setName(target);
+ r.getTargets().add(s);
+ return r;
+ }
+ };
+ }
+
+ /**
+ * Return a service builder.
+ */
+ static Builder<Contract> service(final Class<?> c) {
+ return new Builder<Contract>() {
+ public Service build(final Context ec) {
+ try {
+ return ImplUtil.service(c, ec.jif, ec.af);
+ } catch(InvalidInterfaceException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+
+ static Builder<Contract> service(final WSDLInterface c) {
+ return new Builder<Contract>() {
+ public Service build(final Context ec) {
+ return ImplUtil.service(c, ec.wif, ec.af);
+ }
+ };
+ }
+
+ /**
+ * Return a WSDLInterface builder which loads a WSDL into a contribution.
+ */
+ static Builder<WSDLInterface> wsdli(final String uri, final String ns, final String name, final Contribution c) {
+ return new Builder<WSDLInterface>() {
+ public WSDLInterface build(final Context ec) {
+ try {
+ final ProcessorContext ctx = new ProcessorContext();
+ final WSDLDefinition wd = ec.aproc.read(null, new URI(uri), new URL(new URL(c.getLocation()), uri), ctx, WSDLDefinition.class);
+ c.getModelResolver().addModel(wd, ctx);
+ c.getModelResolver().resolveModel(WSDLDefinition.class, wd, ctx);
+ final WSDLObject<PortType> pt = wd.getWSDLObject(PortType.class, new QName(ns, name));
+ if(pt == null)
+ throw new ContributionResolveException("Couldn't find " + name);
+ final WSDLInterface nwi = ec.wif.createWSDLInterface(pt.getElement(), wd, c.getModelResolver(), null);
+ nwi.setWsdlDefinition(wd);
+ nwi.resetDataBinding(DOMDataBinding.NAME);
+ return nwi;
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+
+ /**
+ * Return the extension point registry used by our nodes.
+ */
+ static ExtensionPointRegistry extensionPoints(final Context ec) {
+ return ec.epr;
+ }
+
+ /**
+ * Return the provider factory extension point used by our nodes.
+ */
+ static ProviderFactoryExtensionPoint providerFactories(final Context ec) {
+ return ec.pfep;
+ }
+
+ /**
+ * Add a deployable composite to a contribution.
+ */
+ static Contribution deploy(final Contribution contrib, final Composite... comps) {
+ for(Composite c: comps)
+ contrib.getDeployables().add(c);
+ return contrib;
+ }
+
+ /**
+ * Configure a node with a list of contributions.
+ */
+ static Node node(final NodeFactory nf, final Contribution... contributions) {
+ return nf.createNode(Arrays.asList(contributions));
+ }
+
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java
new file mode 100644
index 0000000..abd4cd7
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java
@@ -0,0 +1,148 @@
+/*
+ * 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 sample.impl;
+
+import java.lang.annotation.Annotation;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+
+import sample.api.Java;
+import sample.api.WSDL;
+
+/**
+ * Utility functions to help develop a component implementation extension.
+ */
+class ImplUtil {
+
+ /**
+ * Return a Sample implementation with the given name.
+ */
+ static SampleImplementation implementation(String name) {
+ final SampleImplementation impl = new SampleImplementation(name);
+ impl.setUnresolved(true);
+ return impl;
+ }
+
+ /**
+ * Return the Java class configured on an annotation.
+ */
+ static Class<?> clazz(final Annotation a) {
+ return ((Java)a).value();
+ }
+
+ /**
+ * Return the WSDL QName configured on an annotation.
+ */
+ static QName qname(final Annotation a) {
+ final String uri = ((WSDL)a).value();
+ final int h = uri.indexOf('#');
+ return new QName(uri.substring(0, h), uri.substring(h + 1));
+ }
+
+ /**
+ * Convert a Java class to an interface contract.
+ */
+ static JavaInterfaceContract contract(final Class<?> c, final JavaInterfaceFactory jif) throws InvalidInterfaceException {
+ final JavaInterfaceContract ic = jif.createJavaInterfaceContract();
+ ic.setInterface(jif.createJavaInterface(c));
+ return ic;
+ }
+
+ /**
+ * Convert a WSDL interface to an interface contract.
+ */
+ static WSDLInterfaceContract contract(final WSDLInterface wi, final WSDLFactory wf) {
+ final WSDLInterfaceContract ic = wf.createWSDLInterfaceContract();
+ ic.setInterface(wi);
+ return ic;
+ }
+
+ /**
+ * Convert a Java class to a service.
+ */
+ static Service service(final Class<?> c, final JavaInterfaceFactory jif, final AssemblyFactory af) throws InvalidInterfaceException {
+ Service s = af.createService();
+ s.setName(c.getSimpleName());
+ s.setInterfaceContract(contract(c, jif));
+ return s;
+ }
+
+ /**
+ * Convert a WSDL interface to a service.
+ */
+ static Service service(final WSDLInterface wi, final WSDLFactory wf, final AssemblyFactory af) {
+ Service s = af.createService();
+ s.setName(wi.getName().getLocalPart());
+ s.setInterfaceContract(contract(wi, wf));
+ return s;
+ }
+
+ /**
+ * Convert a name and Java class to a reference.
+ */
+ static Reference reference(final String name, final Class<?> c, final JavaInterfaceFactory jif, final AssemblyFactory af) throws InvalidInterfaceException {
+ final Reference r = af.createReference();
+ r.setName(name);
+ r.setInterfaceContract(contract(c, jif));
+ return r;
+ }
+
+ /**
+ * Convert a name and WSDL interface to a reference.
+ */
+ static Reference reference(final String name, final WSDLInterface wi, final WSDLFactory wf, final AssemblyFactory af) {
+ final Reference r = af.createReference();
+ r.setName(name);
+ r.setInterfaceContract(contract(wi, wf));
+ return r;
+ }
+
+ /**
+ * Convert a WSDL qname to a WSDL interface.
+ */
+ static WSDLInterface interfaze(final QName name, final WSDLFactory wif) {
+ final WSDLInterface wir = wif.createWSDLInterface();
+ wir.setUnresolved(true);
+ wir.setName(name);
+ return wir;
+ }
+
+ /**
+ * Convert a WSDL qname to a WSDL definition.
+ */
+ static WSDLDefinition definition(final QName name, final WSDLFactory wif) {
+ final WSDLDefinition wdr = wif.createWSDLDefinition();
+ wdr.setUnresolved(true);
+ wdr.setNamespace(name.getNamespaceURI());
+ wdr.setNameOfPortTypeToResolve(name);
+ return wdr;
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java
new file mode 100644
index 0000000..41ce71a
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java
@@ -0,0 +1,41 @@
+/*
+ * 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 sample.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
+
+/**
+ * Model representing a Sample implementation in an SCA assembly.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SampleImplementation extends ImplementationImpl {
+ static final QName QN = new QName(SCA11_TUSCANY_NS, "implementation.sample");
+
+ final String name;
+ Class<?> clazz;
+
+ SampleImplementation(final String name) {
+ super(QN);
+ this.name = name;
+ }
+
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java
new file mode 100644
index 0000000..6017030
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java
@@ -0,0 +1,174 @@
+/*
+ * 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 sample.impl;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static sample.impl.SampleImplementation.QN;
+import static sample.impl.ImplUtil.clazz;
+import static sample.impl.ImplUtil.definition;
+import static sample.impl.ImplUtil.implementation;
+import static sample.impl.ImplUtil.interfaze;
+import static sample.impl.ImplUtil.qname;
+import static sample.impl.ImplUtil.reference;
+import static sample.impl.ImplUtil.service;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
+
+import sample.api.Java;
+import sample.api.WSDL;
+
+/**
+ * StAX artifact processor for Sample implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SampleImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<SampleImplementation> {
+ final AssemblyFactory af;
+ final JavaInterfaceFactory jif;
+ final WSDLFactory wf;
+
+ public SampleImplementationProcessor(final ExtensionPointRegistry ep) {
+ final FactoryExtensionPoint fep = ep.getExtensionPoint(FactoryExtensionPoint.class);
+ this.af = fep.getFactory(AssemblyFactory.class);
+ this.jif = fep.getFactory(JavaInterfaceFactory.class);
+ this.wf = fep.getFactory(WSDLFactory.class);
+ }
+
+ public QName getArtifactType() {
+ return QN;
+ }
+
+ public Class<SampleImplementation> getModelType() {
+ return SampleImplementation.class;
+ }
+
+ public SampleImplementation read(final XMLStreamReader r, final ProcessorContext ctx) throws ContributionReadException, XMLStreamException {
+ // Read the component implementation element
+ final SampleImplementation impl = implementation(r.getAttributeValue(null, "class"));
+ while(r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName())))
+ ;
+ return impl;
+ }
+
+ public void resolve(final SampleImplementation impl, final ModelResolver res, final ProcessorContext ctx) throws ContributionResolveException {
+ try {
+ // Resolve and introspect the implementation class
+ impl.clazz = resolve(impl.name, res, ctx);
+
+ for(final Annotation a: impl.clazz.getAnnotations()) {
+ if(a instanceof Java)
+ impl.getServices().add(service(clazz(a), jif, af));
+ else if(a instanceof WSDL)
+ impl.getServices().add(service(resolve(qname(a), res, ctx, wf), wf, af));
+ }
+
+ for(Field f: impl.clazz.getDeclaredFields()) {
+ for(final Annotation a: f.getAnnotations()) {
+ if(a instanceof Java)
+ impl.getReferences().add(reference(f.getName(), clazz(a), jif, af));
+ else if(a instanceof WSDL)
+ impl.getReferences().add(reference(f.getName(), resolve(qname(a), res, ctx, wf), wf, af));
+ }
+ }
+
+ impl.setUnresolved(false);
+ } catch(InvalidInterfaceException e) {
+ throw new ContributionResolveException(e);
+ }
+ }
+
+ public void write(final SampleImplementation impl, final XMLStreamWriter w, final ProcessorContext ctx) throws ContributionWriteException, XMLStreamException {
+ writeStart(w, QN.getNamespaceURI(), QN.getLocalPart(), new XAttr("class", impl.name));
+ writeEnd(w);
+ }
+
+ /**
+ * Resolve a Java class.
+ */
+ static Class<?> resolve(final String name, final ModelResolver res, final ProcessorContext ctx) throws ContributionResolveException {
+ final ClassReference cr = res.resolveModel(ClassReference.class, new ClassReference(name), ctx);
+ if(cr.getJavaClass() != null)
+ return cr.getJavaClass();
+ throw new ContributionResolveException(new ClassNotFoundException(name));
+ }
+
+ /**
+ * Resolve a WSDL interface.
+ */
+ static WSDLInterface resolve(final QName name, final ModelResolver res, final ProcessorContext ctx, final WSDLFactory wif) throws ContributionResolveException {
+ final WSDLInterface wi = res.resolveModel(WSDLInterface.class, interfaze(name, wif), ctx);
+ if(!wi.isUnresolved())
+ return domBound(wi);
+
+ final WSDLDefinition wd = res.resolveModel(WSDLDefinition.class, definition(wi.getName(), wif), ctx);
+ if(wd.isUnresolved())
+ throw new ContributionResolveException("Couldn't find " + name.getNamespaceURI());
+
+ WSDLObject<PortType> pt = wd.getWSDLObject(PortType.class, name);
+ if(pt == null)
+ throw new ContributionResolveException("Couldn't find " + name);
+ try {
+ final WSDLInterface nwi = wif.createWSDLInterface(pt.getElement(), wd, res, ctx.getMonitor());
+ nwi.setWsdlDefinition(wd);
+ res.addModel(nwi, ctx);
+ return domBound(nwi);
+ } catch(InvalidInterfaceException e) {
+ throw new ContributionResolveException(e);
+ }
+ }
+
+ /**
+ * Return a WSDL interface configured to use a DOM databinding.
+ */
+ static WSDLInterface domBound(WSDLInterface wi) throws ContributionResolveException {
+ try {
+ final WSDLInterface domwi = (WSDLInterface)wi.clone();
+ domwi.resetDataBinding(DOMDataBinding.NAME);
+ return domwi;
+ } catch(CloneNotSupportedException e) {
+ throw new ContributionResolveException(e);
+ }
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java
new file mode 100644
index 0000000..244251c
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java
@@ -0,0 +1,52 @@
+/*
+ * 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 sample.impl;
+
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+/**
+ * Invoker for Sample components that implement a Java interface.
+ *
+ * @version $Rev$ $Date$
+ */
+class SampleJavaInvoker implements Invoker {
+ final Object instance;
+ final Method method;
+
+ SampleJavaInvoker(final JavaOperation op, final Class<?> clazz, final Object instance) throws SecurityException, NoSuchMethodException {
+ this.instance = instance;
+ this.method = clazz.getMethod(op.getJavaMethod().getName(), op.getJavaMethod().getParameterTypes());
+ }
+
+ public Message invoke(final Message msg) {
+ try {
+ // Call the method that implements the operation
+ msg.setBody(method.invoke(instance, (Object[])msg.getBody()));
+ } catch(Exception e) {
+ e.printStackTrace();
+ msg.setFaultBody(e.getCause());
+ }
+ return msg;
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java
new file mode 100644
index 0000000..5d946b0
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java
@@ -0,0 +1,91 @@
+/*
+ * 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 sample.impl;
+
+import java.lang.reflect.Field;
+
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * Implementation provider for Sample component implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+class SampleProvider implements ImplementationProvider {
+ final RuntimeComponent comp;
+ final SampleImplementation impl;
+ final ProxyFactory pxf;
+ Object instance;
+
+ SampleProvider(final RuntimeComponent comp, final SampleImplementation impl, ProxyFactory pf) {
+ this.comp = comp;
+ this.impl = impl;
+ this.pxf = pf;
+ }
+
+ public void start() {
+ // Construct implementation instance and inject reference proxies
+ try {
+ instance = impl.clazz.newInstance();
+
+ for(ComponentReference r: comp.getReferences()) {
+ final Field f = impl.clazz.getDeclaredField(r.getName());
+ f.setAccessible(true);
+ // Inject a Java or WSDLReference proxy
+ final Interface i = r.getInterfaceContract().getInterface();
+ if(i instanceof JavaInterface)
+ f.set(instance, pxf.createProxy(comp.getComponentContext().getServiceReference(f.getType(), r.getName())));
+ else
+ f.set(instance, new SampleWSDLProxy(r.getEndpointReferences().get(0), i));
+ }
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void stop() {
+ instance = null;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+ public Invoker createInvoker(final RuntimeComponentService s, final Operation op) {
+ try {
+ // Creating an invoker for a Java or WSDL-typed implementation
+ if(op instanceof JavaOperation)
+ return new SampleJavaInvoker((JavaOperation)op, impl.clazz, instance);
+ return new SampleWSDLInvoker((WSDLOperation)op, impl.clazz, instance);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java
new file mode 100644
index 0000000..4ad24d3
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java
@@ -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 sample.impl;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * Factory for Sample implementation providers.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SampleProviderFactory implements ImplementationProviderFactory<SampleImplementation> {
+ final ProxyFactory pxf;
+
+ public SampleProviderFactory(final ExtensionPointRegistry ep) {
+ pxf = ExtensibleProxyFactory.getInstance(ep);
+ }
+
+ public ImplementationProvider createImplementationProvider(final RuntimeComponent comp, final SampleImplementation impl) {
+ return new SampleProvider(comp, impl, pxf);
+ }
+
+ public Class<SampleImplementation> getModelType() {
+ return SampleImplementation.class;
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java
new file mode 100644
index 0000000..6c53172
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java
@@ -0,0 +1,56 @@
+/*
+ * 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 sample.impl;
+
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.w3c.dom.Element;
+
+/**
+ * Invoker for Sample components that implement a WSDL interface using a generic
+ * call method.
+ *
+ * @version $Rev$ $Date$
+ */
+class SampleWSDLInvoker implements Invoker {
+ final String name;
+ final Object instance;
+ final Method method;
+
+ SampleWSDLInvoker(final WSDLOperation op, final Class<?> clazz, final Object instance) throws SecurityException, NoSuchMethodException {
+ this.name = op.getName();
+ this.instance = instance;
+ this.method = clazz.getMethod("call", String.class, Element.class);
+ }
+
+ public Message invoke(final Message msg) {
+ try {
+ // Invoke the generic call method
+ msg.setBody(method.invoke(instance, name, ((Object[])msg.getBody())[0]));
+ } catch(Exception e) {
+ e.printStackTrace();
+ msg.setFaultBody(e.getCause());
+ }
+ return msg;
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java
new file mode 100644
index 0000000..a6882a0
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java
@@ -0,0 +1,57 @@
+/*
+ * 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 sample.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+import org.w3c.dom.Element;
+
+import sample.api.WSDLReference;
+
+/**
+ * Proxy used to call operations on WSDL references.
+ */
+class SampleWSDLProxy implements WSDLReference {
+ final RuntimeEndpointReference repr;
+ final Map<String, Operation> ops;
+
+ SampleWSDLProxy(EndpointReference epr, Interface wi) {
+ repr = (RuntimeEndpointReference)epr;
+ ops = new HashMap<String, Operation>();
+ for(Operation o: wi.getOperations())
+ ops.put(o.getName(), o);
+ }
+
+ @Override
+ public Element call(String op, Element e) {
+ try {
+ // Invoke the named operation on the endpoint reference
+ return (Element)repr.invoke(ops.get(op), new Object[] {e});
+ } catch(InvocationTargetException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
new file mode 100644
index 0000000..908ac95
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation class for the artifact processor extension
+sample.impl.SampleImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.sample,model=sample.impl.SampleImplementation
+
diff --git a/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
new file mode 100644
index 0000000..85aff44
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+sample/impl/sample.xsd
diff --git a/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
new file mode 100644
index 0000000..32a7efc
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory
@@ -0,0 +1,20 @@
+# 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.
+
+# Implementation provider for Sample components
+sample.impl.SampleProviderFactory;model=sample.impl.SampleImplementation
+
diff --git a/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd b/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd
new file mode 100644
index 0000000..c057aef
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd
@@ -0,0 +1,38 @@
+<?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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"/>
+
+ <element name="implementation.sample" type="t:SampleImplementation" substitutionGroup="sca:implementation"/>
+
+ <complexType name="SampleImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <attribute name="class" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java
new file mode 100644
index 0000000..1b7e11c
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java
@@ -0,0 +1,35 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Sample service interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Client {
+
+ String jello(String s);
+
+ String wello(String s);
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java
new file mode 100644
index 0000000..92291c9
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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 sample;
+
+import static java.lang.System.out;
+import static sample.Xutil.elem;
+import static sample.Xutil.elems;
+import static sample.Xutil.print;
+import static sample.Xutil.select;
+import static sample.Xutil.text;
+import static sample.Xutil.xdom;
+import static sample.Xutil.xfilter;
+import static sample.Xutil.xreduce;
+
+import org.w3c.dom.Element;
+
+import sample.api.Java;
+import sample.api.WSDL;
+import sample.api.WSDLReference;
+
+/**
+ * Sample component implementation that uses a mix of Java and WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+@Java(Client.class)
+public class ClientTest {
+
+ @Java(Hello.class)
+ Hello jello;
+
+ @WSDL("http://sample/hello#Hello")
+ WSDLReference wello;
+
+ public String jello(String s) {
+ out.println("ClientTest.jello(" + s + ")");
+ return jello.hello(s);
+ }
+
+ public String wello(String s) {
+ out.println("ClientTest.wello(" + s + ")");
+ final Element hreq = xdom("http://sample/hello", "hello", elem("name", text(s)));
+
+ final Element hres = wello.call("hello", hreq);
+
+ return xreduce(print, "", xfilter(select("result"), elems(hres)));
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java
new file mode 100644
index 0000000..247fc8a
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java
@@ -0,0 +1,33 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Sample service interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Hello {
+
+ String hello(String s);
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java
new file mode 100644
index 0000000..5c999a6
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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 sample;
+
+import static java.lang.System.out;
+import sample.api.Java;
+
+/**
+ * Sample component implementation that uses Java interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+@Java(Hello.class)
+public class JelloTest {
+
+ @Java(Upper.class)
+ Upper upper;
+
+ public String hello(String s) {
+ out.println("JelloTest.hello(" + s + ")");
+ return upper.upper("Hello " + s);
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java
new file mode 100644
index 0000000..9c772b3
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java
@@ -0,0 +1,33 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Sample service interface.
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Upper {
+
+ String upper(String s);
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java
new file mode 100644
index 0000000..5399e44
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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 sample;
+
+import static java.lang.System.out;
+import sample.api.Java;
+
+/**
+ * Sample component implementation that uses Java interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+@Java(Upper.class)
+public class UpperTest {
+
+ public String upper(String s) {
+ out.println("UpperTest.upper(" + s + ")");
+ return s.toUpperCase();
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java
new file mode 100644
index 0000000..1bb9fc1
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java
@@ -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 sample;
+
+import static java.lang.System.out;
+import static sample.Xutil.elem;
+import static sample.Xutil.elems;
+import static sample.Xutil.print;
+import static sample.Xutil.select;
+import static sample.Xutil.text;
+import static sample.Xutil.xdom;
+import static sample.Xutil.xfilter;
+import static sample.Xutil.xml;
+import static sample.Xutil.xreduce;
+
+import org.w3c.dom.Element;
+
+import sample.api.WSDL;
+import sample.api.WSDLReference;
+
+/**
+ * Sample component implementation that uses WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+@WSDL("http://sample/hello#Hello")
+public class WelloTest {
+
+ @WSDL("http://sample/upper#Upper")
+ WSDLReference upper;
+
+ public Element call(String op, Element e) {
+ out.println("WelloTest." + op + "(" + xml(e) + ")");
+ final String name = xreduce(print, "", xfilter(select("name"), elems(e)));
+
+ final Element ureq = xdom("http://sample/upper", "upper", elem("s", text("Hello " + name)));
+ final Element ures = upper.call("upper", ureq);
+
+ final String s = xreduce(print, "", xfilter(select("result"), elems(ures)));
+ return xdom("http://sample/hello", "helloResponse", elem("result", text(s)));
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java
new file mode 100644
index 0000000..ce89f9d
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java
@@ -0,0 +1,225 @@
+/*
+ * 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 sample;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Just for fun, a little bit of magic code and utility functions to help work with XML DOM.
+ */
+class Xutil {
+ interface NodeBuilder {
+ Node build(Document doc);
+ }
+
+ /**
+ * Convert a name and a list of children to a document element.
+ */
+ static Element xdom(String ns, String name, final NodeBuilder... nodes) {
+ return (Element)elem(ns, name, nodes).build(db.newDocument());
+ }
+
+ /**
+ * Convert a name and children to an element.
+ */
+ static NodeBuilder elem(final String uri, final String n, final NodeBuilder... nodes) {
+ return new NodeBuilder() {
+ public Node build(Document doc) {
+ final Element e = doc.createElementNS(uri, n);
+ for(final NodeBuilder n: nodes)
+ e.appendChild(n.build(doc));
+ return e;
+ }
+ };
+ }
+
+ static NodeBuilder elem(final String n, final NodeBuilder... nodes) {
+ return elem(null, n, nodes);
+ }
+
+ /**
+ * Convert a string to a text element.
+ */
+ static NodeBuilder text(final String t) {
+ return new NodeBuilder() {
+ public Node build(final Document doc) {
+ return doc.createTextNode(t);
+ }
+ };
+ }
+
+ private final static DocumentBuilder db = db();
+
+ private static DocumentBuilder db() {
+ try {
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ } catch(ParserConfigurationException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Convert an element to XML.
+ */
+ static TransformerFactory trf = TransformerFactory.newInstance();
+
+ static String xml(final Node node) {
+ try {
+ final StreamResult r = new StreamResult(new StringWriter());
+ trf.newTransformer().transform(new DOMSource(node), r);
+ return r.getWriter().toString();
+ } catch(TransformerException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Evaluate an xpath expression.
+ */
+ private static XPathFactory xpf = XPathFactory.newInstance();
+
+ static String xpath(final String expr, final Node node) {
+ final XPath xp = xpf.newXPath();
+ try {
+ return (String)xp.evaluate(expr, node, XPathConstants.STRING);
+ } catch(XPathExpressionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * A pure Java FP-style alternative to xpath for DOM.
+ */
+ interface Mapper<T> {
+ T map(final Element e);
+ }
+
+ static Mapper<Element> identity = new Mapper<Element>() {
+ public Element map(Element e) {
+ return e;
+ };
+ };
+
+ interface Reducer<T> {
+ T reduce(final T accum, final Element e);
+ }
+
+ static Reducer<String> print = new Reducer<String>() {
+ public String reduce(String accum, Element e) {
+ return accum + e.getTextContent();
+ }
+ };
+
+ /**
+ * Apply a mapper to a list of elements.
+ */
+ static <T> List<T> xmap(final Mapper<T> f, final Iterable<Element> l) {
+ final List<T> v = new ArrayList<T>();
+ for(Element e: l)
+ v.add(f.map(e));
+ return v;
+ }
+
+ /**
+ * Apply a filter to a list of elements.
+ */
+ static List<Element> xfilter(final Mapper<Boolean> f, final Iterable<Element> l) {
+ final List<Element> v = new ArrayList<Element>();
+ for(Element e: l)
+ if(f.map(e))
+ v.add(e);
+ return v;
+ }
+
+ /**
+ * Perform a reduction over a list of elements.
+ */
+ static <T> T xreduce(final Reducer<T> f, final T initial, final Iterable<Element> l) {
+ T accum = initial;
+ for(Element e: l)
+ accum = f.reduce(accum, e);
+ return accum;
+ }
+
+ /**
+ * Return a filter that selects elements by name.
+ */
+ static Mapper<Boolean> select(final String name) {
+ return new Mapper<Boolean>() {
+ public Boolean map(Element e) {
+ return name.equals(e.getLocalName());
+ }
+ };
+ }
+
+ /**
+ * Return the child elements of a node.
+ */
+ static Iterable<Element> elems(final Node parent) {
+ final List<Element> l = new ArrayList<Element>();
+ for (Node n: children(parent))
+ if (n instanceof Element)
+ l.add((Element)n);
+ return l;
+ }
+
+ /**
+ * An iterable over the children of a node.
+ */
+ private static Iterable<Node> children(Node parent) {
+ final NodeList l = parent.getChildNodes();
+ final int n = l.getLength();
+ return new Iterable<Node>() {
+ public Iterator<Node> iterator() {
+ return new Iterator<Node>() {
+ int i = 0;
+ public boolean hasNext() {
+ return i < n;
+ }
+ public Node next() {
+ return l.item(i++);
+ }
+ public void remove() {
+ }
+ };
+ }
+ };
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java
new file mode 100644
index 0000000..406dbab
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java
@@ -0,0 +1,151 @@
+/*
+ * 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 sample.impl;
+
+import static java.lang.System.out;
+import static org.junit.Assert.assertEquals;
+import static sample.impl.EmbedUtil.build;
+import static sample.impl.EmbedUtil.component;
+import static sample.impl.EmbedUtil.composite;
+import static sample.impl.EmbedUtil.contrib;
+import static sample.impl.EmbedUtil.deploy;
+import static sample.impl.EmbedUtil.embedContext;
+import static sample.impl.EmbedUtil.extensionPoints;
+import static sample.impl.EmbedUtil.implementation;
+import static sample.impl.EmbedUtil.node;
+import static sample.impl.EmbedUtil.providerFactories;
+import static sample.impl.EmbedUtil.reference;
+import static sample.impl.EmbedUtil.service;
+import static sample.impl.EmbedUtil.wsdli;
+import static sample.impl.TestUtil.here;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import sample.Client;
+import sample.ClientTest;
+import sample.Hello;
+import sample.JelloTest;
+import sample.Upper;
+import sample.UpperTest;
+import sample.WelloTest;
+
+/**
+ * Test how to assemble a contribution, a SCDL composite and run it on an embedded
+ * Tuscany runtime node. Also shows how pass in a ProviderFactory instead of having
+ * it loaded and constructed by the runtime node.
+ *
+ * @version $Rev$ $Date$
+ */
+public class EmbedTestCase {
+ static NodeFactory nf;
+ static EmbedUtil.Context ec;
+ static Node node;
+
+ @SuppressWarnings("unchecked")
+ @BeforeClass
+ public static void setUp() throws Exception {
+ nf = NodeFactory.newInstance();
+ ec = embedContext(nf);
+
+ // Load the test WSDL definitions (could also construct the WSDL
+ // and XSD models in code but that'd be quite painful, so just
+ // load them from XML for now)
+ final Contribution contrib = build(contrib("test", here()), ec);
+ WSDLInterface Hello_wsdl = build(wsdli("Hello.wsdl", "http://sample/hello", "Hello", contrib), ec);
+ WSDLInterface Upper_wsdl = build(wsdli("Upper.wsdl", "http://sample/upper", "Upper", contrib), ec);
+
+ // Assemble a test composite model (see EmbedUtil
+ // for the little DSL used here, much more concise
+ // than using the assembly model interfaces)
+ final Composite comp =
+ build(composite("http://sample", "test",
+ component("client-test",
+ implementation(ClientTest.class,
+ service(Client.class),
+ reference("jello", Hello.class),
+ reference("wello", Hello_wsdl)),
+ reference("jello", "jello-test"),
+ reference("wello", "wello-test")),
+ component("wello-test",
+ implementation(WelloTest.class,
+ service(Hello_wsdl),
+ reference("upper", Upper_wsdl)),
+ reference("upper", "upper-test")),
+ component("jello-test",
+ implementation(JelloTest.class,
+ service(Hello.class),
+ reference("upper", Upper.class)),
+ reference("upper", "upper-test")),
+ component("upper-test",
+ implementation(UpperTest.class,
+ service(Upper.class)))), ec);
+
+ // Register a test instance of our sample implementation ProviderFactory
+ providerFactories(ec).addProviderFactory(testProviderFactory());
+
+ // Run with it
+ node = node(nf, deploy(contrib, comp));
+ node.start();
+ }
+
+ static ProviderFactory<SampleImplementation> testProviderFactory() {
+ // This shows how to get called when a provider is created
+ return new SampleProviderFactory(extensionPoints(ec)) {
+ public ImplementationProvider createImplementationProvider(RuntimeComponent comp, SampleImplementation impl) {
+ out.println("Creating a provider for component " + comp.getName());
+ return super.createImplementationProvider(comp, impl);
+ }};
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void jello() {
+ out.println("RunTestCase.jello");
+ final String r = client().jello("Java");
+ out.println(r);
+ assertEquals("HELLO JAVA", r);
+ }
+
+ @Test
+ public void wello() {
+ out.println("RunTestCase.wello");
+ final String r = client().wello("WSDL");
+ out.println(r);
+ assertEquals("HELLO WSDL", r);
+ }
+
+ static Client client() {
+ return node.getService(Client.class, "client-test/Client");
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java
new file mode 100644
index 0000000..8a4768c
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java
@@ -0,0 +1,84 @@
+/*
+ * 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 sample.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static sample.impl.TestUtil.here;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.DefaultContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test read/write Sample SCDL implementation elements.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadWriteTestCase {
+ static XMLInputFactory xif;
+ static XMLOutputFactory xof;
+ static StAXArtifactProcessor<Object> xproc;
+ static ProcessorContext ctx;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ final DefaultExtensionPointRegistry ep = new DefaultExtensionPointRegistry();
+ final Contribution contrib = new DefaultContributionFactory().createContribution();
+ contrib.setLocation(here());
+ ctx = new ProcessorContext(contrib, null);
+ xif = XMLInputFactory.newInstance();
+ xof = XMLOutputFactory.newInstance();
+ final StAXArtifactProcessorExtensionPoint xpep = new DefaultStAXArtifactProcessorExtensionPoint(ep);
+ xproc = new ExtensibleStAXArtifactProcessor(xpep, xif, xof);
+ }
+
+ @Test
+ public void testRead() throws Exception {
+ final InputStream is = getClass().getClassLoader().getResourceAsStream("test.composite");
+ final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
+ assertNotNull(c);
+ assertEquals("sample.ClientTest", ((SampleImplementation)c.getComponents().get(0).getImplementation()).name);
+ }
+
+ @Test
+ public void testReadWrite() throws Exception {
+ final InputStream is = getClass().getClassLoader().getResourceAsStream("test.composite");
+ final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
+ final ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ xproc.write(c, xof.createXMLStreamWriter(bos), ctx);
+ assertTrue(bos.toString().contains("class=\"sample.WelloTest\""));
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java
new file mode 100644
index 0000000..29bf02d
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java
@@ -0,0 +1,75 @@
+/*
+ * 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 sample.impl;
+
+import static java.lang.System.out;
+import static org.junit.Assert.assertEquals;
+import static sample.impl.TestUtil.here;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import sample.Client;
+
+/**
+ * Test how to run an SCA contribution containing a test composite on a
+ * Tuscany runtime node.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RunTestCase {
+ static Node node;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ final NodeFactory nf = NodeFactory.newInstance();
+ node = nf.createNode(new Contribution("test", here()));
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void jello() {
+ out.println("RunTestCase.jello");
+ final String r = client().jello("Java");
+ out.println(r);
+ assertEquals("HELLO JAVA", r);
+ }
+
+ @Test
+ public void wello() {
+ out.println("RunTestCase.wello");
+ final String r = client().wello("WSDL");
+ out.println(r);
+ assertEquals("HELLO WSDL", r);
+ }
+
+ static Client client() {
+ return node.getService(Client.class, "client-test/Client");
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java
new file mode 100644
index 0000000..61133d0
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java
@@ -0,0 +1,120 @@
+/*
+ * 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 sample.impl;
+
+import static java.lang.System.out;
+import static org.junit.Assert.assertTrue;
+import static sample.impl.TestUtil.here;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.Socket;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.http.jetty.JettyServer;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test a component that provides and consumes SOAP Web services.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RunWSTestCase {
+ static Node node;
+ static JettyServer jetty;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ // Start test composite on a Tuscany node
+ final NodeFactory nf = NodeFactory.newInstance();
+ node = nf.createNode(new Contribution("test", here()));
+ node.start();
+
+ // Mock up a test Web service on http://localhost:8086/wsupper
+ jetty = new JettyServer((ExtensionPointRegistry)nf.getExtensionPointRegistry());
+ jetty.start();
+ jetty.addServletMapping("http://localhost:8086/wsupper", new HttpServlet() {
+ private static final long serialVersionUID = 1L;
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ assertTrue(read(req.getInputStream()).contains("Hello SOAP"));
+ final String soapresp =
+ "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ "<soapenv:Body><upperResponse xmlns=\"http://sample/upper\">" +
+ "<result xmlns=\"\">HELLO SOAP</result>" +
+ "</upperResponse></soapenv:Body></soapenv:Envelope>";
+
+ write(soapresp, resp.getOutputStream());
+ }
+ });
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ jetty.stop();
+ node.stop();
+ }
+
+ @Test
+ public void wsello() throws Exception {
+ out.println("RunWSTestCase.wsello");
+ // Send a SOAP request to the Web service provided by SCA component wsello-test
+ // on http://localhost:8085/wsello
+ final Socket s = new Socket("localhost", 8085);
+ final String soapreq =
+ "POST /wsello HTTP/1.0\r\n" +
+ "Content-Type: text/xml; charset=UTF-8\r\n" +
+ "Content-length: 231\r\n\r\n" +
+ "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ "<soapenv:Body><hello xmlns=\"http://sample/hello\">" +
+ "<name xmlns=\"\">SOAP</name>" +
+ "</hello></soapenv:Body></soapenv:Envelope>";
+ write(soapreq, s.getOutputStream());
+ assertTrue(read(s.getInputStream()).contains("HELLO SOAP"));
+ }
+
+ static void write(final String s, final OutputStream o) throws IOException {
+ final OutputStreamWriter w = new OutputStreamWriter(o);
+ w.write(s);
+ w.flush();
+ }
+
+ static String read(final InputStream i) throws IOException {
+ return read(new BufferedReader(new InputStreamReader(i)));
+ }
+
+ static String read(final BufferedReader r) throws IOException {
+ final String s = r.readLine();
+ return s == null? "" : s + read(r);
+ }
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java
new file mode 100644
index 0000000..6dcfb33
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java
@@ -0,0 +1,31 @@
+/*
+ * 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 sample.impl;
+
+/**
+ * A hack to determine the test contribution location.
+ */
+public class TestUtil {
+
+ static String here() {
+ return TestUtil.class.getProtectionDomain().getCodeSource().getLocation().toString();
+ }
+
+}
diff --git a/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl b/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl
new file mode 100644
index 0000000..360cea5
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl
@@ -0,0 +1,62 @@
+<?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.
+-->
+<wsdl:definitions targetNamespace="http://sample/hello" xmlns:tns="http://sample/hello"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="Hello">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://sample/hello"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="hello">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="helloResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="helloRequest">
+ <wsdl:part element="tns:hello" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="helloResponse">
+ <wsdl:part element="tns:helloResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="Hello">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:helloRequest" name="helloRequest" />
+ <wsdl:output message="tns:helloResponse" name="helloResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl b/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl
new file mode 100644
index 0000000..8a148bb
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl
@@ -0,0 +1,62 @@
+<?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.
+-->
+<wsdl:definitions targetNamespace="http://sample/upper" xmlns:tns="http://sample/upper"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="Upper">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://sample/upper"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="upper">
+ <complexType>
+ <sequence>
+ <element name="s" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="upperResponse">
+ <complexType>
+ <sequence>
+ <element name="result" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="upperRequest">
+ <wsdl:part element="tns:upper" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="upperResponse">
+ <wsdl:part element="tns:upperResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="Upper">
+ <wsdl:operation name="upper">
+ <wsdl:input message="tns:upperRequest" name="upperRequest" />
+ <wsdl:output message="tns:upperResponse" name="upperResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite b/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite
new file mode 100644
index 0000000..43a75f5
--- /dev/null
+++ b/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite
@@ -0,0 +1,60 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://test"
+ name="wstest">
+
+ <!-- Client test component used by the JUnit tests -->
+ <component name="client-test">
+ <t:implementation.sample class="sample.ClientTest"/>
+ <reference name="wello" target="wello-test"/>
+ <reference name="jello" target="jello-test"/>
+ </component>
+
+ <!-- HelloWorld test component that uses WSDL interfaces -->
+ <component name="wello-test">
+ <t:implementation.sample class="sample.WelloTest"/>
+ <reference name="upper" target="upper-test"/>
+ </component>
+
+ <!-- HelloWorld test component that uses Java interfaces -->
+ <component name="jello-test">
+ <t:implementation.sample class="sample.JelloTest"/>
+ <reference name="upper" target="upper-test"/>
+ </component>
+
+ <!-- HelloWorld test component that uses WSDL interfaces and SOAP Web Services -->
+ <component name="Wsello-test">
+ <t:implementation.sample class="sample.WelloTest"/>
+ <service name="Hello">
+ <binding.ws uri="http://localhost:8085/wsello"/>
+ </service>
+ <reference name="upper">
+ <binding.ws uri="http://localhost:8086/wsupper"/>
+ </reference>
+ </component>
+
+ <!-- Test component converts a string to uppercase -->
+ <component name="upper-test">
+ <t:implementation.sample class="sample.UpperTest"/>
+ </component>
+
+</composite>
diff --git a/samples/extending-tuscany/pom.xml b/samples/extending-tuscany/pom.xml
new file mode 100644
index 0000000..b5f3088
--- /dev/null
+++ b/samples/extending-tuscany/pom.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-samples-extending-tuscany</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Extending Tuscany Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>binding-sample</module>
+ <module>implementation-sample</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/samples/getting-started/callback-api/pom.xml b/samples/getting-started/callback-api/pom.xml
new file mode 100644
index 0000000..96f512f
--- /dev/null
+++ b/samples/getting-started/callback-api/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-callback-api-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample Callback API Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/samples/getting-started/callback-api/src/main/java/sample/CallBack.java b/samples/getting-started/callback-api/src/main/java/sample/CallBack.java
new file mode 100644
index 0000000..16e4297
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/CallBack.java
@@ -0,0 +1,33 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The callback interface.
+ */
+@Remotable
+public interface CallBack {
+
+ void callBackMessage(String aString);
+
+ void callBackIncrement();
+
+}
diff --git a/samples/getting-started/callback-api/src/main/java/sample/Client.java b/samples/getting-started/callback-api/src/main/java/sample/Client.java
new file mode 100644
index 0000000..7e0709e
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/Client.java
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Client {
+
+ void run();
+
+}
diff --git a/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java b/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java
new file mode 100644
index 0000000..01219aa
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java
@@ -0,0 +1,108 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(Client.class)
+public class ClientImpl implements Client, CallBack {
+
+ public static final String DELIMITER = "\n----------------------------";
+
+ @Reference
+ protected sample.Service service;
+
+ private static int callBackCount = 0;
+
+ /**
+ * This function prints the message received from the service
+ * implementation.
+ *
+ * @param String the message received from the service
+ */
+ public void callBackMessage(String aString) {
+ System.out.println("ClientImpl - Received callback message: " + aString);
+ }
+
+ /**
+ * This function increments the callBackCount variable when called from the
+ * service implementation.
+ */
+ public void callBackIncrement() {
+ System.out.println("ClientImpl - Received increment callback");
+ callBackCount++;
+ System.out.println("ClientImpl - Callback counter incremented to : " + getCallBackCount());
+ }
+
+ /**
+ * This method runs different kinds of service calls implying callbacks.
+ */
+ public void run() {
+ simpleCallBack();
+ simpleCallBackByRef();
+ noCallBack();
+ multipleCallBack();
+ }
+
+ /**
+ * The basic callback where the target calls back prior to returning to the
+ * client.
+ */
+ private void simpleCallBack() {
+ System.out.println(DELIMITER + "\nSimple callback" + DELIMITER);
+ service.knockKnock("Knock Knock");
+ }
+
+ /**
+ * The basic callback where the target calls back prior to returning to the
+ * client.
+ */
+ private void simpleCallBackByRef() {
+ System.out.println(DELIMITER + "\nSimple callback by reference" + DELIMITER);
+ service.knockKnockByRef("Knock Knock by reference");
+ }
+
+ /**
+ * The basic callback where the target does not call back to the client.
+ */
+ private void noCallBack() {
+ System.out.println(DELIMITER + "\nNo callback" + DELIMITER);
+ service.noCallBack("No Reply Desired");
+ }
+
+ /**
+ * The basic callback where the target calls back multiple times to the
+ * client.
+ */
+ private void multipleCallBack() {
+ System.out.println(DELIMITER + "\nMultiple callbacks" + DELIMITER);
+ service.multiCallBack("Call me back 3 times");
+ }
+
+ /**
+ * This function returns the callBackCount variable.
+ *
+ * @return Integer the callBackCount variable
+ */
+ public int getCallBackCount() {
+ return callBackCount;
+ }
+
+}
diff --git a/samples/getting-started/callback-api/src/main/java/sample/Launcher.java b/samples/getting-started/callback-api/src/main/java/sample/Launcher.java
new file mode 100644
index 0000000..fa1a59d
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/Launcher.java
@@ -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 sample;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * This class starts the Tuscany Runtime and runs the client calls to the
+ * service.
+ */
+public class Launcher {
+
+ public static void main(String[] args) {
+ Node node = startRuntime();
+ Client client = node.getService(Client.class, "Client");
+ client.run();
+ stopRuntime(node);
+ }
+
+ /**
+ * Starts a Tuscany node with the predefined contribution.
+ *
+ * @return the running node
+ */
+ private static Node startRuntime() {
+ String location = ContributionLocationHelper.getContributionLocation("CallBackApi.composite");
+ Node node = NodeFactory.newInstance().createNode("CallBackApi.composite", new Contribution("c1", location));
+ node.start();
+ return node;
+ }
+
+ /**
+ * Stops a Tuscany node.
+ *
+ * @param node the node to stop
+ */
+ private static void stopRuntime(Node node) {
+ node.stop();
+ }
+}
diff --git a/samples/getting-started/callback-api/src/main/java/sample/Service.java b/samples/getting-started/callback-api/src/main/java/sample/Service.java
new file mode 100644
index 0000000..6723af2
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/Service.java
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+@Callback(CallBack.class)
+public interface Service {
+
+ void knockKnock(String aString);
+
+ void knockKnockByRef(String aString);
+
+ void noCallBack(String aString);
+
+ void multiCallBack(String aString);
+
+}
diff --git a/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java b/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java
new file mode 100644
index 0000000..4850f43
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java
@@ -0,0 +1,96 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(sample.Service.class)
+public class ServiceImpl implements sample.Service {
+
+ public static final String MESSAGE_RECEIVED = "ServiceImpl - Received message: ";
+
+ @Context
+ protected ComponentContext componentContext;
+
+ @Callback
+ protected ServiceReference<CallBack> callbackRef;
+
+ /**
+ * This function gets an object of ServiceImpl by calling
+ * getCallBackInterface function and calls the callBackMessage function.
+ *
+ * @param aString String passed by a function call
+ */
+ public void knockKnock(String aString) {
+ System.out.println(MESSAGE_RECEIVED + aString);
+ CallBack callback = this.getCallBackFromComponentContext();
+ callback.callBackMessage("Who's There");
+ }
+
+ /**
+ * This function calls the callBackMessage function. The reference to this
+ * function is received from the callback reference to the Service class.
+ *
+ * @param aString String passed by a function call
+ */
+ public void knockKnockByRef(String aString) {
+ System.out.println(MESSAGE_RECEIVED + aString);
+ callbackRef.getService().callBackMessage("Who's There");
+ }
+
+ /**
+ * This function gets an object of ServiceImpl by calling
+ * getCallBackInterface function. This function then places multiple
+ * callbacks using the callbackIncrement function defined in the callback
+ * implementation.
+ *
+ * @param aString String passed by a function call
+ */
+ public void multiCallBack(String aString) {
+ CallBack callback = this.getCallBackFromComponentContext();
+ System.out.println(MESSAGE_RECEIVED + aString);
+ callback.callBackIncrement();
+ callback.callBackIncrement();
+ callback.callBackIncrement();
+ }
+
+ /**
+ * This function does not callBack any function.
+ *
+ * @param aString String passed by a function call
+ */
+ public void noCallBack(String aString) {
+ System.out.println(MESSAGE_RECEIVED + aString);
+ }
+
+ /**
+ * This function gets an object of ServiceImpl from the present
+ * componentContext.
+ *
+ * @return the callback
+ */
+ private CallBack getCallBackFromComponentContext() {
+ return componentContext.getRequestContext().getCallback();
+ }
+
+}
diff --git a/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite b/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite
new file mode 100644
index 0000000..ca3a6e5
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite
@@ -0,0 +1,33 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://callback"
+ name="CallBackApi">
+
+ <component name="Client">
+ <implementation.java class="sample.ClientImpl"/>
+ <reference name="service" target="Service"/>
+ </component>
+
+ <component name="Service">
+ <implementation.java class="sample.ServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml b/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..f177912
--- /dev/null
+++ b/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:t="http://callback">
+ <deployable composite="t:CallBackApi" />
+</contribution>
\ No newline at end of file
diff --git a/samples/getting-started/files/helloworld.cmds b/samples/getting-started/files/helloworld.cmds
new file mode 100644
index 0000000..e94a0e4
--- /dev/null
+++ b/samples/getting-started/files/helloworld.cmds
@@ -0,0 +1,19 @@
+# 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.
+
+# install the helloworld contribution and start its deployables
+install helloworld-contribution/target/helloworld-contribution.jar -start
diff --git a/samples/getting-started/files/helloworld.xml b/samples/getting-started/files/helloworld.xml
new file mode 100644
index 0000000..e010748
--- /dev/null
+++ b/samples/getting-started/files/helloworld.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ domain="helloworld">
+
+ <contribution location="helloworld-contribution/target/helloworld-contribution.jar" startDeployables="true"/>
+
+</node>
\ No newline at end of file
diff --git a/samples/getting-started/files/new-sca-contribution.xml b/samples/getting-started/files/new-sca-contribution.xml
new file mode 100644
index 0000000..62e8fef
--- /dev/null
+++ b/samples/getting-started/files/new-sca-contribution.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+
+ <!-- Add exports from the helloworld contribution resources so other contributions can reuse them -->
+ <export namespace="http://sample"/>
+ <export.java package="sample"/>
+
+</contribution>
diff --git a/samples/getting-started/files/scdl-include.xml b/samples/getting-started/files/scdl-include.xml
new file mode 100644
index 0000000..b15b20b
--- /dev/null
+++ b/samples/getting-started/files/scdl-include.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ domain="helloworld">
+
+ <contribution location="helloworld-contribution/target/helloworld-contribution.jar" metaDataURL="new-sca-contribution.xml"/>
+ <contribution location="scdl-include-contribution/target/scdl-include-contribution.zip" startDeployables="true" />
+
+</node>
\ No newline at end of file
diff --git a/samples/getting-started/files/wsClient.html b/samples/getting-started/files/wsClient.html
new file mode 100644
index 0000000..402f30c
--- /dev/null
+++ b/samples/getting-started/files/wsClient.html
@@ -0,0 +1,143 @@
+<!--
+
+ 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.
+
+-->
+
+<!--
+Simple html page that presents a form to post xml to a web service endpoint and display the response xml.
+Copied from ServiceMix wsdl first example.
+-->
+
+<html>
+<head>
+<title>Tuscany Web service Sample Client</title>
+<script type="text/javascript">
+
+var urlToOpen = "http://localhost:8085/HelloworldComponent/Helloworld"; //default URL to open
+
+function getHTTPObject() {
+ var xmlhttp = false;
+
+ /* Compilation conditionnelle d'IE */
+ /*@cc_on
+ @if (@_jscript_version >= 5)
+ try {
+ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e) {
+ try {
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (E) {
+ xmlhttp = false;
+ }
+ }
+ @else
+ xmlhttp = false;
+ @end @*/
+
+ /* on essaie de créer l'objet si ce n'est pas déjà fait */
+ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
+ try {
+ xmlhttp = new XMLHttpRequest();
+ } catch (e) {
+ xmlhttp = false;
+ }
+ }
+
+ if (xmlhttp) {
+ /* on définit ce qui doit se passer quand la page répondra */
+ xmlhttp.onreadystatechange=function() {
+ if (xmlhttp.readyState == 4) { /* 4 : état "complete" */
+ var response = document.getElementById("response");
+ var responseStatus = "";
+ try {
+ responseStatus = xmlhttp.status + "";
+ } catch (e) {
+ responseStatus = "ERROR WHILE RETRIEVING STATUS; MAYBE UNABLE TO CONNECT.";
+ }
+ response.value = xmlhttp.responseText;
+ }
+ }
+ }
+ return xmlhttp;
+}
+
+function send() {
+ if ((document.getElementById("urlToOpen").value != urlToOpen) && (document.getElementById("urlToOpen").value != "")) {
+ //use user entry only if it at least can be okay
+ urlToOpen = document.getElementById("urlToOpen").value;
+ }
+ var xmlhttp = getHTTPObject();
+ if (!xmlhttp) {
+ alert('cound not create XMLHttpRequest object');
+ return;
+ }
+ var request = document.getElementById("request");
+ var response = document.getElementById("response");
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite");
+ } catch (e) {
+ }
+
+
+ try {
+ xmlhttp.open("POST", urlToOpen, true);
+ } catch (e) {
+ alert('error opening');
+ }
+ xmlhttp.setRequestHeader("Content-Type", "text/xml;charset=UTF-8");
+ xmlhttp.send(request.value);
+}
+
+</script>
+</head>
+
+<body>
+
+<h1>Tuscany Web service Sample Client</h1>
+
+<p>Tuscany Web service Sample Client</p>
+
+<p>Sends a request to a Web Service endpoint. (This requires JavaScript)</p>
+<p>Target: <input type="text" size="50" id="urlToOpen" value=""><script type="text/javascript">document.getElementById("urlToOpen").value = urlToOpen;</script>.</p>
+
+<table>
+ <tr>
+ <td>
+ <textarea id="request" style="width:600px;height:400px" ><?xml version='1.0' encoding='UTF-8'?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+<soapenv:Body>
+<ns:sayHello xmlns:ns="http://helloworld">
+<ns:name>petra</ns:name>
+</ns:sayHello>
+</soapenv:Body>
+</soapenv:Envelope>
+
+ </textarea>
+ </td>
+ <td>
+ <textarea id="response" style="width:600px;height:400px">
+ </textarea>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <input type="button" value="Send" onClick="send();"/>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
diff --git a/samples/helloworld/README b/samples/getting-started/helloworld-contribution/README
similarity index 100%
rename from samples/helloworld/README
rename to samples/getting-started/helloworld-contribution/README
diff --git a/samples/getting-started/helloworld-contribution/pom.xml b/samples/getting-started/helloworld-contribution/pom.xml
new file mode 100644
index 0000000..4c8e103
--- /dev/null
+++ b/samples/getting-started/helloworld-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>jar</packaging>
+ <artifactId>sample-helloworld-contribution</artifactId>
+ <name>Apache Tuscany SCA Samples - Getting Started - helloworld-contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/helloworld-scaclient/src/main/java/sample/Helloworld.java b/samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java
similarity index 100%
copy from samples/helloworld-scaclient/src/main/java/sample/Helloworld.java
copy to samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java
diff --git a/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java b/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java
new file mode 100644
index 0000000..aa563cb
--- /dev/null
+++ b/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java
@@ -0,0 +1,37 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
+public class HelloworldImpl implements Helloworld {
+
+ public String sayHello(String name) {
+ System.out.println("HelloworldImpl.sayHello " + name);
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
+}
diff --git a/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml b/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..589b9d2
--- /dev/null
+++ b/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,25 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+
+ <deployable composite="sample:helloworld"/>
+
+</contribution>
diff --git a/samples/helloworld/src/main/resources/helloworld.composite b/samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite
similarity index 100%
rename from samples/helloworld/src/main/resources/helloworld.composite
rename to samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite
diff --git a/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite b/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite
new file mode 100644
index 0000000..52436d8
--- /dev/null
+++ b/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite
@@ -0,0 +1,32 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ name="helloworldws">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldImpl"/>
+ <service name="Helloworld">
+ <binding.ws />
+ </service>
+ </component>
+
+</composite>
diff --git a/samples/helloworld-spring/src/test/java/sample/HelloworldTestCase.java b/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java
similarity index 100%
rename from samples/helloworld-spring/src/test/java/sample/HelloworldTestCase.java
rename to samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java
diff --git a/samples/webapps/helloworld-bpel/README b/samples/getting-started/helloworld-webapp/README
similarity index 100%
rename from samples/webapps/helloworld-bpel/README
rename to samples/getting-started/helloworld-webapp/README
diff --git a/samples/getting-started/helloworld-webapp/pom.xml b/samples/getting-started/helloworld-webapp/pom.xml
new file mode 100644
index 0000000..220341f
--- /dev/null
+++ b/samples/getting-started/helloworld-webapp/pom.xml
@@ -0,0 +1,118 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-helloworld-webapp</artifactId>
+ <name>Apache Tuscany SCA Sample Helloworld</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-contribution</artifactId>
+ <version>${pom.version}</version>
+ <!-- should really go in the target folder but i can't get jetty:run to work using that -->
+ <outputDirectory>src/main/webapp/WEB-INF/sca-contributions</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <overrideWebXml>src/test/resources/test-web.xml</overrideWebXml>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml b/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..755162e
--- /dev/null
+++ b/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,49 @@
+<?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.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Helloworld Sample</display-name>
+
+ <context-param>
+ <param-name>contributions</param-name>
+ <param-value>/WEB-INF/sca-contributions</param-value>
+ </context-param>
+
+<!-- TODO: need to sort out what to do about distributed domain
+ <context-param>
+ <param-name>org.apache.tuscany.sca.config</param-name>
+ <param-value>uri:default</param-value>
+ </context-param>
+-->
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
diff --git a/samples/webapps/helloworld/src/test/java/itest/Helloworld.java b/samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java
similarity index 100%
rename from samples/webapps/helloworld/src/test/java/itest/Helloworld.java
rename to samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java
diff --git a/samples/webapps/helloworld/src/test/java/itest/HelloworldTestCaseFIXME.java b/samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java
similarity index 100%
rename from samples/webapps/helloworld/src/test/java/itest/HelloworldTestCaseFIXME.java
rename to samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java
diff --git a/samples/webapps/helloworld/src/test/resources/test-web.xml b/samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml
similarity index 100%
rename from samples/webapps/helloworld/src/test/resources/test-web.xml
rename to samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml
diff --git a/samples/getting-started/pom.xml b/samples/getting-started/pom.xml
new file mode 100644
index 0000000..3f229a4
--- /dev/null
+++ b/samples/getting-started/pom.xml
@@ -0,0 +1,48 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-getting-started-contributions</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Getting Started Sample Contributions</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-contribution</module>
+ <module>scdl-include-contribution</module>
+ <module>callback-api</module>
+ <module>sca-scopes</module>
+ <module>helloworld-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/getting-started/sca-scopes/pom.xml b/samples/getting-started/sca-scopes/pom.xml
new file mode 100644
index 0000000..6c79d57
--- /dev/null
+++ b/samples/getting-started/sca-scopes/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <name>Apache Tuscany SCA Sample SCA Scopes Contribution</name>
+ <artifactId>sample-sca-scopes-contribution</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/Client.java b/samples/getting-started/sca-scopes/src/main/java/sample/Client.java
new file mode 100644
index 0000000..13f6e00
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/Client.java
@@ -0,0 +1,25 @@
+/*
+ * 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 sample;
+
+public interface Client {
+
+ void run();
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java b/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java
new file mode 100644
index 0000000..3dbeeb0
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class ClientImpl implements Client {
+
+ private static final int TIMES = 5;
+
+ @Reference
+ private CompositeService compositeService;
+
+ @Reference
+ private StatelessService statelessService;
+
+ public void setCompositeService(CompositeService compositeService) {
+ this.compositeService = compositeService;
+ }
+
+ public void setStatelessService(StatelessService statelessService) {
+ this.statelessService = statelessService;
+ }
+
+ @Override
+ public void run() {
+ System.out.println("Calling CompositeService " + TIMES + " times...");
+ for (int i = 0 ; i < TIMES; i++) {
+ compositeService.hello();
+ }
+ System.out.println("Calling StatelessService " + TIMES + " times...");
+ for (int i = 0 ; i < TIMES; i++) {
+ statelessService.hello();
+ }
+ }
+
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java b/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java
new file mode 100644
index 0000000..60384cb
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java
@@ -0,0 +1,27 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface CompositeService {
+
+ void hello();
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java b/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java
new file mode 100644
index 0000000..f458767
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+@Scope("COMPOSITE")
+@Service(CompositeService.class)
+public class CompositeServiceImpl implements CompositeService {
+
+ public CompositeServiceImpl() {
+ super();
+ System.out.println("Constructing CompositeServiceImpl instance.");
+ }
+
+ @Override
+ public void hello() {
+ System.out.println("Saying hello to CompositeServiceImpl instance.");
+ }
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java b/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java
new file mode 100644
index 0000000..8d00b6e
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java
@@ -0,0 +1,56 @@
+/*
+ * 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 sample;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public class Launcher {
+
+ public static void main(String[] args) {
+ Node node = startRuntime();
+ Client client = node.getService(Client.class, "Client");
+ client.run();
+ stopRuntime(node);
+ }
+
+ /**
+ * Starts a Tuscany node with the predefined contribution.
+ *
+ * @return the running node
+ */
+ private static Node startRuntime() {
+ String location = ContributionLocationHelper.getContributionLocation("scopes.composite");
+ Node node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location));
+ node.start();
+ return node;
+ }
+
+ /**
+ * Stops a Tuscany node.
+ *
+ * @param node the node to stop
+ */
+ private static void stopRuntime(Node node) {
+ node.stop();
+ }
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java b/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java
new file mode 100644
index 0000000..8474bc6
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface StatelessService {
+
+ void hello();
+
+}
diff --git a/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java b/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java
new file mode 100644
index 0000000..94d6339
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java
@@ -0,0 +1,37 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+@Scope("STATELESS")
+@Service(StatelessService.class)
+public class StatelessServiceImpl implements StatelessService {
+
+ public StatelessServiceImpl() {
+ super();
+ System.out.println("Constructing StatelessServiceImpl instance.");
+ }
+
+ @Override
+ public void hello() {
+ System.out.println("Saying hello to StatelessServiceImpl.");
+ }
+}
diff --git a/samples/getting-started/sca-scopes/src/main/resources/scopes.composite b/samples/getting-started/sca-scopes/src/main/resources/scopes.composite
new file mode 100644
index 0000000..14937a1
--- /dev/null
+++ b/samples/getting-started/sca-scopes/src/main/resources/scopes.composite
@@ -0,0 +1,38 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://Scopes"
+ name="Scopes">
+
+ <component name="Stateless">
+ <implementation.java class="sample.StatelessServiceImpl"/>
+ </component>
+
+ <component name="Composite">
+ <implementation.java class="sample.CompositeServiceImpl"/>
+ </component>
+
+ <component name="Client">
+ <implementation.java class="sample.ClientImpl"/>
+ <reference name="statelessService" target="Stateless"/>
+ <reference name="compositeService" target="Composite"/>
+ </component>
+
+</composite>
diff --git a/samples/helloworld/README b/samples/getting-started/scdl-include-contribution/README
similarity index 100%
copy from samples/helloworld/README
copy to samples/getting-started/scdl-include-contribution/README
diff --git a/samples/getting-started/scdl-include-contribution/pom.xml b/samples/getting-started/scdl-include-contribution/pom.xml
new file mode 100644
index 0000000..1cb457f
--- /dev/null
+++ b/samples/getting-started/scdl-include-contribution/pom.xml
@@ -0,0 +1,76 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>zip</packaging>
+ <artifactId>sample-scdl-include-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample include Composite Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+
+ <!-- plugin to support zip packaging for SCA contributions -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-zip-plugin</artifactId>
+ <version>alpha2</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <!-- plugin to support using mvn tuscany:run to run this contribution -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <configuration>
+ <contributions>
+ <!-- add the dependee contribution that this contribution uses -->
+ <param>..\helloworld-contribution\target\helloworld-contribution.jar</param>
+ </contributions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml b/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..b7677f1
--- /dev/null
+++ b/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,26 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:scdl-include"/>
+ <import namespace="http://sample"/>
+ <export namespace="http://sample"/>
+</contribution>
+
diff --git a/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite b/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite
new file mode 100644
index 0000000..7f75c65
--- /dev/null
+++ b/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite
@@ -0,0 +1,30 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="scdl-include">
+
+ <include name="sample:helloworld" />
+
+ <service name="MyHelloworld" promote="HelloworldComponent/Helloworld" />
+
+</composite>
diff --git a/samples/helloworld-bpel/build.xml b/samples/helloworld-bpel/build.xml
deleted file mode 100644
index 008953e..0000000
--- a/samples/helloworld-bpel/build.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<!--
- * 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 name="sample-helloworld-bpel" default="compile">
- <property name="test.class" value="helloworld.BPELClient" />
- <property name="test.jar" value="sample-helloworld-bpel.jar" />
- <property name="manifest.jar" value="../../lib/tuscany-sca-manifest.jar" />
-
- <target name="init">
- <mkdir dir="target/classes"/>
- <mkdir dir="target/wsdl2java-source"/>
- </target>
-
- <target name="generate-wsdl" depends="init">
- <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
- <arg value="-targetDirectory"/>
- <arg value="target/wsdl2java-source"/>
- <arg value="-prefix"/>
- <arg value="HelloWorld"/>
- <arg value="-noContainment"/>
- <arg value="-noUnsettable"/>
- <arg value="src/main/resources/helloworld.wsdl"/>
-
- <classpath>
- <pathelement location="${manifest.jar}"/>
- </classpath>
- </java>
-
- <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="true">
- <arg value="-targetDirectory"/>
- <arg value="target/wsdl2java-source"/>
- <arg value="src/main/resources/helloworld.wsdl"/>
-
- <classpath>
- <pathelement location="${manifest.jar}"/>
- </classpath>
- </java>
- </target>
-
- <target name="unzip-ode-db" depends="init">
- <unzip src="../../lib/ode-dao-jpa-ojpa-derby-1.3.2.zip" dest="target/database"/>
- </target>
-
- <target name="compile" depends="init,generate-wsdl,unzip-ode-db">
- <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
- <src path="src/main/java"/>
- <src path="target/wsdl2java-source"/>
- <classpath>
- <pathelement location="${manifest.jar}"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${test.jar}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${test.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run">
- <java classname="${test.class}" fork="true">
- <!-- jvmarg value="-Xdebug"/ -->
- <!-- jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/ -->
- <classpath>
- <pathelement location="target/classes"/>
- <pathelement location="target/database"/>
- <pathelement location="${manifest.jar}"/>
- </classpath>
- </java>
- </target>
-
- <target name="clean">
- <delete includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
-</project>
diff --git a/samples/helloworld-bpel/pom.xml b/samples/helloworld-bpel/pom.xml
deleted file mode 100644
index 328be56..0000000
--- a/samples/helloworld-bpel/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <packaging>zip</packaging>
- <artifactId>sample-helloworld-bpel</artifactId>
- <name>Apache Tuscany SCA Sample HelloWorld BPEL</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <plugin>
- <!-- plugin to support zip packaging for SCA contributions -->
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-zip-plugin</artifactId>
- <version>alpha2</version>
- <extensions>true</extensions>
- </plugin>
-
- <!-- plugin to support using mvn tuscany:run to run this contribution -->
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-bpel</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/helloworld-scaclient/pom.xml b/samples/helloworld-scaclient/pom.xml
deleted file mode 100644
index b822528..0000000
--- a/samples/helloworld-scaclient/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-scaclient</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld SCAClient</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>sample.HelloworldSCAClient</mainClass>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/helloworld-spring/pom.xml b/samples/helloworld-spring/pom.xml
deleted file mode 100644
index 77e1fa7..0000000
--- a/samples/helloworld-spring/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-spring</artifactId>
- <name>Apache Tuscany SCA Sample HelloWorld using Spring</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
-
- <!-- plugin to support using mvn tuscany:run to run this contribution -->
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-spring</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/helloworld-spring/src/main/java/sample/Helloworld.java b/samples/helloworld-spring/src/main/java/sample/Helloworld.java
deleted file mode 100644
index f4e8c50..0000000
--- a/samples/helloworld-spring/src/main/java/sample/Helloworld.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
-
- String sayHello(String name);
-
-}
diff --git a/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java b/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java
deleted file mode 100644
index ac03ea3..0000000
--- a/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 sample;
-
-
-public class HelloworldImpl implements Helloworld {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
diff --git a/samples/helloworld-spring/src/main/resources/helloworld-context.xml b/samples/helloworld-spring/src/main/resources/helloworld-context.xml
deleted file mode 100644
index 89b2cfb..0000000
--- a/samples/helloworld-spring/src/main/resources/helloworld-context.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="sample.HelloworldImpl" lazy-init="true">
- </bean>
-
-</beans>
\ No newline at end of file
diff --git a/samples/helloworld-spring/src/main/resources/helloworld.composite b/samples/helloworld-spring/src/main/resources/helloworld.composite
deleted file mode 100644
index 33895dd..0000000
--- a/samples/helloworld-spring/src/main/resources/helloworld.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://sample"
- xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- name="helloworld">
-
- <component name="HelloworldComponent">
- <implementation.spring location="helloworld-context.xml"/>
- </component>
-
-</composite>
diff --git a/samples/helloworld-ws-sdo/pom.xml b/samples/helloworld-ws-sdo/pom.xml
deleted file mode 100644
index b54a03e..0000000
--- a/samples/helloworld-ws-sdo/pom.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-helloworld-ws-sdo</artifactId>
- <name>Apache Tuscany SCA Sample HelloWorld Web Service SDO</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-lib</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-impl</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-Beta1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
-
- <plugins>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- </dependencies>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>target/sdo-source</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>generate-helloworld-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/wsdl/helloworld.wsdl</schemaFile>
- <javaPackage>helloworld</javaPackage>
- <prefix>Helloworld</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <execution>
- <id>generate-helloworld-sdo1</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/test.xsd</schemaFile>
- <javaPackage>model.sdo</javaPackage>
- <prefix>Entity</prefix>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/helloworld/pom.xml b/samples/helloworld/pom.xml
deleted file mode 100644
index cc1944f..0000000
--- a/samples/helloworld/pom.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <packaging>jar</packaging>
- <artifactId>sample-helloworld</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/helloworld/src/main/java/sample/Helloworld.java b/samples/helloworld/src/main/java/sample/Helloworld.java
deleted file mode 100644
index f4e8c50..0000000
--- a/samples/helloworld/src/main/java/sample/Helloworld.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
-
- String sayHello(String name);
-
-}
diff --git a/samples/helloworld/src/main/java/sample/HelloworldImpl.java b/samples/helloworld/src/main/java/sample/HelloworldImpl.java
deleted file mode 100644
index 5bf6a94..0000000
--- a/samples/helloworld/src/main/java/sample/HelloworldImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 sample;
-
-public class HelloworldImpl implements Helloworld {
-
- public String sayHello(String name) {
- System.out.println("HelloworldImpl.sayHello " + name);
- return "Hello " + name;
- }
-
-}
diff --git a/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml b/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 91b0c8f..0000000
--- a/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sample="http://sample">
- <deployable composite="sample:helloworld"/>
-</contribution>
diff --git a/samples/helloworld/src/test/java/sample/HelloworldTestCase.java b/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
deleted file mode 100644
index 7e679ec..0000000
--- a/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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 sample;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class HelloworldTestCase {
-
- @Test
- public void testSayHello() {
- HelloworldImpl helloworld = new HelloworldImpl();
- assertEquals("Hello Petra", helloworld.sayHello("Petra"));
- }
-
-}
diff --git a/samples/launcher-embedded-jse/README b/samples/launcher-embedded-jse/README
deleted file mode 100644
index 7108333..0000000
--- a/samples/launcher-embedded-jse/README
+++ /dev/null
@@ -1,20 +0,0 @@
-JSE Sample Launcher
-===================
-
-This directory contains a sample java launcher for the
-tuscany sample contributions.
-
-The README file in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running sample contributions using the
-tuscany sample launchers ( where distribution-unpack-dir is the directory in which you
-unpacked the tuscany binary distribution archive)
-
-To use this sample JSE launcher with ant excute the command
-
-ant run-<contributionname>
-
-where run-<contributionname> is one of the targets in the build.xml file
-
-To use this sample launcher to run all of the contributions as junit test cases,
-execute the command "mvn" in the launcher directory.
-
diff --git a/samples/launcher-embedded-jse/build.xml b/samples/launcher-embedded-jse/build.xml
deleted file mode 100644
index 64bad00..0000000
--- a/samples/launcher-embedded-jse/build.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<!--
- * 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 name="launcher-embedded-jse" default="run">
- <property name="tuscany.home" value="../.."/>
- <property name="jar.name" value="sample-launcher-embedded-jse.jar" />
- <property name="main.class" value="launcher.SampleJSELauncher" />
- <property name="wait.before.stopping" value="dontWaitBeforeStopping" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-base-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
- <echo> 'ant run-contribution-binding-sca-calculator' </echo>
- <echo> 'ant run-contribution-binding-ws-calculator' </echo>
- <echo> 'ant run-contribution-binding-rmi-calculator' </echo>
- <echo> 'ant run-contribution-implementation-java-calculator' </echo>
- </target>
-
- <target name="run-contribution-binding-sca-calculator" depends="compile">
- <java classname="${main.class}"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- <arg value="contribution-binding-sca-calculator"/>
- <arg value="${wait.before.stopping}"/>
- </java>
- </target>
-
- <target name="run-contribution-binding-ws-calculator" depends="compile">
- <java classname="launcher.JSELauncherBindingWSCalculator"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- </java>
- </target>
-
- <target name="run-contribution-binding-rmi-calculator" depends="compile">
- <java classname="${main.class}"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- <arg value="contribution-binding-rmi-calculator"/>
- </java>
- </target>
-
- <target name="run-contribution-implementation-java-calculator" depends="compile">
- <java classname="${main.class}"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/features">
- <include name="tuscany-sca-manifest.jar" />
- </fileset>
- </classpath>
- <arg value="contribution-implementaton-java-calculator"/>
- </java>
- </target>
-
-</project>
diff --git a/samples/launcher-embedded-jse/pom.xml b/samples/launcher-embedded-jse/pom.xml
deleted file mode 100644
index 1fba441..0000000
--- a/samples/launcher-embedded-jse/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-launcher-embedded-jse</artifactId>
- <name>Apache Tuscany SCA Sample Launcher Embedded JSE</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java b/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java
deleted file mode 100644
index 3342e4a..0000000
--- a/samples/launcher-embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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 launcher;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import calculator.CalculatorService;
-
-/**
- * This client program shows how to create an embedded SCA runtime, load a contribution,
- * start it and locate and invoke an SCA component
- */
-public class JSELauncherBindingWSCalculator {
-
- public static void main(String[] args) throws Exception {
- JSELauncherBindingWSCalculator launcher = new JSELauncherBindingWSCalculator();
- launcher.launchBindingWSCalculator();
- }
-
- /*
- * Using the Tuscany Node API to load a contribution.
- * Using the Tuscany Node API to get a local service proxy
- */
- public void launchBindingWSCalculator(){
- Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/sample-contribution-binding-ws-calculator.jar"));
- node.start();
-
- CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
-
- // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
- double result = calculator.add(3, 2);
- System.out.println("3 + 2 = " + result);
- if (result != 5.0){
- throw new SampleLauncherException();
- }
-
- node.stop();
- }
-
-}
diff --git a/samples/launcher-embedded-jse/src/main/java/launcher/RuntimeIntegration.java b/samples/launcher-embedded-jse/src/main/java/launcher/RuntimeIntegration.java
deleted file mode 100644
index fdff16c..0000000
--- a/samples/launcher-embedded-jse/src/main/java/launcher/RuntimeIntegration.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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 launcher;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-
-/**
- * Base JSE launcher function
- */
-public class RuntimeIntegration {
-
-
- public Node startNode(Contribution... contributions){
- Node node = NodeFactory.newInstance().createNode(contributions);
- node.start();
- return node;
- }
-
- public void stopNode(Node node){
- node.stop();
- }
-
-}
diff --git a/samples/launcher-embedded-jse/src/main/java/launcher/SampleJSELauncher.java b/samples/launcher-embedded-jse/src/main/java/launcher/SampleJSELauncher.java
deleted file mode 100644
index 9a4a73c..0000000
--- a/samples/launcher-embedded-jse/src/main/java/launcher/SampleJSELauncher.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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 launcher;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-
-import calculator.CalculatorService;
-
-
-/**
- * This client program shows how to create an embedded SCA runtime, load a contribution,
- * start it and, in some cases, locate and invoke an SCA component
- */
-public class SampleJSELauncher extends RuntimeIntegration {
-
- protected boolean waitBeforeStopping = false;
-
- public static void main(String[] args) throws Exception {
-
- // get the contribution name from the 1st argument it there is one
- String contribution = null;
-
- if (args == null || args.length != 1){
- System.out.println("Please provide the name of the sample contribution to run as a parameter");
- System.out.println("Running binding-sca-calculator by default");
- contribution = "contribution-binding-sca-calculator";
- } else {
- contribution = args[0];
- }
-
- // assume that more than one argument means that the caller wants to
- // keep the SCA application running while other clients use the services
- boolean waitBeforeStopping = false;
-
- if (args != null && args.length > 1 && args[1].equals("waitBeforeStopping")){
- waitBeforeStopping = true;
- }
-
- SampleJSELauncher launcher = new SampleJSELauncher(waitBeforeStopping);
-
- if (contribution.equals("contribution-binding-sca-calculator")){
- launcher.launchBindingSCACalculator();
- } else if (contribution.equals("contribution-binding-ws-calculator")){
- launcher.launchBindingWSCalculator();
- } else if (contribution.equals("contribution-binding-rmi-calculator")){
- launcher.launchBindingRMICalculator();
- } else if (contribution.equals("contribution-implementation-java-calculator")){
- launcher.launchImplementationJavaCalculator();
- } else {
- System.out.println("Sample contribution " + contribution + "not found");
- }
-
- }
-
- public SampleJSELauncher(boolean waitBeforeStopping){
- this.waitBeforeStopping = waitBeforeStopping;
- }
-
- /**
- * Wait for user input. Allows us to keep the Tuscany runtime and the SCA application
- * running while other clients access the services provided
- */
- public void waitBeforeStopping(){
- if (waitBeforeStopping){
- try {
- System.out.println("Press key to continue");
- int input = System.in.read();
- } catch (Exception ex) {
- // do nothing
- }
- }
- }
-
- /**
- * The contribution-binding-sca-calculator contribution includes a client component
- * that calls the CalculatorServiceComponent from an operation marked by @Init.
- */
- public void launchBindingSCACalculator(){
- Node node = startNode(new Contribution("c1", "../binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar"));
- waitBeforeStopping();
- stopNode(node);
- }
-
- /*
- * Using a Tuscany specific mechanism for getting at local service proxies
- */
- public void launchBindingWSCalculator(){
- Node node = startNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/classes"));
-
- CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
- // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
- double result = calculator.add(3, 2);
- System.out.println("3 + 2 = " + result);
- if (result != 5.0){
- throw new SampleLauncherException();
- }
-
- waitBeforeStopping();
- stopNode(node);
- }
-
- /*
- * Using a Tuscany specific mechanism for getting at local service proxies
- */
- public void launchBindingRMICalculator(){
- Node node1 = startNode(new Contribution("c1", "../binding-rmi/contribution-calculator-service/target/classes"));
- Node node2 = startNode(new Contribution("c1", "../binding-rmi/contribution-calculator-reference/target/classes"));
-
- CalculatorService calculator = node2.getService(CalculatorService.class, "CalculatorServiceComponent");
- // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
- double result = calculator.add(3, 2);
- System.out.println("3 + 2 = " + result);
- if (result != 5.0){
- throw new SampleLauncherException();
- }
-
- waitBeforeStopping();
- stopNode(node2);
- stopNode(node1);
- }
-
- /**
- * The contribution-binding-sca-calculator contribution includes a client component
- * that calls the CalculatorServiceComponent from an operation marked by @Init.
- */
- public void launchImplementationJavaCalculator(){
- Node node = startNode(new Contribution("c1", "../contribution-implementation-java-calculator/target/classes"));
- waitBeforeStopping();
- stopNode(node);
- }
-
-}
diff --git a/samples/launcher-embedded-jse/src/test/java/launcher/LauncherTestCase.java b/samples/launcher-embedded-jse/src/test/java/launcher/LauncherTestCase.java
deleted file mode 100644
index 33159dc..0000000
--- a/samples/launcher-embedded-jse/src/test/java/launcher/LauncherTestCase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 launcher;
-
-import org.junit.Test;
-
-/**
- * Test sample contributions.
- */
-public class LauncherTestCase {
-
- @Test
- public void testContributionBindingSCACalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-binding-sca-calculator"});
- }
-
-/* replaced by call to specific launcher
- @Test
- public void testContributionBindingWSCalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-binding-ws-calculator"});
- }
-*/
-
- @Test
- public void testContributionBindingWSCalculator() throws Exception {
- JSELauncherBindingWSCalculator.main(null);
- }
-
- @Test
- public void testContributionBindingRMICalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-binding-rmi-calculator"});
- }
-
- @Test
- public void testContributionImplementationJavaCalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-implementation-java-calculator"});
- }
-}
diff --git a/samples/launcher-embedded-osgi-base/pom.xml b/samples/launcher-embedded-osgi-base/pom.xml
deleted file mode 100644
index 595126f..0000000
--- a/samples/launcher-embedded-osgi-base/pom.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-launcher-embedded-osgi-base</artifactId>
- <name>Apache Tuscany SCA Sample Launcher Embedded OSGi using base jar</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.5.0-v20090520</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/launcher-embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java b/samples/launcher-embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java
deleted file mode 100644
index 535488a..0000000
--- a/samples/launcher-embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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 launcher;
-
-import java.net.URI;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-import calculator.CalculatorService;
-
-
-/**
- * This client program shows how to create an embedded SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class SampleJSELauncher extends RuntimeIntegration {
-
- public static void main(String[] args) throws Exception {
- SampleJSELauncher launcher = new SampleJSELauncher();
-
- String contribution = null;
-
- if (args == null || args.length != 1){
- System.out.println("Please provide the name of the sample contribution to run as a parameter");
- System.out.println("Running binding-sca-calculator by default");
- contribution = "contribution-binding-sca-calculator";
- } else {
- contribution = args[0];
- }
-
- if (contribution.equals("contribution-binding-sca-calculator")){
- launcher.launchBindingSCACalculator();
- } else if (contribution.equals("contribution-binding-ws-calculator")){
- launcher.launchBindingWSCalculator();
- } else {
- System.out.println("Sample contribution " + contribution + "not found");
- }
-
- }
-
- /**
- * The contribution-binding-sca-calculator contribution includes a client component
- * that calls the CalculatorServiceComponent from an operation marked by @Init.
- */
- public void launchBindingSCACalculator(){
- Node node = startNode(new Contribution("c1", "../binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar"));
-
- stopNode(node);
- }
-
- /*
- * Using a Tuscany specific mechanism for getting at local service proxies
- */
- public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
- Node node = startNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/sample-contribution-binding-ws-calculator.jar"));
-
- CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
-
- double result = calculator.add(3, 2);
- System.out.println("3 + 2 = " + result);
- if (result != 5.0){
- throw new SampleLauncherException();
- }
-
- stopNode(node);
- }
-
-}
diff --git a/samples/launcher-embedded-osgi/README b/samples/launcher-embedded-osgi/README
deleted file mode 100644
index 01d277a..0000000
--- a/samples/launcher-embedded-osgi/README
+++ /dev/null
@@ -1,20 +0,0 @@
-OSGI Sample Launcher
-===================
-
-This directory contains a sample launcher for the running the
-tuscany sample contributions in an OSGI environment.
-
-The README file in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running sample contributions using the
-tuscany sample launchers. ( where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive)
-
-To use this sample OSGI launcher with ant excute the command
-
-ant run-<contributionname>
-
-where run-<contributionname> is one of the targets in the build.xml file
-
-To use this sample launcher to run all of the contributions as junit test cases,
-execute the command "mvn" in the launcher directory.
diff --git a/samples/launcher-embedded-osgi/build.xml b/samples/launcher-embedded-osgi/build.xml
deleted file mode 100644
index f08d19e..0000000
--- a/samples/launcher-embedded-osgi/build.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<!--
- * 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 name="launcher-embedded-osgi" default="run">
- <property name="tuscany.home" value="../.."/>
- <property name="jar.name" value="sample-launcher-embedded-osgi.jar" />
- <property name="main.class" value="launcher.SampleJSELauncher" />
-
- <echo>${tuscany.home}</echo>
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="${tuscany.home}/lib">
- <include name="tuscany-base-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
- <echo> 'ant run-contribution-binding-sca-calculator' </echo>
- </target>
-
- <target name="run-contribution-binding-sca-calculator" depends="compile">
- <java classname="${main.class}"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/modules">
- <include name="tuscany-node-api-*.jar" />
- <include name="tuscany-sca-api-*.jar" />
- <include name="tuscany-node-launcher-equinox-*.jar" />
- </fileset>
- </classpath>
- <arg value="contribution-binding-sca-calculator"/>
- </java>
- <echo> and ant run </echo>
- </target>
-
- <!-- TODO - this runs from mvn but not from ant so there is some issue with the
- way the environment gets set up
- <target name="run-contribution-binding-ws-calculator" depends="compile">
- <java classname="${main.class}"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="target/${jar.name}"/>
- <fileset dir="${tuscany.home}/modules">
- <include name="tuscany-node-api-*.jar" />
- <include name="tuscany-sca-api-*.jar" />
- <include name="tuscany-node-launcher-equinox-*.jar" />
- </fileset>
- </classpath>
- <arg value="contribution-binding-ws-calculator"/>
- </java>
- </target>
- -->
-
-</project>
diff --git a/samples/launcher-embedded-osgi/pom.xml b/samples/launcher-embedded-osgi/pom.xml
deleted file mode 100644
index 9fd6df6..0000000
--- a/samples/launcher-embedded-osgi/pom.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-launcher-embedded-osgi</artifactId>
- <name>Apache Tuscany SCA Sample Launcher Embedded OSGi</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
-
- <plugins>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java b/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java
deleted file mode 100644
index e506f98..0000000
--- a/samples/launcher-embedded-osgi/src/main/java/launcher/SampleJSELauncher.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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 launcher;
-
-import java.net.URI;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-import calculator.CalculatorService;
-
-
-/**
- * This client program shows how to create an embedded SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class SampleJSELauncher extends RuntimeIntegration {
-
- public static void main(String[] args) throws Exception {
- SampleJSELauncher launcher = new SampleJSELauncher();
-
- String contribution = null;
-
- if (args == null || args.length != 1){
- System.out.println("Please provide the name of the sample contribution to run as a parameter");
- System.out.println("Running binding-sca-calculator by default");
- contribution = "contribution-binding-sca-calculator";
- } else {
- contribution = args[0];
- }
-
- if (contribution.equals("contribution-binding-sca-calculator")){
- launcher.launchBindingSCACalculator();
- } else if (contribution.equals("contribution-binding-ws-calculator")){
- launcher.launchBindingWSCalculator();
- } else {
- System.out.println("Sample contribution " + contribution + "not found");
- }
-
- }
-
- /**
- * The contribution-binding-sca-calculator contribution includes a client component
- * that calls the CalculatorServiceComponent from an operation marked by @Init.
- */
- public void launchBindingSCACalculator(){
- Node node = startNode(new Contribution("c1", "../binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar"));
-
- stopNode(node);
- }
-
- /*
- * Using a Tuscany specific mechanism for getting at local service proxies
- */
- public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
- Node node = startNode(new Contribution("c1", "../contribution-binding-ws-calculator/target/sample-contribution-binding-ws-calculator.jar"));
-
- CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
-
- double result = calculator.add(3, 2);
- System.out.println("3 + 2 = " + result);
- if (result != 5.0){
- throw new SampleLauncherException();
- }
-
- stopNode(node);
- }
-
-}
diff --git a/samples/launcher-embedded-osgi/src/test/java/launcher/LauncherTestCase.java b/samples/launcher-embedded-osgi/src/test/java/launcher/LauncherTestCase.java
deleted file mode 100644
index 7b72ec7..0000000
--- a/samples/launcher-embedded-osgi/src/test/java/launcher/LauncherTestCase.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 launcher;
-
-import org.junit.Test;
-
-
-
-/**
- * Test the Calculator composition.
- */
-public class LauncherTestCase {
-
- @Test
- public void testContributionBindingSCACalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-binding-sca-calculator"});
- }
-
- @Test
- public void testContributionBindingWSCalculator() throws Exception {
- SampleJSELauncher.main(new String[] {"contribution-binding-ws-calculator"});
- }
-}
diff --git a/samples/launcher-shell/README b/samples/launcher-shell/README
deleted file mode 100644
index abdf824..0000000
--- a/samples/launcher-shell/README
+++ /dev/null
@@ -1,34 +0,0 @@
-Sample Tuscany Shell
-====================
-
-This directory contains a sample shell program supporting simple commands to
-start and stop SCA composites.
-
-To build the sample shell do this:
-mvn install
-
-To run it:
-./sca
-
-at the prompt:
-start myNode mySampleContrib ../contribution-implementation-java-calculator/target/classes
-
-or:
-start myNode mySampleContrib http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-
-also try:
-status
-stop myNode
-bye
-
-Starting and stopping composites is pretty fast. To see that, try the following
-two scripts, which start/stop a sample composite 10 times.
-
-./sca <scripts/test.txt
-or
-./sca <scripts/test-remote.txt
-
-The shell can also run as a Webapp. To try it install target/scashell.war in
-a Web container, point your Web browser to http://localhost:8080/scashell
-and try the links on that page.
-
diff --git a/samples/launcher-shell/pom.xml b/samples/launcher-shell/pom.xml
deleted file mode 100644
index f7bafb5..0000000
--- a/samples/launcher-shell/pom.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-launcher-shell</artifactId>
- <name>Apache Tuscany SCA Sample Launcher Shell</name>
- <packaging>war</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-web20</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>scashell</finalName>
- </build>
-</project>
diff --git a/samples/launcher-shell/scripts/test-remote.txt b/samples/launcher-shell/scripts/test-remote.txt
deleted file mode 100644
index fd7bd57..0000000
--- a/samples/launcher-shell/scripts/test-remote.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-# 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
-
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-stop foo
diff --git a/samples/launcher-shell/scripts/test-start.txt b/samples/launcher-shell/scripts/test-start.txt
deleted file mode 100644
index 71f7f3f..0000000
--- a/samples/launcher-shell/scripts/test-start.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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
-
-start foo c1 http://people.apache.org/~jsdelfino/tuscany/java/test/sample-contribution-binding-ws-calculator.jar
-status
diff --git a/samples/launcher-shell/scripts/test-stop.txt b/samples/launcher-shell/scripts/test-stop.txt
deleted file mode 100644
index c942a30..0000000
--- a/samples/launcher-shell/scripts/test-stop.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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
-
-stop foo
diff --git a/samples/launcher-shell/scripts/test.txt b/samples/launcher-shell/scripts/test.txt
deleted file mode 100644
index 66c760b..0000000
--- a/samples/launcher-shell/scripts/test.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-# 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
-
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
-start foo c1 ../contribution-implementation-java-calculator/target/classes
-stop foo
diff --git a/samples/launcher-shell/src/main/java/sample/Shell.java b/samples/launcher-shell/src/main/java/sample/Shell.java
deleted file mode 100644
index 7aecc8a..0000000
--- a/samples/launcher-shell/src/main/java/sample/Shell.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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 sample;
-
-import static java.lang.System.in;
-import static java.lang.System.out;
-import static java.util.Collections.emptyList;
-import static java.util.Collections.singletonList;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.concurrent.Callable;
-import java.io.BufferedReader;
-import java.io.PrintWriter;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.IOException;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-
-/**
- * A little SCA command shell.
- */
-public class Shell {
- final NodeFactory nodeFactory;
-
- public static class NodeInfo {
- final String name;
- final String curi;
- final String cloc;
- final Node node;
-
- NodeInfo(final String name, final String curi, final String cloc, final Node node) {
- this.name = name;
- this.curi = curi;
- this.cloc = cloc;
- this.node = node;
- }
-
- public String toString() {
- return name + " " + curi + " " + cloc;
- }
- }
-
- final Map<String, NodeInfo> nodes = new HashMap<String, NodeInfo>();
- final List<String> history = new ArrayList<String>();
-
- public Shell(NodeFactory nf) {
- this.nodeFactory = nf;
- }
-
- List<?> start(final String name, final String curi, final String cloc) {
- if (nodes.containsKey(name))
- return emptyList();
- final Node node = nodeFactory.createNode(new Contribution(curi, cloc));
- nodes.put(name, new NodeInfo(name, curi, cloc, node));
- node.start();
- return emptyList();
- }
-
- List<?> stop(final String name) {
- final NodeInfo ninfo = nodes.get(name);
- if (ninfo == null)
- return emptyList();
- ninfo.node.stop();
- nodes.remove(name);
- return emptyList();
- }
-
- List<?> stop() {
- for (NodeInfo ninfo: nodes.values())
- ninfo.node.stop();
- nodes.clear();
- return emptyList();
- }
-
- List<?> restart(final String name, final String curi, final String cloc) {
- stop(name);
- return start(name, curi, cloc);
- }
-
- List<?> status() {
- return new ArrayList(nodes.values());
- }
-
- List<?> history() {
- return history;
- }
-
- List<?> bye() {
- return null;
- }
-
- List<String> read(final BufferedReader r) throws IOException {
- final String l = r.readLine();
- history.add(l);
- return l != null? Arrays.asList(l.split(" ")) : singletonList("bye");
- }
-
- Callable<List<?>> eval(final List<String> toks) {
- final String op = toks.get(0);
- if(op.equals("start")) return new Callable<List<?>>() { public List<?> call() {
- return start(toks.get(1), toks.get(2), toks.get(3));
- }};
- if(op.equals("stop")) return new Callable<List<?>>() { public List<?> call() {
- if (toks.size() == 1)
- return stop();
- return stop(toks.get(1));
- }};
- if(op.equals("restart")) return new Callable<List<?>>() { public List<?> call() {
- return restart(toks.get(1), toks.get(2), toks.get(3));
- }};
- if(op.equals("status")) return new Callable<List<?>>() { public List<?> call() {
- return status();
- }};
- if(op.equals("history")) return new Callable<List<?>>() { public List<?> call() {
- return history();
- }};
- if(op.equals("bye")) return new Callable<List<?>>() { public List<?> call() {
- return bye();
- }};
- return new Callable<List<?>>() { public List<?> call() {
- return emptyList();
- }};
- }
-
- List<?> apply(final Callable<List<?>> func) {
- try {
- return func.call();
- } catch (Exception e) {
- e.printStackTrace();
- return singletonList(e);
- }
- }
-
- boolean print(final List<?> l, PrintWriter w) {
- if(l == null)
- return false;
- for(Object o: l)
- w.println(o);
- return true;
- }
-
- public Map<String, NodeInfo> run(final BufferedReader r, final PrintWriter w) throws IOException {
- while(print(apply(eval(read(r))), w));
- r.close();
- return nodes;
- }
-
- public static void main(final String[] args) throws Exception {
- new Shell(NodeFactory.newInstance()).run(new BufferedReader(new InputStreamReader(in)), new PrintWriter(out, true));
- }
-}
diff --git a/samples/launcher-shell/src/main/java/sample/ShellServlet.java b/samples/launcher-shell/src/main/java/sample/ShellServlet.java
deleted file mode 100644
index 76c5758..0000000
--- a/samples/launcher-shell/src/main/java/sample/ShellServlet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 sample;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tuscany.sca.host.webapp.WebAppHelper;
-
-public class ShellServlet extends HttpServlet {
- static final long serialVersionUID = 1L;
-
- Shell shell;
-
- //@Override
- public void init() {
- shell = new Shell(WebAppHelper.getNodeFactory());
- }
-
- //@Override
- public void destroy() {
- shell.stop();
- }
-
- //@Override
- protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
- shell.run(new BufferedReader(new InputStreamReader(new URL(req.getParameter("conf")).openStream())), resp.getWriter());
- }
-}
-
diff --git a/samples/launcher-shell/src/main/webapp/index.html b/samples/launcher-shell/src/main/webapp/index.html
deleted file mode 100644
index d2ae91e..0000000
--- a/samples/launcher-shell/src/main/webapp/index.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- * 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.
--->
-<html>
-<head>
-<title>Sample Runtime Shell</title>
-</head>
-<body>
-<h1>It works</h1>
-
-<p>This Web app runs a sample Tuscany runtime shell similar to samples/launcher-shell.<br/>
-To see how it works and what configuration commands are supported, just read the Shell program's <a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/src/main/java/sample/Shell.java">source code</a>.</p>
-
-<p>Configuration commands can be provided through a text document served from a Web location, for example:<br/>
-<a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/scripts/test-start.txt">http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/scripts/test-start.txt</a></p>
-
-<p>To run that particular configuration script just point your Web browser to:<br/>
-<a href="http://localhost:8080/scashell/run?conf=http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/scripts/test-start.txt">http://localhost:8080/scashell/run?conf=http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/scripts/test-start.txt</a><br/>
-To run the script again and refresh the runtime shell, just refresh that page in your Web browser.
-</p>
-
-<p>Sample configuration script samples are available in the Tuscany Subversion repository <a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/launcher-shell/scripts/">there</a>.
-
-</body>
-</html>
diff --git a/samples/learning-more/async/calculator-contribution/pom.xml b/samples/learning-more/async/calculator-contribution/pom.xml
new file mode 100644
index 0000000..4e35c33
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-implementation-java-calculator-async-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.java Calculator Async Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java
new file mode 100644
index 0000000..c07e5d2
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java
@@ -0,0 +1,49 @@
+/*
+ * 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 calculator;
+
+import java.util.concurrent.Future;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Async client version of the CalculatorService interface
+ *
+ */
+
+@Remotable
+public interface CalculateReferenceAsync {
+
+ //public Response<String> calculate( Integer i1);
+
+ // Sync
+ public String calculate(Integer i1);
+
+ // Aysnc Poll
+ public Response<String> calculateAsync(Integer i1);
+
+ // Async Callback
+ public Future<String> calculateAsync(Integer i1, AsyncHandler<String> handler);
+
+}
+
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java
new file mode 100644
index 0000000..abaeef8
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java
@@ -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 calculator;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+/**
+ * Handles callbacks to the async client
+ */
+
+public class CalculatorAsyncHandler implements AsyncHandler<String> {
+ public void handleResponse(Response<String> res) {
+ try {
+ System.out.println("Async client callback patern: result in handler = " + res.get());
+ } catch(Exception ex){
+ System.out.println("Async client callback patern: exception in handler = " + ex.getMessage());
+ }
+ }
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000..fd7cfcf
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java
@@ -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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE") @EagerInit
+public class CalculatorClient {
+
+ private CalculatorServiceSync calculatorService;
+
+
+ @Reference
+ public void setCalculatorService(CalculatorServiceSync calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+ System.out.println("calculation=" + calculatorService.calculate(20));
+ }
+
+
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java
new file mode 100644
index 0000000..3979529
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java
@@ -0,0 +1,33 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.ResponseDispatch;
+import org.oasisopen.sca.annotation.AsyncInvocation;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The async Calculator service interface.
+ */
+
+@Remotable
+@AsyncInvocation
+public interface CalculatorServiceAsync {
+ void calculateAsync(Integer n1, ResponseDispatch<String> response);
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java
new file mode 100644
index 0000000..1906f46
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java
@@ -0,0 +1,34 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.ResponseDispatch;
+
+public class CalculatorServiceAsyncImpl implements CalculatorServiceAsync {
+
+ @Override
+ public void calculateAsync(Integer n1, ResponseDispatch<String> response) {
+ int result = n1 + n1;
+ String retval = "async service invoked: " + n1 + " + " + n1 + " = " + result;
+
+ response.sendResponse(retval);
+ }
+
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
new file mode 100644
index 0000000..351ba9c
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java
@@ -0,0 +1,101 @@
+/*
+ * 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 calculator;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+import javax.xml.ws.Response;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * An implementation of the Calculator service which just proxies
+ * to sync and asyn versions of the calculator service. This proxy
+ * exercises the various async interface alternatives
+ */
+public class CalculatorServiceProxyImpl implements CalculatorServiceSync {
+
+ @Reference
+ protected CalculateReferenceAsync calculatorServiceRefSync;
+
+ @Reference
+ protected CalculateReferenceAsync calculatorServiceRefAsync;
+
+ @Override
+ public String calculate(Integer n1) {
+ String result = null;
+
+ // calculate using a sync service
+ System.out.println("Calling sync service");
+ result = calculate(calculatorServiceRefSync, n1);
+
+ // calculate using an aycn service
+ System.out.println("Calling async service");
+ result += calculate(calculatorServiceRefAsync, n1);
+
+ return result;
+ }
+
+ // exercise sync and async versions of a service interface method
+ private String calculate(CalculateReferenceAsync calculatorRef, Integer n1) {
+
+ // sync
+ String result = calculatorRef.calculate(1);
+ System.out.println("Sync client patern: result = " + result);
+
+ // async poll
+ Response<String> response = calculatorRef.calculateAsync(20);
+
+ while (!response.isDone()){
+ System.out.println("Waiting for poll");
+ try {
+ Thread.sleep(500);
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+
+ try {
+ result = response.get();
+ System.out.println("Async client poll patern: result = " + result);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ExecutionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // async callback
+ CalculatorAsyncHandler handler = new CalculatorAsyncHandler();
+ Future<String> future = calculatorRef.calculateAsync(3, handler);
+
+ while (!future.isDone()){
+ System.out.println("Waiting for callback");
+ try {
+ Thread.sleep(500);
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+
+ return result;
+ }
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java
new file mode 100644
index 0000000..c0ed1fa
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The sync Calculator service interface.
+ */
+
+@Remotable
+public interface CalculatorServiceSync {
+ String calculate(Integer n1);
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java
new file mode 100644
index 0000000..a5ab67c
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java
@@ -0,0 +1,31 @@
+/*
+ * 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 calculator;
+
+public class CalculatorServiceSyncImpl implements CalculatorServiceSync {
+
+ @Override
+ public String calculate(Integer n1) {
+ int result = n1 + n1;
+ String retval = "sync service invoked: " + n1 + " + " + n1 + " = " + result;
+ return retval;
+ }
+
+}
diff --git a/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite b/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..6117d43
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,43 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceProxyImpl"/>
+ <reference name="calculatorServiceRefSync" target="CalculatorSync"/>
+ <reference name="calculatorServiceRefAsync" target="CalculatorAsync"/>
+ </component>
+
+ <component name="CalculatorSync">
+ <implementation.java class="calculator.CalculatorServiceSyncImpl"/>
+ </component>
+
+ <component name="CalculatorAsync">
+ <implementation.java class="calculator.CalculatorServiceAsyncImpl"/>
+ <service name="CalculatorServiceAsync">
+ <binding.ws uri="http://localhost:8085/CalculatorAsync"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite b/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite
new file mode 100644
index 0000000..374ef27
--- /dev/null
+++ b/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite
@@ -0,0 +1,30 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="CalculatorClient">
+
+ <component name="CalculatorClient">
+ <implementation.java class="calculator.CalculatorClient"/>
+ <reference name="calculatorService" target="CalculatorServiceComponent" />
+ </component>
+
+</composite>
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/learning-more/async/pom.xml b/samples/learning-more/async/pom.xml
new file mode 100644
index 0000000..0672d09
--- /dev/null
+++ b/samples/learning-more/async/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-tuscany-async</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Samples for Synchronous/Asynchronous invocation</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/learning-more/binding-comet/pom.xml b/samples/learning-more/binding-comet/pom.xml
new file mode 100644
index 0000000..319f5ca
--- /dev/null
+++ b/samples/learning-more/binding-comet/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-comet</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.comet</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>weather-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/learning-more/binding-comet/weather-webapp/deploy.sh b/samples/learning-more/binding-comet/weather-webapp/deploy.sh
new file mode 100755
index 0000000..eb53bd5
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/deploy.sh
@@ -0,0 +1,20 @@
+# 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
+
+#!/bin/bash
+
+mvn clean install
+appcfg.sh update target/comet-webapp
\ No newline at end of file
diff --git a/samples/learning-more/binding-comet/weather-webapp/pom.xml b/samples/learning-more/binding-comet/weather-webapp/pom.xml
new file mode 100644
index 0000000..3f1ce3b
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/pom.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-binding-comet-weather-webapp</artifactId>
+ <packaging>war</packaging>
+ <version>1.0</version>
+ <name>Apache Tuscany SCA Sample binding.comet Weather Webapp</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-comet-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax</groupId>
+ <artifactId>javaee-web-api</artifactId>
+ <version>6.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+</project>
+
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java
new file mode 100644
index 0000000..eecc604
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java
@@ -0,0 +1,34 @@
+/*
+ * 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.sca.sample.comet;
+
+import java.util.Date;
+import java.util.Random;
+
+public final class Helper {
+
+ public static int randomInt(final int max) {
+ return (new Random(new Date().getTime()).nextInt(100));
+ }
+
+ private Helper() {
+ }
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java
new file mode 100644
index 0000000..00cbe73
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java
@@ -0,0 +1,31 @@
+/*
+ * 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.sca.sample.comet;
+
+import org.apache.tuscany.sca.sample.comet.model.Location;
+import org.apache.tuscany.sca.sample.comet.model.Response;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HumidityService {
+
+ Response getHumidity(Location location);
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java
new file mode 100644
index 0000000..afbdcbc
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java
@@ -0,0 +1,31 @@
+/*
+ * 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.sca.sample.comet;
+
+import org.apache.tuscany.sca.sample.comet.model.Location;
+import org.apache.tuscany.sca.sample.comet.model.Response;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface PrecipitationService {
+
+ Response getPrecipitation(Location location);
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java
new file mode 100644
index 0000000..4278ef9
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sca.sample.comet;
+
+import java.util.Date;
+
+import org.apache.tuscany.sca.sample.comet.model.Location;
+import org.apache.tuscany.sca.sample.comet.model.Response;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(PrecipitationService.class)
+public class PrecipitationServiceImpl implements PrecipitationService {
+
+ @Override
+ public Response getPrecipitation(final Location location) {
+ final Response response = new Response();
+ response.setDate(new Date());
+ response.setData(Helper.randomInt(100) + "%");
+ return response;
+ }
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java
new file mode 100644
index 0000000..55f935f
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java
@@ -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.sca.sample.comet;
+
+import java.util.Date;
+
+import org.apache.tuscany.sca.sample.comet.model.Location;
+import org.apache.tuscany.sca.sample.comet.model.Response;
+import org.oasisopen.sca.annotation.Service;
+
+@Service({TemperatureService.class, HumidityService.class})
+public class TemperatureHumidityServiceImpl implements TemperatureService, HumidityService {
+
+ @Override
+ public Response getHumidity(final Location location) {
+ final Response response = new Response();
+ response.setDate(new Date());
+ response.setData(Helper.randomInt(90) + "%");
+ return response;
+ }
+
+ @Override
+ public Response getTemperature(final Location location, final int scale) {
+ final Response response = new Response();
+ response.setDate(new Date());
+ final String data = "" + Helper.randomInt(scale == TemperatureService.CELSIUS ? 40 : 150);
+ response.setData(data);
+ return response;
+ }
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java
new file mode 100644
index 0000000..0929882
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java
@@ -0,0 +1,34 @@
+/*
+ * 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.sca.sample.comet;
+
+import org.apache.tuscany.sca.sample.comet.model.Location;
+import org.apache.tuscany.sca.sample.comet.model.Response;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface TemperatureService {
+
+ public static final int CELSIUS = 1;
+ public static final int FAHRENHEIT = 2;
+
+ Response getTemperature(Location location, int scale);
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java
new file mode 100644
index 0000000..ff2da3a
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java
@@ -0,0 +1,43 @@
+/*
+ * 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.sca.sample.comet.model;
+
+public class Location {
+
+ private String city;
+ private String country;
+
+ public String getCity() {
+ return this.city;
+ }
+
+ public void setCity(final String city) {
+ this.city = city;
+ }
+
+ public String getCountry() {
+ return this.country;
+ }
+
+ public void setCountry(final String country) {
+ this.country = country;
+ }
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java
new file mode 100644
index 0000000..aaa23f0
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java
@@ -0,0 +1,45 @@
+/*
+ * 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.sca.sample.comet.model;
+
+import java.util.Date;
+
+public class Response {
+
+ private Date date;
+ private String data;
+
+ public Date getDate() {
+ return this.date;
+ }
+
+ public void setDate(final Date date) {
+ this.date = date;
+ }
+
+ public String getData() {
+ return this.data;
+ }
+
+ public void setData(final String data) {
+ this.data = data;
+ }
+
+}
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..58630c0
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml
new file mode 100644
index 0000000..8696f76
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
+ <application>tuscany-comet</application>
+ <version>1</version>
+ <sessions-enabled>true</sessions-enabled>
+</appengine-web-app>
\ No newline at end of file
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite
new file mode 100644
index 0000000..05b2ddd
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite
@@ -0,0 +1,45 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Stock">
+
+ <component name="c1">
+ <implementation.java class="org.apache.tuscany.sca.sample.comet.TemperatureHumidityServiceImpl"/>
+ <service name="TemperatureService">
+ <interface.java interface="org.apache.tuscany.sca.sample.comet.TemperatureService"/>
+ <tuscany:binding.comet/>
+ </service>
+ <service name="HumidityService">
+ <interface.java interface="org.apache.tuscany.sca.sample.comet.HumidityService"/>
+ <tuscany:binding.comet/>
+ </service>
+ </component>
+
+ <component name="c2">
+ <implementation.java class="org.apache.tuscany.sca.sample.comet.PrecipitationServiceImpl"/>
+ <service name="PrecipitationService">
+ <interface.java interface="org.apache.tuscany.sca.sample.comet.PrecipitationService"/>
+ <tuscany:binding.comet/>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..25b06c4
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:j2ee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3.0.xsd" version="3.0">
+ <display-name>Apache Tuscany Stock Comet Sample</display-name>
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ <async-supported>true</async-supported>
+ </filter>
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+</web-app>
\ No newline at end of file
diff --git a/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html
new file mode 100644
index 0000000..0387e67
--- /dev/null
+++ b/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html
@@ -0,0 +1,157 @@
+<!--
+ * 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.
+-->
+<html>
+ <head>
+ <title>Apache Tuscany Comet Sample</title>
+ <!-- Tuscany Comet Javascript Toolkit is dependent on jQuery -->
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+ <script type="text/javascript" src="org.apache.tuscany.sca.cometComponentContext.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function()
+ {
+ // Initialization
+ var location = new Object();
+ location.city = null;
+ location.country = null;
+
+ document.getElementById('locationButton').disabled = true;
+ document.getElementById('tempCButton').disabled = true;
+ document.getElementById('tempFButton').disabled = true;
+ document.getElementById('humButton').disabled = true;
+ document.getElementById('precipButton').disabled = true;
+
+ document.getElementById('locationButton').onclick = function(event) {
+ location.city = document.getElementById('city').value;
+ location.country = document.getElementById('country').value;
+ document.getElementById('locationButton').value = 'Switch location';
+ document.getElementById('tempCButton').disabled = false;
+ document.getElementById('tempFButton').disabled = false;
+ document.getElementById('humButton').disabled = false;
+ document.getElementById('precipButton').disabled = false;
+ document.getElementById('tempCText').textContent = 'N/A';
+ document.getElementById('tempCDate').textContent = '';
+ document.getElementById('tempFText').textContent = 'N/A';
+ document.getElementById('tempFDate').textContent = '';
+ document.getElementById('humText').textContent = 'N/A';
+ document.getElementById('humDate').textContent = '';
+ document.getElementById('precipText').textContent = 'N/A';
+ document.getElementById('precipDate').textContent = '';
+ }
+
+ // Tuscany Comet specific API
+
+ document.getElementById('connect').onclick = function(event) {
+ /* transport can be : long-polling or streaming */
+ SCA.TuscanyComet.connect(document.getElementById('transport').value);
+ document.getElementById('connect').disabled = true;
+ document.getElementById('transport').disabled = true;
+ document.getElementById('locationButton').disabled = false;
+ }
+
+
+ document.getElementById('tempCButton').onclick = function(event) {
+ SCA.CometComponentContext.TemperatureService.getTemperature(location, 1, updateTempC);
+ }
+
+ document.getElementById('tempFButton').onclick = function(event) {
+ SCA.CometComponentContext.TemperatureService.getTemperature(location, 2, updateTempF);
+ }
+
+ document.getElementById('humButton').onclick = function(event) {
+ SCA.CometComponentContext.HumidityService.getHumidity(location, updateHum);
+ }
+
+ document.getElementById('precipButton').onclick = function(event) {
+ SCA.CometComponentContext.PrecipitationService.getPrecipitation(location, updatePrecip);
+ }
+ });
+
+ function updateTempC(response) {
+ document.getElementById('tempCText').textContent = response.data;
+ document.getElementById('tempCDate').textContent = response.date;
+ }
+
+ function updateTempF(response) {
+ document.getElementById('tempFText').textContent = response.data;
+ document.getElementById('tempFDate').textContent = response.date;
+ }
+
+ function updateHum(response) {
+ document.getElementById('humText').textContent = response.data;
+ document.getElementById('humDate').textContent = response.date;
+ }
+
+ function updatePrecip(response) {
+ document.getElementById('precipText').textContent = response.data;
+ document.getElementById('precipDate').textContent = response.date;
+ }
+ </script>
+ </head>
+ <body>
+ <div id='sidebar'>
+ <h2>Apache Tuscany Comet Sample</h2>
+ <label>Select transport</label>
+ <select id="transport">
+ <option id="streaming" value="streaming">http streaming</option>
+ <option id="long-polling" value="long-polling">long-polling</option>
+ </select>
+ <input id='connect' type='submit' value='Connect'/>
+ <h3>Weather Monitor</h3>
+ <p/>
+ <table>
+ <tr>
+ <td>City</td>
+ <td><input type="text" id='city' value='Brasov'/></td>
+ </tr>
+ <tr>
+ <td>Country</td>
+ <td><input type="text" id ='country' value='Romania'/></td>
+ </tr>
+ </table>
+ <input type="button" id='locationButton' value='Set location'/>
+ <p/>
+ <table>
+ <tr>
+ <th align="left">Temperature (Celsius):</th>
+ <td><span id='tempCText'>N/A</span></td>
+ <td><input type='button' id='tempCButton' value="Update"/></td>
+ <td><span id='tempCDate'></span>
+ </tr>
+ <tr>
+ <th align="left">Temperature (Fahrenheit):</th>
+ <td><span id='tempFText'>N/A</span></td>
+ <td><input type='button' id='tempFButton' value="Update"/></td>
+ <td><span id='tempFDate'></span>
+ </tr>
+ <tr>
+ <th align="left">Humidity:</th>
+ <td><span id='humText'>N/A</span></td>
+ <td><input type='button' id='humButton' value="Update"/></td>
+ <td><span id='humDate'></span>
+ </tr>
+ <tr>
+ <th align="left">Precipitation probability:</th>
+ <td><span id='precipText'>N/A</span></td>
+ <td><input type='button' id='precipButton' value="Update"/></td>
+ <td><span id='precipDate'></span>
+ </tr>
+ </table>
+ </div>
+ </body>
+</html>
diff --git a/samples/learning-more/binding-jms/helloworld-webapp/README b/samples/learning-more/binding-jms/helloworld-webapp/README
new file mode 100644
index 0000000..580d5e7
--- /dev/null
+++ b/samples/learning-more/binding-jms/helloworld-webapp/README
@@ -0,0 +1,131 @@
+JMS HelloWorld Sample
+=====================
+This sample demonstrates a simple webapp containing a hello world style client
+and service using the JMS binding for request-response style messaging.
+
+The README in the samples directory (the directory three directories above this) provides
+general instructions about building and running samples. Take a look there
+first.
+
+As this sample provides a web app there is a manual step where the WAR file
+that contains the sample is copied to your web app container. If you just want
+to give this sample a go deploy the WAR file (target/helloworld-jms.war )
+to you web application server. Alternatevly, the sample pom.xml is configured
+with the Jetty plugin so you can run the it with Jetty by simply doing "mvn jetty:run".
+
+Once the web app is deployed use your browser to visit the following URL;
+
+http://localhost:8080/helloworld-jms
+
+The port and hostname will of course vary depending on your local installation.
+
+Configuring the JMS resources
+-----------------------------
+
+The sample requires JMS resources be manually configured in the server environment, these are:
+
+- a JMS connection factory named "ConnectionFactory"
+- a JMS queue named "HelloWorldService"
+
+See the following for how to define these resources depending on the application server being used:
+
+Tuscany with embedded ActiveMQ broker
+-------------------------------------
+
+
+Apache Tomcat
+-------------
+
+No configuration is necessary for Tomcat as the sample WAR includes everything pre-configured to run
+an ActiveMQ embedded JMS broker and to configure the JMS resources in JNDI.
+
+The JNDI resources are configured in the META-INF/comtext.xml file, for more information on running
+ActiveMQ in Tomcat see: http://activemq.apache.org/tomcat.html
+
+
+Apache Geronimo
+---------------
+
+For Apache Geronimo 2.0.1 (2.0.2 fails to define JMS resources for me)
+
+Logon to the Geronimo Server Console (http://localhost:8080/console, uid system, pswd manager)
+
+In the Console Navigation on the left under Services click JMS Resources
+
+At the bottom of the JMS Resources panel click under Create a new JMS Resource Group click For ActiveMQ
+
+In Resource Group Name enter "MyRGN" and click next
+
+At JMS Resource Group click Add Connection Factory
+
+For JMS Factory Type choose javax.jms.ConnectionFactory and click Next
+
+In Connection Factory Name enter "ConnectionFactory" and click Next
+
+Click Add destination
+
+For JMS Destination Type choose javax.jms.Queue and click Next
+
+Enter "HelloWorldService" for both Message Destination Name and PhysicalName and click Next
+
+Click Deploy Now
+
+Thats it, you're done.
+
+
+WebSphere
+---------
+
+To define the JMS resources in a new WebSphere Application Server 6.1 installation:
+
+1) First define a Service integration bus:
+
+Logon to the WebSphere Integrated Solutions Console (http://localhost:9060/ibm/console)
+
+On the Left hand menu expand Service integration, and click on Buses.
+
+In the Buses panel click on New
+
+Enter a name for the bus, eg MyBus, and click Next, and then click Finish and Save the changes.
+
+In the Buses panel click on MyBus
+
+Find the Topology secion and click on Bus members
+
+Click on Add, leave the defaults and click Next, Next, Next, Finish, and Save the changes.
+
+Restart WebSphere and when back up logon back on to the Integrated Solutions Console
+
+2) Now define the JMS rescources
+
+On the Left hand menu expand Resources, and JMS and click on Connection Facotories.
+
+In the Connection factories panel click New.
+
+Leave the Default messaging provider and click OK
+
+Enter "ConnectionFactory" in the Name and JNDI name and in the Bus name in the Connection pane choose MyBus and click OK
+
+On the Left hand menu in JMS click on Queues
+
+In the Queues panel click New, accept the defaults and click OK
+
+Enter "HelloWorldService" for the Name and JNDI name and in the Bus name in the Connection pane choose MyBus,
+and then in the Queue name drop down list choose "Create SIB destination"
+
+In the Set queue attributes panel enter "HelloWorldService" for the Identifier and click Next, Next, and Finish
+
+That should take you back to the Queues panel where you can click OK to create the new JMS queue.
+
+Save the changes
+
+Restart WebSphere and you're done.
+
+
+
+Others...
+---------
+
+
+
+
diff --git a/samples/learning-more/binding-jms/helloworld-webapp/pom.xml b/samples/learning-more/binding-jms/helloworld-webapp/pom.xml
new file mode 100644
index 0000000..b0660de
--- /dev/null
+++ b/samples/learning-more/binding-jms/helloworld-webapp/pom.xml
@@ -0,0 +1,96 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-binding-jms-helloworld-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample binding.jms HelloWorld WebApp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-all</artifactId>
+ <version>5.3.0</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-jms</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-jms</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldClient.java b/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldClient.java
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java
diff --git a/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldService.java b/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldService.java
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java
diff --git a/samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldServiceImpl.java b/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/java/sample/HelloWorldServiceImpl.java
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java
diff --git a/samples/webapps/helloworld-jms/src/main/webapp/META-INF/context.xml b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/webapp/META-INF/context.xml
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml
diff --git a/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/jetty-env.xml b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/jetty-env.xml
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml
diff --git a/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite
new file mode 100644
index 0000000..b5d8c70
--- /dev/null
+++ b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite
@@ -0,0 +1,44 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloWorldClientComponent"/>
+ </component>
+
+ <component name="HelloWorldClientComponent">
+ <implementation.java class="sample.HelloWorldClient"/>
+ <reference name="helloWorldRef">
+ <binding.jms uri="jms:queue:HelloWorldService"/>
+ </reference>
+ </component>
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java class="sample.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <binding.jms />
+ </service>
+ </component>
+
+</composite>
diff --git a/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-jms/src/main/webapp/hello.jsp b/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp
similarity index 100%
rename from samples/webapps/helloworld-jms/src/main/webapp/hello.jsp
rename to samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp
diff --git a/samples/learning-more/binding-jms/pom.xml b/samples/learning-more/binding-jms/pom.xml
new file mode 100644
index 0000000..673fd96
--- /dev/null
+++ b/samples/learning-more/binding-jms/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-jms</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.jms</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-rmi/README b/samples/learning-more/binding-jsonrpc/README
similarity index 100%
copy from samples/binding-rmi/README
copy to samples/learning-more/binding-jsonrpc/README
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/README b/samples/learning-more/binding-jsonrpc/calculator-contribution/README
new file mode 100644
index 0000000..1e5bc9c
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/README
@@ -0,0 +1,26 @@
+Calculator Sample Contribution
+==============================
+
+This sample contribution implements a simple calculator using SCA components.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive) Take a look there for instructions on how to launch
+this sample contribution.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+Amongst the other output created by the launcher/contribution combination, you should see the following output ...
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml b/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml
new file mode 100644
index 0000000..00abb65
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml
@@ -0,0 +1,57 @@
+<!--
+ * 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 name="sample-binding-jsonrpc-calculator-contribution" default="compile">
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-jsonrpc-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
+
+
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml b/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml
new file mode 100644
index 0000000..0be4221
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-jsonrpc-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.jsonrpc Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java
new file mode 100644
index 0000000..bb39e96
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java
@@ -0,0 +1,88 @@
+/*
+ * 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 calculator;
+
+public class AddBean {
+
+ protected double n1;
+ protected double n2;
+ protected double n3;
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ public double getN1() {
+ return n1;
+ }
+
+ public void setN1(double n1) {
+ this.n1 = n1;
+ }
+
+ public double getN2() {
+ return n2;
+ }
+
+ public void setN2(double n2) {
+ this.n2 = n2;
+ }
+
+ public double getN3() {
+ return n3;
+ }
+
+ public void setN3(double n3) {
+ this.n3 = n3;
+ }
+
+ public Boolean getB() {
+ return b;
+ }
+
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..03e844d
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java
@@ -0,0 +1,32 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Add service interface
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+ AddBean addComplexParam(AddBean aBean);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..8eabfa6
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,43 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Add service
+ */
+@Service(AddService.class)
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+ public AddBean addComplexParam(AddBean aBean) {
+ aBean.setN3(aBean.getN1() + aBean.getN2());
+ return aBean;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000..1df1f31
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java
@@ -0,0 +1,52 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE")
+@EagerInit
+public class CalculatorClient {
+
+ private CalculatorService calculatorService;
+
+ @Reference
+ public void setCalculatorService(CalculatorService calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+ // Calculate
+ System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..78eea39
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..d32cc73
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,86 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ AddBean aBean = new AddBean();
+ // So data to test different types
+ aBean.setB(true);
+ aBean.setS("Fred");
+ aBean.setX(27);
+ aBean.setY(58);
+
+ // the numbers to be added
+ aBean.setN1(n1);
+ aBean.setN2(n2);
+
+ aBean = addService.addComplexParam(aBean);
+
+ return aBean.getN3();
+ //return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000..ddd7b9c
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Divide service.
+ */
+@Service(DivideService.class)
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000..cc0de49
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Multiply service.
+ */
+@Service(MultiplyService.class)
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000..22e95f7
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the subtract service.
+ */
+@Service(SubtractService.class)
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..5f1add2
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,53 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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"/>
+ <service name="AddService">
+ <tuscany:binding.jsonrpc uri="http://localhost:8085/AddServiceComponent/AddService"/>
+ </service>
+ </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>
+
+</composite>
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite
rename to samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..1952eb4
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,50 @@
+/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * A unit test of the basic Java implementation classes in this contribution
+ * without using SCA
+ */
+public class CalculatorTestCase {
+
+ @Test
+ public void testCalculator() throws Exception {
+ AddService add = new AddServiceImpl();
+ SubtractService subtract = new SubtractServiceImpl();
+ MultiplyService multiply = new MultiplyServiceImpl();
+ DivideService divide = new DivideServiceImpl();
+
+ CalculatorServiceImpl calculator = new CalculatorServiceImpl();
+
+ calculator.setAddService(add);
+ calculator.setSubtractService(subtract);
+ calculator.setMultiplyService(multiply);
+ calculator.setDivideService(divide);
+
+ assertEquals(calculator.add(3, 2), 5.0, 0);
+ assertEquals(calculator.subtract(3, 2), 1.0, 0);
+ assertEquals(calculator.multiply(3, 2), 6.0, 0);
+ assertEquals(calculator.divide(3, 2), 1.5, 0);
+ }
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml b/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml
new file mode 100644
index 0000000..36714c6
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml
@@ -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.
+-->
+<project name="DojoZipInstaller">
+
+
+ <property name="dojo.version" value="1.3.0"/>
+ <property name="dojo.zip" value="${localRepository}/org/dojotoolkit/dojo/${dojo.version}/dojo-${dojo.version}.zip"/>
+ <property name="unpack.location" value="${basedir}/src/main/webapp/dojo"/>
+
+
+ <target name="check-dojo-installed">
+ <condition property="already.installed" >
+ <available file="${localRepository}/org/dojotoolkit/dojo/${dojo.version}/dojo-${dojo.version}.zip"/>
+ </condition>
+ </target>
+
+ <target name="check-dojo-unpacked">
+ <condition property="already.unpacked" >
+ <available file="${unpack.location}"/>
+ </condition>
+ </target>
+
+ <target name="unpack-dojo-files" depends="check-dojo-installed, check-dojo-unpacked" unless="already.unpacked">
+ <fail message="dojo zip file not installed in local repository: ${localRepository}" unless="already.installed"/>
+ <mkdir dir="${basedir}/target/dojo-unpack-temp/"/>
+ <unzip src="${localRepository}/org/dojotoolkit/dojo/${dojo.version}/dojo-${dojo.version}.zip"
+ dest="${basedir}/target/dojo-unpack-temp/"
+ overwrite="false"
+ encoding="native-encoding">
+ <patternset>
+ <include name="dojo-${dojo.version}/dojo/**"/>
+ <exclude name="dojo-${dojo.version}/dojo/tests/**"/>
+ <exclude name="dojo-${dojo.version}/dijit/**"/>
+ <exclude name="dojo-${dojo.version}/dojox/**"/>
+ <exclude name="dojo-${dojo.version}/util/**"/>
+ </patternset>
+ </unzip>
+ <move file="${basedir}/target/dojo-unpack-temp/dojo-${dojo.version}"
+ tofile="${unpack.location}"
+ verbose="true"/>
+ <delete dir="${basedir}/target/dojo-unpack-temp/"/>
+ </target>
+
+ <target name="clean-dojo-files">
+ <delete dir="${unpack.location}"/>
+ </target>
+</project>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml b/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml
new file mode 100644
index 0000000..e4a7b49
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml
@@ -0,0 +1,126 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-jsonrpc-calculator-webapp</artifactId>
+ <name>Apache Tuscany SCA Sample binding.jsonrpc Calculator WebApp</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webapp</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.dojotoolkit</groupId>
+ <artifactId>dojo</artifactId>
+ <version>1.3.0</version>
+ <type>zip</type>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dojo-files</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="./build-dojo.xml" target="unpack-dojo-files">
+ <property name="localRepository" value="${settings.localRepository}"/>
+ <property name="artifactId" value="${artifactId}"/>
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ <execution>
+ <id>clean-dojo-files</id>
+ <phase>clean</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="./build-dojo.xml" target="clean-dojo-files">
+ <property name="localRepository" value="${settings.localRepository}"/>
+ <property name="artifactId" value="${artifactId}"/>
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java
new file mode 100644
index 0000000..71724ee
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java
@@ -0,0 +1,90 @@
+/*
+ * 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 calculator;
+
+public class AddBean {
+ private static final String DEFAULT_S = "default string";
+ private static final Boolean DEFAULT_B = false;
+
+ protected double n1;
+ protected double n2;
+ protected double n3;
+
+ protected Boolean b;
+ protected String s;
+ protected int x;
+ protected Integer y;
+
+ public double getN1() {
+ return n1;
+ }
+
+ public void setN1(double n1) {
+ this.n1 = n1;
+ }
+
+ public double getN2() {
+ return n2;
+ }
+
+ public void setN2(double n2) {
+ this.n2 = n2;
+ }
+
+ public double getN3() {
+ return n3;
+ }
+
+ public void setN3(double n3) {
+ this.n3 = n3;
+ }
+
+ public Boolean getB() {
+ return b;
+ }
+
+ public void setB(Boolean b) {
+ this.b = b;
+ }
+
+ public String getS() {
+ return s;
+ }
+
+ public void setS(String s) {
+ this.s = s;
+ }
+
+ public int getX() {
+ return x;
+ }
+
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ public Integer getY() {
+ return y;
+ }
+
+ public void setY(Integer y) {
+ this.y = y;
+ }
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..03e844d
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java
@@ -0,0 +1,32 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Add service interface
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+ AddBean addComplexParam(AddBean aBean);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..e16b352
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,44 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Add service
+ */
+@Service(AddService.class)
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+ public AddBean addComplexParam(AddBean aBean) {
+ aBean.setN3(aBean.getN1() + aBean.getN2());
+ System.out.println("Adding " + aBean.getN1() + " to " + aBean.getN1() + " gives " + aBean.getN3());
+ return aBean;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..78eea39
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..d32cc73
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,86 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ AddBean aBean = new AddBean();
+ // So data to test different types
+ aBean.setB(true);
+ aBean.setS("Fred");
+ aBean.setX(27);
+ aBean.setY(58);
+
+ // the numbers to be added
+ aBean.setN1(n1);
+ aBean.setN2(n2);
+
+ aBean = addService.addComplexParam(aBean);
+
+ return aBean.getN3();
+ //return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000..ddd7b9c
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Divide service.
+ */
+@Service(DivideService.class)
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000..cc0de49
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Multiply service.
+ */
+@Service(MultiplyService.class)
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000..22e95f7
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the subtract service.
+ */
+@Service(SubtractService.class)
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite
new file mode 100644
index 0000000..dc0df87
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite
@@ -0,0 +1,53 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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"/>
+ <service name="AddService">
+ <tuscany:binding.jsonrpc />
+ </service>
+ </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>
+
+</composite>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..b7e216b
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Contribution binding-jsonrpc Calculator WebApp Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>calculate.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html
new file mode 100644
index 0000000..6d22806
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html
@@ -0,0 +1,62 @@
+<!--
+ * 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.
+-->
+<html>
+
+<head>
+ <title>Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample</title>
+
+ <script type="text/javascript" src="dojo/dojo/dojo.js"></script>
+
+ <script language="JavaScript">
+ dojo.require("dojo.rpc.JsonService");
+
+ var addService = new dojo.rpc.JsonService("AddServiceComponent/AddService?smd");
+
+ function calculate() {
+ var addRequest = new Object();
+ addRequest.n1 = 1;
+ addRequest.n2 = 1;
+ addRequest.n3 = 0;
+ addRequest.b = true;
+ addRequest.s = "fred";
+ addRequest.x = 2;
+ addRequest.y = 3;
+
+ addService.addComplexParam(addRequest).addCallback(calculateResponse);
+ }
+
+ function calculateResponse(reply) {
+ document.getElementById('result').innerHTML=reply.n3;
+ }
+
+ </script>
+
+</head>
+
+<body>
+
+<h2>Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample</h2>
+
+ 1 + 1 =
+ <button name="submit" onclick="calculate()">Calculate</button>
+
+ <div id='result'/>
+
+</body>
+</html>
diff --git a/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..1952eb4
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,50 @@
+/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * A unit test of the basic Java implementation classes in this contribution
+ * without using SCA
+ */
+public class CalculatorTestCase {
+
+ @Test
+ public void testCalculator() throws Exception {
+ AddService add = new AddServiceImpl();
+ SubtractService subtract = new SubtractServiceImpl();
+ MultiplyService multiply = new MultiplyServiceImpl();
+ DivideService divide = new DivideServiceImpl();
+
+ CalculatorServiceImpl calculator = new CalculatorServiceImpl();
+
+ calculator.setAddService(add);
+ calculator.setSubtractService(subtract);
+ calculator.setMultiplyService(multiply);
+ calculator.setDivideService(divide);
+
+ assertEquals(calculator.add(3, 2), 5.0, 0);
+ assertEquals(calculator.subtract(3, 2), 1.0, 0);
+ assertEquals(calculator.multiply(3, 2), 6.0, 0);
+ assertEquals(calculator.divide(3, 2), 1.5, 0);
+ }
+}
diff --git a/samples/learning-more/binding-jsonrpc/pom.xml b/samples/learning-more/binding-jsonrpc/pom.xml
new file mode 100644
index 0000000..2b45e22
--- /dev/null
+++ b/samples/learning-more/binding-jsonrpc/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-jsonrpc</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.jsonrpc</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ <module>calculator-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-rmi/README b/samples/learning-more/binding-rmi/README
similarity index 100%
rename from samples/binding-rmi/README
rename to samples/learning-more/binding-rmi/README
diff --git a/samples/binding-rmi/contribution-calculator-reference/README b/samples/learning-more/binding-rmi/calculator-reference-contribution/README
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/README
rename to samples/learning-more/binding-rmi/calculator-reference-contribution/README
diff --git a/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml b/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml
new file mode 100644
index 0000000..06f6ba8
--- /dev/null
+++ b/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml
@@ -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.
+-->
+
+<project name="sample-binding-rmi-calculator-reference-contribution" default="compile">
+
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-rmi-calculator-reference-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+</project>
+
+
diff --git a/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml b/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml
new file mode 100644
index 0000000..5040e49
--- /dev/null
+++ b/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-rmi-calculator-reference-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.rmi Calculator Reference Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/AddService.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/AddService.java
copy to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorService.java
rename to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorServiceImpl.java
copy to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/DivideService.java
copy to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java
copy to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/SubtractService.java
copy to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/resources/CalculatorRMIReference.composite b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/resources/CalculatorRMIReference.composite
rename to samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
rename to samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java b/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/test/java/calculator/CalculatorRMIServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-service/README b/samples/learning-more/binding-rmi/calculator-service-contribution/README
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/README
rename to samples/learning-more/binding-rmi/calculator-service-contribution/README
diff --git a/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml b/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml
new file mode 100644
index 0000000..79ec168
--- /dev/null
+++ b/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml
@@ -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.
+-->
+
+<project name="sample-binding-rmi-calculator-service-contribution" default="compile">
+
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-rmi-calculator-service-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+</project>
+
+
diff --git a/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml b/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml
new file mode 100644
index 0000000..84ed2d7
--- /dev/null
+++ b/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-rmi-calculator-service-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.rmi Calculator Service Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/AddService.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/AddService.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/AddServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorClient.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/CalculatorService.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/CalculatorServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/DivideService.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/DivideServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java
similarity index 100%
copy from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java
copy to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/MultiplyServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/SubtractService.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/java/calculator/SubtractServiceImpl.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/resources/CalculatorRMIServer.composite b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/resources/CalculatorRMIServer.composite
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite
diff --git a/samples/binding-rmi/contribution-calculator-service/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/binding-rmi/contribution-calculator-service/src/test/java/calculator/CalculatorRMIServerTestCase.java b/samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
rename to samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java
diff --git a/samples/learning-more/binding-rmi/pom.xml b/samples/learning-more/binding-rmi/pom.xml
new file mode 100644
index 0000000..762310c
--- /dev/null
+++ b/samples/learning-more/binding-rmi/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-rmi</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.rmi</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-reference-contribution</module>
+ <module>calculator-service-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-sca/README b/samples/learning-more/binding-sca/README
similarity index 100%
rename from samples/binding-sca/README
rename to samples/learning-more/binding-sca/README
diff --git a/samples/binding-sca/contribution-calculator/README b/samples/learning-more/binding-sca/calculator-contribution/README
similarity index 100%
rename from samples/binding-sca/contribution-calculator/README
rename to samples/learning-more/binding-sca/calculator-contribution/README
diff --git a/samples/learning-more/binding-sca/calculator-contribution/build.xml b/samples/learning-more/binding-sca/calculator-contribution/build.xml
new file mode 100644
index 0000000..8fef755
--- /dev/null
+++ b/samples/learning-more/binding-sca/calculator-contribution/build.xml
@@ -0,0 +1,57 @@
+<!--
+ * 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 name="sample-binding-sca-calculator-contribution" default="compile">
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-sca-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
+
+
diff --git a/samples/learning-more/binding-sca/calculator-contribution/pom.xml b/samples/learning-more/binding-sca/calculator-contribution/pom.xml
new file mode 100644
index 0000000..aa95b0b
--- /dev/null
+++ b/samples/learning-more/binding-sca/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-sca-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.sca Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/AddService.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/AddService.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/AddServiceImpl.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorClient.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorService.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/CalculatorServiceImpl.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/DivideService.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/DivideServiceImpl.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
diff --git a/samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java
similarity index 100%
rename from samples/binding-rmi/contribution-calculator-reference/src/main/java/calculator/MultiplyService.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/MultiplyServiceImpl.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/SubtractService.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/java/calculator/SubtractServiceImpl.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/Calculator.composite b/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/main/resources/Calculator.composite
rename to samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite b/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite
similarity index 100%
copy from samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite
copy to samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
copy from samples/binding-sca/contribution-calculator/src/main/resources/META-INF/sca-contribution.xml
copy to samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/binding-sca/contribution-calculator/src/test/java/calculator/CalculatorTestCase.java b/samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
similarity index 100%
rename from samples/binding-sca/contribution-calculator/src/test/java/calculator/CalculatorTestCase.java
rename to samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
diff --git a/samples/learning-more/binding-sca/pom.xml b/samples/learning-more/binding-sca/pom.xml
new file mode 100644
index 0000000..6f96249
--- /dev/null
+++ b/samples/learning-more/binding-sca/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-sca</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.sca</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-rmi/README b/samples/learning-more/binding-ws/README
similarity index 100%
copy from samples/binding-rmi/README
copy to samples/learning-more/binding-ws/README
diff --git a/samples/learning-more/binding-ws/calculator-contribution/README b/samples/learning-more/binding-ws/calculator-contribution/README
new file mode 100644
index 0000000..a1f34e0
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/README
@@ -0,0 +1,25 @@
+Calculator Contribution Sample
+==============================
+
+This directory contains code which implements a simple calculator SCA contribution.
+
+The contribution can be run as a tuscany application using one of the tuscany launchers
+as described in the README in the root directory of the samples.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The launcher exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+You should see the following output (depending on the launcher you use, this output
+may be surrounded by other output).
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
+
diff --git a/samples/learning-more/binding-ws/calculator-contribution/build.xml b/samples/learning-more/binding-ws/calculator-contribution/build.xml
new file mode 100644
index 0000000..ab27460
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/build.xml
@@ -0,0 +1,55 @@
+<!--
+ * 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 name="sample-binding-ws-calculator-contribution" default="compile">
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-ws-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+</project>
diff --git a/samples/contribution-binding-ws-calculator/calculator.odg b/samples/learning-more/binding-ws/calculator-contribution/calculator.odg
similarity index 100%
rename from samples/contribution-binding-ws-calculator/calculator.odg
rename to samples/learning-more/binding-ws/calculator-contribution/calculator.odg
Binary files differ
diff --git a/samples/contribution-binding-ws-calculator/calculator.png b/samples/learning-more/binding-ws/calculator-contribution/calculator.png
similarity index 100%
rename from samples/contribution-binding-ws-calculator/calculator.png
rename to samples/learning-more/binding-ws/calculator-contribution/calculator.png
Binary files differ
diff --git a/samples/learning-more/binding-ws/calculator-contribution/pom.xml b/samples/learning-more/binding-ws/calculator-contribution/pom.xml
new file mode 100644
index 0000000..7d1a89f
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/pom.xml
@@ -0,0 +1,54 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-ws-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.ws Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..138213b
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java
@@ -0,0 +1,31 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Add service interface
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..caf4d35
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..ad87375
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+
+/**
+ * The Calculator service interface.
+ */
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..d3fa7a8
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
@@ -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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000..cd91935
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000..c85357f
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000..1b66908
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite b/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..3688ebc
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,54 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" >
+ <binding.ws uri="http://localhost:8085/AddServiceComponent"/>
+ </reference>
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ <service name="AddService">
+ <binding.ws uri="http://localhost:8085/AddServiceComponent"/>
+ </service>
+ </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>
+
+</composite>
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..3a7548c
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
+</contribution>
\ No newline at end of file
diff --git a/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..1952eb4
--- /dev/null
+++ b/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,50 @@
+/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * A unit test of the basic Java implementation classes in this contribution
+ * without using SCA
+ */
+public class CalculatorTestCase {
+
+ @Test
+ public void testCalculator() throws Exception {
+ AddService add = new AddServiceImpl();
+ SubtractService subtract = new SubtractServiceImpl();
+ MultiplyService multiply = new MultiplyServiceImpl();
+ DivideService divide = new DivideServiceImpl();
+
+ CalculatorServiceImpl calculator = new CalculatorServiceImpl();
+
+ calculator.setAddService(add);
+ calculator.setSubtractService(subtract);
+ calculator.setMultiplyService(multiply);
+ calculator.setDivideService(divide);
+
+ assertEquals(calculator.add(3, 2), 5.0, 0);
+ assertEquals(calculator.subtract(3, 2), 1.0, 0);
+ assertEquals(calculator.multiply(3, 2), 6.0, 0);
+ assertEquals(calculator.divide(3, 2), 1.5, 0);
+ }
+}
diff --git a/samples/helloworld-ws-sdo/README b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README
similarity index 100%
rename from samples/helloworld-ws-sdo/README
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README
diff --git a/samples/helloworld-ws-sdo/build.xml b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml
similarity index 100%
rename from samples/helloworld-ws-sdo/build.xml
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml
diff --git a/samples/helloworld-ws-sdo/helloworld-ws-sdo.png b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png
similarity index 100%
rename from samples/helloworld-ws-sdo/helloworld-ws-sdo.png
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png
Binary files differ
diff --git a/samples/helloworld-ws-sdo/maven-eclipse.xml b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml
similarity index 100%
rename from samples/helloworld-ws-sdo/maven-eclipse.xml
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml
diff --git a/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml
new file mode 100644
index 0000000..7ec782f
--- /dev/null
+++ b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml
@@ -0,0 +1,180 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-binding-ws-helloworld-ws-sdo-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample binding.ws HelloWorld Web Service SDO Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-lib</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/sdo-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>generate-helloworld-sdo</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/wsdl/helloworld.wsdl</schemaFile>
+ <javaPackage>helloworld</javaPackage>
+ <prefix>Helloworld</prefix>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-helloworld-sdo1</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/test.xsd</schemaFile>
+ <javaPackage>model.sdo</javaPackage>
+ <prefix>Entity</prefix>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldClient.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldImpl.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServer.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldService.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/helloworld/HelloWorldServiceComponent.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java
diff --git a/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java
diff --git a/samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/helloworld-ws-sdo/src/main/resources/helloworldws.composite b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/helloworldws.composite
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite
diff --git a/samples/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/helloworldwsclient.composite
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite
diff --git a/samples/helloworld-ws-sdo/src/main/resources/logging.properties b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/logging.properties
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties
diff --git a/samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite
diff --git a/samples/helloworld-ws-sdo/src/main/resources/test.xsd b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/test.xsd
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd
diff --git a/samples/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl
similarity index 100%
rename from samples/helloworld-ws-sdo/src/main/resources/wsdl/helloworld.wsdl
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl
diff --git a/samples/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldClientTestCase.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java
diff --git a/samples/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/test/java/helloworld/HelloWorldTestServer.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java
diff --git a/samples/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java b/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java
similarity index 100%
rename from samples/helloworld-ws-sdo/src/test/java/helloworld/TestCaseRunner.java
rename to samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java
diff --git a/samples/learning-more/binding-ws/pom.xml b/samples/learning-more/binding-ws/pom.xml
new file mode 100644
index 0000000..5316373
--- /dev/null
+++ b/samples/learning-more/binding-ws/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-binding-ws</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample binding.ws</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ <!--module>helloworld-ws-sdo-contribution</module-->
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/dosgi-dynamic-calculator-operations/LICENSE b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/LICENSE
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE
diff --git a/samples/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF
diff --git a/samples/dosgi-dynamic-calculator-operations/NOTICE b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/NOTICE
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml
diff --git a/samples/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml
diff --git a/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README
new file mode 100644
index 0000000..9cd41b0
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README
@@ -0,0 +1,196 @@
+Distributed OSGi Calculator Sample
+==================================
+This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. (where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive). Take a look there first (noting at you read it that this sample
+is not a new style sample).
+
+On Windows, run
+java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console -Dorg.osgi.sca.domain.registry=tribes:default
+
+On *Unix, run
+java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console -Dorg.osgi.sca.domain.registry=tribes:default
+
+You should see the osgi console:
+
+osgi>
+
+You can run "ss" command under the osgi> to see the status of the bundles.
+osgi> ss
+
+Then you can install and start the calculator.dosgi bundle:
+
+osgi> install file:./target/sample-dosgi-dynamic-calculator-operations.jar
+Bundle id is 198
+
+osgi> start 198
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
+t
+INFO: Starting calculator.dosgi.dynamic.operations_1.0.0 [198]
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
+t
+INFO: Registering calculator.dosgi.operations.AddService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
+INFO: Starting node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6 domai
+n: tuscany.apache.org
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
+rvice
+INFO: RMI service registered: rmi://localhost:8085/AddService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl addEndpoint
+INFO: Add endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-4486-
+87eb-07ece11888f6#service-binding(AddService/Add)
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
+t
+INFO: Registering calculator.dosgi.operations.SubtractService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
+INFO: Starting node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35 domai
+n: tuscany.apache.org
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
+rvice
+INFO: RMI service registered: rmi://localhost:8085/SubtractService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl addEndpoint
+INFO: Add endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-41f0
+-b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
+t
+INFO: Registering calculator.dosgi.operations.MultiplyService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
+INFO: Starting node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057 domai
+n: tuscany.apache.org
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
+rvice
+INFO: RMI service registered: rmi://localhost:8085/MultiplyService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl addEndpoint
+INFO: Add endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47b3-
+bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator star
+t
+INFO: Registering calculator.dosgi.operations.DivideService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.node.impl.NodeImpl start
+INFO: Starting node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98 domai
+n: tuscany.apache.org
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost registerSe
+rvice
+INFO: RMI service registered: rmi://localhost:8085/DivideService
+Nov 4, 2009 5:16:51 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl addEndpoint
+INFO: Add endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-444e-
+b22a-06d347ab7e98#service-binding(DivideService/Divide)
+Nov 4, 2009 5:16:51 PM calculator.dosgi.operations.impl.OperationsActivator getB
+undle
+INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
+gi.dynamic.operations
+
+osgi>
+
+To stop the bundle:
+
+osgi> stop 198
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl endpointRemoved
+INFO: Remove endpoint - (@8010288)Endpoint: URI = osgi.service.b43555f0-9509-44
+4e-b22a-06d347ab7e98#service-binding(DivideService/Divide)
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
+Service
+INFO: RMI service unregistered: rmi://localhost:8085/DivideService
+Nov 4, 2009 5:18:43 PM calculator.dosgi.operations.impl.OperationsActivator stop
+
+INFO: Stopping calculator.dosgi.dynamic.operations_1.0.0 [198]
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.d3cadb93-e9b9-4486-87eb-07ece11888f6
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl endpointRemoved
+INFO: Remove endpoint - (@8144744)Endpoint: URI = osgi.service.d3cadb93-e9b9-44
+86-87eb-07ece11888f6#service-binding(AddService/Add)
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
+Service
+INFO: RMI service unregistered: rmi://localhost:8085/AddService
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.b6259ccc-6ae4-41f0-b61b-c5a8c7f42b35
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl endpointRemoved
+INFO: Remove endpoint - (@30229114)Endpoint: URI = osgi.service.b6259ccc-6ae4-4
+1f0-b61b-c5a8c7f42b35#service-binding(SubtractService/Subtract)
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
+Service
+INFO: RMI service unregistered: rmi://localhost:8085/SubtractService
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.8469c64c-9a28-47b3-bc4a-c5fa8d471057
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl endpointRemoved
+INFO: Remove endpoint - (@3312704)Endpoint: URI = osgi.service.8469c64c-9a28-47
+b3-bc4a-c5fa8d471057#service-binding(MultiplyService/Multiply)
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.host.rmi.DefaultRMIHost unregister
+Service
+INFO: RMI service unregistered: rmi://localhost:8085/MultiplyService
+Nov 4, 2009 5:18:43 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.b43555f0-9509-444e-b22a-06d347ab7e98
+
+osgi>
+
+To exit the console, run:
+osgi> exit
+
+Sample Overview
+---------------
+The application consists of two OSGi bundles:
+ * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
+ consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
+ * The operations bundle: It provides the add/subtract/multiply/divide services.
+ (See ../samples/dosgi-dynamic-calculator-operations)
+
+
+dosgi-dynamic-calculator-operations/
+ src/
+ main/
+ java/
+ calculator/
+ dosgi/
+ operations/
+ AddService.java - Interface for Add
+ SubtractService.java - Interface for Subtract
+ MultiplyService.java - Interface for Multiply
+ DivideService.java - Interface for Divide
+ impl/
+ OperationsActivator.java - OSGi bundle activator
+ AddServiceImpl.java - Implementation for Add
+ SubtractServiceImpl.java - Implementation for Subtract
+ MultiplyServiceImpl.java - Implementation for Multiply
+ DivideServiceImpl.java - Implementation for Divide
+ resources/
+ META-INF/
+ sca-contribution.xml
+ OSGI-INF/
+ sca-config/
+ operations-config.xml - The SCA configuration file for OSGi remote services
+ test/
+ java/
+ src/
+ calculator/
+ dosgi/
+ operations/
+ test/
+ OperationsOSGiNodeTestCase.java - The JUNIT test case that tests this bundle using a RMI client
+
+ META-INF/
+ MANIFEST.MF - The OSGi manifest for this bundle
+ pom.xml - the Maven build file
+
+
+
+Building And Running The Test Case Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd dosgi-dynamic-calculator-operations
+mvn
+
diff --git a/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml
new file mode 100644
index 0000000..e3501ff
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml
@@ -0,0 +1,148 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-dynamic-calculator-operations</artifactId>
+ <name>Apache Tuscany SCA Sample OSGi Remote Services Dynamic Calculator Operations</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-all</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
diff --git a/samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
diff --git a/samples/dosgi-dynamic-calculator/LICENSE b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE
similarity index 100%
rename from samples/dosgi-dynamic-calculator/LICENSE
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE
diff --git a/samples/dosgi-dynamic-calculator/META-INF/MANIFEST.MF b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF
similarity index 100%
rename from samples/dosgi-dynamic-calculator/META-INF/MANIFEST.MF
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF
diff --git a/samples/dosgi-dynamic-calculator/NOTICE b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE
similarity index 100%
rename from samples/dosgi-dynamic-calculator/NOTICE
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE
diff --git a/samples/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml
diff --git a/samples/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml
diff --git a/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
new file mode 100644
index 0000000..195fa9e
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+<!-- A consumer-side service description file for RFC 119 -->
+<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+ <!-- Describe a remote OSGi service -->
+ <endpoint-description>
+ <property name="objectClass" value="calculator.dosgi.operations.AddService" />
+ <property name="remote.configs.supported" value="org.osgi.sca"/>
+ <property name="service.imported.configs" value="org.osgi.sca"/>
+ <property name="sca.reference" value="addService"/>
+<!-- ##############################################################################################################-->
+<!-- Property org.osgi.sca.bindings can be removed when running with -Dorg.osgi.sca.domain.registry=tribes:default -->
+ <property name="org.osgi.sca.bindings">
+ <list>
+ <value>{http://sample}Add</value>
+ </list>
+ </property>
+<!-- ##############################################################################################################-->
+ </endpoint-description>
+ <endpoint-description>
+ <property name="objectClass" value="calculator.dosgi.operations.SubtractService" />
+ <property name="service.imported.configs" value="org.osgi.sca"/>
+ <property name="remote.configs.supported" value="org.osgi.sca"/>
+ <property name="sca.reference" value="subtractService"/>
+<!-- ##############################################################################################################-->
+<!-- Property org.osgi.sca.bindings can be removed when running with -Dorg.osgi.sca.domain.registry=tribes:default -->
+ <property name="org.osgi.sca.bindings">
+ <list>
+ <value>{http://sample}Subtract</value>
+ </list>
+ </property>
+<!-- ##############################################################################################################-->
+ </endpoint-description>
+ <endpoint-description>
+ <property name="objectClass" value="calculator.dosgi.operations.MultiplyService" />
+ <property name="service.imported.configs" value="org.osgi.sca"/>
+ <property name="remote.configs.supported" value="org.osgi.sca"/>
+ <property name="sca.reference" value="multiplyService"/>
+<!-- ##############################################################################################################-->
+<!-- Property org.osgi.sca.bindings can be removed when running with -Dorg.osgi.sca.domain.registry=tribes:default -->
+ <property name="org.osgi.sca.bindings" value="{http://sample}Multiply"/>
+<!-- ##############################################################################################################-->
+ </endpoint-description>
+ <endpoint-description>
+ <property name="objectClass" value="calculator.dosgi.operations.DivideService" />
+ <property name="service.imported.configs" value="org.osgi.sca"/>
+ <property name="remote.configs.supported" value="org.osgi.sca"/>
+ <property name="sca.reference" value="divideService"/>
+<!-- ##############################################################################################################-->
+<!-- Property org.osgi.sca.bindings can be removed when running with -Dorg.osgi.sca.domain.registry=tribes:default -->
+ <property name="org.osgi.sca.bindings" value="{http://sample}Divide"/>
+<!-- ##############################################################################################################-->
+ </endpoint-description>
+</endpoint-descriptions>
\ No newline at end of file
diff --git a/samples/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml
similarity index 100%
rename from samples/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml
diff --git a/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README
new file mode 100644
index 0000000..be0ead7
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README
@@ -0,0 +1,148 @@
+Distributed OSGi Calculator Sample
+==================================
+This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. (where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive). Take a look there first (noting at you read it that this sample
+is not a new style sample).
+
+NOTE: if you want this sample to exploit the dynamic distribution behaviour there is some unit test
+ configuration that should be disabled. See the comments in OSGI-INF/remote-service/calculator-service-descriptions.xml
+
+On Windows, run
+java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console -Dorg.osgi.sca.domain.registry=tribes:default
+
+On *Unix, run
+java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console -Dorg.osgi.sca.domain.registry=tribes:default
+
+You should see the osgi console:
+
+osgi>
+
+osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
+INFO: Equinox-based service discoverer is now configured.
+
+You can run "ss" command under the osgi> to see the status of the bundles.
+osgi> ss
+
+Then you can install and start the calculator.dosgi bundle:
+
+osgi> install file:./target/sample-dosgi-dynamic-calculator.jar
+Bundle id is 198
+
+osgi> start 198
+Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
+INFO: Starting calculator.dosgi.dynamic_1.0.0 [198]
+Nov 4, 2009 5:20:21 PM calculator.dosgi.impl.CalculatorActivator start
+INFO: Registering calculator.dosgi.CalculatorService
+Nov 4, 2009 5:20:21 PM org.apache.tuscany.sca.node.impl.NodeImpl start
+INFO: Starting node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869 domai
+n: tuscany.apache.org
+log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX
+Utils).
+log4j:WARN Please initialize the log4j system properly.
+Nov 4, 2009 5:20:24 PM org.mortbay.log.Slf4jLog info
+INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mort
+bay.log.Slf4jLog
+Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
+INFO: jetty-6.1.x
+Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyLogger info
+INFO: Started SelectChannelConnector@0.0.0.0:8086
+Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletM
+apping
+INFO: Added Servlet mapping: http://rfengt61p:8086/CalculatorService
+Nov 4, 2009 5:20:25 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl addEndpoint
+INFO: Add endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-42b3
+-9287-71fe6537c869#service-binding(CalculatorService/Calculator)
+Nov 4, 2009 5:20:25 PM calculator.dosgi.impl.CalculatorActivator getBundle
+INFO: calculator.dosgi.operations.AddService is loaded by bundle: calculator.dos
+gi.dynamic
+
+You can point your browser to http://localhost:8086/CalculatorService?wsdl to see
+the WSDL.
+
+You can also use the WebService Explorer from Eclipse WTP to test the Web Service.
+
+To stop the bundle:
+
+osgi> stop 198
+Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
+Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.core.assembly.impl.EndpointRegistr
+yImpl endpointRemoved
+INFO: Remove endpoint - (@23394516)Endpoint: URI = osgi.service.d5a06834-ae15-4
+2b3-9287-71fe6537c869#service-binding(CalculatorService/Calculator)
+Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.http.jetty.JettyServer removeServl
+etMapping
+INFO: Removed Servlet mapping: /CalculatorService
+Nov 4, 2009 5:21:16 PM calculator.dosgi.impl.CalculatorActivator stop
+INFO: Stopping calculator.dosgi.dynamic_1.0.0 [198]
+Nov 4, 2009 5:21:16 PM org.apache.tuscany.sca.node.impl.NodeImpl stop
+INFO: Stopping node: urn:osgi.service.d5a06834-ae15-42b3-9287-71fe6537c869
+
+To exit the console, run:
+osgi> exit
+
+Sample Overview
+---------------
+The application consists of two OSGi bundles:
+ * The calculator bundle: It provides the calculator service. The service is implemented by a java class that
+ consumes other services to perform the “add”, “subtract”, “multiply” and “divide” operations.
+ * The operations bundle: It provides the add/subtract/multiply/divide services.
+ (See ../samples/dosgi-dynamic-calculator-operations)
+
+
+dosgi-dynamic-calculator/
+ src/
+ main/
+ java/
+ calculator/
+ dosgi/
+ CalculatorService.java - The interface for Calculator service
+ impl/
+ CalculatorActivator.java - OSGi bundle activator for Calculator bundle
+ CalculatorServiceDSImpl.java - OSGi declarative service based implementation
+ CalculatorServiceImpl.java - Basic OSGi implementation
+ operations/
+ AddService.java - Interface for Add
+ SubtractService.java - Interface for Subtract
+ MultiplyService.java - Interface for Multiply
+ DivideService.java - Interface for Divide
+ rmi/
+ OperationsRemote.java - RMI remote interface for operations
+ OperationsRMIServer_Stub.java - RMI stub
+ OperationsRMIServer.java - RMI server implementation of the operations
+ resources/
+ META-INF/
+ sca-contribution.xml
+ OSGI-INF/
+ sca-config/
+ calculator-config.xml - The SCA configuration file for OSGi remote services
+ remote-service/
+ calculator-service-descriptions.xml - The OSGi remote service endpoint descriptions
+ test/
+ java/
+ src/
+ calculator/
+ dosgi/
+ test/
+ CalculatorOSGiNodeTestCase.java - The JUNIT test case that tests this bundle against a RMI service
+
+ META-INF/
+ MANIFEST.MF - The OSGi manifest for this bundle
+ dosig-calculator.png - a pictorial representation of the sample
+ pom.xml - the Maven build file
+
+
+
+Building And Running The Test Case Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd dosgi-calculator
+mvn
+
diff --git a/samples/dosgi-dynamic-calculator/dosgi-calculator.png b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png
similarity index 100%
rename from samples/dosgi-dynamic-calculator/dosgi-calculator.png
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png
Binary files differ
diff --git a/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml
new file mode 100644
index 0000000..25d53d1
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml
@@ -0,0 +1,153 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-dynamic-calculator</artifactId>
+ <name>Apache Tuscany SCA Sample OSGi Remote Services Dynamic Calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
diff --git a/samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java
diff --git a/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
diff --git a/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
diff --git a/samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
similarity index 100%
rename from samples/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
rename to samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
diff --git a/samples/learning-more/distributed-osgi/pom.xml b/samples/learning-more/distributed-osgi/pom.xml
new file mode 100644
index 0000000..abe0fd0
--- /dev/null
+++ b/samples/learning-more/distributed-osgi/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-distributed-osgi</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Distributed OSGI Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>dosgi-dynamic-calculator</module>
+ <module>dosgi-dynamic-calculator-operations</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/helloworld-bpel/README b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README
similarity index 100%
rename from samples/helloworld-bpel/README
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README
diff --git a/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml
new file mode 100644
index 0000000..d94388f
--- /dev/null
+++ b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml
@@ -0,0 +1,95 @@
+<!--
+ * 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 name="sample-implementation-bpel-helloworld-contribution" default="compile">
+ <property name="test.class" value="helloworld.BPELClient" />
+ <property name="test.jar" value="sample-implementation-bpel-helloworld-contribution.jar" />
+ <property name="manifest.jar" value="../../lib/tuscany-sca-manifest.jar" />
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ <mkdir dir="target/wsdl2java-source"/>
+ </target>
+
+ <target name="generate-wsdl" depends="init">
+ <java classname="org.apache.tuscany.sdo.generate.XSD2JavaGenerator" fork="true">
+ <arg value="-targetDirectory"/>
+ <arg value="target/wsdl2java-source"/>
+ <arg value="-prefix"/>
+ <arg value="HelloWorld"/>
+ <arg value="-noContainment"/>
+ <arg value="-noUnsettable"/>
+ <arg value="src/main/resources/helloworld.wsdl"/>
+
+ <classpath>
+ <pathelement location="${manifest.jar}"/>
+ </classpath>
+ </java>
+
+ <java classname="org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator" fork="true">
+ <arg value="-targetDirectory"/>
+ <arg value="target/wsdl2java-source"/>
+ <arg value="src/main/resources/helloworld.wsdl"/>
+
+ <classpath>
+ <pathelement location="${manifest.jar}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="unzip-ode-db" depends="init">
+ <unzip src="../../lib/ode-dao-jpa-ojpa-derby-1.3.2.zip" dest="target/database"/>
+ </target>
+
+ <target name="compile" depends="init,generate-wsdl,unzip-ode-db">
+ <javac destdir="target/classes" debug="on" source="1.5" target="1.5">
+ <src path="src/main/java"/>
+ <src path="target/wsdl2java-source"/>
+ <classpath>
+ <pathelement location="${manifest.jar}"/>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${test.jar}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${test.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="run">
+ <java classname="${test.class}" fork="true">
+ <!-- jvmarg value="-Xdebug"/ -->
+ <!-- jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"/ -->
+ <classpath>
+ <pathelement location="target/classes"/>
+ <pathelement location="target/database"/>
+ <pathelement location="${manifest.jar}"/>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+
+</project>
diff --git a/samples/helloworld-bpel/helloworld-bpel.png b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png
similarity index 100%
rename from samples/helloworld-bpel/helloworld-bpel.png
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png
Binary files differ
diff --git a/samples/helloworld-bpel/helloworld-bpel.svg b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg
similarity index 100%
rename from samples/helloworld-bpel/helloworld-bpel.svg
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg
diff --git a/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml
new file mode 100644
index 0000000..1423cca
--- /dev/null
+++ b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml
@@ -0,0 +1,76 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>zip</packaging>
+ <artifactId>sample-implementation-bpel-helloworld-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.bpel HelloWorld Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <!-- plugin to support zip packaging for SCA contributions -->
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-zip-plugin</artifactId>
+ <version>alpha2</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <!-- plugin to support using mvn tuscany:run to run this contribution -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/helloworld-bpel/src/main/java/helloworld/Hello.java b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java
similarity index 100%
rename from samples/helloworld-bpel/src/main/java/helloworld/Hello.java
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java
diff --git a/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/helloworld-bpel/src/main/resources/helloworld.bpel b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel
similarity index 100%
rename from samples/helloworld-bpel/src/main/resources/helloworld.bpel
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel
diff --git a/samples/helloworld-bpel/src/main/resources/helloworld.composite b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite
similarity index 100%
rename from samples/helloworld-bpel/src/main/resources/helloworld.composite
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite
diff --git a/samples/helloworld-bpel/src/main/resources/helloworld.wsdl b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl
similarity index 100%
rename from samples/helloworld-bpel/src/main/resources/helloworld.wsdl
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl
diff --git a/samples/helloworld-bpel/src/main/resources/log4j.properties b/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties
similarity index 100%
rename from samples/helloworld-bpel/src/main/resources/log4j.properties
rename to samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties
diff --git a/samples/webapps/helloworld-bpel/README b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README
similarity index 100%
copy from samples/webapps/helloworld-bpel/README
copy to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README
diff --git a/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml
new file mode 100644
index 0000000..4a8a359
--- /dev/null
+++ b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml
@@ -0,0 +1,160 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-bpel-helloworld-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implementation.bpel Helloworld WebApp</name>
+
+ <properties>
+ <tuscany.version>2.0-Beta1</tuscany.version>
+ <jetty.version>6.1.18</jetty.version>
+ </properties>
+
+ <dependencies>
+ <!-- TUSCANY DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- JUNIT DEPENDENCY FOR TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-management</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-bpel</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
+ <version>1.1.1</version>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ <includes>**/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-bpel</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/resources/helloworld.bpel
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel
diff --git a/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl
diff --git a/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp b/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp
similarity index 100%
rename from samples/webapps/helloworld-bpel/src/main/webapp/hello.jsp
rename to samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp
diff --git a/samples/learning-more/implementation-bpel/pom.xml b/samples/learning-more/implementation-bpel/pom.xml
new file mode 100644
index 0000000..a983531
--- /dev/null
+++ b/samples/learning-more/implementation-bpel/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-implememtation-bpel</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Implementation BPEL Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-bpel-contribution</module>
+ <module>helloworld-bpel-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive-ws/README b/samples/learning-more/implementation-composite/helloworld-recursive-ws/README
new file mode 100644
index 0000000..a21077b
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive-ws/README
@@ -0,0 +1,153 @@
+Hello World BPEL Sample
+======================================
+This sample demonstrates an SCA service implemented by a BPEL process.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. (where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive). Take a look there first (noting at you read it that this sample
+is not a new style sample).
+
+If you just want to run it to see what happens open a command prompt, navigate
+to this sample directory, and do
+
+ant compile run
+
+OR if you don't have ant, on Windows do
+
+mkdir target\classes
+mkdir target\wsdl2java-source
+java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl
+java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl
+unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database
+javac -d target\classes -cp target\classes;..\..\lib\tuscany-sca-manifest.jar -sourcepath src\main\java;target\wsdl2java-source -target 1.5 -g -source 1.5 src\main\java\helloworld\BPELClient.java
+copy src\main\resources\* target\classes
+java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient
+
+and on *nix do
+
+mkdir target/classes
+mkdir target/wsdl2java-source
+java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl
+java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl
+unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database
+javac -d target/classes -cp target/classes;../../lib/tuscany-sca-manifest.jar -sourcepath src/main/java;target/wsdl2java-source -target 1.5 -g -source 1.5 src/main/java/helloworld/BPELClient.java
+cp src/main/resources/* target/classes
+java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient
+
+The sample will start an embedded BPEL engine, deploy a process and invoke it.
+
+Sample Overview
+---------------
+The sample provides a single component that is wired to a service with a
+web service binding.
+
+helloworld-bpel/
+ src/
+ main/
+ java/
+ helloworld/
+ BPELClient.java - client application for
+ BEPELHelloWorldComponent
+
+ resources/
+ deploy.xml - ODE deployment descriptor
+ helloworld.bpel - helloworld bpel process
+ helloworld.componentType - helloworld bpel service description
+ helloworld.composite - the SCA assembly for this sample
+ helloworld.wsdl - the service description that describes
+ the bpel process
+ log4j.properties - logging configuration
+
+ test/
+ java/
+ helloworld/
+ BPELHelloWorldTestCase.java - JUnit test case
+ helloworld-bpel.png - a pictorial representation of the
+ sample .composite file
+ build.xml - the Ant build file
+ pom.xml - the Maven build file
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+
+With the binary distribution the sample can be built and run using Ant as
+follows
+
+cd helloworld-bpel
+ant compile
+ant run
+
+
+You should see the following output from the run target.
+
+run:
+ [java] Starting BPELHelloWorldComponent
+ [java] >>> Deploying : D:\temp\SCA1.1-RC1\tuscany-sca-1.1-incubating\samples\helloworld-bpel\target\classes
+ [java] ::arg:::::: <?xml version="1.0" encoding="UTF-8"?>
+ [java] <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/exampl
+e/helloworld.wsdl">Hello</message></hello>
+ [java] ::message:: <?xml version="1.0" encoding="UTF-8"?>
+ [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/impleme
+ntation/bpel/example/helloworld.wsdl">Hello</message></hello></TestPart></message>
+ [java] Status: RESPONSE
+ [java] Response: <?xml version="1.0" encoding="UTF-8"?>
+ [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message>
+ [java] Hello World
+ [java] Stopping BPELHelloWorldComponent
+ [java] Stopped !!!
+
+BUILD SUCCESSFUL
+Total time: 36 seconds
+
+Building And Running The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows. When using Maven, a simple test is present that exercise
+the same logic as the client to invoke the BPEl process.
+
+cd helloworld-bpel
+mvn
+
+You should see the following output from the test phase.
+
+-
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running helloworld.BPELHelloWorldTestCase
+Starting BPELHelloWorldComponent
+>>> Deploying : D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\classes
+::arg:::::: <?xml version="1.0" encoding="UTF-8"?>
+<hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld
+.wsdl">Hello</message></hello>
+::message:: <?xml version="1.0" encoding="UTF-8"?>
+<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel
+/example/helloworld.wsdl">Hello</message></hello></TestPart></message>
+Status: RESPONSE
+Response: <?xml version="1.0" encoding="UTF-8"?>
+<message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message>
+Stopping BPELHelloWorldComponent
+Stopped !!!
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.656 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] [jar:jar]
+[INFO] Building jar: D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar
+[INFO] [install:install]
+[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresend
+e\.m2\repository\org\apache\tuscany\sca\sample-helloworld-bpel\1.1-incubating-SNAPSHOT\sample-helloworld-bpel-1.1-incubating-SNAPSHOT.jar
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 53 seconds
+[INFO] Finished at: Sun Jan 13 09:54:39 PST 2008
+[INFO] Final Memory: 24M/43M
+[INFO] ------------------------------------------------------------------------
+
+
+This shows that the Junit test cases have run successfully.
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml b/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml
new file mode 100644
index 0000000..e637126
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml
@@ -0,0 +1,82 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>zip</packaging>
+ <artifactId>sample-implementation-composite-helloworld-ws-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implemenation.composite Helloworld WS Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-contribution</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <!-- plugin to support zip packaging for SCA contributions -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-zip-plugin</artifactId>
+ <version>alpha2</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <!-- plugin to support using mvn tuscany:run to run this contribution -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <configuration>
+ <contributions>
+ <!-- add the dependee contribution that this contribution uses -->
+ <param>..\helloworld-recursive\target\sample-helloworld-recursive.jar</param>
+ <param>..\..\..\getting-started\helloworld\target\helloworld-contribution.jar</param>
+ </contributions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..ffc35bb
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+
+ <deployable composite="sample:helloworld-ws"/>
+
+ <import namespace="http://sample"/>
+ <import.java package="sample"/>
+
+</contribution>
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite b/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite
new file mode 100644
index 0000000..7197542
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite
@@ -0,0 +1,33 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ xmlns:hns="http://sample"
+ name="helloworld-ws">
+
+ <component name="HelloworldWSComponent">
+ <implementation.composite name="hns:helloworld-recursive"/>
+ <service name="MyHelloworld">
+ <binding.ws />
+ </service>
+ </component>
+
+</composite>
diff --git a/samples/helloworld/README b/samples/learning-more/implementation-composite/helloworld-recursive/README
similarity index 100%
copy from samples/helloworld/README
copy to samples/learning-more/implementation-composite/helloworld-recursive/README
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml b/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml
new file mode 100644
index 0000000..3adb8f3
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml
@@ -0,0 +1,76 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <packaging>zip</packaging>
+ <artifactId>sample-implementation-composite-helloworld-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.composite Helloworld Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+
+ <!-- plugin to support zip packaging for SCA contributions -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-zip-plugin</artifactId>
+ <version>alpha2</version>
+ <extensions>true</extensions>
+ </plugin>
+
+ <!-- plugin to support using mvn tuscany:run to run this contribution -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <configuration>
+ <contributions>
+ <!-- add the dependee contribution that this contribution uses -->
+ <param>..\helloworld\target\sample-helloworld.jar</param>
+ </contributions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000..15d9304
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,26 @@
+<?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.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:helloworld-recursive"/>
+ <import namespace="http://sample"/>
+ <export namespace="http://sample"/>
+</contribution>
+
diff --git a/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite b/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite
new file mode 100644
index 0000000..1094fea
--- /dev/null
+++ b/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite
@@ -0,0 +1,30 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:inc="http://sample"
+ targetNamespace="http://sample"
+ name="helloworld-recursive">
+
+ <include name="inc:helloworld" />
+
+ <service name="MyHelloworld" promote="HelloworldComponent/Helloworld" />
+
+</composite>
diff --git a/samples/learning-more/implementation-composite/pom.xml b/samples/learning-more/implementation-composite/pom.xml
new file mode 100644
index 0000000..75ab3eb
--- /dev/null
+++ b/samples/learning-more/implementation-composite/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-implememtation-composite</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Implementation Composite Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-recursive</module>
+ <module>helloworld-recursive-ws</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-rmi/README b/samples/learning-more/implementation-java/README
similarity index 100%
copy from samples/binding-rmi/README
copy to samples/learning-more/implementation-java/README
diff --git a/samples/learning-more/implementation-java/calculator-contribution/README b/samples/learning-more/implementation-java/calculator-contribution/README
new file mode 100644
index 0000000..9e1ff82
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/README
@@ -0,0 +1,25 @@
+Calculator Sample Contribution
+==============================
+
+This sample implements a simple calculator using SCA components.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive) Take a look there for instructions on how to launch
+this sample contribution.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+You should see the following output from the run target.
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
diff --git a/samples/learning-more/implementation-java/calculator-contribution/build.xml b/samples/learning-more/implementation-java/calculator-contribution/build.xml
new file mode 100644
index 0000000..21dd4db
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/build.xml
@@ -0,0 +1,56 @@
+<!--
+ * 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 name="sample-implementation-java-calculator-contribution" default="compile">
+
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-implementation-java-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
diff --git a/samples/learning-more/implementation-java/calculator-contribution/pom.xml b/samples/learning-more/implementation-java/calculator-contribution/pom.xml
new file mode 100644
index 0000000..1b39902
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-implementation-java-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.java Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..5a1e7a6
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java
@@ -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 calculator;
+
+/**
+ * The Add service interface
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..caf4d35
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000..2b791a8
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java
@@ -0,0 +1,62 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE") @EagerInit
+public class CalculatorClient {
+
+ private CalculatorService calculatorService;
+
+ @Reference
+ public void setCalculatorService(CalculatorService calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+
+ // Calculate
+ System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader()));
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+ }
+
+ private static String print(ClassLoader cl) {
+ StringBuffer buf = new StringBuffer();
+ for (; cl != null;) {
+ buf.append(cl.toString());
+ buf.append(' ');
+ cl = cl.getParent();
+ }
+ return buf.toString();
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..78eea39
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..d3fa7a8
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
@@ -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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000..cd91935
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000..c85357f
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000..1b66908
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite b/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..370e1cf
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,49 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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>
+
+</composite>
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite b/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite
similarity index 100%
copy from samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite
copy to samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
copy from samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml
copy to samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..c1cd131
--- /dev/null
+++ b/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,49 @@
+/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator composition.
+ */
+public class CalculatorTestCase {
+
+ @Test
+ public void testCalculator() throws Exception {
+ AddService add = new AddServiceImpl();
+ SubtractService subtract = new SubtractServiceImpl();
+ MultiplyService multiply = new MultiplyServiceImpl();
+ DivideService divide = new DivideServiceImpl();
+
+ CalculatorServiceImpl calculator = new CalculatorServiceImpl();
+
+ calculator.setAddService(add);
+ calculator.setSubtractService(subtract);
+ calculator.setMultiplyService(multiply);
+ calculator.setDivideService(divide);
+
+ assertEquals(calculator.add(3, 2), 5.0, 0);
+ assertEquals(calculator.subtract(3, 2), 1.0, 0);
+ assertEquals(calculator.multiply(3, 2), 6.0, 0);
+ assertEquals(calculator.divide(3, 2), 1.5, 0);
+ }
+}
diff --git a/samples/learning-more/implementation-java/pom.xml b/samples/learning-more/implementation-java/pom.xml
new file mode 100644
index 0000000..562f2c0
--- /dev/null
+++ b/samples/learning-more/implementation-java/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-implementation-java</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample implementation.java</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/dosgi-calculator-operations/LICENSE b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE
similarity index 100%
rename from samples/dosgi-calculator-operations/LICENSE
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE
diff --git a/samples/dosgi-calculator-operations/META-INF/MANIFEST.MF b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF
similarity index 100%
rename from samples/dosgi-calculator-operations/META-INF/MANIFEST.MF
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF
diff --git a/samples/dosgi-calculator-operations/NOTICE b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE
similarity index 100%
rename from samples/dosgi-calculator-operations/NOTICE
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/add-component.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
diff --git a/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
diff --git a/samples/dosgi-calculator-operations/README b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/README
similarity index 100%
rename from samples/dosgi-calculator-operations/README
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/README
diff --git a/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml
new file mode 100644
index 0000000..6d4f4c6
--- /dev/null
+++ b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml
@@ -0,0 +1,150 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-calculator-operations</artifactId>
+ <name>Apache Tuscany SCA Sample OSGi Remote Services Calculator Operations</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-all</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+<!-- Don't think we need this as the JUnit test starts equinox
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+-->
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
diff --git a/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
diff --git a/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
diff --git a/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
similarity index 100%
rename from samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
diff --git a/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
new file mode 100644
index 0000000..07f6aad
--- /dev/null
+++ b/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
@@ -0,0 +1,105 @@
+/*
+ * 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 calculator.dosgi.operations.test;
+
+import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+import calculator.dosgi.operations.AddService;
+
+/**
+ *
+ */
+public class OperationsOSGiNodeTestCase {
+ private static EquinoxHost host;
+ private static BundleContext context;
+ private static Bundle operationsBundle;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ try {
+ host = new EquinoxHost();
+ context = host.start();
+
+ for (Bundle b : context.getBundles()) {
+ if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
+ .startsWith("org.apache.tuscany.sca.")) {
+ try {
+ if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ // Start the non-fragment bundle
+ b.start();
+ }
+ } catch (Exception e) {
+ System.out.println("Error for bundle: " + b.getSymbolicName());
+ e.printStackTrace();
+ }
+ System.out.println(bundleStatus(b, false));
+ }
+ if ("calculator.dosgi.operations".equals(b.getSymbolicName())) {
+ operationsBundle = b;
+ }
+ }
+
+ if (operationsBundle != null) {
+ operationsBundle.start();
+ System.out.println(bundleStatus(operationsBundle, false));
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ @Test
+ public void testOSGi() throws Exception {
+ Registry registry = LocateRegistry.getRegistry(8085);
+ Object add = registry.lookup("AddService");
+ AddService addService = OSGiTestUtils.cast(add, AddService.class);
+ double sum = addService.add(1.0, 2.0);
+ Assert.assertEquals(3.0, sum, 0.0);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (host != null) {
+ host.stop();
+ context = null;
+ }
+ }
+
+}
diff --git a/samples/dosgi-calculator/LICENSE b/samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE
similarity index 100%
rename from samples/dosgi-calculator/LICENSE
rename to samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE
diff --git a/samples/dosgi-calculator/META-INF/MANIFEST.MF b/samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF
similarity index 100%
rename from samples/dosgi-calculator/META-INF/MANIFEST.MF
rename to samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF
diff --git a/samples/dosgi-calculator/NOTICE b/samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE
similarity index 100%
rename from samples/dosgi-calculator/NOTICE
rename to samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE
diff --git a/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml b/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
similarity index 100%
rename from samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
diff --git a/samples/dosgi-calculator/OSGI-INF/calculator-component.xml b/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml
similarity index 100%
rename from samples/dosgi-calculator/OSGI-INF/calculator-component.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml
diff --git a/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType b/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType
similarity index 100%
rename from samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType
rename to samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType
diff --git a/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite b/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite
similarity index 100%
rename from samples/dosgi-calculator/OSGI-INF/sca/bundle.composite
rename to samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite
diff --git a/samples/dosgi-calculator/README b/samples/learning-more/implementation-osgi/dosgi-calculator/README
similarity index 100%
rename from samples/dosgi-calculator/README
rename to samples/learning-more/implementation-osgi/dosgi-calculator/README
diff --git a/samples/dosgi-calculator/dosgi-calculator.png b/samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png
similarity index 100%
rename from samples/dosgi-calculator/dosgi-calculator.png
rename to samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png
Binary files differ
diff --git a/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml b/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml
new file mode 100644
index 0000000..a6c0eb7
--- /dev/null
+++ b/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml
@@ -0,0 +1,153 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-calculator</artifactId>
+ <name>Apache Tuscany SCA Sample OSGi Remote Services Calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
diff --git a/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
similarity index 100%
rename from samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
diff --git a/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
similarity index 100%
rename from samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
diff --git a/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
similarity index 100%
rename from samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
diff --git a/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
similarity index 100%
rename from samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
rename to samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
diff --git a/samples/learning-more/implementation-osgi/pom.xml b/samples/learning-more/implementation-osgi/pom.xml
new file mode 100644
index 0000000..2194494
--- /dev/null
+++ b/samples/learning-more/implementation-osgi/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-distributed-osgi-static</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Distributed OSGI Statically Configured Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>dosgi-calculator</module>
+ <module>dosgi-calculator-operations</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/binding-rmi/README b/samples/learning-more/implementation-script/README
similarity index 100%
copy from samples/binding-rmi/README
copy to samples/learning-more/implementation-script/README
diff --git a/samples/learning-more/implementation-script/calculator-contribution/README b/samples/learning-more/implementation-script/calculator-contribution/README
new file mode 100644
index 0000000..1e5bc9c
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/README
@@ -0,0 +1,26 @@
+Calculator Sample Contribution
+==============================
+
+This sample contribution implements a simple calculator using SCA components.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive) Take a look there for instructions on how to launch
+this sample contribution.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+Amongst the other output created by the launcher/contribution combination, you should see the following output ...
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
diff --git a/samples/learning-more/implementation-script/calculator-contribution/build.xml b/samples/learning-more/implementation-script/calculator-contribution/build.xml
new file mode 100644
index 0000000..837e3b6
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/build.xml
@@ -0,0 +1,57 @@
+<!--
+ * 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 name="sample-implementation-script-calculator-contribution" default="compile">
+ <property name="tuscany.home" value="../../.."/>
+ <property name="jar.name" value="sample-implementation-script-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
+
+
diff --git a/samples/learning-more/implementation-script/calculator-contribution/pom.xml b/samples/learning-more/implementation-script/calculator-contribution/pom.xml
new file mode 100644
index 0000000..468f629
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-implementation-script-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.script Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..5a1e7a6
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java
@@ -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 calculator;
+
+/**
+ * The Add service interface
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000..1df1f31
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java
@@ -0,0 +1,52 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE")
+@EagerInit
+public class CalculatorClient {
+
+ private CalculatorService calculatorService;
+
+ @Reference
+ public void setCalculatorService(CalculatorService calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+ // Calculate
+ System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+ }
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..78eea39
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..8e4b082
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,72 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..d441aa0
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,50 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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">
+ <tuscany:implementation.script script="calculator/AddServiceImpl.js"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <tuscany:implementation.script script="calculator/SubtractServiceImpl.rb"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <tuscany:implementation.script script="calculator/MultiplyServiceImpl.py"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <tuscany:implementation.script script="calculator/DivideServiceImpl.groovy"/>
+ </component>
+
+</composite>
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite
similarity index 100%
copy from samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite
copy to samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
copy from samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml
copy to samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType
new file mode 100644
index 0000000..5f6d884
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="AddService">
+ <interface.java interface="calculator.AddService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js
new file mode 100644
index 0000000..6f11106
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+function add(n1, n2) {
+ return n1 + n2;
+}
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType
new file mode 100644
index 0000000..f4bb4e3
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="DivideService">
+ <interface.java interface="calculator.DivideService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy
new file mode 100644
index 0000000..c31c1e8
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+def divide(n1, n2) {
+ return n1 / n2
+}
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType
new file mode 100644
index 0000000..35dc572
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="MultiplyService">
+ <interface.java interface="calculator.MultiplyService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py
new file mode 100644
index 0000000..cce0b5b
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py
@@ -0,0 +1,20 @@
+# 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.
+#
+
+def multiply(n1, n2):
+ return n1 * n2
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType
new file mode 100644
index 0000000..ee768f7
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <service name="SubtractService">
+ <interface.java interface="calculator.SubtractService" />
+ </service>
+
+</componentType>
+
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb
new file mode 100644
index 0000000..132a1d1
--- /dev/null
+++ b/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb
@@ -0,0 +1,21 @@
+# 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.
+#
+
+def subtract(n1, n2)
+ return n1 - n2
+end
\ No newline at end of file
diff --git a/samples/learning-more/implementation-script/pom.xml b/samples/learning-more/implementation-script/pom.xml
new file mode 100644
index 0000000..6d0ee2a
--- /dev/null
+++ b/samples/learning-more/implementation-script/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-implementation-script</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample implementation.script</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml b/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml
new file mode 100644
index 0000000..f7c34b6
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml
@@ -0,0 +1,67 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-spring-helloworld-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample implemenation.spring HelloWorld Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <!-- plugin to support using mvn tuscany:run to run this contribution -->
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java
new file mode 100644
index 0000000..7c50d66
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java
@@ -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 sample;
+
+import java.util.Date;
+
+/**
+ *
+ */
+public interface DateService {
+ Date getDate();
+}
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java
new file mode 100644
index 0000000..64bdd86
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java
@@ -0,0 +1,37 @@
+/*
+ * 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 sample;
+
+import java.util.Date;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ *
+ */
+@Service(DateService.class)
+public class DateServiceImpl implements DateService {
+
+ public Date getDate() {
+ System.out.println("DateServiceImpl.getDate()");
+ return new Date();
+ }
+
+}
diff --git a/samples/helloworld-scaclient/src/main/java/sample/Helloworld.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java
similarity index 100%
copy from samples/helloworld-scaclient/src/main/java/sample/Helloworld.java
copy to samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java
new file mode 100644
index 0000000..ddcb1d9
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloworldClientImpl implements Helloworld {
+ private Helloworld helloworld;
+
+ // SCA reference
+ @Reference(required = false)
+ private DateService dateService;
+
+ public HelloworldClientImpl() {
+ System.out.println("HelloworldClientImpl()");
+ }
+
+ public String sayHello(String name) {
+ System.out.println("HelloworldClientImpl.sayHello(" + name + ")");
+ if (dateService == null) {
+ return "Hello " + name;
+ }
+ return "[" + dateService.getDate() + "] " + helloworld.sayHello(name);
+ }
+
+ // Setter for spring injection
+ public void setHelloworld(Helloworld helloworld) {
+ System.out.println("Injected with " + helloworld);
+ this.helloworld = helloworld;
+ }
+
+}
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java
new file mode 100644
index 0000000..125c333
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java
@@ -0,0 +1,34 @@
+/*
+ * 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 sample;
+
+
+public class HelloworldImpl implements Helloworld {
+
+ public HelloworldImpl() {
+ super();
+ System.out.println("HelloworldImpl()");
+ }
+
+ public String sayHello(String name) {
+ System.out.println("HelloworldImpl.sayHello(" + name + ")");
+ return "Hello " + name;
+ }
+
+}
diff --git a/samples/helloworld-spring/src/main/resources/META-INF/sca-contribution.xml b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from samples/helloworld-spring/src/main/resources/META-INF/sca-contribution.xml
rename to samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml
new file mode 100644
index 0000000..15e9647
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml
@@ -0,0 +1,37 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="HelloworldClientBean" class="sample.HelloworldClientImpl">
+ <property name="helloworld">
+ <ref bean="HelloworldBean"/>
+ </property>
+ </bean>
+
+ <!--
+ <sca:reference name="dateService" type="sample.DateService"/>
+ -->
+
+</beans>
\ No newline at end of file
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml
new file mode 100644
index 0000000..9ecd099
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml
@@ -0,0 +1,30 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="HelloworldBean" class="sample.HelloworldImpl">
+ </bean>
+
+</beans>
\ No newline at end of file
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite
new file mode 100644
index 0000000..6d35675
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite
@@ -0,0 +1,36 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="helloworld">
+
+ <component name="HelloworldClientComponent">
+ <implementation.spring location="helloworld-client-context.xml"/>
+ <service name="HelloworldClientBean">
+ <tuscany:binding.jsonrpc/>
+ </service>
+ <reference name="dateService" target="DateServiceComponent"/>
+ </component>
+
+ <component name="DateServiceComponent">
+ <implementation.java class="sample.DateServiceImpl"/>
+ </component>
+</composite>
diff --git a/samples/helloworld-spring/src/test/java/sample/HelloworldTestCase.java b/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java
similarity index 100%
copy from samples/helloworld-spring/src/test/java/sample/HelloworldTestCase.java
copy to samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml b/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml
new file mode 100644
index 0000000..8ec49f0
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml
@@ -0,0 +1,185 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-spring-helloworld-webapp</artifactId>
+ <name>Apache Tuscany SCA Sample implementation.spring Helloworld WebApp</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-webapp</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-implementation-spring-helloworld-contribution</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-spring</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- Skip the normal tests, we'll run them in the integration-test phase -->
+ <skip>true</skip>
+ </configuration>
+
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <!-- Ingore the test failures so that the build will proceed to stop the tomcat server -->
+ <testFailureIgnore>true</testFailureIgnore>
+ <skip>false</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <overlays>
+ <overlay>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-implementation-spring-helloworld-contribution</artifactId>
+ <type>jar</type>
+ <targetPath>WEB-INF/classes</targetPath>
+ <excludes>
+ <exclude>META-INF/**/*</exclude>
+ </excludes>
+ </overlay>
+
+ <overlay>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-implementation-spring-helloworld-contribution</artifactId>
+ <type>jar</type>
+ <includes>
+ <include>META-INF/**/*</include>
+ </includes>
+ </overlay>
+
+ <overlay>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-webapp</artifactId>
+ <type>jar</type>
+ <targetPath>WEB-INF/classes</targetPath>
+ <includes>
+ <include>org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml</include>
+ </includes>
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <overrideWebXml>src/test/resources/test-web.xml</overrideWebXml>
+ <webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+ <webXml>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</webXml>
+ <classesDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</classesDirectory>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..49590e0
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Apache Tuscany Helloworld Spring Sample</display-name>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ /WEB-INF/classes/helloworld-context.xml
+ /WEB-INF/classes/org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml
+ </param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java
new file mode 100644
index 0000000..fa77f08
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java
@@ -0,0 +1,58 @@
+/*
+ * 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 sample;
+
+import java.io.ByteArrayInputStream;
+
+import junit.framework.Assert;
+
+import org.json.JSONObject;
+import org.junit.Test;
+
+import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+
+/**
+ *
+ */
+public class HelloworldClientTestCase {
+ private static final String SERVICE_URL =
+ "http://localhost:8085/helloworld/HelloworldClientComponent/HelloworldClientBean";
+
+ @Test
+ public void testJSONRPCBinding() throws Exception {
+ JSONObject jsonRequest = new JSONObject("{ \"method\": \"sayHello\", \"params\": [\"Ray\"], \"id\": 1}");
+
+ WebConversation wc = new WebConversation();
+ WebRequest request =
+ new PostMethodWebRequest(SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),
+ "application/json");
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+
+ JSONObject jsonResp = new JSONObject(response.getText());
+ String text = jsonResp.getString("result");
+ Assert.assertTrue(text.endsWith("Hello Ray"));
+ }
+}
diff --git a/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml
new file mode 100644
index 0000000..0ad2ed4
--- /dev/null
+++ b/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml
@@ -0,0 +1,25 @@
+<?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.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+</web-app>
diff --git a/samples/learning-more/implementation-spring/pom.xml b/samples/learning-more/implementation-spring/pom.xml
new file mode 100644
index 0000000..b109806
--- /dev/null
+++ b/samples/learning-more/implementation-spring/pom.xml
@@ -0,0 +1,44 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-implememtation-spring</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Implementation Spring Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-spring-contribution</module>
+ <module>helloworld-spring-webapp</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/webapps/helloworld-jaxrs/README b/samples/learning-more/implementation-web/helloworld-jaxrs/README
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/README
rename to samples/learning-more/implementation-web/helloworld-jaxrs/README
diff --git a/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml b/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml
new file mode 100644
index 0000000..29e6694
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml
@@ -0,0 +1,116 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-jaxrs-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implemenation.web Helloworld JAX-RS WebApp</name>
+
+ <dependencies>
+
+ <!-- Tuscany dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-nodep</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- Wink dependency for JAX-RS support -->
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-common</artifactId>
+ <version>1.1.1-incubating</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wink</groupId>
+ <artifactId>wink-server</artifactId>
+ <version>1.1.1-incubating</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-jaxrs</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-jaxrs</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java
diff --git a/samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/application b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/application
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application
diff --git a/samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java b/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java
new file mode 100644
index 0000000..50197cd
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java
@@ -0,0 +1,43 @@
+/*
+ * 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 itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.TextPage;
+import com.gargoylesoftware.htmlunit.WebClient;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ TextPage page = (TextPage)new WebClient().getPage("http://localhost:8085/helloworld-jaxrs/rest/world");
+ assertEquals("Hello World", page.getContent());
+ }
+
+}
diff --git a/samples/webapps/helloworld-js-client/README b/samples/learning-more/implementation-web/helloworld-js-client/README
similarity index 100%
rename from samples/webapps/helloworld-js-client/README
rename to samples/learning-more/implementation-web/helloworld-js-client/README
diff --git a/samples/learning-more/implementation-web/helloworld-js-client/pom.xml b/samples/learning-more/implementation-web/helloworld-js-client/pom.xml
new file mode 100644
index 0000000..9a24116
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-js-client/pom.xml
@@ -0,0 +1,104 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-js-client-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implemenation.web Helloworld Javascript Client WebApp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-json</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-js-client</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-js-client</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-js-client/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-js-client/src/main/webapp/hello.html b/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html
similarity index 100%
rename from samples/webapps/helloworld-js-client/src/main/webapp/hello.html
rename to samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html
diff --git a/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java b/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java
new file mode 100644
index 0000000..de41997
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java
@@ -0,0 +1,77 @@
+/*
+ * 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 itest;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Verfiy the serverside code is working, not sure how to easily itest the browser javascript code
+ */
+@Ignore("TUSCANY-3688")
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws MalformedURLException, IOException {
+
+ URL url = new URL("http://localhost:8085/helloworld-js-client/org.oasisopen.sca.componentContext.js/foo/call/plaincall/service.sayHello.dwr");
+ URLConnection conn = url.openConnection();
+ conn.setDoOutput(true);
+ OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
+
+ // to find this run the sample through TCPMON to capture the messages
+
+ String data = URLEncoder.encode("callCount", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8");
+ data += "&" + URLEncoder.encode("page", "UTF-8") + "=" + URLEncoder.encode("/helloworld-js-client/", "UTF-8");
+ data += "&" + URLEncoder.encode("httpSessionId", "UTF-8") + "=" + URLEncoder.encode("", "UTF-8");
+ data += "&" + URLEncoder.encode("scriptSessionId", "UTF-8") + "=" + URLEncoder.encode("A023DA664E56F075491BE1B87B37B02671", "UTF-8");
+ data += "&" + URLEncoder.encode("c0-scriptName", "UTF-8") + "=" + URLEncoder.encode("service", "UTF-8");
+ data += "&" + URLEncoder.encode("c0-methodName", "UTF-8") + "=" + URLEncoder.encode("sayHello", "UTF-8");
+ data += "&" + URLEncoder.encode("c0-id", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8");
+ data += "&" + URLEncoder.encode("c0-param0", "UTF-8") + "=" + URLEncoder.encode("string:petra", "UTF-8");
+ data += "&" + URLEncoder.encode("batchId", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8");
+
+ wr.write(data);
+ wr.flush();
+
+ BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ rd.readLine(); // throw 'allowScriptTagRemoting is false.';
+ rd.readLine(); //#DWR-INSERT
+ rd.readLine(); //#DWR-REPLY
+ String line = rd.readLine(); // dwr.engine._remoteHandleCallback('0','0',"Hello petra");
+ wr.close();
+ rd.close();
+
+ assertTrue(line.endsWith("\"Hello petra\");"));
+
+ }
+
+}
diff --git a/samples/learning-more/implementation-web/helloworld-jsf/pom.xml b/samples/learning-more/implementation-web/helloworld-jsf/pom.xml
new file mode 100644
index 0000000..a141f82
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-jsf/pom.xml
@@ -0,0 +1,99 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-jsf-webapp</artifactId>
+ <name>Apache Tuscany SCA Sample implemenation.web Helloworld JSF WebApp</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-myfaces</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-jsf</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-jsf</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java b/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java
diff --git a/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/helloWorld.jsp b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/helloWorld.jsp
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/index.jsp b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/index.jsp
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp
diff --git a/samples/webapps/helloworld-jsf/src/main/webapp/page2.jsp b/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp
similarity index 100%
rename from samples/webapps/helloworld-jsf/src/main/webapp/page2.jsp
rename to samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp
diff --git a/samples/webapps/helloworld-jsp/README b/samples/learning-more/implementation-web/helloworld-jsp/README
similarity index 100%
rename from samples/webapps/helloworld-jsp/README
rename to samples/learning-more/implementation-web/helloworld-jsp/README
diff --git a/samples/learning-more/implementation-web/helloworld-jsp/pom.xml b/samples/learning-more/implementation-web/helloworld-jsp/pom.xml
new file mode 100644
index 0000000..6232782
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-jsp/pom.xml
@@ -0,0 +1,98 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-jsp-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implemenation-web Helloworld JSP WebApp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-jsp</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-jsp</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-jsp/src/main/webapp/hello.jsp b/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/main/webapp/hello.jsp
rename to samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp
diff --git a/samples/webapps/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java b/samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
similarity index 100%
rename from samples/webapps/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
rename to samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
diff --git a/samples/webapps/helloworld-servlet/README b/samples/learning-more/implementation-web/helloworld-servlet/README
similarity index 100%
rename from samples/webapps/helloworld-servlet/README
rename to samples/learning-more/implementation-web/helloworld-servlet/README
diff --git a/samples/learning-more/implementation-web/helloworld-servlet/pom.xml b/samples/learning-more/implementation-web/helloworld-servlet/pom.xml
new file mode 100644
index 0000000..bd1fed4
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-servlet/pom.xml
@@ -0,0 +1,105 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-servlet-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implementation.web Helloworld Servlet WebApp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-nodep</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-servlet</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-servlet</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
diff --git a/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java b/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
diff --git a/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-servlet/src/main/webapp/hello.html b/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/main/webapp/hello.html
rename to samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html
diff --git a/samples/webapps/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java b/samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
similarity index 100%
rename from samples/webapps/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
rename to samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java
diff --git a/samples/learning-more/implementation-web/helloworld-stripes/pom.xml b/samples/learning-more/implementation-web/helloworld-stripes/pom.xml
new file mode 100644
index 0000000..c80a0bc
--- /dev/null
+++ b/samples/learning-more/implementation-web/helloworld-stripes/pom.xml
@@ -0,0 +1,118 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-implementation-web-helloworld-stripes-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample implementation.web Helloworld Stripes WebApp</name>
+
+ <dependencies>
+
+ <!-- Tuscany dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- Stripes Framework dependencies -->
+ <dependency>
+ <groupId>net.sourceforge.stripes</groupId>
+ <artifactId>stripes</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>2.6</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>helloworld-stripes</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+ <configuration>
+ <contextPath>helloworld-stripes</contextPath>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ <connectors>
+ <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>8085</port>
+ </connector>
+ </connectors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java b/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
diff --git a/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java b/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
diff --git a/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java b/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java
diff --git a/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java b/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
diff --git a/samples/webapps/helloworld-stripes/src/main/resources/StripesResources.properties b/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/resources/StripesResources.properties
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties
diff --git a/samples/webapps/helloworld-stripes/src/main/resources/log4j.properties b/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/resources/log4j.properties
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/webapps/helloworld-stripes/src/main/webapp/index.html b/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/main/webapp/index.html
rename to samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html
diff --git a/samples/webapps/helloworld-stripes/src/test/java/README b/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/test/java/README
rename to samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README
diff --git a/samples/webapps/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
similarity index 100%
rename from samples/webapps/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
rename to samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
diff --git a/samples/learning-more/implementation-web/pom.xml b/samples/learning-more/implementation-web/pom.xml
new file mode 100644
index 0000000..9b85d8d
--- /dev/null
+++ b/samples/learning-more/implementation-web/pom.xml
@@ -0,0 +1,50 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-implementation-webapp</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample Web Applications</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-jaxrs</module>
+ <module>helloworld-js-client</module>
+ <module>helloworld-jsf</module>
+<!-- failure due to lack of tag support?
+ <module>helloworld-jsp</module>
+-->
+ <module>helloworld-servlet</module>
+ <module>helloworld-stripes</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/learning-more/pom.xml b/samples/learning-more/pom.xml
new file mode 100644
index 0000000..d149ceb
--- /dev/null
+++ b/samples/learning-more/pom.xml
@@ -0,0 +1,60 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples-learning-more</artifactId>
+ <version>2.0-Beta1</version>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Learning More Sample Contributions</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>binding-jms</module>
+ <module>binding-rmi</module>
+ <module>binding-sca</module>
+ <module>binding-ws</module>
+ <!-- module>binding-comet</module -->
+ <module>binding-jsonrpc</module>
+ <module>implementation-bpel</module>
+ <module>implementation-composite</module>
+ <module>implementation-java</module>
+ <module>implementation-script</module>
+ <module>implementation-spring</module>
+ <module>implementation-osgi</module>
+ <module>implementation-web</module>
+ <module>distributed-osgi</module>
+ <module>sca-client</module>
+ <module>async</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/calculator-scaclient/README b/samples/learning-more/sca-client/calculator-scaclient/README
similarity index 100%
rename from samples/calculator-scaclient/README
rename to samples/learning-more/sca-client/calculator-scaclient/README
diff --git a/samples/learning-more/sca-client/calculator-scaclient/pom.xml b/samples/learning-more/sca-client/calculator-scaclient/pom.xml
new file mode 100644
index 0000000..2182064
--- /dev/null
+++ b/samples/learning-more/sca-client/calculator-scaclient/pom.xml
@@ -0,0 +1,69 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-sca-client-calculator</artifactId>
+ <name>Apache Tuscany SCA Sample SCA Client Calculator</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>sample.CalculatorSCAClient</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/calculator-scaclient/src/main/java/calculator/CalculatorService.java b/samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/calculator-scaclient/src/main/java/calculator/CalculatorService.java
rename to samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java
diff --git a/samples/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java b/samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java
similarity index 100%
rename from samples/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java
rename to samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java
diff --git a/samples/learning-more/sca-client/helloworld-scaclient/pom.xml b/samples/learning-more/sca-client/helloworld-scaclient/pom.xml
new file mode 100644
index 0000000..8bc955a
--- /dev/null
+++ b/samples/learning-more/sca-client/helloworld-scaclient/pom.xml
@@ -0,0 +1,69 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-sca-client-helloworld</artifactId>
+ <name>Apache Tuscany SCA Sample SCA Client Helloworld </name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>sample.HelloworldSCAClient</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/helloworld-scaclient/src/main/java/sample/Helloworld.java b/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java
similarity index 100%
rename from samples/helloworld-scaclient/src/main/java/sample/Helloworld.java
rename to samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java
diff --git a/samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java b/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
similarity index 100%
rename from samples/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
rename to samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
diff --git a/samples/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java b/samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
similarity index 100%
rename from samples/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
rename to samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
diff --git a/samples/learning-more/sca-client/pom.xml b/samples/learning-more/sca-client/pom.xml
new file mode 100644
index 0000000..8a9381f
--- /dev/null
+++ b/samples/learning-more/sca-client/pom.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <version>2.0-Beta1</version>
+ <artifactId>tuscany-samples-sca-client</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA SCAClient Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>helloworld-scaclient</module>
+ <module>calculator-scaclient</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/logging-scribe/pom.xml b/samples/logging-scribe/pom.xml
deleted file mode 100644
index e9e7d65..0000000
--- a/samples/logging-scribe/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <packaging>jar</packaging>
- <artifactId>sample-logging-scribe</artifactId>
- <name>Apache Tuscany SCA Scribe Logging Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.5.8</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- <version>2.0-Beta1</version>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/samples/pom.xml b/samples/pom.xml
index c3cca86..2f19861 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -26,74 +26,39 @@
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>tuscany-samples</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <version>2.0-Beta1</version>
<packaging>pom</packaging>
<name>Apache Tuscany SCA Samples</name>
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
<modules>
- <module>calculator-osgi</module>
- <module>dosgi-calculator</module>
- <module>dosgi-calculator-operations</module>
- <module>dosgi-dynamic-calculator</module>
- <module>dosgi-dynamic-calculator-operations</module>
- <module>calculator-scaclient</module>
- <module>helloworld</module>
- <module>helloworld-scaclient</module>
-<!-- *********
- IF YOU ADD ANY SAMPLES THEN ALSO ADD THEM TO
- distribution\all\src\main\components\bin-samples.xml
- OR THEY WONT GET IN RELEASES
- ********* -->
-<!-- *********
- ALSO SAMPLES SHOULD HAVE A TEST IN itest/distribution TO
- ENSURE THAT THEY WORK PROPERLY OUT OF A DISTRIBUTION
- ********* -->
-
- <module>helloworld-bpel</module>
- <module>helloworld-spring</module>
- <module>store</module>
- <module>store-webapp</module>
- <module>webapps/helloworld</module>
- <module>webapps/helloworld-bpel</module>
- <module>webapps/helloworld-jaxrs</module>
- <module>webapps/helloworld-jms</module>
- <module>webapps/helloworld-js-client</module>
- <module>webapps/helloworld-jsp</module>
- <module>webapps/helloworld-stripes</module>
- <module>webapps/helloworld-servlet</module>
-
- <!-- contributions - SCA samples -->
-
- <module>binding-rmi</module>
- <module>binding-sca</module>
- <module>contribution-binding-ws-calculator</module>
- <module>contribution-implementation-java-calculator</module>
-
- <!-- contributions - Tuscany samples -->
-
- <!-- TODO -->
-
- <!-- contribution launchers -->
-
- <!-- don't need to process these as they just contain README files
- <module>launcher-command-line</module>
- <module>launcher-maven</module>
- -->
- <module>launcher-embedded-jse</module>
- <module>launcher-embedded-osgi</module>
- <module>launcher-embedded-osgi-base</module>
-
- <!-- Application samples -->
-
- <!-- TODO -->
-
+ <module>getting-started</module>
+ <module>learning-more</module>
+ <module>running-tuscany</module>
+ <module>applications</module>
+ <module>extending-tuscany</module>
</modules>
- </profile>
- </profiles>
+
+ <build>
+ <plugins>
+ <!-- this prevents the sample artifacts being deployed as they're only distributed as part of the binary distribution -->
+ <plugin>
+ <inherited>true</inherited>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <!-- this prevents adding LICENSE/NOTICE/DEPENDENCIES files to the sample artifacts which aren't needed as they're not separately distributed -->
+ <plugin>
+ <inherited>true</inherited>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/samples/launcher-command-line/README b/samples/running-tuscany/command-line/README
similarity index 100%
rename from samples/launcher-command-line/README
rename to samples/running-tuscany/command-line/README
diff --git a/samples/running-tuscany/eclipse/README b/samples/running-tuscany/eclipse/README
new file mode 100644
index 0000000..a2460ec
--- /dev/null
+++ b/samples/running-tuscany/eclipse/README
@@ -0,0 +1,15 @@
+To import sample contributions into Eclipse you first need to import the
+Tuscany runtime. You then need to import the sample contribution into Eclipse
+as a project. Instructions for doing both of these things can be found here
+
+http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html
+
+Note. these instructions refer to our 1.x code base but it holds true for
+our 2.x code base.
+
+Once you have a contribution imported into Eclipse and cleanly compiling
+against the Tuscany runtime jars you probably want to be able to run and
+debug it. The easiest way to do this is with a simple Java launcher. If you
+import the running-tuscany/embedded-jse project into Eclipse you'll see a
+number of such launcher programs which you can copy to launch the
+contribution(s) of your choice.
diff --git a/samples/running-tuscany/embedded-jse/README b/samples/running-tuscany/embedded-jse/README
new file mode 100644
index 0000000..b10f588
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/README
@@ -0,0 +1,15 @@
+JSE Sample Launchers
+====================
+
+This directory contains sample java launchers for the
+tuscany sample contributions.
+
+To use this sample JSE launcher with ant execute the command
+
+ant run-<contributionname>
+
+where run-<contributionname> is one of the targets in the build.xml file
+
+To use this sample launcher to run all of the contributions as junit test cases,
+execute the command "mvn" in the launcher directory.
+
diff --git a/samples/running-tuscany/embedded-jse/build.xml b/samples/running-tuscany/embedded-jse/build.xml
new file mode 100644
index 0000000..6769622
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/build.xml
@@ -0,0 +1,141 @@
+<!--
+ * 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 name="launcher-embedded-jse" default="run">
+ <property name="tuscany.home" value="../../.."/>
+ <property name="jar.name" value="sample-launcher-embedded-jse.jar" />
+
+ <echo>Root of Tuscany binary distribution is - ${tuscany.home}</echo>
+
+ <import file="${tuscany.home}/features/tuscany-base-runtime-pom/build-path.xml"/>
+ <import file="${tuscany.home}/features/tuscany-binding-ws-runtime-axis2/build-path.xml"/>
+ <import file="${tuscany.home}/features/tuscany-binding-rmi-runtime/build-path.xml"/>
+ <import file="${tuscany.home}/features/tuscany-host-jetty/build-path.xml"/>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-base-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ </jar>
+ </target>
+
+ <target name="run" depends="compile">
+ <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
+ <echo> 'ant sample-binding-sca-calculator-contribution' </echo>
+ <echo> 'ant sample-binding-ws-calculator-contribution' </echo>
+ <echo> 'ant sample-binding-rmi-calculator-contribution' </echo>
+ <echo> 'ant sample-implementation-java-calculator-contribution' </echo>
+ <echo> 'ant sample-implementation-java-calculator-async-contribution' </echo>
+ </target>
+
+ <!-- Run using the "all" manifest jar -->
+ <target name="sample-binding-sca-calculator-contribution" depends="compile">
+ <java classname="launcher.JSELauncherBindingSCACalculator"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/features">
+ <include name="tuscany-sca-manifest.jar" />
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <!-- Run using the base + extension ant paths -->
+ <target name="sample-binding-ws-calculator-contribution" depends="compile">
+ <java classname="launcher.JSELauncherBindingWSCalculator"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <path refid="tuscany-base-runtime-pom.path"/>
+ <path refid="tuscany-binding-ws-runtime-axis2.path"/>
+ <path refid="tuscany-host-jetty.path"/>
+ </classpath>
+ </java>
+ </target>
+
+ <!-- Run using the base + extension manifest -->
+ <target name="sample-binding-rmi-calculator-contribution" depends="compile">
+ <java classname="launcher.JSELauncherBindingRMICalculator"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/features/tuscany-base-runtime-pom">
+ <include name="tuscany-base-runtime-pom-manifest.jar" />
+ </fileset>
+ <fileset dir="${tuscany.home}/features/tuscany-binding-rmi-runtime">
+ <include name="tuscany-binding-rmi-runtime-manifest.jar" />
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <!-- Run using the base + extension aggregations -->
+ <target name="sample-implementation-java-calculator-contribution" depends="compile">
+ <java classname="launcher.JSELauncherImplementationJavaCalculator"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-base-runtime-aggregation-2.0-Beta1.jar" />
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+ <target name="sample-implementation-java-calculator-async-contribution" depends="compile">
+ <java classname="launcher.JSELauncherImplementationJavaCalculatorAsync"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/features/tuscany-base-runtime-pom">
+ <include name="tuscany-base-runtime-pom-manifest.jar" />
+ </fileset>
+ <fileset dir="${tuscany.home}/features/tuscany-binding-ws-runtime-axis2">
+ <include name="tuscany-binding-ws-runtime-axis2-manifest.jar" />
+ </fileset>
+ <fileset dir="${tuscany.home}/features/tuscany-host-jetty">
+ <include name="tuscany-host-jetty-manifest.jar" />
+ </fileset>
+ </classpath>
+ </java>
+ </target>
+
+</project>
diff --git a/samples/running-tuscany/embedded-jse/pom.xml b/samples/running-tuscany/embedded-jse/pom.xml
new file mode 100644
index 0000000..f48ec00
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/pom.xml
@@ -0,0 +1,92 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-launcher-embedded-jse</artifactId>
+ <name>Apache Tuscany SCA Sample Launcher Embedded JSE</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-script-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/launcher-embedded-jse/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/launcher-embedded-jse/src/main/java/calculator/CalculatorService.java
rename to samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java
new file mode 100644
index 0000000..b4ef6b6
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherBindingJSONRPCCalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherBindingJSONRPCCalculator launcher = new JSELauncherBindingJSONRPCCalculator();
+ launcher.launchBindingSCACalculator();
+ }
+
+ /*
+ * Using the Tuscany Node API to load a contribution.
+ * Using the Tuscany Node API to get a local service proxy
+ */
+ public void launchBindingSCACalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../binding-jsonrpc/calculator-contribution/target/sample-binding-jsonrpc-calculator-contribution.jar"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java
new file mode 100644
index 0000000..b3c99ed
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherBindingRMICalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherBindingRMICalculator launcher = new JSELauncherBindingRMICalculator();
+ launcher.launchBindingRMICalculator();
+ }
+
+
+ public void launchBindingRMICalculator(){
+
+ Node node1 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-service-contribution/target/sample-binding-rmi-calculator-service-contribution.jar"));
+ Node node2 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-reference-contribution/target/sample-binding-rmi-calculator-reference-contribution.jar"));
+
+ node1.start();
+ node2.start();
+
+ CalculatorService calculator = node2.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node1.stop();
+ node2.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java
new file mode 100644
index 0000000..43de9e6
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherBindingSCACalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherBindingSCACalculator launcher = new JSELauncherBindingSCACalculator();
+ launcher.launchBindingSCACalculator();
+ }
+
+ /*
+ * Using the Tuscany Node API to load a contribution.
+ * Using the Tuscany Node API to get a local service proxy
+ */
+ public void launchBindingSCACalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java
new file mode 100644
index 0000000..7c212a7
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherBindingWSCalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherBindingWSCalculator launcher = new JSELauncherBindingWSCalculator();
+ launcher.launchBindingWSCalculator();
+ }
+
+ /*
+ * Using the Tuscany Node API to load a contribution.
+ * Using the Tuscany Node API to get a local service proxy
+ */
+ public void launchBindingWSCalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java
new file mode 100644
index 0000000..6e865f3
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java
@@ -0,0 +1,46 @@
+/*
+ * 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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherImplementationJavaCalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherImplementationJavaCalculator launcher = new JSELauncherImplementationJavaCalculator();
+ launcher.launchImplementationJavaCalculator();
+ }
+
+ public void launchImplementationJavaCalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-java/calculator-contribution/target/sample-implementation-java-calculator-contribution.jar"));
+ node.start();
+
+ node.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java
new file mode 100644
index 0000000..98cab93
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java
@@ -0,0 +1,44 @@
+/*
+ * 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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherImplementationJavaCalculatorAsync {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherImplementationJavaCalculatorAsync launcher = new JSELauncherImplementationJavaCalculatorAsync();
+ launcher.launchImplementationJavaCalculator();
+ }
+
+ public void launchImplementationJavaCalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/async/calculator-contribution/target/sample-implementation-java-calculator-async-contribution.jar"));
+ node.start();
+
+ node.stop();
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java
new file mode 100644
index 0000000..4f6e951
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java
@@ -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 launcher;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an embedded SCA runtime, load a contribution,
+ * start it and locate and invoke an SCA component
+ */
+public class JSELauncherImplementationScriptCalculator {
+
+ public static void main(String[] args) throws Exception {
+ JSELauncherImplementationScriptCalculator launcher = new JSELauncherImplementationScriptCalculator();
+ launcher.launchImplementationScriptCalculator();
+ }
+
+ /*
+ * Using the Tuscany Node API to load a contribution.
+ * Using the Tuscany Node API to get a local service proxy
+ */
+ public void launchImplementationScriptCalculator(){
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-script/calculator-contribution/target/sample-implementation-script-calculator-contribution.jar"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ node.stop();
+ }
+
+}
diff --git a/samples/launcher-embedded-jse/src/main/java/launcher/SampleLauncherException.java b/samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java
similarity index 100%
rename from samples/launcher-embedded-jse/src/main/java/launcher/SampleLauncherException.java
rename to samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java
diff --git a/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java b/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java
new file mode 100644
index 0000000..4c6a93f
--- /dev/null
+++ b/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java
@@ -0,0 +1,62 @@
+/*
+ * 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 launcher;
+
+import org.junit.Test;
+
+/**
+ * Test sample contributions.
+ */
+public class LauncherTestCase {
+
+ @Test
+ public void testBindingJSONRPCCalculator() throws Exception {
+ JSELauncherBindingSCACalculator.main(null);
+ }
+
+ @Test
+ public void testBindingSCACalculator() throws Exception {
+ JSELauncherBindingSCACalculator.main(null);
+ }
+
+ @Test
+ public void testBindingWSCalculator() throws Exception {
+ JSELauncherBindingWSCalculator.main(null);
+ }
+
+ @Test
+ public void testBindingRMICalculator() throws Exception {
+ JSELauncherBindingRMICalculator.main(null);
+ }
+
+ @Test
+ public void testImplementationJavaCalculator() throws Exception {
+ JSELauncherImplementationJavaCalculator.main(null);
+ }
+
+ @Test
+ public void testImplementationScriptCalculator() throws Exception {
+ JSELauncherImplementationScriptCalculator.main(null);
+ }
+
+ @Test
+ public void testImplementationJavaCalculatorAsync() throws Exception {
+ JSELauncherImplementationJavaCalculatorAsync.main(null);
+ }
+}
diff --git a/samples/launcher-embedded-osgi-base/README b/samples/running-tuscany/embedded-osgi-base/README
similarity index 100%
rename from samples/launcher-embedded-osgi-base/README
rename to samples/running-tuscany/embedded-osgi-base/README
diff --git a/samples/launcher-embedded-osgi-base/build.xml b/samples/running-tuscany/embedded-osgi-base/build.xml
similarity index 100%
rename from samples/launcher-embedded-osgi-base/build.xml
rename to samples/running-tuscany/embedded-osgi-base/build.xml
diff --git a/samples/running-tuscany/embedded-osgi-base/pom.xml b/samples/running-tuscany/embedded-osgi-base/pom.xml
new file mode 100644
index 0000000..faead94
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi-base/pom.xml
@@ -0,0 +1,71 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-launcher-embedded-osgi-base</artifactId>
+ <name>Apache Tuscany SCA Sample Launcher Embedded OSGi using base jar</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-nodep</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <version>3.5.0-v20090520</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/launcher-embedded-osgi-base/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/launcher-embedded-osgi-base/src/main/java/calculator/CalculatorService.java
rename to samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java
diff --git a/samples/launcher-embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java b/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java
similarity index 100%
rename from samples/launcher-embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java
rename to samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java
diff --git a/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java b/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java
new file mode 100644
index 0000000..4d8ea7f
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java
@@ -0,0 +1,89 @@
+/*
+ * 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 launcher;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+import calculator.CalculatorService;
+
+
+/**
+ * This client program shows how to create an embedded SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class SampleJSELauncher extends RuntimeIntegration {
+
+ public static void main(String[] args) throws Exception {
+ SampleJSELauncher launcher = new SampleJSELauncher();
+
+ String contribution = null;
+
+ if (args == null || args.length != 1){
+ System.out.println("Please provide the name of the sample contribution to run as a parameter");
+ System.out.println("Running binding-sca-calculator by default");
+ contribution = "contribution-binding-sca-calculator";
+ } else {
+ contribution = args[0];
+ }
+
+ if (contribution.equals("contribution-binding-sca-calculator")){
+ launcher.launchBindingSCACalculator();
+ } else if (contribution.equals("contribution-binding-ws-calculator")){
+ launcher.launchBindingWSCalculator();
+ } else {
+ System.out.println("Sample contribution " + contribution + "not found");
+ }
+
+ }
+
+ /**
+ * The contribution-binding-sca-calculator contribution includes a client component
+ * that calls the CalculatorServiceComponent from an operation marked by @Init.
+ */
+ public void launchBindingSCACalculator(){
+ Node node = startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
+
+ stopNode(node);
+ }
+
+ /*
+ * Using a Tuscany specific mechanism for getting at local service proxies
+ */
+ public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
+ Node node = startNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ stopNode(node);
+ }
+
+}
diff --git a/samples/launcher-embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java b/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java
similarity index 100%
rename from samples/launcher-embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java
rename to samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java
diff --git a/samples/launcher-embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java b/samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java
similarity index 100%
rename from samples/launcher-embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java
rename to samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java
diff --git a/samples/running-tuscany/embedded-osgi/README b/samples/running-tuscany/embedded-osgi/README
new file mode 100644
index 0000000..e0352fa
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/README
@@ -0,0 +1,20 @@
+OSGI Sample Launcher
+===================
+
+This directory contains a sample launcher for the running the
+tuscany sample contributions in an OSGI environment.
+
+The README file in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running sample contributions using the
+tuscany sample launchers. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive)
+
+To use this sample OSGI launcher with ant excute the command
+
+ant <contributionname>
+
+where <contributionname> is one of the targets in the provided build.xml file
+
+To use this sample launcher to run all of the contributions as junit test cases,
+execute the command "mvn" in the launcher directory.
diff --git a/samples/running-tuscany/embedded-osgi/build.xml b/samples/running-tuscany/embedded-osgi/build.xml
new file mode 100644
index 0000000..6b1f591
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/build.xml
@@ -0,0 +1,98 @@
+<!--
+ * 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 name="launcher-embedded-osgi" default="run">
+ <property name="tuscany.home" value="../../.."/>
+ <property name="jar.name" value="sample-launcher-embedded-osgi.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-base-*.jar" />
+ </fileset>
+ <fileset dir="${tuscany.home}/modules">
+ <include name="tuscany-node-api-*.jar" />
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-launcher-equinox-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="run" depends="compile">
+ <echo>Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of</echo>
+ <echo> 'ant sample-binding-sca-calculator-contribution' </echo>
+ </target>
+
+ <target name="sample-binding-sca-calculator-contribution" depends="compile">
+ <java classname="launcher.SampleOSGILauncherBindingSCA"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/modules">
+ <include name="tuscany-node-api-*.jar" />
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-launcher-equinox-*.jar" />
+ </fileset>
+ </classpath>
+ <arg value="contribution-binding-sca-calculator"/>
+ </java>
+ <echo> and ant run </echo>
+ </target>
+
+ <!-- TODO - this runs from mvn but not from ant so there is some issue with the
+ way the environment gets set up
+ <target name="sample-binding-ws-calculator-contribution" depends="compile">
+ <java classname="${main.class}"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="target/${jar.name}"/>
+ <fileset dir="${tuscany.home}/modules">
+ <include name="tuscany-node-api-*.jar" />
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-launcher-equinox-*.jar" />
+ </fileset>
+ </classpath>
+ <arg value="contribution-binding-ws-calculator"/>
+ </java>
+ </target>
+ -->
+
+</project>
diff --git a/samples/running-tuscany/embedded-osgi/pom.xml b/samples/running-tuscany/embedded-osgi/pom.xml
new file mode 100644
index 0000000..41263a2
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/pom.xml
@@ -0,0 +1,75 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-launcher-embedded-osgi</artifactId>
+ <name>Apache Tuscany SCA Sample Launcher Embedded OSGi</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+
+ </plugins>
+ </build>
+</project>
diff --git a/samples/launcher-embedded-osgi/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/launcher-embedded-osgi/src/main/java/calculator/CalculatorService.java
rename to samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java
diff --git a/samples/launcher-embedded-osgi/src/main/java/launcher/RuntimeIntegration.java b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java
similarity index 100%
rename from samples/launcher-embedded-osgi/src/main/java/launcher/RuntimeIntegration.java
rename to samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java
diff --git a/samples/launcher-embedded-osgi/src/main/java/launcher/SampleLauncherException.java b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java
similarity index 100%
rename from samples/launcher-embedded-osgi/src/main/java/launcher/SampleLauncherException.java
rename to samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java
diff --git a/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java
new file mode 100644
index 0000000..6683062
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java
@@ -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 launcher;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+import calculator.CalculatorService;
+
+
+/**
+ * This client program shows how to create an embedded SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class SampleOSGILauncherBindingSCA extends RuntimeIntegration {
+
+ public static void main(String[] args) throws Exception {
+ SampleOSGILauncherBindingSCA launcher = new SampleOSGILauncherBindingSCA();
+
+
+ Node node = launcher.startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar"));
+ launcher.stopNode(node);
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java
new file mode 100644
index 0000000..c9299f7
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java
@@ -0,0 +1,84 @@
+/*
+ * 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 launcher;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+import calculator.CalculatorService;
+
+
+/**
+ * This client program shows how to create an embedded SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class SampleOSGILauncherBindingWS extends RuntimeIntegration {
+
+ public static void main(String[] args) throws Exception {
+ SampleOSGILauncherBindingWS launcher = new SampleOSGILauncherBindingWS();
+
+ // launcher.launchBindingWSCalculator();
+
+ Node node = launcher.startNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar"));
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ launcher.stopNode(node);
+ }
+
+ /**
+ * The contribution-binding-sca-calculator contribution includes a client component
+ * that calls the CalculatorServiceComponent from an operation marked by @Init.
+ */
+ public void launchBindingSCACalculator(){
+ Node node = startNode(new Contribution("c1", "../../learning-more/binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar"));
+
+ stopNode(node);
+ }
+
+ /*
+ * Using a Tuscany specific mechanism for getting at local service proxies
+ */
+ public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{
+ Node node = startNode(new Contribution("c1", "../../learning-more/binding-ws/contribution-calculator/target/sample-contribution-binding-ws-calculator.jar"));
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ double result = calculator.add(3, 2);
+ System.out.println("3 + 2 = " + result);
+ if (result != 5.0){
+ throw new SampleLauncherException();
+ }
+
+ stopNode(node);
+ }
+
+}
diff --git a/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java b/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java
new file mode 100644
index 0000000..789484c
--- /dev/null
+++ b/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java
@@ -0,0 +1,41 @@
+/*
+ * 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 launcher;
+
+import org.junit.Test;
+
+
+
+/**
+ * Test the Calculator composition.
+ */
+public class LauncherTestCase {
+
+
+ @Test
+ public void testContributionBindingSCACalculator2() throws Exception {
+ SampleOSGILauncherBindingSCA.main(null);
+ }
+
+
+ @Test
+ public void testContributionBindingWSCalculator() throws Exception {
+ SampleOSGILauncherBindingWS.main(null);
+ }
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/README b/samples/running-tuscany/maven-junit/calculator-contribution/README
new file mode 100644
index 0000000..1e5bc9c
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/README
@@ -0,0 +1,26 @@
+Calculator Sample Contribution
+==============================
+
+This sample contribution implements a simple calculator using SCA components.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. ( where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive) Take a look there for instructions on how to launch
+this sample contribution.
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+Amongst the other output created by the launcher/contribution combination, you should see the following output ...
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/build.xml b/samples/running-tuscany/maven-junit/calculator-contribution/build.xml
new file mode 100644
index 0000000..bd06210
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/build.xml
@@ -0,0 +1,57 @@
+<!--
+ * 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 name="sample-binding-sca-calculator-contribution" default="compile">
+ <property name="tuscany.home" value="../../../.."/>
+ <property name="jar.name" value="sample-binding-sca-calculator-contribution.jar" />
+
+ <echo>${tuscany.home}</echo>
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="${tuscany.home}/lib">
+ <include name="tuscany-sca-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+</project>
+
+
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml b/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml
new file mode 100644
index 0000000..f25931e
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml
@@ -0,0 +1,58 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-maven-junit-calculator-contribution</artifactId>
+ <name>Apache Tuscany SCA Sample Maven JUnit Calculator Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>2.0-Beta1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java
new file mode 100644
index 0000000..5a1e7a6
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java
@@ -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 calculator;
+
+/**
+ * The Add service interface
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..b3671cc
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Add service
+ */
+@Service(AddService.class)
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000..1df1f31
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java
@@ -0,0 +1,52 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+@Scope("COMPOSITE")
+@EagerInit
+public class CalculatorClient {
+
+ private CalculatorService calculatorService;
+
+ @Reference
+ public void setCalculatorService(CalculatorService calculatorService) {
+ this.calculatorService = calculatorService;
+ }
+
+ @Init
+ public void calculate() {
+ // Calculate
+ System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader());
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..78eea39
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,37 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..8e4b082
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,72 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java
new file mode 100644
index 0000000..ef6a8b3
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java
@@ -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 calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000..ddd7b9c
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Divide service.
+ */
+@Service(DivideService.class)
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java
new file mode 100644
index 0000000..db568cc
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000..cc0de49
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the Multiply service.
+ */
+@Service(MultiplyService.class)
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java
new file mode 100644
index 0000000..56ee372
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java
@@ -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 calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000..22e95f7
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * An implementation of the subtract service.
+ */
+@Service(SubtractService.class)
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..370e1cf
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite
@@ -0,0 +1,49 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <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>
+
+</composite>
diff --git a/samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite
similarity index 100%
copy from samples/binding-sca/contribution-calculator/src/main/resources/CalculatorClient.composite
copy to samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite
diff --git a/samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml b/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
copy from samples/contribution-implementation-java-calculator/src/main/resources/META-INF/sca-contribution.xml
copy to samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml
diff --git a/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..ba26918
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,49 @@
+/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Test;
+
+/**
+ * A unit test of the basic Java implementation classes in this contribution
+ * without using SCA
+ */
+public class CalculatorTestCase {
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "./target/classes"));
+ node.start();
+
+ CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ assertEquals(calculator.add(3, 2), 5.0, 0);
+ assertEquals(calculator.subtract(3, 2), 1.0, 0);
+ assertEquals(calculator.multiply(3, 2), 6.0, 0);
+ assertEquals(calculator.divide(3, 2), 1.5, 0);
+
+ node.stop();
+ }
+}
diff --git a/samples/running-tuscany/maven-junit/pom.xml b/samples/running-tuscany/maven-junit/pom.xml
new file mode 100644
index 0000000..fc18687
--- /dev/null
+++ b/samples/running-tuscany/maven-junit/pom.xml
@@ -0,0 +1,43 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-sample-maven-junit</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Sample Maven Junit</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-contribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/calculator-osgi/META-INF/MANIFEST.MF b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF
similarity index 100%
rename from samples/calculator-osgi/META-INF/MANIFEST.MF
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF
diff --git a/samples/calculator-osgi/README b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/README
similarity index 100%
rename from samples/calculator-osgi/README
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/README
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml
new file mode 100644
index 0000000..41a5273
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml
@@ -0,0 +1,78 @@
+<!--
+ * 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 name="calculator-osgi" default="run">
+ <property name="sample.name" value="${ant.project.name}"/>
+ <property name="sample.jar" value="./target/sample-${sample.name}.jar" />
+
+ <target name="init">
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5">
+ <classpath>
+ <fileset dir="../../features">
+ <include name="tuscany-sca-manifest.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="${sample.jar}" basedir="target/classes">
+ </jar>
+ </target>
+
+ <target name="run" depends="compile">
+ <java jar="../../features/tuscany-sca-manifest.jar" fork="true">
+ <jvmarg value="-Djava.util.logging.config.file=logging.properties"/>
+ <!-- optional to set the deployable composite -->
+ <arg value="-composite"/>
+ <arg value="Calculator.composite"/>
+ <!-- stop the node after the application runs -->
+ <arg value="-ttl"/>
+ <arg value="0"/>
+ <arg value="${sample.jar}"/>
+ </java>
+ </target>
+
+ <target name="run-equinox" depends="compile">
+ <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true">
+ <jvmarg value="-Djava.util.logging.config.file=logging.properties"/>
+ <arg value="-composite"/>
+ <arg value="Calculator.composite"/>
+ <arg value="-config"/>
+ <arg value="../../features/configuration"/>
+ <arg value="-ttl"/>
+ <arg value="0"/>
+ <arg value="${sample.jar}"/>
+ </java>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+</project>
+
diff --git a/samples/logging.properties b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties
similarity index 100%
rename from samples/logging.properties
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml
new file mode 100644
index 0000000..d48de56
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml
@@ -0,0 +1,116 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-maven-osgi-junit-calculator-osgi</artifactId>
+ <name>Apache Tuscany SCA Sample Maven OSGI JUnit Calculator OSGi</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-all</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/calculator-osgi/src/main/java/calculator/AddService.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/AddService.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/AddServiceImpl.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/CalculatorService.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/DivideService.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/DivideService.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/MultiplyService.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/SubtractService.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/SubtractService.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
rename from samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/resources/Calculator.composite b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite
similarity index 100%
rename from samples/calculator-osgi/src/main/resources/Calculator.composite
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite
diff --git a/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
similarity index 100%
rename from samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
rename to samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
diff --git a/samples/calculator-osgi/META-INF/MANIFEST.MF b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF
similarity index 100%
copy from samples/calculator-osgi/META-INF/MANIFEST.MF
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README
new file mode 100644
index 0000000..4c67296
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README
@@ -0,0 +1,99 @@
+Calculator Sample
+=================
+This sample implements a simple calculator using SCA components and run it in a OSGi environment using the REST binding.
+
+The README in the <distribution-unpack-dir>/samples directory provides
+general instructions about building and running samples. (where
+distribution-unpack-dir is the directory in which you unpacked the tuscany
+binary distribution archive). Take a look there first (noting at you read it that this sample
+is not a new style sample).
+
+If you just want to run it to see what happens open a command prompt, navigate
+to this sample directory and do:
+
+ant run
+
+OR if you don't have ant, on Windows do
+
+java -jar ..\..\features\tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ..\..\features\configuration\ -ttl 0 target\sample-calculator-osgi.jar
+
+and on *nix do
+
+java -jar ../../features/tuscany-sca-equinox-manifest.jar -composite Calculator.composite -config ../../features/configuration/ -ttl 0 target/sample-calculator-osgi.jar
+
+Sample Overview
+---------------
+The sample provides a single calculator service with a default SCA (java)
+binding. The CalculatorClient exercises this interface by calling add,
+subtract, multiply and divide operations. This results in messages passing to
+the appropriate components in the composite across the local wires.
+
+calculator/
+ src/
+ main/
+ java/
+ calculator/
+ CalculatorService.java - the first component, calls +-/* as
+ appropriate
+ CalculatorServiceImpl.java
+ AddService.java - adds two numbers
+ AddServiceImpl.java
+ SubtractService.java - subtracts one number from another
+ SubtractServiceImpl.java
+ MultiplyService.java - multiplies two numbers
+ MultiplyServiceImpl.java
+ DivideService.java - divides one number by another
+ DivideServiceImpl.java
+ CalculatorClient.java - starts the SCA Runtime and
+ deploys the Calculator.composite.
+ It then calls the deployed Calculator
+ Components services
+ resources/
+ Calculator.composite - the SCA assembly for this sample
+ test/
+ java/
+ calculator/
+ CalculatorTestCase.java - JUnit test case
+ calculator.png - a pictorial representation of the sample
+ .composite file
+ build.xml - the Ant build file
+ pom.xml - the Maven build file
+
+Building And Running The Sample Using Ant
+-----------------------------------------
+With the binary distribution the sample can be built and run using Ant as
+follows
+
+cd calculator
+ant compile
+ant run
+
+You should see the following output from the run target.
+
+run:
+ [java] 3 + 2=5.0
+ [java] 3 - 2=1.0
+ [java] 3 * 2=6.0
+ [java] 3 / 2=1.5
+
+Building And Running The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built and run
+using Maven as follows.
+
+cd calculator
+mvn
+
+You should see the following output from the test phase.
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running calculator.CalculatorTestCase
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.272 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+This shows that the Junit test cases have run successfully.
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml
new file mode 100644
index 0000000..9dbc67b
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml
@@ -0,0 +1,163 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-maven-osgi-junit-calculator-rest-osgi</artifactId>
+ <name>Apache Tuscany SCA Sample Maven OSGi JUnit Calculator REST OSGi</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-all</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Explicitly add slf4j so that jabsorb uses the latest versions -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <skipTests>true</skipTests>
+
+ <forkMode>never</forkMode>
+ </configuration>
+ </plugin>
+
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>osgi.configuration.area</name>
+ <value>${project.build.directory}/equinox</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/samples/calculator-osgi/src/main/java/calculator/AddService.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/AddService.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000..193a7d6
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java
@@ -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 calculator;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+
+ return n1 + n2;
+ }
+
+}
diff --git a/samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/CalculatorActivator.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java
new file mode 100644
index 0000000..2d14bbd
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java
@@ -0,0 +1,66 @@
+/*
+ * 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 calculator;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ @GET
+ @Path("add/{n1}/{n2}")
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ String add(@PathParam("n1") String n1, @PathParam("n2") String n2);
+
+ @GET
+ @Path("subtract/{n1}/{n2}")
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ String subtract(@PathParam("n1") String n1, @PathParam("n2") String n2);
+
+ @GET
+ @Path("multiply/{n1}/{n2}")
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ String multiply(@PathParam("n1") String n1, @PathParam("n2") String n2);
+
+ @GET
+ @Path("divide/{n1}/{n2}")
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ String divide(@PathParam("n1") String n1, @PathParam("n2") String n2);
+
+ @GET
+ @Path("calculate/{formula}")
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ String calculate(@PathParam("formula") String formula);
+
+}
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000..55aabdb
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,88 @@
+/*
+ * 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 calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public String add(String n1, String n2) {
+ //System.out.println("ADD Operation ==> " + n1 + " + " + n2 + " = " + addService.add(Double.parseDouble(n1), Double.parseDouble(n2)));
+ return String.valueOf(addService.add(Double.parseDouble(n1), Double.parseDouble(n2)));
+ }
+
+ public String subtract(String n1, String n2) {
+ //System.out.println("SUBTRACT Operation ==> " + n1 + " + " + n2 + " = " + subtractService.subtract(Double.parseDouble(n1), Double.parseDouble(n2)));
+ return String.valueOf(subtractService.subtract(Double.parseDouble(n1), Double.parseDouble(n2)));
+ }
+
+ public String multiply(String n1, String n2) {
+ //System.out.println("MULTIPLY Operation ==> " + n1 + " + " + n2 + " = " + multiplyService.multiply(Double.parseDouble(n1), Double.parseDouble(n2)));
+ return String.valueOf(multiplyService.multiply(Double.parseDouble(n1), Double.parseDouble(n2)));
+ }
+
+ public String divide(String n1, String n2) {
+ //System.out.println("DIVIDE Operation ==> " + n1 + " + " + n2 + " = " + divideService.divide(Double.parseDouble(n1), Double.parseDouble(n2)));
+ return String.valueOf(divideService.divide(Double.parseDouble(n1), Double.parseDouble(n2)));
+ }
+
+ public String calculate(String formula) {
+ String[] operands = formula.split("[\\+\\-\\*\\:]");
+ if(formula.contains("+")) {
+ return add( operands[0], operands[1]);
+ } else if(formula.contains("-")) {
+ return subtract( operands[0], operands[1]);
+ } else if(formula.contains("*")) {
+ return multiply( operands[0], operands[1]);
+ } else if(formula.contains(":")) {
+ return divide( operands[0], operands[1]);
+ } else {
+ throw new IllegalArgumentException("Invalid formula: " + formula );
+ }
+ }
+
+}
diff --git a/samples/calculator-osgi/src/main/java/calculator/DivideService.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/DivideService.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/MultiplyService.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/MultiplyService.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/SubtractService.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/SubtractService.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java
diff --git a/samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
copy from samples/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java
copy to samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite
new file mode 100644
index 0000000..c428ce9
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite
@@ -0,0 +1,55 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <service name="CalculatorService">
+ <tuscany:binding.rest uri="http://localhost:8085/calculator">
+ <tuscany:operationSelector.jaxrs />
+ </tuscany:binding.rest>
+ </service>
+ <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>
+
+</composite>
diff --git a/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java
new file mode 100644
index 0000000..704101b
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java
@@ -0,0 +1,126 @@
+/*
+ * 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 calculator;
+
+import javax.ws.rs.core.MediaType;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.WebConversation;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+/**
+ * This shows how to test the Calculator composition.
+ */
+public class CalculatorTestCase {
+ private final static String SERVICE_URL = "http://localhost:8085/calculator/";
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("Calculator.composite");
+ node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("calculator", location));
+ System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader());
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testAdd() throws Exception {
+ String queryString = "/add/3/2";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString);
+ request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN);
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("5.0", response.getText());
+ }
+
+ @Test
+ public void testSubtract() throws Exception {
+ String queryString = "/subtract/3/2";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString);
+ request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN);
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("1.0", response.getText());
+ }
+
+ @Test
+ public void testMultiply() throws Exception {
+ String queryString = "/multiply/3/2";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString);
+ request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN);
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("6.0", response.getText());
+ }
+
+ @Test
+ public void testDivide() throws Exception {
+ String queryString = "/divide/3/2";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString);
+ request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN);
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("1.5", response.getText());
+ }
+
+ @Test
+ public void testFormula() throws Exception {
+ String queryString = "/calculate/3+2";
+
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString);
+ request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN);
+ WebResponse response = wc.getResource(request);
+
+ Assert.assertEquals(200, response.getResponseCode());
+ Assert.assertEquals("5.0", response.getText());
+ }
+
+}
diff --git a/samples/running-tuscany/maven-osgi-junit/pom.xml b/samples/running-tuscany/maven-osgi-junit/pom.xml
new file mode 100644
index 0000000..473270b
--- /dev/null
+++ b/samples/running-tuscany/maven-osgi-junit/pom.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-maven-osgi-junit</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <version>2.0-Beta1</version>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Maven OSGI Junit plugin Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>calculator-osgi</module>
+ <module>calculator-rest-osgi</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/launcher-maven/README b/samples/running-tuscany/maven/README
similarity index 100%
rename from samples/launcher-maven/README
rename to samples/running-tuscany/maven/README
diff --git a/samples/running-tuscany/osgi/README b/samples/running-tuscany/osgi/README
new file mode 100644
index 0000000..6df2c1d
--- /dev/null
+++ b/samples/running-tuscany/osgi/README
@@ -0,0 +1,33 @@
+The Tuscany runtime can be run in and OSGi container.
+
+Running in Equinox
+------------------
+
+On Windows, run
+java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console
+
+On *Unix, run
+java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console
+
+You should see the osgi console:
+
+osgi>
+
+osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start
+INFO: Equinox-based service discoverer is now configured.
+
+You can run "ss" command under the osgi> to see the status of the bundles.
+osgi> ss
+
+Then you can install and start contributions as bundles by doing the following:
+
+osgi> install file:./path/to/contribution_bundle.jar
+
+Note that contribution_bundle.jar will need an activator in order to register the bundle as a SCA contribution
+see samples/????
+TODO is this still true
+
+Running on Felix
+----------------
+
+See http://tuscany.apache.org/documentation-2x/running-tuscany-sca-2x-with-equinox-and-felix.html
diff --git a/samples/running-tuscany/pom.xml b/samples/running-tuscany/pom.xml
new file mode 100644
index 0000000..9d4ec8c
--- /dev/null
+++ b/samples/running-tuscany/pom.xml
@@ -0,0 +1,57 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-samples-running-tuscany</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Running Tuscany Samples</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <!-- don't need to process these as they just contain README files
+ <module>command-line</module>
+ <module>eclipse</module>
+ <module>maven</module>
+ <module>maven-junit</module>
+ <module>maven-osgi-junit</module>
+ <module>osgi</module>
+ <module>webapp</module>
+ -->
+ <module>embedded-jse</module>
+ <module>embedded-osgi</module>
+ <!-- module>embedded-osgi-base</module -->
+ <module>maven-osgi-junit</module>
+ <module>maven-junit</module>
+ <module>shell</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
diff --git a/samples/running-tuscany/shell/README b/samples/running-tuscany/shell/README
new file mode 100644
index 0000000..9745f57
--- /dev/null
+++ b/samples/running-tuscany/shell/README
@@ -0,0 +1,34 @@
+Sample Tuscany Shell
+====================
+
+This directory contains a sample shell program supporting simple commands to
+start and stop SCA composites.
+
+To build the sample shell do this:
+mvn install
+
+To run it:
+./sca
+
+at the prompt:
+start myNode ../../applications/store/target/sample-store.jar
+
+or:
+start myNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+
+also try:
+status
+stop myNode
+bye
+
+Starting and stopping composites is pretty fast. To see that, try the following
+two scripts, which start/stop the sample store composite 10 times.
+
+./sca <scripts/test.txt
+or
+./sca <scripts/test-remote.txt
+
+The shell can also run as a Webapp. To try it install target/scashell.war in
+a Web container, point your Web browser to http://localhost:8080/scashell
+and try the links on that page.
+
diff --git a/samples/running-tuscany/shell/pom.xml b/samples/running-tuscany/shell/pom.xml
new file mode 100644
index 0000000..d7f14cb
--- /dev/null
+++ b/samples/running-tuscany/shell/pom.xml
@@ -0,0 +1,92 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-launcher-shell</artifactId>
+ <name>Apache Tuscany SCA Sample Launcher Shell</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-web20</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>scashell</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <version>1.0</version>
+ <configuration>
+ <!-- Key used for configuring access to server in settings.xml-->
+ <server>tomcat</server>
+ <!-- context for the webapp, as finalName is not being honored -->
+ <path>/scashell</path>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/samples/launcher-shell/sca b/samples/running-tuscany/shell/sca
similarity index 100%
rename from samples/launcher-shell/sca
rename to samples/running-tuscany/shell/sca
diff --git a/samples/running-tuscany/shell/sca.bat b/samples/running-tuscany/shell/sca.bat
new file mode 100644
index 0000000..5110eff
--- /dev/null
+++ b/samples/running-tuscany/shell/sca.bat
@@ -0,0 +1,30 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+
+rem cd to target to reduce the length of the classpath. It blows up cmd.exe without this
+cd target
+set _CLASSPATH=.\classes
+for %%i in (.\scashell\WEB-INF\lib\*.jar) do call:setClasspath %%i
+set CLASSPATH=%_CLASSPATH%
+@echo on
+java sample.Shell
+cd ..
+goto:eof
+
+:setClasspath
+set _CLASSPATH=%_CLASSPATH%;%1
+goto:eof
\ No newline at end of file
diff --git a/samples/running-tuscany/shell/scripts/test-remote.txt b/samples/running-tuscany/shell/scripts/test-remote.txt
new file mode 100644
index 0000000..dc13e5c
--- /dev/null
+++ b/samples/running-tuscany/shell/scripts/test-remote.txt
@@ -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
+
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
+start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+stop testNode
diff --git a/samples/running-tuscany/shell/scripts/test-start.txt b/samples/running-tuscany/shell/scripts/test-start.txt
new file mode 100644
index 0000000..2514a90
--- /dev/null
+++ b/samples/running-tuscany/shell/scripts/test-start.txt
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+
+restart testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar
+status
diff --git a/samples/launcher-shell/scripts/test-status.txt b/samples/running-tuscany/shell/scripts/test-status.txt
similarity index 100%
rename from samples/launcher-shell/scripts/test-status.txt
rename to samples/running-tuscany/shell/scripts/test-status.txt
diff --git a/samples/running-tuscany/shell/scripts/test-stop.txt b/samples/running-tuscany/shell/scripts/test-stop.txt
new file mode 100644
index 0000000..39eb36a
--- /dev/null
+++ b/samples/running-tuscany/shell/scripts/test-stop.txt
@@ -0,0 +1,17 @@
+# 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
+
+stop testNode
diff --git a/samples/running-tuscany/shell/scripts/test.txt b/samples/running-tuscany/shell/scripts/test.txt
new file mode 100644
index 0000000..bf489a4
--- /dev/null
+++ b/samples/running-tuscany/shell/scripts/test.txt
@@ -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
+
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
+start testNode ../../applications/store/target/sample-store.jar
+stop testNode
diff --git a/samples/running-tuscany/shell/src/main/java/sample/Shell.java b/samples/running-tuscany/shell/src/main/java/sample/Shell.java
new file mode 100644
index 0000000..d0d8fb5
--- /dev/null
+++ b/samples/running-tuscany/shell/src/main/java/sample/Shell.java
@@ -0,0 +1,203 @@
+/*
+ * 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 sample;
+
+import static java.lang.System.in;
+import static java.lang.System.out;
+import static java.util.Collections.emptyList;
+import static java.util.Collections.singletonList;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * A little SCA command shell.
+ */
+public class Shell {
+ final NodeFactory nf;
+
+ public static class Nodeconf {
+ final String name;
+ final String cloc;
+ final String dcuri;
+ final Node node;
+
+ Nodeconf(final String name, final String cloc, final String dcuri, final Node node) {
+ this.name = name;
+ this.cloc = cloc;
+ this.dcuri = dcuri;
+ this.node = node;
+ }
+
+ public String toString() {
+ return name + " " + cloc + (dcuri != null? " " + dcuri : "");
+ }
+ }
+
+ final Map<String, Nodeconf> nodes = new HashMap<String, Nodeconf>();
+ final List<String> history = new ArrayList<String>();
+
+ public Shell(NodeFactory nf) {
+ this.nf = nf;
+ }
+
+ List<?> start(final String name, final String cloc, final String dcuri) {
+ if(nodes.containsKey(name))
+ return emptyList();
+ final Node node = dcuri != null? nf.createNode(dcuri, new Contribution(cloc, cloc)) : nf.createNode(new Contribution(cloc, cloc));
+ nodes.put(name, new Nodeconf(name, cloc, dcuri, node));
+ node.start();
+ return emptyList();
+ }
+
+ List<?> stop(final String name) {
+ final Nodeconf ninfo = nodes.get(name);
+ if(ninfo == null)
+ return emptyList();
+ ninfo.node.stop();
+ nodes.remove(name);
+ return emptyList();
+ }
+
+ List<?> stop() {
+ for(Nodeconf ninfo: nodes.values())
+ ninfo.node.stop();
+ nodes.clear();
+ return emptyList();
+ }
+
+ List<?> restart(final String name, final String cloc, final String dcuri) {
+ final Nodeconf ninfo = nodes.get(name);
+ if(ninfo == null)
+ return start(name, cloc, dcuri);
+ ninfo.node.stop();
+ nodes.remove(name);
+ if (cloc == null)
+ return start(ninfo.name, ninfo.cloc, ninfo.dcuri);
+ return start(name, cloc, dcuri);
+ }
+
+ List<?> status() {
+ return new ArrayList<Object>(nodes.values());
+ }
+
+ List<?> history() {
+ return history;
+ }
+
+ List<?> bye() {
+ return null;
+ }
+
+ List<String> read(final BufferedReader r) throws IOException {
+ final String l = r.readLine();
+ history.add(l);
+ return l != null ? Arrays.asList(l.split(" ")) : singletonList("bye");
+ }
+
+ Callable<List<?>> eval(final List<String> toks) {
+ final String op = toks.get(0);
+ if(op.equals("start"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return start(toks.get(1), toks.get(2), toks.size() >= 4? toks.get(3) : null);
+ }
+ };
+ if(op.equals("stop"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ if(toks.size() == 1)
+ return stop();
+ return stop(toks.get(1));
+ }
+ };
+ if(op.equals("restart"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return restart(toks.get(1), toks.size() >= 3? toks.get(2) : null, toks.size() >= 4? toks.get(3) : null);
+ }
+ };
+ if(op.equals("status"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return status();
+ }
+ };
+ if(op.equals("history"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return history();
+ }
+ };
+ if(op.equals("bye"))
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return bye();
+ }
+ };
+ return new Callable<List<?>>() {
+ public List<?> call() {
+ return emptyList();
+ }
+ };
+ }
+
+ List<?> apply(final Callable<List<?>> func) {
+ try {
+ return func.call();
+ } catch(Exception e) {
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ return singletonList(sw);
+ }
+ }
+
+ boolean print(final List<?> l, PrintWriter w) {
+ if(l == null)
+ return false;
+ for(Object o: l)
+ w.println(o);
+ return true;
+ }
+
+ public Map<String, Nodeconf> run(final BufferedReader r, final PrintWriter w) throws IOException {
+ while(print(apply(eval(read(r))), w))
+ ;
+ r.close();
+ return nodes;
+ }
+
+ public static void main(final String[] args) throws Exception {
+ new Shell(NodeFactory.newInstance()).run(new BufferedReader(new InputStreamReader(in)), new PrintWriter(out, true));
+ }
+}
diff --git a/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java b/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java
new file mode 100644
index 0000000..55aadbd
--- /dev/null
+++ b/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java
@@ -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 sample;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.tuscany.sca.host.webapp.WebAppHelper;
+
+public class ShellServlet extends HttpServlet {
+ static final long serialVersionUID = 1L;
+
+ Shell shell;
+
+ public void init() {
+ shell = new Shell(WebAppHelper.getNodeFactory());
+ }
+
+ public void destroy() {
+ shell.stop();
+ }
+
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
+ shell.run(new BufferedReader(new InputStreamReader(new URL(req.getParameter("conf")).openStream())), resp.getWriter());
+ }
+}
diff --git a/samples/launcher-shell/src/main/webapp/WEB-INF/web.xml b/samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from samples/launcher-shell/src/main/webapp/WEB-INF/web.xml
rename to samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml
diff --git a/samples/running-tuscany/shell/src/main/webapp/index.html b/samples/running-tuscany/shell/src/main/webapp/index.html
new file mode 100644
index 0000000..7d8a856
--- /dev/null
+++ b/samples/running-tuscany/shell/src/main/webapp/index.html
@@ -0,0 +1,42 @@
+<!--
+ * 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.
+-->
+<html>
+<head>
+<title>Sample Runtime Shell</title>
+</head>
+<body>
+<h1>It works</h1>
+
+<p>This Web app runs a sample Tuscany runtime shell similar to samples/launcher-shell.<br/>
+To see how it works and what configuration commands are supported, just read the Shell program's <a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/src/main/java/sample/Shell.java">source code</a>.</p>
+
+<p>Configuration commands can be provided through a text document served from a Web location, for example:<br/>
+<a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt">http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt</a></p>
+
+<p>To run that particular configuration script just point your Web browser to:<br/>
+<a href="/scashell/run?conf=http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt">http://localhost:8080/scashell/run?conf=http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt</a><br/>
+To run the script again and refresh the runtime shell, just refresh that page in your Web browser.
+</p>
+
+<p>This script starts the Tuscany sample store application. Click <a href="/scashell/store/">here</a> to use that application after you've started it.</p>
+
+<p>Sample configuration script samples are available in the Tuscany Subversion repository <a href="http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/">there</a>.
+
+</body>
+</html>
diff --git a/samples/running-tuscany/webapp/README b/samples/running-tuscany/webapp/README
new file mode 100644
index 0000000..2d80e36
--- /dev/null
+++ b/samples/running-tuscany/webapp/README
@@ -0,0 +1,59 @@
+The Tuscany SCA Java runtime can run inside a webapp (a WAR) and expose
+services when the webapp is started. In order for this to work
+a number of things have to be in place in the webapp:
+
+1. The Tuscany runtime jars have to be packaed in the webapp WEB-INF/lib
+ directory
+2. The Tuscany HTTP filter servlet has to be configured in the
+ WEB-INF/web.xml file using something like:
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+3. The composite application has to packaged in the WAR file. When the
+ TuscanyServletFilter started it effectvely reads its own WAR file as
+ the contribution. As an alternative you can package complete
+ contribution archives in the WEB-INF/sca-contributions directory.
+
+In the getting-started/helloworl-webapp sample we provided a Maven
+build script that perform these WAR packaging steps.
+
+To execute a webapp based contributions (sample contributions that have webapp
+at the end of their name) you can build the contribution using maven and then
+copy the resulting war file to your web container of choice
+
+For example, for learning-more/binding-jsonrpc/contribution-calculator-webapp,
+do the following
+
+cd learning-more/binding-jsonrpc/contribution-calculator-webapp
+mvn
+cp target/sample-contribution-binding-jsonrpc-calculator-webapp.war your_container_deployment-dir
+
+
+As an alternative sample webapp based contributions can be run within Jetty directly from Maven, look for
+webapp contributions that have the following configuration in their pom.xml file:
+
+<plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.18</version>
+</plugin>
+
+For contributions that have this, for example,
+learning-more/binding-jsonrpc/contribution-calculator-webapp, do the following
+
+cd learning-more/binding-jsonrpc/contribution-calculator-webapp
+mvn jetty:run
+
+This will launch the contribution in the Jetty runtime and then wait. At this point you can use
+HTTP clients to send messages to services that the running SCA applcation exposes. For this
+example try pointing your browser at:
+
+http://localhost:8080/sample-contribution-binding-jsonrpc-calculator-webapp/
diff --git a/samples/store-webapp/pom.xml b/samples/store-webapp/pom.xml
deleted file mode 100644
index 8000b0f..0000000
--- a/samples/store-webapp/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>sample-store-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Getting Started Online Store as WebApp</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-web20</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>tomcat-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <!-- Key used for configuring access to server in settings.xml-->
-
- <server>tomcat</server>
- <!-- context for the webapp, as finalName is not being honored -->
- <path>/${artifactId}</path>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/store/build.xml b/samples/store/build.xml
deleted file mode 100644
index bd36a0d..0000000
--- a/samples/store/build.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<!--
- * 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 name="store" default="compile">
- <property name="test.class" value="launch.Launch" />
- <property name="test.jar" value="sample-store.jar" />
-
- <target name="init">
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5">
- <classpath>
- <pathelement location="../../features/tuscany-sca-manifest.jar"/>
- <fileset refid="3rdparty.jars"/>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${test.jar}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${test.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run-classes">
- <java classname="${test.class}"
- fork="true">
- <classpath>
- <pathelement path="target/classes"/>
- <pathelement location="../../features/tuscany-sca-manifest.jar"/>
- <fileset refid="3rdparty.jars"/>
- </classpath>
- </java>
- </target>
-
- <target name="run">
- <java classname="${test.class}"
- fork="true">
- <classpath>
- <pathelement path="target/${test.jar}"/>
- <pathelement location="../../features/tuscany-sca-manifest.jar"/>
- <fileset refid="3rdparty.jars"/>
- </classpath>
- </java>
- </target>
-
- <target name="clean">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- </target>
-
- <fileset id="3rdparty.jars" dir="../../lib">
- <include name="saxon-8.7.jar"/>
- </fileset>
-</project>
diff --git a/samples/store/pom.xml b/samples/store/pom.xml
deleted file mode 100644
index 76bacff..0000000
--- a/samples/store/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>sample-store</artifactId>
- <name>Apache Tuscany SCA Sample Getting Started Online Store</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-web20</artifactId>
- <type>pom</type>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
diff --git a/samples/store/src/main/resources/uiservices/store.html b/samples/store/src/main/resources/uiservices/store.html
deleted file mode 100644
index 000f1f8..0000000
--- a/samples/store/src/main/resources/uiservices/store.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!--
- * 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.
--->
-<html>
-<head>
-<title>Store</title>
-
-<script type="text/javascript" src="/dojo/dojo.js"></script>
-<script type="text/javascript" src="store.js"></script>
-
-<script language="JavaScript">
-
- //@Reference
- var catalog = new tuscany.sca.Reference("catalog");
-
- //@Reference
- var shoppingCart = new tuscany.sca.Reference("shoppingCart");
-
- //@Reference
- var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
-
- var catalogItems;
-
- function catalog_getResponse(items,exception) {
- if(exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
-
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
- }
-
- function shoppingCart_getResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- if (entries.length != 0) {
- try {
- shoppingTotal.getTotal().addCallback(shoppingTotal_getTotalResponse);
- }
- catch(e){
- alert(e);
- }
- }
- }
- }
-
- function shoppingTotal_getTotalResponse(total,exception) {
- if(exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
- }
-
- function shoppingCart_postResponse(entry) {
- shoppingCart.get("").addCallback(shoppingCart_getResponse);
- }
-
- function addToCart() {
- var items = document.catalogForm.items;
- var j = 0;
- for (var i=0; i<items.length; i++) {
- if (items[i].checked) {
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
- '<Item xmlns="http://services/">' +
- '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
- '</Item>' + '</content></entry>';
- shoppingCart.post(entry).addCallback(shoppingCart_postResponse);
- items[i].checked = false;
- }
- }
- }
- function checkoutCart() {
- document.getElementById('store').innerHTML='<h2>' +
- 'Thanks for Shopping With Us!</h2>'+
- '<h2>Your Order</h2>'+
- '<form name="orderForm">'+
- document.getElementById('shoppingCart').innerHTML+
- '<br>'+
- document.getElementById('total').innerHTML+
- '<br>'+
- '<br>'+
- '<input type="submit" value="Continue Shopping">'+
- '</form>';
- shoppingCart.del("");
- }
- function deleteCart() {
- shoppingCart.del("");
- document.getElementById('shoppingCart').innerHTML = "";
- document.getElementById('total').innerHTML = "";
- }
-
- function init() {
- try {
- catalog.get().addCallback(catalog_getResponse);
- shoppingCart.get("").addCallback(shoppingCart_getResponse);
- }
- catch(e){
- alert(e);
- }
- }
-
-</script>
-
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
- <div id="store">
- <h2>Catalog</h2>
- <form name="catalogForm">
- <div id="catalog" ></div>
- <br>
- <input type="button" onClick="addToCart()" value="Add to Cart">
- </form>
-
- <br>
-
- <h2>Your Shopping Cart</h2>
- <form name="shoppingCartForm">
- <div id="shoppingCart"></div>
- <br>
- <div id="total"></div>
- <br>
- <input type="button" onClick="checkoutCart()" value="Checkout">
- <input type="button" onClick="deleteCart()" value="Empty">
- <a href="../ShoppingCart/Cart/">(feed)</a>
- </form>
- </div>
-</body>
-</html>
diff --git a/samples/webapps/helloworld-bpel/pom.xml b/samples/webapps/helloworld-bpel/pom.xml
deleted file mode 100644
index 5e87da2..0000000
--- a/samples/webapps/helloworld-bpel/pom.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<?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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-bpel-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld BPEL</name>
-
- <properties>
- <tuscany.version>2.0-Beta1</tuscany.version>
- <jetty.version>6.1.18</jetty.version>
- </properties>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <!-- JETTY DEPENDENCIES FOR TESTING -->
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-management</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>helloworld-bpel</finalName>
-
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.1.1</version>
- <type>zip</type>
- <overWrite>false</overWrite>
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- <includes>**/*</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-bpel</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/samples/webapps/helloworld-jaxrs/pom.xml b/samples/webapps/helloworld-jaxrs/pom.xml
deleted file mode 100644
index bd5857f..0000000
--- a/samples/webapps/helloworld-jaxrs/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-jaxrs-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld JAX-RS</name>
-
- <dependencies>
-
- <!-- Tuscany dependency -->
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Wink dependency for JAX-RS support -->
- <dependency>
- <groupId>org.apache.wink</groupId>
- <artifactId>wink-common</artifactId>
- <version>1.1.1-incubating</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wink</groupId>
- <artifactId>wink-server</artifactId>
- <version>1.1.1-incubating</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.0</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-jaxrs</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-jaxrs</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java b/samples/webapps/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java
deleted file mode 100644
index ffe5dd3..0000000
--- a/samples/webapps/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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 itest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.TextPage;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
-
-/**
- */
-public class HelloworldTestCase {
-
- @Test
- public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
- TextPage page = (TextPage)new WebClient().getPage("http://localhost:8085/helloworld-jaxrs/rest/world");
- assertEquals("Hello World", page.getContent());
- }
-
-}
diff --git a/samples/webapps/helloworld-jms/README b/samples/webapps/helloworld-jms/README
deleted file mode 100644
index 88bbe9a..0000000
--- a/samples/webapps/helloworld-jms/README
+++ /dev/null
@@ -1,131 +0,0 @@
-JMS HelloWorld Sample
-=====================
-This sample demonstrates a simple webapp containing a hello world style client
-and service using the JMS binding for request-response style messaging.
-
-The README in the samples directory (the directory above this) provides
-general instructions about building and running samples. Take a look there
-first.
-
-As this sample provides a web app there is a manual step where the WAR file
-that contains the sample is copied to your web app container. If you just want
-to give this sample a go deploy the WAR file (target/helloworld-jms.war )
-to you web application server. Alternatevly, the sample pom.xml is configured
-with the Jetty plugin so you can run the it with Jetty by simply doing "mvn jetty:run".
-
-Once the web app is deployed use your browser to visit the following URL;
-
-http://localhost:8080/helloworld-jms
-
-The port and hostname will of course vary depending on your local installation.
-
-Configuring the JMS resources
------------------------------
-
-The sample requires JMS resources be manually configured in the server environment, these are:
-
-- a JMS connection factory named "ConnectionFactory"
-- a JMS queue named "HelloWorldService"
-
-See the following for how to define these resources depending on the application server being used:
-
-Tuscany with embedded ActiveMQ broker
--------------------------------------
-
-
-Apache Tomcat
--------------
-
-No configuration is necessary for Tomcat as the sample WAR includes everything pre-configured to run
-an ActiveMQ embedded JMS broker and to configure the JMS resources in JNDI.
-
-The JNDI resources are configured in the META-INF/comtext.xml file, for more information on running
-ActiveMQ in Tomcat see: http://activemq.apache.org/tomcat.html
-
-
-Apache Geronimo
----------------
-
-For Apache Geronimo 2.0.1 (2.0.2 fails to define JMS resources for me)
-
-Logon to the Geronimo Server Console (http://localhost:8080/console, uid system, pswd manager)
-
-In the Console Navigation on the left under Services click JMS Resources
-
-At the bottom of the JMS Resources panel click under Create a new JMS Resource Group click For ActiveMQ
-
-In Resource Group Name enter "MyRGN" and click next
-
-At JMS Resource Group click Add Connection Factory
-
-For JMS Factory Type choose javax.jms.ConnectionFactory and click Next
-
-In Connection Factory Name enter "ConnectionFactory" and click Next
-
-Click Add destination
-
-For JMS Destination Type choose javax.jms.Queue and click Next
-
-Enter "HelloWorldService" for both Message Destination Name and PhysicalName and click Next
-
-Click Deploy Now
-
-Thats it, you're done.
-
-
-WebSphere
----------
-
-To define the JMS resources in a new WebSphere Application Server 6.1 installation:
-
-1) First define a Service integration bus:
-
-Logon to the WebSphere Integrated Solutions Console (http://localhost:9060/ibm/console)
-
-On the Left hand menu expand Service integration, and click on Buses.
-
-In the Buses panel click on New
-
-Enter a name for the bus, eg MyBus, and click Next, and then click Finish and Save the changes.
-
-In the Buses panel click on MyBus
-
-Find the Topology secion and click on Bus members
-
-Click on Add, leave the defaults and click Next, Next, Next, Finish, and Save the changes.
-
-Restart WebSphere and when back up logon back on to the Integrated Solutions Console
-
-2) Now define the JMS rescources
-
-On the Left hand menu expand Resources, and JMS and click on Connection Facotories.
-
-In the Connection factories panel click New.
-
-Leave the Default messaging provider and click OK
-
-Enter "ConnectionFactory" in the Name and JNDI name and in the Bus name in the Connection pane choose MyBus and click OK
-
-On the Left hand menu in JMS click on Queues
-
-In the Queues panel click New, accept the defaults and click OK
-
-Enter "HelloWorldService" for the Name and JNDI name and in the Bus name in the Connection pane choose MyBus,
-and then in the Queue name drop down list choose "Create SIB destination"
-
-In the Set queue attributes panel enter "HelloWorldService" for the Identifier and click Next, Next, and Finish
-
-That should take you back to the Queues panel where you can click OK to create the new JMS queue.
-
-Save the changes
-
-Restart WebSphere and you're done.
-
-
-
-Others...
----------
-
-
-
-
\ No newline at end of file
diff --git a/samples/webapps/helloworld-jms/pom.xml b/samples/webapps/helloworld-jms/pom.xml
deleted file mode 100644
index 5d4b787..0000000
--- a/samples/webapps/helloworld-jms/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-jms-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample JMS HelloWorld in a WebApp</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-jms</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.3.0</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-jms</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-jms</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite b/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite
deleted file mode 100644
index c51985b..0000000
--- a/samples/webapps/helloworld-jms/src/main/webapp/WEB-INF/web.composite
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloWorldClientComponent"/>
- </component>
-
- <component name="HelloWorldClientComponent">
- <implementation.java class="sample.HelloWorldClient"/>
- <reference name="helloWorldRef">
- <binding.jms uri="jms:HelloWorldService"/>
- </reference>
- </component>
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="sample.HelloWorldServiceImpl" />
- <service name="HelloWorldService">
- <binding.jms />
- </service>
- </component>
-
-</composite>
diff --git a/samples/webapps/helloworld-js-client/pom.xml b/samples/webapps/helloworld-js-client/pom.xml
deleted file mode 100644
index f9e3d30..0000000
--- a/samples/webapps/helloworld-js-client/pom.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-js-client-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld Javascript Client</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-json-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-js-client</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-js-client</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java b/samples/webapps/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java
deleted file mode 100644
index 099b442..0000000
--- a/samples/webapps/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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 itest;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-
-import org.junit.Test;
-
-/**
- * Verfiy the serverside code is working, not sure how to easily itest the browser javascript code
- */
-public class HelloworldTestCase {
-
- @Test
- public void testA() throws MalformedURLException, IOException {
-
- URL url = new URL("http://localhost:8085/helloworld-js-client/org.oasisopen.sca.componentContext.js/foo/call/plaincall/service.sayHello.dwr");
- URLConnection conn = url.openConnection();
- conn.setDoOutput(true);
- OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
-
- // to find this run the sample through TCPMON to capture the messages
-
- String data = URLEncoder.encode("callCount", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8");
- data += "&" + URLEncoder.encode("page", "UTF-8") + "=" + URLEncoder.encode("/helloworld-js-client/", "UTF-8");
- data += "&" + URLEncoder.encode("httpSessionId", "UTF-8") + "=" + URLEncoder.encode("", "UTF-8");
- data += "&" + URLEncoder.encode("scriptSessionId", "UTF-8") + "=" + URLEncoder.encode("A023DA664E56F075491BE1B87B37B02671", "UTF-8");
- data += "&" + URLEncoder.encode("c0-scriptName", "UTF-8") + "=" + URLEncoder.encode("service", "UTF-8");
- data += "&" + URLEncoder.encode("c0-methodName", "UTF-8") + "=" + URLEncoder.encode("sayHello", "UTF-8");
- data += "&" + URLEncoder.encode("c0-id", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8");
- data += "&" + URLEncoder.encode("c0-param0", "UTF-8") + "=" + URLEncoder.encode("string:petra", "UTF-8");
- data += "&" + URLEncoder.encode("batchId", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8");
-
- wr.write(data);
- wr.flush();
-
- BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
- rd.readLine(); // throw 'allowScriptTagRemoting is false.';
- rd.readLine(); //#DWR-INSERT
- rd.readLine(); //#DWR-REPLY
- String line = rd.readLine(); // dwr.engine._remoteHandleCallback('0','0',"Hello petra");
- wr.close();
- rd.close();
-
- assertTrue(line.endsWith("\"Hello petra\");"));
-
- }
-
-}
diff --git a/samples/webapps/helloworld-jsf/pom.xml b/samples/webapps/helloworld-jsf/pom.xml
deleted file mode 100644
index 67919c3..0000000
--- a/samples/webapps/helloworld-jsf/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-jsf-webapp</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld JSF</name>
- <packaging>war</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-Beta1</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-myfaces</artifactId>
- <version>2.0-Beta1</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-jsf</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-jsf</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld-jsp/pom.xml b/samples/webapps/helloworld-jsp/pom.xml
deleted file mode 100644
index 566eaa5..0000000
--- a/samples/webapps/helloworld-jsp/pom.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-jsp-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld JSP</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-jsp</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-jsp</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld-servlet/pom.xml b/samples/webapps/helloworld-servlet/pom.xml
deleted file mode 100644
index 134aca5..0000000
--- a/samples/webapps/helloworld-servlet/pom.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-servlet-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld Servlet</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-servlet</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-servlet</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
-
diff --git a/samples/webapps/helloworld-stripes/pom.xml b/samples/webapps/helloworld-stripes/pom.xml
deleted file mode 100644
index 68dfecf..0000000
--- a/samples/webapps/helloworld-stripes/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-stripes-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld using Stripes</name>
-
- <dependencies>
-
- <!-- Tuscany dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <!-- Stripes Framework dependencies -->
- <dependency>
- <groupId>net.sourceforge.stripes</groupId>
- <artifactId>stripes</artifactId>
- <version>1.5.2</version>
- </dependency>
-
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>1.1.2</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>2.6</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld-stripes</finalName>
- <plugins>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld-stripes</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld/README b/samples/webapps/helloworld/README
deleted file mode 100644
index 828aadb..0000000
--- a/samples/webapps/helloworld/README
+++ /dev/null
@@ -1,7 +0,0 @@
-The README in the <distribution-unpack-dir>/samples directory provides
-general instructions about building and running samples. (where
-distribution-unpack-dir is the directory in which you unpacked the tuscany
-binary distribution archive). Take a look there first (noting at you read it that this sample
-is not a new style sample).
-
-TODO - finish
\ No newline at end of file
diff --git a/samples/webapps/helloworld/pom.xml b/samples/webapps/helloworld/pom.xml
deleted file mode 100644
index cb50dd3..0000000
--- a/samples/webapps/helloworld/pom.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-helloworld-webapp</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld</name>
- <packaging>war</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <version>2.0-Beta1</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>helloworld</finalName>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy</id>
- <phase>compile</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld</artifactId>
- <version>${pom.version}</version>
- <!-- should really go in the target folder but i can't get jetty:run to work using that -->
- <outputDirectory>src/main/webapp/WEB-INF/sca-contributions</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.18</version>
- <configuration>
- <contextPath>helloworld</contextPath>
- <stopKey>foo</stopKey>
- <stopPort>9999</stopPort>
- </configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>process-test-classes</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <overrideWebXml>src/test/resources/test-web.xml</overrideWebXml>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- <connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>8085</port>
- </connector>
- </connectors>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml b/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 85aed34..0000000
--- a/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>Apache Tuscany Helloworld Sample</display-name>
-
- <context-param>
- <param-name>contributions</param-name>
- <param-value>/WEB-INF/sca-contributions</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.apache.tuscany.sca.config</param-name>
- <param-value>uri:default</param-value>
- </context-param>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
diff --git a/shades/base-nodep/pom.xml b/shades/base-nodep/pom.xml
deleted file mode 100644
index 2ceb07b..0000000
--- a/shades/base-nodep/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base-nodep</artifactId>
- <name>Apache Tuscany SCA Base Jar including dependencies</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <!-- Tuscany uses java.util.logging but extensions and dependencies may use
- log4j, commons-logging, slf4j, or java.util.logging. So inlcude slf4j
- modules for all of those that delegate to java.util.logging. This should
- mean there's no need for any other logging jars and no conflicts on
- logging verisons as those are handled transparently by slf4j, and,
- everything uses and can be configured just with java.util.logging.
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.0</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>1.6.0</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <version>1.6.0</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <version>1.6.0</version>
- </dependency>
- -->
-
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.5.0-v20090520</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/base/pom.xml b/shades/base/pom.xml
deleted file mode 100644
index 10f6a43..0000000
--- a/shades/base/pom.xml
+++ /dev/null
@@ -1,318 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <name>Apache Tuscany SCA Base Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-domain-node</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-launcher</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <!-- dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-javascript</artifactId>
- <version>${pom.version}</version>
- </dependency -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-hazelcast-runtime</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-stripes</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>net.sourceforge.stripes</groupId>
- <artifactId>stripes</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-wink</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-jaxws-ri</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-rmi</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-osgi</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-osgi-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
-<!-- these remaining dependencies are not required when using JDK6, so use a scope of provided -->
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- <version>1.0.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.12</version>
- <scope>provided</scope>
- </dependency>
-
-
- <dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.soap</groupId>
- <artifactId>saaj-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.jws</groupId>
- <artifactId>jsr181-api</artifactId>
- <version>1.0-MR1</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0-2</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <createSourcesJar>true</createSourcesJar>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- <include>org.apache.tuscany.sca.shades:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <manifestEntries>
- <Main-Class>org.apache.tuscany.sca.launcher.LauncherMain</Main-Class>
- </manifestEntries>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/bpel-nodep/pom.xml b/shades/bpel-nodep/pom.xml
deleted file mode 100644
index 73018c5..0000000
--- a/shades/bpel-nodep/pom.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-bpel-nodep</artifactId>
- <name>Apache Tuscany SCA BPEL Jar including dependencies</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-bpel</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-webservices</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/bpel/pom.xml b/shades/bpel/pom.xml
deleted file mode 100644
index b8e74ff..0000000
--- a/shades/bpel/pom.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-bpel</artifactId>
- <name>Apache Tuscany SCA BPEL Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- </exclusion>
- <!-- exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion -->
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/jms-nodep/pom.xml b/shades/jms-nodep/pom.xml
deleted file mode 100644
index 3d95ab4..0000000
--- a/shades/jms-nodep/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-jms-nodep</artifactId>
- <name>Apache Tuscany SCA JMS Support Jar including dependencies</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-jms</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- <version>5.3.0</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.activemq</groupId>
- <artifactId>kahadb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.activemq.protobuf</groupId>
- <artifactId>activemq-protobuf</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-net</groupId>
- <artifactId>commons-net</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/jms/pom.xml b/shades/jms/pom.xml
deleted file mode 100644
index 0765281..0000000
--- a/shades/jms/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-jms</artifactId>
- <name>Apache Tuscany SCA JMS Support Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/json-nodep/pom.xml b/shades/json-nodep/pom.xml
deleted file mode 100644
index ed376bc..0000000
--- a/shades/json-nodep/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-json-nodep</artifactId>
- <name>Apache Tuscany SCA JSONP Support Jar including dependencies</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-json</artifactId>
- <version>${pom.version}</version>
-
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/json/pom.xml b/shades/json/pom.xml
deleted file mode 100644
index cfc0dae..0000000
--- a/shades/json/pom.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-json</artifactId>
- <name>Apache Tuscany SCA JSON Support Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonp-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-common-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-impl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-client</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/pom.xml b/shades/pom.xml
deleted file mode 100644
index cba0194..0000000
--- a/shades/pom.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <relativePath>../pom.xml</relativePath>
- <version>2.0-Beta1</version>
- </parent>
-
- <artifactId>tuscany-shades</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Shaded Jars</name>
-
- <modules>
- <module>base</module>
- <module>base-nodep</module>
- <module>jms</module>
- <module>json</module>
- <module>json-nodep</module>
- <module>spring</module>
- <module>spring-nodep</module>
- <module>webservices</module>
- <module>webservices-nodep</module>
- </modules>
-
-</project>
diff --git a/shades/spring-nodep/pom.xml b/shades/spring-nodep/pom.xml
deleted file mode 100644
index b7e9b85..0000000
--- a/shades/spring-nodep/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-spring-nodep</artifactId>
- <name>Apache Tuscany SCA Spring Support Jar including dependencies</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-spring</artifactId>
- <version>${pom.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/spring/pom.xml b/shades/spring/pom.xml
deleted file mode 100644
index 488079d..0000000
--- a/shades/spring/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-spring</artifactId>
- <name>Apache Tuscany SCA Spring Support Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring-runtime</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/webservices-nodep/pom.xml b/shades/webservices-nodep/pom.xml
deleted file mode 100644
index 33af4ec..0000000
--- a/shades/webservices-nodep/pom.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-webservices-nodep</artifactId>
- <name>Apache Tuscany SCA Web Services Jar including dependencies</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-webservices</artifactId>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/shades/webservices/pom.xml b/shades/webservices/pom.xml
deleted file mode 100644
index 364b058..0000000
--- a/shades/webservices/pom.xml
+++ /dev/null
@@ -1,208 +0,0 @@
-<?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.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-shades</artifactId>
- <version>2.0-Beta1</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-webservices</artifactId>
- <name>Apache Tuscany SCA Web Services Jar</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
- <version>${pom.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-activation_1.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-stax-api_1.0_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.rampart</groupId>
- <artifactId>rampart-trust</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>opensaml</groupId>
- <artifactId>opensaml</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca.shades</groupId>
- <artifactId>tuscany-base</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
- <artifactSet>
- <includes>
- <include>org.apache.tuscany.sca:*</include>
- </includes>
- </artifactSet>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/testing/compliance-tests/assembly/pom.xml b/testing/compliance-tests/assembly/pom.xml
new file mode 100644
index 0000000..fc631e5
--- /dev/null
+++ b/testing/compliance-tests/assembly/pom.xml
@@ -0,0 +1,154 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-assembly</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Assembly</name>
+
+ <dependencies>
+
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-asm-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- Not sure why this is required for ASM. But ASM_6039 & ASM_6036 fail without it -->
+ <dependency>
+ <groupId>com.sun.xml.ws</groupId>
+ <artifactId>jaxws-rt</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+
+ <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+<!--
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+-->
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/ASM_5016_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_6004_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_6007_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_6008_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_6014_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_6034_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_12007_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ <exclude>**/ASM_12008_TestCase.java</exclude><!-- TUSCANY-3709 -->
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-assembly-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-asm-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
new file mode 100644
index 0000000..e7a161a
--- /dev/null
+++ b/testing/compliance-tests/assembly/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
@@ -0,0 +1,217 @@
+/*
+ * 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.sca.otest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import testClient.TestException_Exception;
+import client.RuntimeBridge;
+
+/**
+ * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
+ *
+ */
+public class TuscanyRuntimeBridge implements RuntimeBridge {
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
+ protected NodeFactory launcher;
+ protected Node node;
+ protected Properties expectedErrorMessages;
+
+ public TuscanyRuntimeBridge() {
+ // read test error mapping
+ expectedErrorMessages = new Properties();
+ try {
+ InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
+ expectedErrorMessages.load(propertiesStream);
+ } catch (IOException e) {
+ System.out.println("Unable to read oasis-sca-tests-errors.properties file");
+ }
+ }
+
+ public boolean startContribution(String compositeName, String contributionLocation, String[] contributionNames) throws Exception {
+ try {
+ // Tuscany specific code which starts the contribution(s) holding the test
+ launcher = NodeFactory.newInstance();
+
+ Contribution[] contributions = new Contribution[contributionNames.length];
+ String[] contributionURIs = getContributionURIs(contributionLocation, contributionNames);
+ for (int i = 0; i < contributions.length; i++) {
+ contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
+ } // end for
+
+ node = launcher.createNode(compositeName, contributions);
+ // Start the node
+ node.start();
+
+ // For debugging
+ // print out the composites that have been read in success cases
+ // System.out.println(((NodeImpl)node).dumpDomainComposite());
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ throw e;
+ } // end try
+
+ return true;
+ } // end method startContribution
+
+ /**
+ * Gets the location of the Contributions as URIs
+ * @param contributionLocation - a location pattern URI, which contains one or more "%1"
+ * substrings, which are substituted with the name of the contribution to get the URI of
+ * the contribution
+ * @return the contribution locations as an array of Strings
+ */
+ protected String[] getContributionURIs(String contributionLocation, String[] contributionNames) throws Exception {
+ String[] locations = new String[contributionNames.length];
+
+ if (locations != null && contributionLocation != null) {
+
+ for (int i = 0; i < locations.length; i++) {
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
+
+ locations[i] = aLocation;
+ } // end for
+ } else {
+ if (locations == null) {
+ // No contribution specified - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
+ } else {
+ // No contribution location supplied - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
+ } // end if
+ } // end if
+
+ return locations;
+ } // end getContributionURI
+
+ public void stopContribution() {
+ if (node != null) {
+ node.stop();
+ } // end if
+ if (launcher != null) {
+ launcher.destroy();
+ } // end if
+ } // end method stopContribution
+
+ public void checkError(String testName, Throwable ex) throws Throwable {
+
+ String expectedMessage = expectedErrorMessages.getProperty(testName);
+ String receivedMessage = getErrorMessage(ex);//ex.getMessage();
+
+ if (expectedMessage == null){
+ writeMissingMessage(testName, ex);
+ fail("Null expected error message for test " + testName +
+ "Please add message to oasis-sca-tests-errors.properties");
+ } // end if
+
+ if (receivedMessage == null){
+ ex.printStackTrace();
+ fail("Null received error message for test " + testName);
+ } // end if
+
+ if (expectedMessage.startsWith("*")) {
+ // allow using * to ignore a message comparison
+ return;
+ }
+
+ // Deal with the case where the message has variable parts within it
+ // marked with the characters ***. Here we tokenize the expected string
+ // and make sure all the individual parts are present in the results string
+ String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+
+ if (expectedMessageParts.length > 1){
+ int foundParts = 0;
+ for(int i = 0; i < expectedMessageParts.length; i++){
+ if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+ foundParts++;
+ }
+ }
+
+ if (foundParts == expectedMessageParts.length){
+ return;
+ }
+ }
+
+
+ // Deal with the case where the end of the message is variable (eg contains absolute filenames)
+ // and where the only relevant part is the start of the message - in this case the expected
+ // message only contains the stem section which is unchanging...
+ if( receivedMessage.length() > expectedMessage.length() ) {
+ // Truncate the received message to the length of the expected message
+ receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
+ } // end if
+
+ if (!expectedMessage.equals(receivedMessage)) {
+ writeIncorrectMessage(testName, expectedMessage, receivedMessage);
+ }
+
+ assertEquals( expectedMessage, receivedMessage );
+
+ return;
+
+ }
+
+ protected void writeMissingMessage(String testName, Throwable ex) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
+ out.write(testName + "=*");
+ out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected void writeIncorrectMessage(String testName, String expected, String received) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
+ out.write(testName); out.newLine();
+ out.write(" " + expected); out.newLine();
+ out.write(" " + received); out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected String getErrorMessage(Throwable ex) {
+ String errorMessage = null;
+
+ if (ex instanceof TestException_Exception) {
+ TestException_Exception te = (TestException_Exception) ex;
+ errorMessage = te.getFaultInfo().getMessage();
+ } else {
+ errorMessage = ex.getMessage();
+ }
+
+ return errorMessage;
+ }
+} // end class TuscanyRuntimeBridge
diff --git a/testing/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..2601b6b
--- /dev/null
+++ b/testing/compliance-tests/assembly/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=Java
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=./target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..b48764e
--- /dev/null
+++ b/testing/compliance-tests/assembly/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -0,0 +1,95 @@
+# 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.
+
+ASM_4002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TestComponent1 Service = Service1
+ASM_4003=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = TestComponent1 Reference = Reference1
+ASM_4004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40005,ASM60014] Duplicate implementation property name: Component = TestComponent1 Property = propertyName
+ASM_4007=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - propertyName
+ASM_4008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40011,ASM60034] No value configured on a mustSupply property: Component = TestComponent1 Property = propertyName
+ASM_5004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - [ASM50022] Too many targets on reference: reference1
+ASM_5005=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: Test_ASM_5005Component1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = Test_ASM_5005Component1 Service = Service1
+ASM_5006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Component type service not found for component service (missing @Remotable annotation?): Component = TestComponent1 Service = InvalidName
+ASM_5007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: Test_ASM_5007Component1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = Test_ASM_5007Component1 Reference = Reference1
+ASM_5008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50008] Component type reference not found for component reference: Component = TestComponent1 Reference = InvalidName
+ASM_5009=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [ASM50001] Duplicate component name: Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component = TestComponent1
+ASM_5010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComponent1 Service = Service1
+ASM_5014=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50009] Component reference multiplicity incompatible with reference multiplicity: Component = TestComponent1 Reference = Reference1
+ASM_5023=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite11, Component: Composite11Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite4, Component: Composite4Component1] - [ASM50022] Too many targets on reference: reference1
+ASM_5024=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Reference: Reference1] - [ASM50026] Composite {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component TestComponent1 Reference Reference1 must not specify endpoints using both target attribute and with a binding child element
+ASM_5027=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Duplicate component property name: Component = TestComponent1 Property = serviceName
+ASM_5028=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50031] Property not found for component property: Component = TestComponent1 Property = randomName
+ASM_5029=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM50032] The property component TestComponent1 property complexType has many values but its "many" attribute is set to false
+ASM_5030=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_5030, Artifact: Test_ASM_5030.composite] - ASM50033: value attribute exists for the property element
+ASM_5035=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - complexType
+ASM_5036=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5036Component1] - [ASM_5036] The property component TEST_ASM_5036Component1 property complexType has XSD type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType2 while its component type property has the XSD type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType1
+ASM_5037=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5037Component1] - [ASM50031] Property not found for component property: Component = TEST_ASM_5037Component1 Property = bogusName
+ASM_5038=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5038Component1] - [ASM50027] The property serviceData1 on component TEST_ASM_5038Component1 has a value which does not match the simple type {http://www.w3.org/2001/XMLSchema}float with which it is associated
+ASM_5039=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5039Component1] - [ASM50038] The property complexType on component TEST_ASM_5039Component1 has a value which does not match the complex type {http://docs.oasis-open.org/ns/opencsa/scatests/200903}ComplexType1 with which it is associated. Validation reported cvc-complex-type.2.4.d: Invalid content was found starting with element 'test:thirdData'. No child element is expected at this point.
+ASM_5040=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_5040Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite74] - [ASM50042] Composite reference promotes component reference with 1..1 multiplicity and nonOverridable flag set true: Composite = TestComposite74.composite Composite reference = Reference1 Component reference = Reference1
+ASM_6001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_6001, Artifact: TestDuplicate1.composite] - [ASM_6001] More than one composite with the same name {http://docs.oasis-open.org/ns/opencsa/scatests/200903}DuplicateComposite found in contribution
+ASM_6002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TestComponent1 Service = Service1
+ASM_6003=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite17] - [ASM60004,ASM60032] Promoted component service not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite17 Service = SpuriousComponent/SpuriousService
+ASM_6005=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40004,ASM50007,ASM60006] Duplicate implementation reference name: Component = TestComponent1 Reference = Reference1
+ASM_6006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite20] - [ASM60007] Promoted component reference not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite20 Reference = Composite20Componentz/Reference1
+ASM_6008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6008Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite22] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference. Operation operation2 not found on target
+ASM_6012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6012TestComponent1] - [ASM40005,ASM60014] Duplicate implementation property name: Component = TEST_ASM_6012TestComponent1 Property = propertyName
+ASM_6016=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite30, Component: TestComponent1, Reference: Reference1] - [ASM60028] No target services found for the component reference to be autowired: Reference1
+ASM_6020=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Reference: Reference1] - [ASM60028] No target services found for the component reference to be autowired: Reference1
+ASM_6021=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_6021TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite31] - [ASM60004,ASM60032] Promoted component service not found: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite31 Service = Not_A_URI_of_a_Component
+ASM_6022=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite32, Component: TestComponent1] - [ASM60033] No targets for reference: Composite = {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite32 Reference = Reference1
+ASM_6023=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM40011,ASM60034] No value configured on a mustSupply property: Component = TestComponent1 Property = simpleType
+ASM_6024=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM60030,JCI50004,JCI80001] Component implementation not resolved: Component = TestComponent1 Uri = TestComponent1
+ASM_6025=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [ASM50001] Duplicate component name: Composite = {http://docs.oasis-open.org/ns/opencsa/sca/200912} Component = TestComponent1
+ASM_6028=org.apache.tuscany.sca.contribution.processor.ContributionReadException: [ASM40010,ASM60040] Error: property has both @type and @element attribute values - InvalidProperty
+ASM_6029=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [ASM60041] Error: Composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_ASM_6029 can only include another composite with the identical @local attribute value
+ASM_6030=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [ASM60042] Error: Composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Invalid_composite_name is not a valid composite within the domain
+ASM_6031=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite39] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
+ASM_6032=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite40] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
+ASM_6033=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite41] - [ASM60011] Composite reference multiplicity incompatible with component reference multiplicity: Composite = TestComposite41.composite Composite reference = Reference1 Component reference = Reference1
+ASM_6036=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - No endpoints found in the domain that match the reference (@***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (@***)Endpoint: URI = TEST_ASM_6036Component1#service(ServiceZ) [Unresolved]
+ASM_6039=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - No endpoints found in the domain that match the reference (@***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (@***)Endpoint: URI = TEST_ASM_6039Component1#service-binding(Service1/harry) [Unresolved]
+ASM_8001=org.apache.tuscany.sca.interfacedef.OverloadedOperationException: [JCA20001] Cannot overload operation operation1 on org.oasisopen.sca.test.Service3 as it is a @Remotable interface
+ASM_8004=org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callback org.oasisopen.sca.test.Service6Callback must be remotable on remotable interface org.oasisopen.sca.test.Service6
+ASM_8005=org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callbackorg.oasisopen.sca.test.Service7Callback must not be remotable on local interface org.oasisopen.sca.test.Service7
+ASM_8006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_8006, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_ASM_8006] - The interface.wsdl element has a forward interface with a callback declared in the WSDL {http://test.sca.oasisopen.org/}Service9Callback and a callback interface also declared using the callbackInterface attribute {http://test.sca.oasisopen.org/}Service8Callback but the callback interfaces are not equal.
+ASM_8007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent2] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComponent2 Service = Service1
+ASM_8008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TestComponent1 Reference = Reference1
+ASM_8009=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8009Component1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TEST_ASM_8009Component1 Reference = Reference1
+ASM_8010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8010Component2, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite63] - Interface of composite service Service1 must be subset of the interface declared by promoted component service. Callback operation not found on target
+ASM_8011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite62] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference. Callback operation not found on target
+ASM_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8012Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite64] - [ASM60008,ASM60013] Interface of composite reference Reference1 must be compatible with the interface declared by promoted component reference.
+ASM_8014=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent2, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Joe and {http://docs.oasis-open.org/ns/opencsa/sca/200912}confidentiality.transport are mutually exclusive
+ASM_8017=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_8017Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite72] - Interface of composite service Service1a must be subset of the interface declared by promoted component service. Callback interface doesn't match
+ASM_8018=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestClient Service = TestInvocation
+ASM_8019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_8019, Artifact: Test_ASM_8019.composite] - The interface.wsdl interface {http://test.sca.oasisopen.org/}Service1 element can only have a remotable attribute with the value "true" as WSDL interface are assumed to be remotable by default. The value that was found is: false.
+ASM_9002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - Multiple bindings with the same name for a service: Service = Service1 Binding name = Fred
+ASM_9005=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_9005Component1] - [ASM90005] The SCA binding Service1 on component TEST_ASM_9005Component1 service Service1 should not have a URI and the URI is currently set to http://example/bar
+ASM_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_10001, Artifact: META-INF/definitions.xml, Definitions: jar:file:***ASM_10001***.zip!/META-INF/definitions.xml] - [ASM10001,POL30002] Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}Fred found in domain
+ASM_10003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_10003, Artifact: META-INF/definitions.xml, Definitions: jar:file:***ASM_10003***.zip!/META-INF/definitions.xml] - XMLSchema validation error occured in: Test_ASM_10003.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":intent, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySet, "http://docs.oasis-open.org/ns/opencsa/sca/200912":bindingType, "http://docs.oasis-open.org/ns/opencsa/sca/200912":implementationType, "http://docs.oasis-open.org/ns/opencsa/sca/200912":externalAttachment, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
+ASM_12003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Invalid interface when resolving
+ASM_12007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComposite5TestComponent1 Service = Service1 Operations called operation2 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}int target = {http://www.w3.org/2001/XMLSchema}string don't match for output types|||
+ASM_12008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_ASM_12008TestComponent1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/2009032}TestComposite5, Component: TestComposite5TestComponent1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TestComposite5TestComponent1 Service = Service1 Operations called operation2 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}int target = {http://www.w3.org/2001/XMLSchema}string don't match for output types|||
+ASM_12011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestComponent1] - [ASM60030,JCI50004,JCI80001] Component implementation not resolved: Component = TestComponent1 Uri = TestComponent1
+ASM_12012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_12012, Artifact: META-INF/sca-contribution.xml] - XMLSchema validation error occured in: jar:file:***ASM_12012***.zip!/META-INF/sca-contribution.xml ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'component'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":deployable, "http://docs.oasis-open.org/ns/opencsa/sca/200912":importBase, "http://docs.oasis-open.org/ns/opencsa/sca/200912":exportBase, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
+ASM_13001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13001, Artifact: Test_ASM_13001.composite] - XMLSchema validation error occured in: Test_ASM_13001.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'sevrice'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
+ASM_13002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13002, Artifact: Test_ASM_13002.composite] - XMLSchema validation error occured in: Test_ASM_13002.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":binding, "http://docs.oasis-open.org/ns/opencsa/sca/200912":callback, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
+ASM_13003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13003, Artifact: Test_ASM_13003.composite] - XMLSchema validation error occured in: Test_ASM_13003.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'binding.ws'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":include, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment, "http://docs.oasis-open.org/ns/opencsa/sca/200912":service, "http://docs.oasis-open.org/ns/opencsa/sca/200912":property, "http://docs.oasis-open.org/ns/opencsa/sca/200912":component, "http://docs.oasis-open.org/ns/opencsa/sca/200912":reference, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wire, WC[##other:"http://docs.oasis-open.org/ns/opencsa/sca/200912"]}' is expected.
+ASM_13004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestClient_0002, Component: TestClient_0002TestClient] - [ASM40011,ASM60034] No value configured on a mustSupply property
+ASM_13005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13005, Artifact: Test_ASM_13005.composite] - XMLSchema validation error occured in: Test_ASM_13005.composite ,line = ***, column = ***, Message = cvc-elt.2: The value of {abstract} in the element declaration for 'implementation' must be false.
+ASM_13006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13006, Artifact: Test_ASM_13006.composite] - XMLSchema validation error occured in: Test_ASM_13006.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'callback' is not allowed to appear in element 'interface.java'.
+ASM_13007=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13007, Artifact: Test_ASM_13007.composite] - XMLSchema validation error occured in: Test_ASM_13007.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'mulplicity' is not allowed to appear in element 'reference'.
+ASM_13008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: ASM_13008, Artifact: Test_ASM_13008.composite] - XMLSchema validation error occured in: Test_ASM_13008.composite ,line = ***, column = ***, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'operation'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":documentation, "http://docs.oasis-open.org/ns/opencsa/sca/200912":wireFormat, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationSelector, "http://docs.oasis-open.org/ns/opencsa/sca/200912":requires, "http://docs.oasis-open.org/ns/opencsa/sca/200912":policySetAttachment}' is expected.
\ No newline at end of file
diff --git a/testing/compliance-tests/binding-jms/pom.xml b/testing/compliance-tests/binding-jms/pom.xml
new file mode 100644
index 0000000..3088295
--- /dev/null
+++ b/testing/compliance-tests/binding-jms/pom.xml
@@ -0,0 +1,132 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-binding-jms</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Binding JMS</name>
+
+ <dependencies>
+
+ <dependency>
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-jms-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>5.2.0</version>
+ </dependency>
+
+ <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- exclude>**/POJO_8011_TestCase.java</exclude -->
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-jms-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-jms-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/compliance-tests/binding-jms/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/binding-jms/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
similarity index 100%
rename from compliance-tests/binding-jms/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
rename to testing/compliance-tests/binding-jms/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
diff --git a/testing/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..dc3296a
--- /dev/null
+++ b/testing/compliance-tests/binding-jms/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=Java
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..804777a
--- /dev/null
+++ b/testing/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -0,0 +1,48 @@
+# Copyright(C) OASIS(R) 2010. All Rights Reserved.
+# OASIS trademark, IPR and other policies apply.
+#
+# Detailed Tuscany error messages for SCA JMS Binding testcases, where the testcase causes an
+# exception either in initialization or at runtime
+#
+BJM_3001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3001, Artifact: Test_BJM_3001.composite] - URI must start with the scheme jms:jndi: or jms:queue: or jms:topic: for uri: http://test.sca.oasisopen.org/
+BJM_3002=Test service got an exception during execution: org.apache.tuscany.sca.binding.jms.JMSBindingException JMS Destination BJM_3002_Queue not found with create mode of "ifNotExist" while registering binding Reference1 invoker
+BJM_3011=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination TEST_BJM_3011_Queue already exists but has create mode of "always" while registering service Service1 listener
+BJM_3011A=org.apache.tuscany.sca.binding.jms.JMSBindingException: Incorrect resource type for ActivationSpec: org.apache.activemq.command.ActiveMQQueue
+BJM_3011C=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3011C, Artifact: Test_BJM_3011C.composite] - When connection factory "AlreadyExists" element is present then a destination name must also be defined
+BJM_3011D=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination AlreadyExists already exists but has create mode of "always" while registering service Service1 listener
+BJM_3012A=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3012A, Artifact: Test_BJM_3012A.composite] - Must specify jndiName attribute when create mode is "ifNotExist"
+BJM_3012C=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3012C, Artifact: Test_BJM_3012C.composite] - Missing ConnectionFactory Name
+BJM_3012D=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3012D, Artifact: Test_BJM_3012D.composite] - Must specify jndiName attribute when create mode is "ifNotExist"
+BJM_3013=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination TEST_BJM_3013_Queue not found with create mode of "ifNotExist" while registering service Service1 listener
+BJM_3013A=org.apache.tuscany.sca.binding.jms.JMSBindingException: Can not create ActivationSpec
+BJM_3013C= org.apache.tuscany.sca.binding.jms.JMSBindingException: connection factory not found: TEST_BJM_3013_CF
+BJM_3014=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination TEST_BJM_3014_Queue expecting type of queue but found topic while registering service Service1 listener
+BJM_3014A=org.apache.tuscany.sca.binding.jms.JMSBindingException: Incorrect resource type for ActivationSpec: org.apache.activemq.command.ActiveMQTopic
+BJM_3014C=org.apache.tuscany.sca.binding.jms.JMSBindingException: JNDI resource 'TEST_BJM_3014_Queue' is not a JMS ConnectionFactory
+BJM_3014D=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination TEST_BJM_3014_Topic expecting type of queue but found topic while registering service Service1 listener
+BJM_3015Aa=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3015Aa, Artifact: Test_BJM_3015Aa.composite] - Must specify jndiName attribute when create mode is "never"
+BJM_3015Ab=org.apache.tuscany.sca.binding.jms.JMSBindingException: ActivationSpec specifies create mode of "never" but resource does not exist at jndiName DoesntExist
+BJM_3015Ac=org.apache.tuscany.sca.binding.jms.JMSBindingException: Incorrect resource type for ActivationSpec: org.apache.activemq.command.ActiveMQQueue
+BJM_3015Ca=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3015Ca, Artifact: Test_BJM_3015Ca.composite] - Missing ConnectionFactory Name
+BJM_3015Cb=org.apache.tuscany.sca.binding.jms.JMSBindingException: connection factory not found: DoesntExist
+BJM_3015Cc=org.apache.tuscany.sca.binding.jms.JMSBindingException: JNDI resource 'TEST_BJM_3015_Queue' is not a JMS ConnectionFactory
+BJM_3015Da=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3015Da, Artifact: Test_BJM_3015Da.composite] - Must specify jndiName attribute when create mode is "never"
+BJM_3015Db=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination BJM_3015_DoesntExist not found but create mode of "never" while registering service Service1 listener
+BJM_3015Dc=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination TEST_BJM_3015_Topic expecting type of queue but found topic while registering service Service1 listener
+BJM_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3017, Artifact: Test_BJM_3017.composite] - XMLSchema validation error occured in: Test_BJM_3017.composite ,line = 36, column = 17, Message = cvc-complex-type.2.4.a: Invalid content was found starting with element 'activationSpec'. One of '{"http://docs.oasis-open.org/ns/opencsa/sca/200912":response, "http://docs.oasis-open.org/ns/opencsa/sca/200912":headers, "http://docs.oasis-open.org/ns/opencsa/sca/200912":messageSelection, "http://docs.oasis-open.org/ns/opencsa/sca/200912":resourceAdapter, "http://docs.oasis-open.org/ns/opencsa/sca/200912":operationProperties, "http://docs.oasis-open.org/ns/opencsa/sca/200912":extensions}' is expected.
+BJM_3018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3018, Artifact: Test_BJM_3018.composite] - When connection factory "TEST_BJM_3018_CF" element is present then a destination name must also be defined
+BJM_3019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3019, Artifact: Test_BJM_3019.composite] - Activation spec name TEST_BJM_3019_AS must match destination name TEST_BJM_3019_Queue_XXX
+BJM_3020=Test service got an exception during execution: org.apache.tuscany.sca.binding.jms.JMSBindingException Activation spec can not be specified on an SCA reference binding.
+BJM_3021=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3021, Artifact: Test_BJM_3021.composite] - XMLSchema validation error occured in: Test_BJM_3021.composite ,line = 44, column = 21, Message = cvc-complex-type.2.4.d: Invalid content was found starting with element 'activationSpec'. No child element is expected at this point.
+BJM_3022=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3022, Artifact: Test_BJM_3022.composite] - Activation spec name TEST_BJM_3022_Response_AS must match destination name TEST_BJM_3022_Response_Queue
+BJM_3023=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.binding.jms.JMSBindingException: [BJM30023] response/activationSpec element MUST NOT be present when the binding is being used for an SCA service
+BJM_3029=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3029, Artifact: Test_BJM_3029.composite] - XMLSchema validation error occured in: Test_BJM_3029.composite ,line = 37, column = 17, Message = cvc-complex-type.3.2.2: Attribute 'selectedOperation' is not allowed to appear in element 'operationProperties'.
+BJM_3034=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3034, Artifact: Test_BJM_3034.composite] - Destination TEST_BJM_3034_Queue can not be specified when URI jms:jndi:TEST_BJM_3034_Queue is present
+BJM_3036=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3036, Artifact: Test_BJM_3036.composite] - XMLSchema validation error occured in: Test_BJM_3036.composite ,line = 26, column = 13, Message = cvc-complex-type.3.2.2: Attribute 'invalidAttribute' is not allowed to appear in element 'binding.jms'
+BJM_3037A=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3037A, Artifact: Test_BJM_3037A.composite] - A JNDI name must be specified when an ActivationSpec has a create mode of "always"
+BJM_3037C=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BJM_3037C, Artifact: Test_BJM_3037C.composite] - Missing ConnectionFactory Name
+BJM_3037D=org.apache.tuscany.sca.binding.jms.JMSBindingException: JMS Destination Service1 already exists but has create mode of "always" while registering service Service1 listener
+BJM_4004=org.xml.sax.SAXParseException: Content is not allowed in prolog
+BJM_4011=Cannot determine service operation
+BJM_6016=message property scaCallbackDestination does not start with 'jms:jndi:' found: DOESNT_EXIST
+
diff --git a/testing/compliance-tests/binding-ws/pom.xml b/testing/compliance-tests/binding-ws/pom.xml
new file mode 100644
index 0000000..b60630e
--- /dev/null
+++ b/testing/compliance-tests/binding-ws/pom.xml
@@ -0,0 +1,145 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-binding-ws</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Binding WS</name>
+
+ <dependencies>
+
+ <dependency>
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-ws-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-ws-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-ws-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/compliance-tests/binding-ws/sca_variables.dtd b/testing/compliance-tests/binding-ws/sca_variables.dtd
similarity index 100%
rename from compliance-tests/binding-ws/sca_variables.dtd
rename to testing/compliance-tests/binding-ws/sca_variables.dtd
diff --git a/testing/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
new file mode 100644
index 0000000..139e8b3
--- /dev/null
+++ b/testing/compliance-tests/binding-ws/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
@@ -0,0 +1,217 @@
+/*
+ * 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.sca.otest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import testClient.TestException_Exception;
+import client.RuntimeBridge;
+
+/**
+ * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
+ *
+ */
+public class TuscanyRuntimeBridge implements RuntimeBridge {
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
+ protected NodeFactory launcher;
+ protected Node node;
+ protected Properties expectedErrorMessages;
+
+ public TuscanyRuntimeBridge() {
+ // read test error mapping
+ expectedErrorMessages = new Properties();
+ try {
+ InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
+ expectedErrorMessages.load(propertiesStream);
+ } catch (IOException e) {
+ System.out.println("Unable to read oasis-sca-tests-errors.properties file");
+ }
+ }
+
+ public boolean startContribution(String compositeName, String contributionLocation, String[] contributionNames) throws Exception {
+ try {
+ // Tuscany specific code which starts the contribution(s) holding the test
+ launcher = NodeFactory.newInstance();
+
+ Contribution[] contributions = new Contribution[contributionNames.length];
+ String[] contributionURIs = getContributionURIs(contributionLocation, contributionNames);
+ for (int i = 0; i < contributions.length; i++) {
+ contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
+ } // end for
+
+ node = launcher.createNode(compositeName, contributions);
+ // Start the node
+ node.start();
+
+ // For debugging
+ // print out the composites that have been read in success cases
+ // System.out.println(((NodeImpl)node).dumpDomainComposite());
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ throw e;
+ } // end try
+
+ return true;
+ } // end method startContribution
+
+ /**
+ * Gets the location of the Contributions as URIs
+ * @param contributionLocation - a location pattern URI, which contains one or more "%1"
+ * substrings, which are substituted with the name of the contribution to get the URI of
+ * the contribution
+ * @return the contribution locations as an array of Strings
+ */
+ protected String[] getContributionURIs(String contributionLocation, String[] contributionNames) throws Exception {
+ String[] locations = new String[contributionNames.length];
+
+ if (locations != null && contributionLocation != null) {
+
+ for (int i = 0; i < locations.length; i++) {
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
+
+ locations[i] = aLocation;
+ } // end for
+ } else {
+ if (locations == null) {
+ // No contribution specified - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
+ } else {
+ // No contribution location supplied - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
+ } // end if
+ } // end if
+
+ return locations;
+ } // end getContributionURI
+
+ public void stopContribution() {
+ if (node != null) {
+ node.stop();
+ } // end if
+ if (launcher != null) {
+ launcher.destroy();
+ } // end if
+ } // end method stopContribution
+
+ public void checkError(String testName, Throwable ex) throws Throwable {
+
+ String expectedMessage = expectedErrorMessages.getProperty(testName);
+ String receivedMessage = getErrorMessage(ex);//ex.getMessage();
+
+ if (expectedMessage == null){
+ writeMissingMessage(testName, ex);
+ fail("Null expected error message for test " + testName +
+ "Please add message to oasis-sca-tests-errors.properties");
+ } // end if
+
+ if (receivedMessage == null){
+ ex.printStackTrace();
+ fail("Null received error message for test " + testName);
+ } // end if
+
+ if (expectedMessage.startsWith("*")) {
+ // allow using * to ignore a message comparison
+ return;
+ }
+
+ // Deal with the case where the message has variable parts within it
+ // marked with the characters ***. Here we tokenize the expected string
+ // and make sure all the individual parts are present in the results string
+ String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+
+ if (expectedMessageParts.length > 1){
+ int foundParts = 0;
+ for(int i = 0; i < expectedMessageParts.length; i++){
+ if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+ foundParts++;
+ }
+ }
+
+ if (foundParts == expectedMessageParts.length){
+ return;
+ }
+ }
+
+
+ // Deal with the case where the end of the message is variable (eg contains absolute filenames)
+ // and where the only relevant part is the start of the message - in this case the expected
+ // message only contains the stem section which is unchanging...
+ if( receivedMessage.length() > expectedMessage.length() ) {
+ // Truncate the received message to the length of the expected message
+ receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
+ } // end if
+
+ if (!expectedMessage.equals(receivedMessage)) {
+ writeIncorrectMessage(testName, expectedMessage, receivedMessage);
+ }
+
+ assertEquals( expectedMessage, receivedMessage );
+
+ return;
+
+ }
+
+ protected void writeMissingMessage(String testName, Throwable ex) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
+ out.write(testName + "=*");
+ out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected void writeIncorrectMessage(String testName, String expected, String received) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
+ out.write(testName); out.newLine();
+ out.write(" " + expected); out.newLine();
+ out.write(" " + received); out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected String getErrorMessage(Throwable ex) {
+ String errorMessage = null;
+
+ if (ex instanceof TestException_Exception) {
+ TestException_Exception te = (TestException_Exception) ex;
+ errorMessage = te.getFaultInfo().getMessage();
+ } else {
+ errorMessage = ex.getMessage();
+ }
+
+ return errorMessage;
+ }
+} // end class TuscanyRuntimeBridge
diff --git a/testing/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..dc3296a
--- /dev/null
+++ b/testing/compliance-tests/binding-ws/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=Java
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..572a5f1
--- /dev/null
+++ b/testing/compliance-tests/binding-ws/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -0,0 +1,33 @@
+# 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.
+
+BWS_2001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2001, Artifact: Test_BWS_2001.composite] - [BWS20001] The URI value for binding.ws on an SCA reference must be absolute. Non-absolute value found /TEST_BWS_2001Component2/Service1
+BWS_2002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2002, Artifact: Test_BWS_2002.composite] - Invalid WebService binding wsdlElement attribute: http://test.sca.oasisopen.org/#wsdl.port(NonExistentPortName)
+BWS_2003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2003, Artifact: Test_BWS_2003.composite] - [BWS20003] The wsdlElement attribute of a binding.ws on an SCA service must not specify the wsdl.service form of URI. The following URI was found http://test.sca.oasisopen.org/#wsdl.service(Service1Service)
+BWS_2005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2005, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2005] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany
+BWS_2007=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: Component TEST_BWS_2007Component2 Service Service1 interface is incompatible with the interface of the reference binding - Service1 - Operations called operation1 are not compatible Operation argument types source = {http://www.w3.org/2001/XMLSchema}float target = {http://www.w3.org/2001/XMLSchema}string don't match for output types|||Operations called operation1 are not compatible||| - [(***)Endpoint: URI = TEST_BWS_2007Component2#service-binding(Service1/Service1)]
+BWS_2011=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2011, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2011] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany
+BWS_2013=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2013, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2013] - [BWS20005][BWS20010] The WSDL binding transport http://example.com/foo/bar is not supported by Tuscany
+BWS_2015=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2015, Artifact: Test_BWS_2015.composite] - [BWS20017] binding.ws has a @wsdli:wsdlLocation attribute but no @wsdlElement attribute
+BWS_2016=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2016, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_BWS_2016] - Exception locating wsdli:location resource: org.apache.tuscany.sca.contribution.processor.ContributionReadException: java.io.FileNotFoundException: http://example.org/Service1.wsdl
+BWS_2017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2017, Artifact: Test_BWS_2017.composite] - [BWS20019] with binding.ws you can only specify one of url, wsa:EndpointReference, #wsdl.service or #wsdl.port. The following were found [uri, wsa:EndpointReference]
+BWS_2018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2018, Artifact: Test_BWS_2018.composite] - [BWS20020] For the callback element of an SCA service, the binding must not specify an endpoint address URI or a WS-Addressing wsa:EndpointReference
+BWS_2019=org.oasisopen.sca.ServiceRuntimeException: [Contribution: BWS_2019, Artifact: Test_BWS_2019.composite] - XMLSchema validation error occured in: Test_BWS_2019.composite ,line = 36, column = 10, Message = cvc-complex-type.3.2.2: Attribute 'invalidAttribute' is not allowed to appear in element 'binding.ws'.
+BWS_2020=org.oasisopen.sca.ServiceRuntimeException [BWS20025] Unable to determine destination endpoint for endpoint reference (***)EndpointReference: URI = TEST_BWS_2020Component1#reference-binding(reference1/Reference1) RESOLVED_BINDING Target = (***)Endpoint:
+BWS_2022=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: Component TEST_BWS_2022Component1 Reference reference1 interface is incompatible with the interface of the reference binding Reference1 - Callback interface doesn't match as one of the callback interfaces is null - [(***)EndpointReference: URI = TEST_BWS_2022Component1#reference-binding(reference1/Reference1) RESOLVED_BINDING Target = (***)Endpoint: ]
+BWS_4008=org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.apache.tuscany.sca.runtime.ActivationException: org.oasisopen.sca.ServiceRuntimeException: rpc/encoded WSDL style not supported. Component TEST_BWS_4008Component1 Reference reference1 Binding Reference1
+BWS_5003=A header representing a Message Addressing Property is not valid and the message cannot be processed
\ No newline at end of file
diff --git a/testing/compliance-tests/java-caa/pom.xml b/testing/compliance-tests/java-caa/pom.xml
new file mode 100644
index 0000000..287b704
--- /dev/null
+++ b/testing/compliance-tests/java-caa/pom.xml
@@ -0,0 +1,142 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-java-caa</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Java CAA</name>
+
+ <dependencies>
+
+ <dependency>
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-j-caa-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/JCA_11021_TestCase.java</exclude><!-- TUSCANY-3664 -->
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>process-test-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-javacaa-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-j-caa-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/testing/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
new file mode 100644
index 0000000..db16f85
--- /dev/null
+++ b/testing/compliance-tests/java-caa/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
@@ -0,0 +1,224 @@
+/*
+ * 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.sca.otest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import testClient.TestException_Exception;
+import client.RuntimeBridge;
+
+/**
+ * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
+ *
+ */
+public class TuscanyRuntimeBridge implements RuntimeBridge {
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
+ protected NodeFactory launcher;
+ protected Node node;
+ protected Properties expectedErrorMessages;
+
+ public TuscanyRuntimeBridge() {
+ // read test error mapping
+ expectedErrorMessages = new Properties();
+ try {
+ InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
+ expectedErrorMessages.load(propertiesStream);
+ } catch (IOException e) {
+ System.out.println("Unable to read oasis-sca-tests-errors.properties file");
+ }
+ }
+
+ public boolean startContribution(String compositeName, String contributionLocation, String[] contributionNames) throws Exception {
+ try {
+ // Tuscany specific code which starts the contribution(s) holding the test
+ launcher = NodeFactory.newInstance();
+
+ Contribution[] contributions = new Contribution[contributionNames.length];
+ String[] contributionURIs = getContributionURIs(contributionLocation, contributionNames);
+ for (int i = 0; i < contributions.length; i++) {
+ contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
+ } // end for
+
+ node = launcher.createNode(compositeName, contributions);
+
+ // Set the domain URI for the node as JCA_9016 tests for this domain name
+ NodeConfiguration nodeConfiguration = ((NodeImpl)node).getConfiguration();
+ nodeConfiguration.setDomainURI("http://Domain1");
+
+ // Start the node
+ node.start();
+
+ // For debugging
+ // print out the composites that have been read in success cases
+ // System.out.println(((NodeImpl)node).dumpDomainComposite());
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ throw e;
+ } // end try
+
+ return true;
+ } // end method startContribution
+
+ /**
+ * Gets the location of the Contributions as URIs
+ * @param contributionLocation - a location pattern URI, which contains one or more "%1"
+ * substrings, which are substituted with the name of the contribution to get the URI of
+ * the contribution
+ * @return the contribution locations as an array of Strings
+ */
+ protected String[] getContributionURIs(String contributionLocation, String[] contributionNames) throws Exception {
+ String[] locations = new String[contributionNames.length];
+
+ if (locations != null && contributionLocation != null) {
+
+ for (int i = 0; i < locations.length; i++) {
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
+
+ locations[i] = aLocation;
+ } // end for
+ } else {
+ if (locations == null) {
+ // No contribution specified - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
+ } else {
+ // No contribution location supplied - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
+ } // end if
+ } // end if
+
+ return locations;
+ } // end getContributionURI
+
+ public void stopContribution() {
+ if (node != null) {
+ node.stop();
+ } // end if
+ if (launcher != null) {
+ launcher.destroy();
+ } // end if
+ } // end method stopContribution
+
+ public void checkError(String testName, Throwable ex) throws Throwable {
+
+ String expectedMessage = expectedErrorMessages.getProperty(testName);
+ String receivedMessage = getErrorMessage(ex);//ex.getMessage();
+
+ if (expectedMessage == null){
+ writeMissingMessage(testName, ex);
+ fail("Null expected error message for test " + testName +
+ "Please add message to oasis-sca-tests-errors.properties");
+ } // end if
+
+ if (receivedMessage == null){
+ ex.printStackTrace();
+ fail("Null received error message for test " + testName);
+ } // end if
+
+ if (expectedMessage.startsWith("*")) {
+ // allow using * to ignore a message comparison
+ return;
+ }
+
+ // Deal with the case where the message has variable parts within it
+ // marked with the characters ***. Here we tokenize the expected string
+ // and make sure all the individual parts are present in the results string
+ String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+
+ if (expectedMessageParts.length > 1){
+ int foundParts = 0;
+ for(int i = 0; i < expectedMessageParts.length; i++){
+ if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+ foundParts++;
+ }
+ }
+
+ if (foundParts == expectedMessageParts.length){
+ return;
+ }
+ }
+
+
+ // Deal with the case where the end of the message is variable (eg contains absolute filenames)
+ // and where the only relevant part is the start of the message - in this case the expected
+ // message only contains the stem section which is unchanging...
+ if( receivedMessage.length() > expectedMessage.length() ) {
+ // Truncate the received message to the length of the expected message
+ receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
+ } // end if
+
+ if (!expectedMessage.equals(receivedMessage)) {
+ writeIncorrectMessage(testName, expectedMessage, receivedMessage);
+ }
+
+ assertEquals( expectedMessage, receivedMessage );
+
+ return;
+
+ }
+
+ protected void writeMissingMessage(String testName, Throwable ex) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
+ out.write(testName + "=*");
+ out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected void writeIncorrectMessage(String testName, String expected, String received) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
+ out.write(testName); out.newLine();
+ out.write(" " + expected); out.newLine();
+ out.write(" " + received); out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected String getErrorMessage(Throwable ex) {
+ String errorMessage = null;
+
+ if (ex instanceof TestException_Exception) {
+ TestException_Exception te = (TestException_Exception) ex;
+ errorMessage = te.getFaultInfo().getMessage();
+ } else {
+ errorMessage = ex.getMessage();
+ }
+
+ return errorMessage;
+ }
+} // end class TuscanyRuntimeBridge
diff --git a/testing/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..b224643
--- /dev/null
+++ b/testing/compliance-tests/java-caa/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=POJO
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=./target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..980ffe5
--- /dev/null
+++ b/testing/compliance-tests/java-caa/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -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.
+JCA_1001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callback org.oasisopen.sca.test.ServiceRemoteLocalCallback must be remotable on remotable interface org.oasisopen.sca.test.ServiceRemoteLocal
+JCA_1002=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: org.apache.tuscany.sca.interfacedef.InvalidCallbackException: Callbackorg.oasisopen.sca.test.ServiceLocalRemoteCallback must not be remotable on local interface org.oasisopen.sca.test.ServiceLocalRemote
+JCA_2001=org.apache.tuscany.sca.interfacedef.OverloadedOperationException: [JCA20001] Cannot overload operation operation1 on org.oasisopen.sca.test.Service1Overload as it is a @Remotable interface
+JCA_3001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3001, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3001] - Class Not Found Exception: Service1
+JCA_3002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3002, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3002] - Class Not Found Exception: Service1
+JCA_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3003, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3003] - Class Not Found Exception: Service3Callback
+JCA_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3004, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3004] - Class Not Found Exception: Service3Callback
+JCA_3006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3006Component2] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TEST_JCA_3006Component2 Service = Service3WithCallback Callback operation not found on target
+JCA_3007=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_3007Component1] - [JCA30001,JCA30002,JCA30003,JCA90046] Component reference interface incompatible with implementation reference interface: Component = TEST_JCA_3007Component1 Reference = reference1
+JCA_3008=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3008, Artifact: Test_JCA_3008.composite] - XMLSchema validation error occured in: Test_JCA_3008.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'oops' is not allowed to appear in element 'interface.java'.
+JCA_3009=org.apache.tuscany.sca.interfacedef.InvalidAnnotationException: [JCA30005] @Remotable annotation present in a interface marked as not remotable in the SCDL
+JCA_3011=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3011, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3011] - [JCA30006] Forbidden annotation interface org.oasisopen.sca.annotation.Property found on service interface in class org.oasisopen.sca.test.JCA3011Service
+JCA_3012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_3012, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_3012] - [JCA30007] Forbidden annotation interface org.oasisopen.sca.annotation.Property found on callback interface in class org.oasisopen.sca.test.JCA3012Service3Callback
+JCA_3013=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - = Unable to match the endpoint reference (***)EndpointReference: URI = TEST_JCA_3013Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3013Component2#service(ServiceOneWay) [Unresolved] with the policy of the service to which it refers, matching process was Match policy of (***)EndpointReference: URI = TEST_JCA_3013Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3013Component2#service(ServiceOneWay) [Unresolved] to (***)Endpoint: URI = TEST_JCA_3013Component2#service-binding(ServiceOneWay/ServiceOneWay) Match because there are no intents or policies |||Match interface of (***)EndpointReference: URI = TEST_JCA_3013Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3013Component2#service(ServiceOneWay) [Unresolved] to (***)Endpoint: URI = TEST_JCA_3013Component2#service-binding(ServiceOneWay/ServiceOneWay) operations one-way not the same, source = false target = true|||Operations called inonly1 are not compatible|||Match failed because the interface contract mapper failed |||
+JCA_3014=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - = Unable to match the endpoint reference (***)EndpointReference: URI = TEST_JCA_3014Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3014Component2#service(Service3OperationsWSDL) [Unresolved] with the policy of the service to which it refers, matching process was Match policy of (***)EndpointReference: URI = TEST_JCA_3014Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3014Component2#service(Service3OperationsWSDL) [Unresolved] to (***)Endpoint: URI = TEST_JCA_3014Component2#service-binding(Service3OperationsWSDL/Service3OperationsWSDL) Match because there are no intents or policies |||Match interface of (***)EndpointReference: URI = TEST_JCA_3014Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_3014Component2#service(Service3OperationsWSDL) [Unresolved] to (***)Endpoint: URI = TEST_JCA_3014Component2#service-binding(Service3OperationsWSDL/Service3OperationsWSDL) Operation operation3 not found on target|||Match failed because the interface contract mapper failed |||
+JCA_7004=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - = Unable to match the endpoint reference (***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_7004Component1#service(Service1AsyncServerError) [Unresolved] with the policy of the service to which it refers, matching process was Match policy of (***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_7004Component1#service(Service1AsyncServerError) [Unresolved] to (***)Endpoint: URI = TEST_JCA_7004Component1#service-binding(Service1AsyncServerError/Service1AsyncServerError) Match because there are no intents or policies |||Match interface of (***)EndpointReference: URI = TestClient#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_7004Component1#service(Service1AsyncServerError) [Unresolved] to (***)Endpoint: URI = TEST_JCA_7004Component1#service-binding(Service1AsyncServerError/Service1AsyncServerError) Operation operation1 not found on target|||Match failed because the interface contract mapper failed |||
+JCA_10001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalPropertyException: [JCA90001] Argument 1 of method operation1 in class class org.oasisopen.sca.test.service1BadAnnotation can not be a Property
+JCA_10002=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_10002, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_10002] - [JCA9002] SCA annotations are not permitted on static members: org.oasisopen.sca.test.service1Sta
+JCA_10003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_10003, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_10003] - [JCA9002] SCA annotations are not permitted on static members: org.oasisopen.sca.test.service1Sta
+JCA_10004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalCallbackReferenceException: [JCA90046] @Callback on field of method must not have any parameters
+JCA_10006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: JCA90003 constructor parameters for class org.oasisopen.sca.test.service1BadConstrImpl must have @Property or @Reference annotation
+JCA_10007=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalDestructorException: [JCA90004] Destructor must not have arguments
+JCA_10008=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalInitException: [JCA90008] Initializer must not have argments
+JCA_10009=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.IllegalPropertyException: [JCA90011] Final field serviceName in class org.oasisopen.sca.test.service1BadPropImpl can not be annotated as a Property
+JCA_10010=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidPropertyException: [JCA90013] Missing property name: public org.oasisopen.sca.test.service1ConstrBadPropImpl(java.lang.String)[0]
+JCA_10011=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidPropertyException: [JCA90014] Constructor property must not have required=false: org.oasisopen.sca.test.service1ConstrBadPropImpl
+JCA_10013=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_10013Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent6.qual2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent6.qual1 are mutually exclusive
+JCA_10014=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidReferenceException: [JCA90018] @Reference in a Constructor must have a name attributeorg.oasisopen.sca.test.service1ConstrBad
+JCA_10015=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidReference
+JCA_10046=org.oasisopen.sca.ServiceRuntimeException: [] - [JCA90040] Exception while generating WSDL for TEST_JCA_10046Component1/Unmappable exception was: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
+JCA_10047=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90041] @Scope annotation not allowed on service interface
+JCA_10048=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90042,JCI20002] Implementation missing service method operation2 service interface org.oasisopen.sca.test.Service1Superset
+JCA_10049=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90050] The number of Strings in the names attribute array of the @Service annotation MUST match the number of elements in the value attribute array
+JCA_10050=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_10050Component1] - [ASM40003,ASM60003,JCA90045] Duplicate implementation service name: Component = TEST_JCA_10050Component1 Service = Service1
+JCA_10051=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90059] The array of interfaces or classes specified by the value attribute of the @Service annotation
+JCA_10052=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90060] The value of each element in the @Service names array MUST be unique amongst all the other element values in the array
+JCA_11005=org.oasisopen.sca.ServiceRuntimeException: [Component: TEST_JCA_11005Component1, Service: Service1] - [JCA100006] JAX-WS client-side asynchronous polling and callback methods are not allowed in service interfaces
+JCA_11010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11010Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive
+JCA_11011=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11011Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive
+JCA_11012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 are mutually exclusive
+JCA_11013=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_11013Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+JCA_11014=org.oasisopen.sca.ServiceRuntimeException: [Contribution: JCA_11014, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_11014] - [JCA100018] Forbidden annotation interface javax.xml.ws.WebServiceClient found in class org.oasisopen.sca.test.Service1WithWebServiceClient
+JCA_11016=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException Unable to bind [] - = Unable to match the endpoint reference (***)EndpointReference: URI = TEST_JCA_11016Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] with the policy of the service to which it refers, matching process was Match policy of (***)EndpointReference: URI = TEST_JCA_11016Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] to (***)Endpoint: URI = TEST_JCA_11016Component2#service-binding(Service3OperationsWebServiceProviderImpl/Service3OperationsWebServiceProviderImpl) Match because there are no intents or policies |||Match interface of (***)EndpointReference: URI = TEST_JCA_11016Component1#reference(reference1) WIRED_TARGET_NOT_FOUND Target = (***)Endpoint: URI = TEST_JCA_11016Component2#service(Service3OperationsWebServiceProviderImpl) [Unresolved] to (***)Endpoint: URI = TEST_JCA_11016Component2#service-binding(Service3OperationsWebServiceProviderImpl/Service3OperationsWebServiceProviderImpl) Operation operation3 not found on target|||Match failed because the interface contract mapper failed |||
+JCA_11020=Test service got an exception during execution: java.lang.IllegalArgumentException No matching operation is found: public abstract java.lang.String org.oasisopen.sca.test.Service2Operations.operation1(java.lang.String)
+# Intent and PolicySet related tests
+JCA_8001=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_8001Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent1 are mutually exclusive
+JCA_8002=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8002: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Method that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadIntent.operation1(java.lang.String)
+JCA_8003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8003: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Field that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadIntent.someField
+JCA_8004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8004: Resolving Java implementation: org.oasisopen.sca.test.service1BadIntent, [JCA70002,JCA70005] Constructor parameter that is not an SCA reference cannot have policySet/intent annotations: public org.oasisopen.sca.test.service1BadIntent(java.lang.String)[0]
+JCA_8006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_JCA_8006Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent2 and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent1 are mutually exclusive
+JCA_8008=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8008: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Method that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadPolicySet.operation1(java.lang.String)
+JCA_8009=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8009: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Field that is not an SCA reference cannot have policySet/intent annotations: public java.lang.String org.oasisopen.sca.test.service1BadPolicySet.someField
+JCA_8010=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.contribution.processor.ContributionResolveException: Processing composite {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TEST_JCA_8010: Resolving Java implementation: org.oasisopen.sca.test.service1BadPolicySet, [JCA70002,JCA70005] Constructor parameter that is not an SCA reference cannot have policySet/intent annotations: public org.oasisopen.sca.test.service1BadPolicySet(java.lang.String)[0]
+
diff --git a/testing/compliance-tests/java-ci/pom.xml b/testing/compliance-tests/java-ci/pom.xml
new file mode 100644
index 0000000..9ce6218
--- /dev/null
+++ b/testing/compliance-tests/java-ci/pom.xml
@@ -0,0 +1,139 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-java-ci</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Java CI</name>
+
+ <dependencies>
+
+ <dependency>
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-j-ci-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- This is need when running with Sun JDK which gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-jci-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-sca-j-ci-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/testing/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
new file mode 100644
index 0000000..e7a161a
--- /dev/null
+++ b/testing/compliance-tests/java-ci/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
@@ -0,0 +1,217 @@
+/*
+ * 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.sca.otest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import testClient.TestException_Exception;
+import client.RuntimeBridge;
+
+/**
+ * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
+ *
+ */
+public class TuscanyRuntimeBridge implements RuntimeBridge {
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
+ protected NodeFactory launcher;
+ protected Node node;
+ protected Properties expectedErrorMessages;
+
+ public TuscanyRuntimeBridge() {
+ // read test error mapping
+ expectedErrorMessages = new Properties();
+ try {
+ InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
+ expectedErrorMessages.load(propertiesStream);
+ } catch (IOException e) {
+ System.out.println("Unable to read oasis-sca-tests-errors.properties file");
+ }
+ }
+
+ public boolean startContribution(String compositeName, String contributionLocation, String[] contributionNames) throws Exception {
+ try {
+ // Tuscany specific code which starts the contribution(s) holding the test
+ launcher = NodeFactory.newInstance();
+
+ Contribution[] contributions = new Contribution[contributionNames.length];
+ String[] contributionURIs = getContributionURIs(contributionLocation, contributionNames);
+ for (int i = 0; i < contributions.length; i++) {
+ contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
+ } // end for
+
+ node = launcher.createNode(compositeName, contributions);
+ // Start the node
+ node.start();
+
+ // For debugging
+ // print out the composites that have been read in success cases
+ // System.out.println(((NodeImpl)node).dumpDomainComposite());
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ throw e;
+ } // end try
+
+ return true;
+ } // end method startContribution
+
+ /**
+ * Gets the location of the Contributions as URIs
+ * @param contributionLocation - a location pattern URI, which contains one or more "%1"
+ * substrings, which are substituted with the name of the contribution to get the URI of
+ * the contribution
+ * @return the contribution locations as an array of Strings
+ */
+ protected String[] getContributionURIs(String contributionLocation, String[] contributionNames) throws Exception {
+ String[] locations = new String[contributionNames.length];
+
+ if (locations != null && contributionLocation != null) {
+
+ for (int i = 0; i < locations.length; i++) {
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
+
+ locations[i] = aLocation;
+ } // end for
+ } else {
+ if (locations == null) {
+ // No contribution specified - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
+ } else {
+ // No contribution location supplied - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
+ } // end if
+ } // end if
+
+ return locations;
+ } // end getContributionURI
+
+ public void stopContribution() {
+ if (node != null) {
+ node.stop();
+ } // end if
+ if (launcher != null) {
+ launcher.destroy();
+ } // end if
+ } // end method stopContribution
+
+ public void checkError(String testName, Throwable ex) throws Throwable {
+
+ String expectedMessage = expectedErrorMessages.getProperty(testName);
+ String receivedMessage = getErrorMessage(ex);//ex.getMessage();
+
+ if (expectedMessage == null){
+ writeMissingMessage(testName, ex);
+ fail("Null expected error message for test " + testName +
+ "Please add message to oasis-sca-tests-errors.properties");
+ } // end if
+
+ if (receivedMessage == null){
+ ex.printStackTrace();
+ fail("Null received error message for test " + testName);
+ } // end if
+
+ if (expectedMessage.startsWith("*")) {
+ // allow using * to ignore a message comparison
+ return;
+ }
+
+ // Deal with the case where the message has variable parts within it
+ // marked with the characters ***. Here we tokenize the expected string
+ // and make sure all the individual parts are present in the results string
+ String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+
+ if (expectedMessageParts.length > 1){
+ int foundParts = 0;
+ for(int i = 0; i < expectedMessageParts.length; i++){
+ if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+ foundParts++;
+ }
+ }
+
+ if (foundParts == expectedMessageParts.length){
+ return;
+ }
+ }
+
+
+ // Deal with the case where the end of the message is variable (eg contains absolute filenames)
+ // and where the only relevant part is the start of the message - in this case the expected
+ // message only contains the stem section which is unchanging...
+ if( receivedMessage.length() > expectedMessage.length() ) {
+ // Truncate the received message to the length of the expected message
+ receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
+ } // end if
+
+ if (!expectedMessage.equals(receivedMessage)) {
+ writeIncorrectMessage(testName, expectedMessage, receivedMessage);
+ }
+
+ assertEquals( expectedMessage, receivedMessage );
+
+ return;
+
+ }
+
+ protected void writeMissingMessage(String testName, Throwable ex) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
+ out.write(testName + "=*");
+ out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected void writeIncorrectMessage(String testName, String expected, String received) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
+ out.write(testName); out.newLine();
+ out.write(" " + expected); out.newLine();
+ out.write(" " + received); out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected String getErrorMessage(Throwable ex) {
+ String errorMessage = null;
+
+ if (ex instanceof TestException_Exception) {
+ TestException_Exception te = (TestException_Exception) ex;
+ errorMessage = te.getFaultInfo().getMessage();
+ } else {
+ errorMessage = ex.getMessage();
+ }
+
+ return errorMessage;
+ }
+} // end class TuscanyRuntimeBridge
diff --git a/testing/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..d1ef56c
--- /dev/null
+++ b/testing/compliance-tests/java-ci/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=POJO
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..8d8c93a
--- /dev/null
+++ b/testing/compliance-tests/java-ci/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -0,0 +1,38 @@
+# 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.
+POJO_2003=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.IntrospectionException: [JCA90042,JCI20002] Implementation missing service method operation2 service interface org.oasisopen.sca.test.Service1Superset
+POJO_5001=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException: [JCI50001] No public constructor for class
+POJO_5005=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException:
+POJO_5006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateConstructorException: [JCI50002] Multiple constructors marked with @Constructor
+POJO_5007=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidConstructorException: [JCI50005] Multiple annotated constructors
+POJO_8002=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8002Component1] - [ASM50004,JCA30002,JCI80001] Component service interface incompatible with implementation service interface: Component = TEST_POJO_8002Component1 Service = Service1Superset Operation operationb not found on target
+POJO_8003=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8003Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
+POJO_8008=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8008Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}suspendsTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}propagatesTransaction are mutually exclusive
+POJO_8012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8012Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}***anagedTransaction and {http://docs.oasis-open.org/ns/opencsa/sca/200912}***anagedTransaction are mutually exclusive
+POJO_8013=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicatePropertyException: duplicateProperty
+POJO_8014=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: org.apache.tuscany.sca.implementation.java.introspect.impl.DuplicateReferenceException: duplicateReference
+POJO_8030=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8030Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_2 are mutually exclusive
+POJO_8031=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8031Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8032=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8032Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8033=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8033Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}antiSoap and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP are mutually exclusive
+POJO_8035=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POJO_8035Component1, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_1 and {http://docs.oasis-open.org/ns/opencsa/sca/200912}SOAP.v1_2 are mutually exclusive
+POJO_9001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_9001, Artifact: Test_POJO_9001.composite] - XMLSchema validation error occured in: Test_POJO_9001.composite ,line = ***, column = ***, Message = cvc-complex-type.3.2.2: Attribute 'interface' is not allowed to appear in element 'implementation.java'.
+POJO_10001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10001, Artifact: META-INF/sca-contribution.xml] - [JCI10001] The value of the @package attribute on the <import.java/> element is not unique across all other <import.java/> elements within the contribution.
+POJO_10004=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [JCI100007] A Java package org.oasisopen.sca.test;version=1.0.0 that is specified on an export element MUST be contained within the contribution containing the export element.
+POJO_10005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POJO_10005, Artifact: META-INF/sca-contribution.xml] - [JCI10004] The value of the @package attribute on the <export.java/> element is not unique across all other <export.java/> elements within the contribution.
+POJO_10006=org.apache.tuscany.sca.contribution.processor.ContributionResolveException: [JCI100007] A Java package org.oasisopen.sca.test.y that is specified on an export element MUST be contained within the contribution containing the export element.
+
diff --git a/testing/compliance-tests/policy/pom.xml b/testing/compliance-tests/policy/pom.xml
new file mode 100644
index 0000000..8dc92a3
--- /dev/null
+++ b/testing/compliance-tests/policy/pom.xml
@@ -0,0 +1,144 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-compliance-test-policy</artifactId>
+ <name>Apache Tuscany SCA Specification Compliance Tests Policy</name>
+
+ <dependencies>
+
+ <dependency>
+ <!-- This is only needed to get the module working in Eclipse which doesn't pick it up from the dependency plugin unpack -->
+ <!-- The dependency plugin unpack is needed as presently the surefire plugin wont run tests in a dependency jar -->
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-policy-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-osgi-runtime-pom</artifactId>
+ <version>2.0-Beta1</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <!-- This is need for POL_4013 and POL_4028 when running with Sun JDK which
+ gets an unsupported operation exception creating an XMLStreamReader from a DOMSource
+ when Tuscany is writing a property value -->
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- 3002 is no longer part of the suite and 4015/4016 are tests for optional support that Tuscany doesn't provide -->
+ <exclude>**/POL_3002_TestCase.java</exclude>
+ <exclude>**/POL_4015_TestCase.java</exclude>
+ <exclude>**/POL_4016_TestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>oasis-policy-contributions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/oasis-contributions</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-otests-policy-tests</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>jar</type>
+ <excludes>commons-logging.properties,oasis-sca-tests.properties,tuscany-oasis-sca-tests-errors.properties</excludes>
+ <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/testing/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java b/testing/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
new file mode 100644
index 0000000..a6ee41a
--- /dev/null
+++ b/testing/compliance-tests/policy/src/test/java/org/apache/tuscany/sca/otest/TuscanyRuntimeBridge.java
@@ -0,0 +1,218 @@
+/*
+ * 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.sca.otest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import testClient.TestException_Exception;
+import client.RuntimeBridge;
+
+/**
+ * An implementation of the Runtime Bridge for the Apache Tuscany SCA runtime (version 2.x)
+ *
+ */
+public class TuscanyRuntimeBridge implements RuntimeBridge {
+
+ static final String CONTRIBUTION_LOCATION_PROPKEY = "OASIS_TESTENV_CONTRIBUTION_LOCATION";
+
+ protected NodeFactory launcher;
+ protected Node node;
+ protected Properties expectedErrorMessages;
+
+ public TuscanyRuntimeBridge() {
+ // read test error mapping
+ expectedErrorMessages = new Properties();
+ try {
+ InputStream propertiesStream = this.getClass().getResourceAsStream("/tuscany-oasis-sca-tests-errors.properties");
+ expectedErrorMessages.load(propertiesStream);
+ } catch (IOException e) {
+ System.out.println("Unable to read oasis-sca-tests-errors.properties file");
+ }
+ }
+
+ public boolean startContribution(String compositeName, String contributionLocation, String[] contributionNames) throws Exception {
+ try {
+ // Tuscany specific code which starts the contribution(s) holding the test
+ launcher = NodeFactory.newInstance();
+
+ Contribution[] contributions = new Contribution[contributionNames.length];
+ String[] contributionURIs = getContributionURIs(contributionLocation, contributionNames);
+ for (int i = 0; i < contributions.length; i++) {
+ contributions[i] = new Contribution(contributionNames[i], contributionURIs[i]);
+ } // end for
+
+ node = launcher.createNode(compositeName, contributions);
+ // Start the node
+ node.start();
+
+ // For debugging
+ // print out the composites that have been read in success cases
+ // System.out.println(((NodeImpl)node).dumpDomainComposite());
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ throw e;
+ } // end try
+
+ return true;
+ } // end method startContribution
+
+ /**
+ * Gets the location of the Contributions as URIs
+ * @param contributionLocation - a location pattern URI, which contains one or more "%1"
+ * substrings, which are substituted with the name of the contribution to get the URI of
+ * the contribution
+ * @return the contribution locations as an array of Strings
+ */
+ protected String[] getContributionURIs(String contributionLocation, String[] contributionNames) throws Exception {
+ String[] locations = new String[contributionNames.length];
+
+ if (locations != null && contributionLocation != null) {
+
+ for (int i = 0; i < locations.length; i++) {
+ String aLocation = contributionLocation.replaceAll("%1", contributionNames[i]);
+
+ locations[i] = aLocation;
+ } // end for
+ } else {
+ if (locations == null) {
+ // No contribution specified - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution supplied - error");
+ } else {
+ // No contribution location supplied - throw an Exception
+ throw new Exception("Unable to start SCA runtime - no contribution location supplied - error");
+ } // end if
+ } // end if
+
+ return locations;
+ } // end getContributionURI
+
+ public void stopContribution() {
+ if (node != null) {
+ node.stop();
+ } // end if
+ if (launcher != null) {
+ launcher.destroy();
+ } // end if
+ } // end method stopContribution
+
+ public void checkError(String testName, Throwable ex) throws Throwable {
+
+ String expectedMessage = expectedErrorMessages.getProperty(testName);
+ String receivedMessage = getErrorMessage(ex);//ex.getMessage();
+
+ if (expectedMessage == null){
+ writeMissingMessage(testName, ex);
+ fail("Null expected error message for test " + testName +
+ "Please add message to oasis-sca-tests-errors.properties");
+ } // end if
+
+ if (receivedMessage == null){
+ ex.printStackTrace();
+ fail("Null received error message for test " + testName);
+ } // end if
+
+ if (expectedMessage.startsWith("*")) {
+ // allow using * to ignore a message comparison
+ return;
+ }
+
+ // Deal with the case where the message has variable parts within it
+ // marked with the characters ***. Here we tokenize the expected string
+ // and make sure all the individual parts are present in the results string
+ String expectedMessageParts[] = expectedMessage.split("\\*\\*\\*");
+
+ if (expectedMessageParts.length > 1){
+ int foundParts = 0;
+ for(int i = 0; i < expectedMessageParts.length; i++){
+ if (receivedMessage.indexOf(expectedMessageParts[i]) > -1 ){
+ foundParts++;
+ }
+ }
+
+ if (foundParts == expectedMessageParts.length){
+ return;
+ }
+ }
+
+
+ // Deal with the case where the end of the message is variable (eg contains absolute filenames)
+ // and where the only relevant part is the start of the message - in this case the expected
+ // message only contains the stem section which is unchanging...
+ if( receivedMessage.length() > expectedMessage.length() ) {
+ // Truncate the received message to the length of the expected message
+ receivedMessage = receivedMessage.substring(0, expectedMessage.length() );
+ } // end if
+
+ if (!expectedMessage.equals(receivedMessage)) {
+ writeIncorrectMessage(testName, expectedMessage, receivedMessage);
+ }
+
+ assertEquals( expectedMessage, receivedMessage );
+
+ return;
+
+ }
+
+ protected void writeMissingMessage(String testName, Throwable ex) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestMissingMsgs.txt", true));
+ out.write(testName + "=*");
+ out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected void writeIncorrectMessage(String testName, String expected, String received) {
+ try {
+ BufferedWriter out = new BufferedWriter(new FileWriter("target/OTestIncorrectMsgs.txt", true));
+ out.write(testName); out.newLine();
+ out.write(" " + expected); out.newLine();
+ out.write(" " + received); out.newLine();
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+
+ protected String getErrorMessage(Throwable ex) {
+ String errorMessage = null;
+
+ if (ex instanceof TestException_Exception) {
+ TestException_Exception te = (TestException_Exception) ex;
+ errorMessage = te.getFaultInfo().getMessage();
+ } else {
+ errorMessage = ex.getMessage();
+ }
+
+ return errorMessage;
+ }
+
+} // end class TuscanyRuntimeBridge
diff --git a/testing/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties b/testing/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties
new file mode 100644
index 0000000..0347fc3
--- /dev/null
+++ b/testing/compliance-tests/policy/src/test/resources/oasis-sca-tests.properties
@@ -0,0 +1,30 @@
+# 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.
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=Java
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+#org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyOSGiRuntimeBridge
+org.oasis.sca.tests.assembly.runtime_bridge=org.apache.tuscany.sca.otest.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=target/oasis-contributions/%1/target/%1.zip
+
diff --git a/testing/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties b/testing/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
new file mode 100644
index 0000000..3a6e066
--- /dev/null
+++ b/testing/compliance-tests/policy/src/test/resources/tuscany-oasis-sca-tests-errors.properties
@@ -0,0 +1,57 @@
+# 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.
+
+POL_3001=Test service got an exception during execution: org.oasisopen.sca.ServiceRuntimeException WSDL document is using SOAP v1.2 but SOAP v1.1 is required by the specified policy intents
+POL_3002=TUSCANY-3370
+POL_3003=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3003, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3003.zip!/META-INF/definitions.xml] - [ASM10001,POL30002] Duplicate intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}dupIntent found in domain
+POL_3004=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3004, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3004.zip!/META-INF/definitions.xml] - [POL30004] Intent twoDefaults has more than one qualifier marked as the default qualifier
+POL_3005=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3005, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3005.zip!/META-INF/definitions.xml] - [POL30005] The intent dupQualifiers has more than one qualifier with the name qual1
+POL_3006=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3006, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3006.zip!/META-INF/definitions.xml] - [POL30006] The profile intent name bad.ProfileIntent must not have the character "." in it
+POL_3009=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3009, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3009.zip!/META-INF/definitions.xml] - [POL30010] The policy set TwoIntentMapPolicySet has more than one intent map with the name testIntent6
+POL_3012=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30015] Required Intent - {http://docs.oasis-open.org/ns/opencsa/scatests/200903}undefinedIntent2 not found for ProfileIntent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}badProfileIntent
+POL_3013=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30016] Excluded Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}undefinedIntent not found for intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}noMuxIntent
+POL_3014=org.oasisopen.sca.ServiceRuntimeException: [Contribution: Policy_General, Definitions: jar:file:***/Policy_General.zip!/META-INF/definitions.xml] - DuplicatePolicySet
+POL_3015=org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.xpath.XPathExpressionException
+POL_3016=org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.xpath.XPathExpressionException
+POL_3017=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL30020] The policy set {http://docs.oasis-open.org/ns/opencsa/scatests/200903}BadIntentMapPolicySet intent map testIntent6 has missing qualifiers: testIntent6.qual2 The intent map qualifiers must match the provided intent qualifiers.
+POL_3018=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_3018, Artifact: META-INF/definitions.xml, Definitions: jar:file:***/POL_3018.zip!/META-INF/definitions.xml] - [POL30021] Intent Map provides for Intent not specified as provided by parent PolicySet - BadIntentMapPolicySet
+POL_3020=TUSCANY-3371
+POL_4001=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntentExt2 associated with policy subject ***Endpoint: URI = TestClient#service-binding(TestInvocation/TestInvocation) has no matching policy set
+POL_4004=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POL_4004Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestCompositeImplIntent, Component: TestComposite0Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite0, Component: TestComposite0Component1] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent.qual2 associated with policy subject {http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java (class=org.oasisopen.sca.test.service1Impl) has no matching policy set
+POL_4005=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POL_4005Component1, Service: Service1] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent.qual2 associated with policy subject ***Endpoint: URI = TEST_POL_4005Component1#service-binding(Service1/Service1) has no matching policy set
+POL_4006=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}HighIntent associated with policy subject ***Endpoint: URI = TestClient#service-binding(TestInvocation/TestInvocation) has no matching policy set
+POL_4009=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POL_4009Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestCompositeImplPolicySet, Component: TestComposite0Component1, Composite: {http://docs.oasis-open.org/ns/opencsa/scatests/200903}TestComposite0, Component: TestComposite0Component1] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testImplIntent2 associated with policy subject {http://docs.oasis-open.org/ns/opencsa/sca/200912}implementation.java (class=org.oasisopen.sca.test.service1Impl) has no matching policy set
+POL_4010=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}DirectIntent associated with policy subject ***Endpoint: URI = TestClient#service-binding(TestInvocation/TestInvocation) has no matching policy set
+POL_4012=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent*** and {http://docs.oasis-open.org/ns/opencsa/scatests/200903}testIntent*** are mutually exclusive
+POL_4018=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - The intent {http://docs.oasis-open.org/ns/opencsa/scatests/200903}DirectIntent associated with policy subject ***Endpoint: URI = TestClient#service-binding(TestInvocation/TestInvocation) has no matching policy set
+POL_4027=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4027, Artifact: META-INF/definitions.xml, Definitions:*** - [POL40020] Duplicate binding type {http://docs.oasis-open.org/ns/opencsa/sca/200912}dupBinding.type found in domain
+POL_4028=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}] - [POL40002] The policy {http://docs.oasis-open.org/ns/opencsa/scatests/200903}PolicySetExtAttachProp has been attached to a property or one of its children. This is not allowed.
+POL_4033=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_4033, Artifact: META-INF/definitions.xml, Definitions:*** - ContributionReadException occurred due to: org.apache.tuscany.sca.contribution.processor.ContributionReadException: javax.xml.xpath.XPathExpressionException
+POL_5001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: http://tuscany.apache.org/SystemContribution] - [POL50001] An extension to support the implementation type {http://docs.oasis-open.org/ns/opencsa/sca/200912}unknown.type cant be found in the domain
+POL_9006=org.oasisopen.sca.ServiceRuntimeException: [] - The Component reference reference1 can not require transactedOneWay because the implementation for Component TEST_POL_9006Component1 requires managedTransaction.local
+POL_9009=org.oasisopen.sca.ServiceRuntimeException: [] - The Component service Service1 can not require transactedOneWay because the implementation for Component TEST_POL_9009Component2 requires managedTransaction.local
+POL_9015=org.oasisopen.sca.ServiceRuntimeException: [] - The component service Service1 can not require propagatesTransaction because the implementation for component TEST_POL_9015Component1 requires managedTransaction.local
+POL_9016=org.oasisopen.sca.ServiceRuntimeException: [] - The component service Service1 can not require propagatesTransaction because the implementation for component TEST_POL_9016Component1 requires noManagedTransaction
+POL_9017=org.oasisopen.sca.ServiceRuntimeException: [] - The component reference reference1 can not require propagatesTransaction because the implementation for component TEST_POL_9017Component1 requires managedTransaction.local
+POL_9018=org.oasisopen.sca.ServiceRuntimeException: [] - The component reference reference1 can not require propagatesTransaction because the implementation for component TEST_POL_9018Component1 requires noManagedTransaction
+POL_9019=org.oasisopen.sca.ServiceRuntimeException: [***] - The Component reference reference1 can not require transactedOneWay because the implementation for Component TEST_POL_9019Component1 requires managedTransaction.local
+POL_9020=org.oasisopen.sca.ServiceRuntimeException: [] - The component reference reference1 can not require transactedOneWay because the operation operation1 is a two way operation
+POL_9021=org.oasisopen.sca.ServiceRuntimeException: [] - The component reference reference1 can not require immediateOneWay because the operation operation1 is a two way operation
+POL_9022=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POL_9022Component1, Reference: reference1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}*** and {http://docs.oasis-open.org/ns/opencsa/sca/200912}*** are mutually exclusive
+POL_9023=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TEST_POL_9023Component2, Service: Service1] - [POL40009,ASM60009,ASM60010,JCA70001,JCA70003] Intent {http://docs.oasis-open.org/ns/opencsa/sca/200912}*** and {http://docs.oasis-open.org/ns/opencsa/sca/200912}*** are mutually exclusive
+POL_10001=org.oasisopen.sca.ServiceRuntimeException: [Composite: {http://docs.oasis-open.org/ns/opencsa/sca/200912}, Component: TestClient, Service: TestInvocation] - The noListener intent may only be specified on a reference.
+POL_11001=org.oasisopen.sca.ServiceRuntimeException: [Contribution: POL_11001, Artifact: Test_POL_11001.composite] - XMLSchema validation error occured in: Test_POL_11001.composite ,line = 21, column = 4, Message = cvc-complex-type.3.2.2: Attribute 'badAttribute' is not allowed to appear in element 'policySetAttachment'.
\ No newline at end of file
diff --git a/testing/compliance-tests/pom.xml b/testing/compliance-tests/pom.xml
new file mode 100644
index 0000000..06535ad
--- /dev/null
+++ b/testing/compliance-tests/pom.xml
@@ -0,0 +1,53 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <packaging>pom</packaging>
+ <artifactId>tuscany-compliance-tests</artifactId>
+ <name>Apache Tuscany SCA Compliance Tests</name>
+
+ <repositories>
+ <repository>
+ <!-- OASIS will eventually publish these themselves but for now they're in the Tuscany svn -->
+ <id>oasis.contributions</id>
+ <url>http://svn.apache.org/repos/asf/tuscany/maven</url>
+ </repository>
+ </repositories>
+
+ <modules>
+
+ <module>assembly</module>
+ <module>java-caa</module>
+ <module>java-ci</module>
+ <module>policy</module>
+ <module>binding-ws</module>
+<!--
+ <module>binding-jms</module>
+-->
+ </modules>
+
+</project>
diff --git a/testing/itest/T3558/pom.xml b/testing/itest/T3558/pom.xml
new file mode 100644
index 0000000..c6846ea
--- /dev/null
+++ b/testing/itest/T3558/pom.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-t3558</artifactId>
+ <name>Apache Tuscany SCA iTest T3558</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/itest/T3558/src/test/java/org/apache/tuscany/sca/itest/t3558/T3558TestCase.java b/testing/itest/T3558/src/test/java/org/apache/tuscany/sca/itest/t3558/T3558TestCase.java
similarity index 100%
rename from itest/T3558/src/test/java/org/apache/tuscany/sca/itest/t3558/T3558TestCase.java
rename to testing/itest/T3558/src/test/java/org/apache/tuscany/sca/itest/t3558/T3558TestCase.java
diff --git a/itest/T3558/src/test/resources/sample-store-all.jar b/testing/itest/T3558/src/test/resources/sample-store-all.jar
similarity index 100%
rename from itest/T3558/src/test/resources/sample-store-all.jar
rename to testing/itest/T3558/src/test/resources/sample-store-all.jar
Binary files differ
diff --git a/itest/T3558/src/test/resources/sample-store-client.jar b/testing/itest/T3558/src/test/resources/sample-store-client.jar
similarity index 100%
rename from itest/T3558/src/test/resources/sample-store-client.jar
rename to testing/itest/T3558/src/test/resources/sample-store-client.jar
Binary files differ
diff --git a/itest/T3558/src/test/resources/sample-store.jar b/testing/itest/T3558/src/test/resources/sample-store.jar
similarity index 100%
rename from itest/T3558/src/test/resources/sample-store.jar
rename to testing/itest/T3558/src/test/resources/sample-store.jar
Binary files differ
diff --git a/testing/itest/async-interactions/pom.xml b/testing/itest/async-interactions/pom.xml
new file mode 100644
index 0000000..d2c4e0c
--- /dev/null
+++ b/testing/itest/async-interactions/pom.xml
@@ -0,0 +1,165 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-async-integrations</artifactId>
+ <name>Apache Tuscany Async Integration Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>5.2.0</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>add-jaxws</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/jaxws-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>1.12</version>
+ <!-- Explicitly add the transitive dependencies for jaxws-api http://jira.codehaus.org/browse/MEV-498 -->
+ <dependencies>
+ <dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>1.0-MR1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>wsimport-client</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>creditcard.wsdl</wsdlFile>
+ </wsdlFiles>
+ <bindingDirectory>${basedir}/src/main/resources/wsdl</bindingDirectory>
+ <bindingFiles>
+ <bindingFile>creditcard-client.xml</bindingFile>
+ </bindingFiles>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <!-- Configure the stale file so that two executions will work -->
+ <staleFile>${project.build.directory}/wsimport-client.stale</staleFile>
+ <verbose>false</verbose>
+ <xnocompile>true</xnocompile>
+
+ <xjcArgs>
+ <xjcArg>-p</xjcArg>
+ <xjcArg>com.example.test.jaxb.client</xjcArg>
+ </xjcArgs>
+
+ </configuration>
+ </execution>
+ <execution>
+ <id>wsimport-server</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>creditcard.wsdl</wsdlFile>
+ </wsdlFiles>
+ <bindingDirectory>${basedir}/src/main/resources/wsdl</bindingDirectory>
+ <bindingFiles>
+ <bindingFile>creditcard-server.xml</bindingFile>
+ </bindingFiles>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <staleFile>${project.build.directory}/wsimport-server.stale</staleFile>
+ <verbose>false</verbose>
+ <xnocompile>true</xnocompile>
+
+ <xjcArgs>
+ <xjcArg>-p</xjcArg>
+ <xjcArg>com.example.test.jaxb.server</xjcArg>
+ </xjcArgs>
+
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardClient.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardClient.java
new file mode 100644
index 0000000..31a9bc3
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardClient.java
@@ -0,0 +1,69 @@
+/*
+ * 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 test.client;
+
+/**
+ * A client interface to invoke the CreditCardPayment using different interaction patterns
+ */
+public interface CreditCardClient {
+ /**
+ * Invoke the service synchronously
+ * @param creditCardNumber
+ * @param holder
+ * @param amount
+ * @return
+ */
+ String authorize(String creditCardNumber, String holder, float amount);
+
+ /**
+ * Invoke the service asynchronously and poll for the result
+ * @param creditCardNumber
+ * @param holder
+ * @param amount
+ * @return
+ */
+ String authorizeAsync(String creditCardNumber, String holder, float amount);
+
+ /**
+ * Invoke the service asynchronously and get the result from a callback
+ * @param creditCardNumber
+ * @param holder
+ * @param amount
+ * @return
+ */
+ String authorizeAsyncWithCallback(String creditCardNumber, String holder, float amount);
+
+ /**
+ * Invoke the service using oneway (fire-and-forget) and the target component will make a callback upon the request has been processed
+ * @param creditCardNumber
+ * @param holder
+ * @param amount
+ * @return
+ */
+ String authorizeSCAAsyncWithCallback(String creditCardNumber, String holder, float amount);
+
+ /**
+ * Invoke the service using request/response and the target component will make a callback upon the request has been processed
+ * @param creditCardNumber
+ * @param holder
+ * @param amount
+ * @return
+ */
+ String authorizeSCAWithCallback(String creditCardNumber, String holder, float amount);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallback.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallback.java
new file mode 100644
index 0000000..648f30d
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallback.java
@@ -0,0 +1,32 @@
+/*
+ * 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 test.client;
+
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The oneway callback interface
+ */
+@Remotable
+public interface CreditCardPaymentCallback {
+ // Makes a callback
+ @OneWay
+ void authorizeResponseOneway(String creditCardNumber, String status);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallbackSync.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallbackSync.java
new file mode 100644
index 0000000..801effa
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentCallbackSync.java
@@ -0,0 +1,30 @@
+/*
+ * 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 test.client;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The synchronous callback interface
+ */
+@Remotable
+public interface CreditCardPaymentCallbackSync {
+ // Makes a callback
+ String authorizeResponse(String creditCardNumber, String status);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentClientImpl.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentClientImpl.java
new file mode 100644
index 0000000..69a6203
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentClientImpl.java
@@ -0,0 +1,188 @@
+/*
+ * 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 test.client;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Future;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Service;
+
+import com.example.test.jaxb.client.AuthorizeResponse;
+import com.example.test.jaxb.client.CreditCardDetailsType;
+import com.example.test.jaxb.client.ObjectFactory;
+import com.example.test.jaxb.client.PayerType;
+import com.example.test.jaxws.client.AuthorizeFault;
+import com.example.test.jaxws.client.CreditCardPayment;
+
+/**
+ * Mocked implementation of CreditCardPaymentClient
+ */
+@Service(CreditCardClient.class)
+public class CreditCardPaymentClientImpl implements CreditCardClient, CreditCardPaymentCallback,
+ CreditCardPaymentCallbackSync {
+
+ @Reference
+ private CreditCardPayment proxy;
+
+ @Reference
+ private CreditCardPaymentRequestClient asyncProxy;
+
+ @Reference
+ private CreditCardPaymentRequestClientSync syncProxy;
+
+ @Override
+ public String authorize(String creditCardNumber, String holder, float amount) {
+ CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
+
+ try {
+ return proxy.authorize(creditCard, amount);
+ } catch (AuthorizeFault e) {
+ return "FAIL: " + e.getFaultInfo().getErrorCode();
+ }
+
+ }
+
+ private CreditCardDetailsType createCreditCard(String creditCardNumber, String holder) {
+ ObjectFactory factory = new ObjectFactory();
+ CreditCardDetailsType creditCard = factory.createCreditCardDetailsType();
+ creditCard.setCreditCardNumber(creditCardNumber);
+ PayerType payer = factory.createPayerType();
+ payer.setName(holder);
+ creditCard.setCardOwner(payer);
+ return creditCard;
+ }
+
+ public String authorizeAsync(String creditCardNumber, String holder, float amount) {
+ CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
+
+ Response<AuthorizeResponse> respone = proxy.authorizeAsync(creditCard, amount);
+ try {
+ return respone.get().getStatus();
+ } catch (Exception e) {
+ e.printStackTrace();
+ return "FAIL: " + e.getMessage();
+ }
+
+ }
+
+ public String authorizeAsyncWithCallback(String creditCardNumber, String holder, float amount) {
+ CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
+
+ Future<?> respone = proxy.authorizeAsync(creditCard, amount, new AsyncHandler<AuthorizeResponse>() {
+
+ @Override
+ public void handleResponse(Response<AuthorizeResponse> res) {
+ try {
+ System.out.println(Thread.currentThread() + " Response has arrived: " + res.get().getStatus());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ });
+
+ while (!(respone.isDone() || respone.isCancelled())) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ return "FAIL: " + e.getMessage();
+ }
+ }
+
+ System.out.println(Thread.currentThread() + " The task is done");
+ try {
+ return ((AuthorizeResponse)respone.get()).getStatus();
+ } catch (Exception e) {
+ e.printStackTrace();
+ return "FAIL: " + e.getMessage();
+ }
+ }
+
+ /**
+ * A map that host the result for a given credit card
+ */
+ private static Map<String, String> statusMap = new HashMap<String, String>();
+
+ public String authorizeSCAAsyncWithCallback(String creditCardNumber, String holder, float amount) {
+ CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
+ asyncProxy.authorizeRequestOneway(creditCard, amount);
+ synchronized (statusMap) {
+ while (true) {
+ String status = statusMap.remove("ASYNC:" + creditCardNumber);
+ if (status != null) {
+ System.out.println("Response found for " + creditCardNumber + " :" + status);
+ return status;
+ } else {
+ try {
+ statusMap.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ return "FAIL: " + e.getMessage();
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void authorizeResponseOneway(String creditCardNumber, String status) {
+ System.out.println("SCA one callback: CreditCard: " + creditCardNumber + " Status: " + status);
+ synchronized (statusMap) {
+ statusMap.put("ASYNC:" + creditCardNumber, status);
+ statusMap.notifyAll();
+ }
+ }
+
+ public String authorizeSCAWithCallback(String creditCardNumber, String holder, float amount) {
+ CreditCardDetailsType creditCard = createCreditCard(creditCardNumber, holder);
+ syncProxy.authorizeRequest(creditCard, amount);
+ synchronized (statusMap) {
+ while (true) {
+ String status = statusMap.remove("SYNC:" + creditCardNumber);
+ if (status != null) {
+ System.out.println("Response found for " + creditCardNumber + " :" + status);
+ return status;
+ } else {
+ try {
+ statusMap.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ return "FAIL: " + e.getMessage();
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public String authorizeResponse(String creditCardNumber, String status) {
+ System.out.println("SCA synchronous callback: CreditCard: " + creditCardNumber + " Status: " + status);
+ synchronized (statusMap) {
+ statusMap.put("SYNC:" + creditCardNumber, status);
+ statusMap.notifyAll();
+ }
+ return "ACK";
+ }
+
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClient.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClient.java
new file mode 100644
index 0000000..fe0e99c
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClient.java
@@ -0,0 +1,37 @@
+/*
+ * 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 test.client;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+import com.example.test.jaxb.client.CreditCardDetailsType;
+
+/**
+ * The bi-direction interface for the client side (we need separate classes for the client and server so that they can take different CreditCardDetailsType)
+ */
+@Remotable
+@Callback(CreditCardPaymentCallback.class)
+public interface CreditCardPaymentRequestClient {
+ // Send out the request
+ @OneWay
+ void authorizeRequestOneway(CreditCardDetailsType creditCard, float amount);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClientSync.java b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClientSync.java
new file mode 100644
index 0000000..52f5014
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/client/CreditCardPaymentRequestClientSync.java
@@ -0,0 +1,35 @@
+/*
+ * 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 test.client;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+import com.example.test.jaxb.client.CreditCardDetailsType;
+
+/**
+ * The synchronous bi-direction interface for the client side (we need separate classes for the client and server so that they can take different CreditCardDetailsType)
+ */
+@Remotable
+@Callback(CreditCardPaymentCallbackSync.class)
+public interface CreditCardPaymentRequestClientSync {
+ // Send out the request
+ String authorizeRequest(CreditCardDetailsType creditCard, float amount);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentImpl.java b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentImpl.java
new file mode 100644
index 0000000..8d946b5
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentImpl.java
@@ -0,0 +1,82 @@
+/*
+ * 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 test.server;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Service;
+
+import test.client.CreditCardPaymentCallback;
+import test.client.CreditCardPaymentCallbackSync;
+
+import com.example.test.jaxb.server.CreditCardDetailsType;
+import com.example.test.jaxws.server.AuthorizeFault;
+import com.example.test.jaxws.server.CreditCardPayment;
+
+/**
+ * Mocked implementation of CreditCardPayment
+ */
+@Service({CreditCardPayment.class, CreditCardPaymentRequestServer.class, CreditCardPaymentRequestServerSync.class})
+public class CreditCardPaymentImpl implements CreditCardPayment, CreditCardPaymentRequestServer,
+ CreditCardPaymentRequestServerSync {
+ @Callback
+ protected CreditCardPaymentCallback callback;
+
+ @Callback
+ protected CreditCardPaymentCallbackSync callbackSync;
+
+ @Override
+ public void authorizeRequestOneway(CreditCardDetailsType creditCard, float amount) {
+ String status;
+ try {
+ status = authorize(creditCard, amount);
+ } catch (AuthorizeFault e) {
+ status = "FAIL: " + e.getFaultInfo().getErrorCode();
+ }
+ callback.authorizeResponseOneway(creditCard.getCreditCardNumber(), status);
+ }
+
+ @Override
+ public String authorizeRequest(CreditCardDetailsType creditCard, float amount) {
+ String status;
+ try {
+ status = authorize(creditCard, amount);
+ } catch (AuthorizeFault e) {
+ status = "FAIL: " + e.getFaultInfo().getErrorCode();
+ }
+ callbackSync.authorizeResponse(creditCard.getCreditCardNumber(), status);
+ return "ACK";
+ }
+
+ @Override
+ public String authorize(CreditCardDetailsType creditCard, float amount) throws AuthorizeFault {
+ if (creditCard != null) {
+ System.out.println("Checking card: name = " + creditCard.getCardOwner().getName()
+ + " number = "
+ + creditCard.getCreditCardNumber()
+ + " for amount "
+ + amount);
+ } else {
+ System.out.println("Checking card is null");
+ }
+
+ return "OK";
+ }
+
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServer.java b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServer.java
new file mode 100644
index 0000000..f257e5a
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServer.java
@@ -0,0 +1,39 @@
+/*
+ * 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 test.server;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
+import org.oasisopen.sca.annotation.Remotable;
+
+import test.client.CreditCardPaymentCallback;
+
+import com.example.test.jaxb.server.CreditCardDetailsType;
+
+/**
+ * The bi-direction interface for the server side
+ */
+@Remotable
+@Callback(CreditCardPaymentCallback.class)
+public interface CreditCardPaymentRequestServer {
+ // Send out the request
+ @OneWay
+ void authorizeRequestOneway(CreditCardDetailsType creditCard, float amount);
+}
diff --git a/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServerSync.java b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServerSync.java
new file mode 100644
index 0000000..93351c0
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/java/test/server/CreditCardPaymentRequestServerSync.java
@@ -0,0 +1,37 @@
+/*
+ * 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 test.server;
+
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Remotable;
+
+import test.client.CreditCardPaymentCallbackSync;
+
+import com.example.test.jaxb.server.CreditCardDetailsType;
+
+/**
+ * The synchronous bi-direction interface for the client side (we need separate classes for the client and server so that they can take different CreditCardDetailsType)
+ */
+@Remotable
+@Callback(CreditCardPaymentCallbackSync.class)
+public interface CreditCardPaymentRequestServerSync {
+ // Send out the request
+ String authorizeRequest(CreditCardDetailsType creditCard, float amount);
+}
diff --git a/testing/itest/async-interactions/src/main/resources/jndi.properties b/testing/itest/async-interactions/src/main/resources/jndi.properties
new file mode 100644
index 0000000..3241326
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/resources/jndi.properties
@@ -0,0 +1,39 @@
+ # 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.
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.RequestQueue = RequestQueue
+queue.ResponseQueue = ResponseQueue
+
+queue.CreditCardPayment = CreditCardPaymentQueue
+queue.CreditCardPaymentRequestServer = CreditCardPaymentRequestServerQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/async-interactions/src/main/resources/test/client/creditcard-client.composite b/testing/itest/async-interactions/src/main/resources/test/client/creditcard-client.composite
new file mode 100644
index 0000000..92a802f
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/resources/test/client/creditcard-client.composite
@@ -0,0 +1,47 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912" targetNamespace="http://www.example.com"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="CreditCardComposite">
+
+ <component name="CreditCardPaymentComponent">
+ <implementation.java class="test.server.CreditCardPaymentImpl" />
+ <service name="CreditCardPayment">
+ <binding.jms>
+ <tuscany:wireFormat.jmsTextXML />
+ <destination jndiName="CreditCardPayment" />
+ </binding.jms>
+ </service>
+
+ <service name="CreditCardPaymentRequestServer">
+ <binding.jms>
+ <tuscany:wireFormat.jmsTextXML />
+ <destination jndiName="CreditCardPaymentRequestServer" />
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="CreditCardClientComponent">
+ <implementation.java class="test.client.CreditCardPaymentClientImpl" />
+ <reference name="proxy" target="CreditCardPaymentComponent/CreditCardPayment" />
+ <reference name="asyncProxy" target="CreditCardPaymentComponent/CreditCardPaymentRequestServer" />
+ <reference name="syncProxy" target="CreditCardPaymentComponent/CreditCardPaymentRequestServerSync" />
+ </component>
+
+</composite>
diff --git a/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-client.xml b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-client.xml
new file mode 100644
index 0000000..edf8f37
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-client.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="creditcard.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions">
+ <package name="com.example.test.jaxws.client"/>
+ <enableAsyncMapping>true</enableAsyncMapping>
+ </bindings>
+</bindings>
\ No newline at end of file
diff --git a/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-server.xml b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-server.xml
new file mode 100644
index 0000000..9f39e16
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard-server.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="creditcard.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions">
+ <package name="com.example.test.jaxws.server"/>
+ <enableAsyncMapping>false</enableAsyncMapping>
+ </bindings>
+</bindings>
\ No newline at end of file
diff --git a/testing/itest/async-interactions/src/main/resources/wsdl/creditcard.wsdl b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard.wsdl
new file mode 100644
index 0000000..9398832
--- /dev/null
+++ b/testing/itest/async-interactions/src/main/resources/wsdl/creditcard.wsdl
@@ -0,0 +1,125 @@
+<?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.
+-->
+<wsdl:definitions name="CreditCardPayment" targetNamespace="http://www.example.com/CreditCardPayment/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.com/CreditCardPayment/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com/CreditCardPayment/"
+ xmlns:tns="http://www.example.com/CreditCardPayment/">
+
+ <!-- https://jaxb.dev.java.net/issues/show_bug.cgi?id=518 -->
+ <!-- I have to change the complex types to be annoymous -->
+ <xsd:element name="authorize">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="CreditCard" type="tns:CreditCardDetailsType"></xsd:element>
+ <xsd:element name="Amount" type="xsd:float"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="authorizeResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Status" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:complexType name="CreditCardDetailsType">
+ <xsd:sequence>
+ <xsd:element name="CreditCardType" type="tns:CreditCardTypeType" minOccurs="0" />
+ <xsd:element name="CreditCardNumber" type="xsd:string" minOccurs="0" />
+ <xsd:element name="ExpMonth" type="xsd:int" minOccurs="0" />
+ <xsd:element name="ExpYear" type="xsd:int" minOccurs="0" />
+ <xsd:element name="CardOwner" type="tns:PayerType" minOccurs="0" />
+ <xsd:element name="CVV2" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:simpleType name="CreditCardTypeType">
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="Visa" />
+ <xsd:enumeration value="MasterCard" />
+ <xsd:enumeration value="Discover" />
+ <xsd:enumeration value="Amex" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:complexType name="PayerType">
+ <xsd:sequence>
+ <xsd:element name="Name" type="xsd:string" />
+ <xsd:element name="Address" type="tns:AddressType" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AddressType">
+ <xsd:sequence>
+ <xsd:element name="Street" type="xsd:string" />
+ <xsd:element name="City" type="xsd:string" />
+ <xsd:element name="State" type="xsd:string" />
+ <xsd:element name="ZipCode" type="xsd:string" />
+ <xsd:element name="HomePhone" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="authorizeFault">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="errorCode" type="xsd:string"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="AuthorizeRequest">
+ <wsdl:part name="parameters" element="tns:authorize"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="AuthorizeResponse">
+ <wsdl:part name="parameters" element="tns:authorizeResponse"></wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="AuthorizeFault">
+ <wsdl:part name="parameters" element="tns:authorizeFault"></wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="CreditCardPayment">
+ <wsdl:operation name="authorize">
+ <wsdl:input message="tns:AuthorizeRequest"></wsdl:input>
+ <wsdl:output message="tns:AuthorizeResponse"></wsdl:output>
+ <wsdl:fault name="authorizationFailure" message="tns:AuthorizeFault"></wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CreditCardPaymentBinding" type="tns:CreditCardPayment">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="authorize">
+ <soap:operation soapAction="http://www.example.com/CreditCardPayment/authorize" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="authorizationFailure">
+ <soap:fault name="authorizationFailure" use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CreditCardPaymentService">
+ <wsdl:port name="CreditCardPaymentPort" binding="tns:CreditCardPaymentBinding">
+ <soap:address location="http://localhost:8080/CreditCardPayment" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
\ No newline at end of file
diff --git a/testing/itest/async-interactions/src/test/java/itest/CreditCardTestCase.java b/testing/itest/async-interactions/src/test/java/itest/CreditCardTestCase.java
new file mode 100644
index 0000000..d9b8217
--- /dev/null
+++ b/testing/itest/async-interactions/src/test/java/itest/CreditCardTestCase.java
@@ -0,0 +1,89 @@
+/*
+ * 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 itest;
+
+import java.util.concurrent.ExecutionException;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import test.client.CreditCardClient;
+
+/**
+ * A test case for two SCA components exchange data via binding.jms
+ */
+public class CreditCardTestCase {
+
+ private static Node node;
+ private static CreditCardClient client;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(CreditCardClient.class);
+ node =
+ NodeFactory.newInstance().createNode("test/client/creditcard-client.composite",
+ new Contribution("cc", contribution));
+ node.start();
+
+ client = node.getService(CreditCardClient.class, "CreditCardClientComponent/CreditCardClient");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testCreditCard() {
+ String status = client.authorize("123", "John", 100.0f);
+ Assert.assertEquals("OK", status);
+ }
+
+ @Test
+ public void testCreditCardAsync() throws InterruptedException, ExecutionException {
+ String result = client.authorizeAsync("456", "Mary", 120.0f);
+ Assert.assertEquals("OK", result);
+ }
+
+ @Test
+ public void testCreditCardAsyncWithCallback() throws InterruptedException, ExecutionException {
+ String result = client.authorizeAsyncWithCallback("789", "Smith", 180.0f);
+ Assert.assertEquals("OK", result);
+ }
+
+ @Test
+ public void testCreditCardSCAAsyncWithCallback() throws InterruptedException, ExecutionException {
+ String result = client.authorizeSCAAsyncWithCallback("888", "Jane", 110.0f);
+ Assert.assertEquals("OK", result);
+ }
+
+ @Test
+ public void testCreditCardSCAWithCallback() throws InterruptedException, ExecutionException {
+ String result = client.authorizeSCAWithCallback("999", "Steve", 210.0f);
+ Assert.assertEquals("OK", result);
+ }
+}
diff --git a/testing/itest/base/dependencies/pom.xml b/testing/itest/base/dependencies/pom.xml
new file mode 100644
index 0000000..319971c
--- /dev/null
+++ b/testing/itest/base/dependencies/pom.xml
@@ -0,0 +1,59 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-base-dependencies</artifactId>
+ <name>Apache Tuscany SCA iTest Base Dependencies</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Copy all the dependencies so the test can verify only the expected ones get dragged in -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/testing/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java b/testing/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java
new file mode 100644
index 0000000..2cdd77b
--- /dev/null
+++ b/testing/itest/base/dependencies/src/test/java/org/apache/tuscany/sca/itest/base/dependencies/ValidateDependenciesTestCase.java
@@ -0,0 +1,56 @@
+/*
+ * 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.sca.itest.base.dependencies;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+/**
+ * Test case for verifying the expected dependencies of the base jar
+ * (Uses maven-dependency-plugin config in the pom.xml to generate the dependency list)
+ *
+ * *** NOTE: this is an API! If the dependencies change the API is changed and users will be broken.
+ * Don't just change the list without thinking about the consequencies
+ *
+ * Current required jars are:
+ * asm-3.1.jar
+ * cglib-2.2.jar
+ * tuscany-base-2.0-SNAPSHOT.jar
+ * wsdl4j-1.6.2.jar
+ * XmlSchema-1.4.3.jar
+ *
+ * junit-4.8.1.jar (only from this testcase)
+ *
+ */
+public class ValidateDependenciesTestCase {
+
+ @Test
+ public void countDependencies() {
+
+ File dependenciesDir = new File("target/dependency");
+ Assert.assertTrue(dependenciesDir.exists());
+
+ File[] dependencyFiles = dependenciesDir.listFiles();
+ Assert.assertEquals(6, dependencyFiles.length);
+ }
+}
diff --git a/itest/base/pom.xml b/testing/itest/base/pom.xml
similarity index 100%
rename from itest/base/pom.xml
rename to testing/itest/base/pom.xml
diff --git a/itest/bpel/helloworld-reference/pom.xml b/testing/itest/bpel/helloworld-reference/pom.xml
similarity index 100%
rename from itest/bpel/helloworld-reference/pom.xml
rename to testing/itest/bpel/helloworld-reference/pom.xml
diff --git a/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java b/testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsService.java
diff --git a/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java b/testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsServiceImpl.java
diff --git a/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java b/testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/greetings/GreetingsTestCase.java
diff --git a/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java b/testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldService.java
diff --git a/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java b/testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java b/testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java
rename to testing/itest/bpel/helloworld-reference/src/test/java/helloworld/HelloWorldTestCase.java
diff --git a/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite b/testing/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite
rename to testing/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.composite
diff --git a/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl b/testing/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl
rename to testing/itest/bpel/helloworld-reference/src/test/resources/greetings/greetings.wsdl
diff --git a/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel b/testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel
rename to testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.bpel
diff --git a/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite b/testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite
rename to testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.composite
diff --git a/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl b/testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl
rename to testing/itest/bpel/helloworld-reference/src/test/resources/helloworld/helloworld.wsdl
diff --git a/itest/bpel/helloworld-reference/src/test/resources/log4j.properties b/testing/itest/bpel/helloworld-reference/src/test/resources/log4j.properties
similarity index 100%
rename from itest/bpel/helloworld-reference/src/test/resources/log4j.properties
rename to testing/itest/bpel/helloworld-reference/src/test/resources/log4j.properties
diff --git a/itest/bpel/helloworld-ws/pom.xml b/testing/itest/bpel/helloworld-ws/pom.xml
similarity index 100%
rename from itest/bpel/helloworld-ws/pom.xml
rename to testing/itest/bpel/helloworld-ws/pom.xml
diff --git a/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java b/testing/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java
rename to testing/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorld.java
diff --git a/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java b/testing/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java
rename to testing/itest/bpel/helloworld-ws/src/test/java/helloworld/HelloWorldTestCase.java
diff --git a/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.bpel b/testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.bpel
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.bpel
rename to testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.bpel
diff --git a/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.composite b/testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.composite
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.composite
rename to testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.composite
diff --git a/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.wsdl b/testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.wsdl
rename to testing/itest/bpel/helloworld-ws/src/test/resources/helloworld/helloworld.wsdl
diff --git a/itest/bpel/helloworld-ws/src/test/resources/log4j.properties b/testing/itest/bpel/helloworld-ws/src/test/resources/log4j.properties
similarity index 100%
rename from itest/bpel/helloworld-ws/src/test/resources/log4j.properties
rename to testing/itest/bpel/helloworld-ws/src/test/resources/log4j.properties
diff --git a/itest/bpel/helloworld/pom.xml b/testing/itest/bpel/helloworld/pom.xml
similarity index 100%
rename from itest/bpel/helloworld/pom.xml
rename to testing/itest/bpel/helloworld/pom.xml
diff --git a/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java b/testing/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
similarity index 100%
rename from itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
rename to testing/itest/bpel/helloworld/src/test/java/helloworld/HelloWorld.java
diff --git a/testing/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java b/testing/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
new file mode 100644
index 0000000..cbed39c
--- /dev/null
+++ b/testing/itest/bpel/helloworld/src/test/java/helloworld/HelloWorldTestCase.java
@@ -0,0 +1,75 @@
+/*
+ * 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 helloworld;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.implementation.bpel.example.helloworld.HelloPortType;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Tests the BPEL Helloworld Service
+ *
+ * @version $Rev$ $Date$
+ */
+@Ignore
+public class HelloWorldTestCase {
+
+ private static Node node;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("helloworld/helloworld.composite");
+ node = NodeFactory.newInstance().createNode("helloworld/helloworld.composite", new Contribution("c1", location));
+ node.start();
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testServiceInvocation() throws Exception {
+ HelloPortType bpelService = node.getService(HelloPortType.class, "BPELHelloWorldService");
+ String response = bpelService.hello("Hello");
+ Assert.assertEquals("Hello World", response);
+ }
+
+ @Test
+ public void testReferenceInvocation() throws Exception {
+ HelloWorld bpelService = node.getService(HelloWorld.class, "BPELHelloWorld");
+ String response = bpelService.hello("Hello");
+ Assert.assertEquals("Hello World", response);
+ }
+}
diff --git a/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel b/testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel
similarity index 100%
rename from itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel
rename to testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.bpel
diff --git a/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite b/testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite
similarity index 100%
rename from itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite
rename to testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.composite
diff --git a/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl b/testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl
rename to testing/itest/bpel/helloworld/src/test/resources/helloworld/helloworld.wsdl
diff --git a/itest/bpel/helloworld/src/test/resources/log4j.properties b/testing/itest/bpel/helloworld/src/test/resources/log4j.properties
similarity index 100%
rename from itest/bpel/helloworld/src/test/resources/log4j.properties
rename to testing/itest/bpel/helloworld/src/test/resources/log4j.properties
diff --git a/itest/bpel/pom.xml b/testing/itest/bpel/pom.xml
similarity index 100%
rename from itest/bpel/pom.xml
rename to testing/itest/bpel/pom.xml
diff --git a/testing/itest/builder/pom.xml b/testing/itest/builder/pom.xml
new file mode 100644
index 0000000..147a694
--- /dev/null
+++ b/testing/itest/builder/pom.xml
@@ -0,0 +1,62 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-builder</artifactId>
+ <name>Apache Tuscany SCA iTest Builder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDImpl.java
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentDReferenceMultiplicityImpl.java
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentEImpl.java
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/ComponentFImpl.java
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3.java
diff --git a/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java b/testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java
similarity index 100%
rename from itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java
rename to testing/itest/builder/src/main/java/org/apache/tuscany/sca/itest/builder/Service3a.java
diff --git a/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario1/scenario1.composite b/testing/itest/builder/src/main/resources/scenario1/scenario1.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario1/scenario1.composite
rename to testing/itest/builder/src/main/resources/scenario1/scenario1.composite
diff --git a/itest/builder/src/main/resources/scenario1/scenario1a.composite b/testing/itest/builder/src/main/resources/scenario1/scenario1a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario1/scenario1a.composite
rename to testing/itest/builder/src/main/resources/scenario1/scenario1a.composite
diff --git a/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario10/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario10/scenario10.composite b/testing/itest/builder/src/main/resources/scenario10/scenario10.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario10/scenario10.composite
rename to testing/itest/builder/src/main/resources/scenario10/scenario10.composite
diff --git a/itest/builder/src/main/resources/scenario10/scenario10a.composite b/testing/itest/builder/src/main/resources/scenario10/scenario10a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario10/scenario10a.composite
rename to testing/itest/builder/src/main/resources/scenario10/scenario10a.composite
diff --git a/itest/builder/src/main/resources/scenario10/service3.wsdl b/testing/itest/builder/src/main/resources/scenario10/service3.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario10/service3.wsdl
rename to testing/itest/builder/src/main/resources/scenario10/service3.wsdl
diff --git a/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario11/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario11/scenario11.composite b/testing/itest/builder/src/main/resources/scenario11/scenario11.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario11/scenario11.composite
rename to testing/itest/builder/src/main/resources/scenario11/scenario11.composite
diff --git a/itest/builder/src/main/resources/scenario11/scenario11a.composite b/testing/itest/builder/src/main/resources/scenario11/scenario11a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario11/scenario11a.composite
rename to testing/itest/builder/src/main/resources/scenario11/scenario11a.composite
diff --git a/itest/builder/src/main/resources/scenario11/service3.wsdl b/testing/itest/builder/src/main/resources/scenario11/service3.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario11/service3.wsdl
rename to testing/itest/builder/src/main/resources/scenario11/service3.wsdl
diff --git a/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario12/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario12/scenario12.composite b/testing/itest/builder/src/main/resources/scenario12/scenario12.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario12/scenario12.composite
rename to testing/itest/builder/src/main/resources/scenario12/scenario12.composite
diff --git a/itest/builder/src/main/resources/scenario12/scenario12a.composite b/testing/itest/builder/src/main/resources/scenario12/scenario12a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario12/scenario12a.composite
rename to testing/itest/builder/src/main/resources/scenario12/scenario12a.composite
diff --git a/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario13/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario13/scenario13.composite b/testing/itest/builder/src/main/resources/scenario13/scenario13.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario13/scenario13.composite
rename to testing/itest/builder/src/main/resources/scenario13/scenario13.composite
diff --git a/itest/builder/src/main/resources/scenario13/scenario13a.composite b/testing/itest/builder/src/main/resources/scenario13/scenario13a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario13/scenario13a.composite
rename to testing/itest/builder/src/main/resources/scenario13/scenario13a.composite
diff --git a/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario2/scenario2.composite b/testing/itest/builder/src/main/resources/scenario2/scenario2.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario2/scenario2.composite
rename to testing/itest/builder/src/main/resources/scenario2/scenario2.composite
diff --git a/itest/builder/src/main/resources/scenario2/scenario2a.composite b/testing/itest/builder/src/main/resources/scenario2/scenario2a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario2/scenario2a.composite
rename to testing/itest/builder/src/main/resources/scenario2/scenario2a.composite
diff --git a/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario3/scenario3.composite b/testing/itest/builder/src/main/resources/scenario3/scenario3.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario3/scenario3.composite
rename to testing/itest/builder/src/main/resources/scenario3/scenario3.composite
diff --git a/itest/builder/src/main/resources/scenario3/scenario3a.composite b/testing/itest/builder/src/main/resources/scenario3/scenario3a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario3/scenario3a.composite
rename to testing/itest/builder/src/main/resources/scenario3/scenario3a.composite
diff --git a/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario4/scenario4.composite b/testing/itest/builder/src/main/resources/scenario4/scenario4.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario4/scenario4.composite
rename to testing/itest/builder/src/main/resources/scenario4/scenario4.composite
diff --git a/itest/builder/src/main/resources/scenario4/scenario4a.composite b/testing/itest/builder/src/main/resources/scenario4/scenario4a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario4/scenario4a.composite
rename to testing/itest/builder/src/main/resources/scenario4/scenario4a.composite
diff --git a/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario5/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario5/scenario5.composite b/testing/itest/builder/src/main/resources/scenario5/scenario5.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario5/scenario5.composite
rename to testing/itest/builder/src/main/resources/scenario5/scenario5.composite
diff --git a/itest/builder/src/main/resources/scenario5/scenario5a.composite b/testing/itest/builder/src/main/resources/scenario5/scenario5a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario5/scenario5a.composite
rename to testing/itest/builder/src/main/resources/scenario5/scenario5a.composite
diff --git a/itest/builder/src/main/resources/scenario5/scenarios.wsdl b/testing/itest/builder/src/main/resources/scenario5/scenarios.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario5/scenarios.wsdl
rename to testing/itest/builder/src/main/resources/scenario5/scenarios.wsdl
diff --git a/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario6/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario6/scenario6.composite b/testing/itest/builder/src/main/resources/scenario6/scenario6.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario6/scenario6.composite
rename to testing/itest/builder/src/main/resources/scenario6/scenario6.composite
diff --git a/itest/builder/src/main/resources/scenario6/scenario6a.composite b/testing/itest/builder/src/main/resources/scenario6/scenario6a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario6/scenario6a.composite
rename to testing/itest/builder/src/main/resources/scenario6/scenario6a.composite
diff --git a/itest/builder/src/main/resources/scenario6/scenarios.wsdl b/testing/itest/builder/src/main/resources/scenario6/scenarios.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario6/scenarios.wsdl
rename to testing/itest/builder/src/main/resources/scenario6/scenarios.wsdl
diff --git a/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario7/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario7/scenario7.composite b/testing/itest/builder/src/main/resources/scenario7/scenario7.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario7/scenario7.composite
rename to testing/itest/builder/src/main/resources/scenario7/scenario7.composite
diff --git a/itest/builder/src/main/resources/scenario7/scenario7a.composite b/testing/itest/builder/src/main/resources/scenario7/scenario7a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario7/scenario7a.composite
rename to testing/itest/builder/src/main/resources/scenario7/scenario7a.composite
diff --git a/itest/builder/src/main/resources/scenario7/scenarios.wsdl b/testing/itest/builder/src/main/resources/scenario7/scenarios.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario7/scenarios.wsdl
rename to testing/itest/builder/src/main/resources/scenario7/scenarios.wsdl
diff --git a/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario8/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario8/scenario8.composite b/testing/itest/builder/src/main/resources/scenario8/scenario8.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario8/scenario8.composite
rename to testing/itest/builder/src/main/resources/scenario8/scenario8.composite
diff --git a/itest/builder/src/main/resources/scenario8/scenario8a.composite b/testing/itest/builder/src/main/resources/scenario8/scenario8a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario8/scenario8a.composite
rename to testing/itest/builder/src/main/resources/scenario8/scenario8a.composite
diff --git a/itest/builder/src/main/resources/scenario8/scenarios.wsdl b/testing/itest/builder/src/main/resources/scenario8/scenarios.wsdl
similarity index 100%
rename from itest/builder/src/main/resources/scenario8/scenarios.wsdl
rename to testing/itest/builder/src/main/resources/scenario8/scenarios.wsdl
diff --git a/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml b/testing/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml
rename to testing/itest/builder/src/main/resources/scenario9/META-INF/sca-contribution.xml
diff --git a/itest/builder/src/main/resources/scenario9/scenario9.composite b/testing/itest/builder/src/main/resources/scenario9/scenario9.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario9/scenario9.composite
rename to testing/itest/builder/src/main/resources/scenario9/scenario9.composite
diff --git a/itest/builder/src/main/resources/scenario9/scenario9a.composite b/testing/itest/builder/src/main/resources/scenario9/scenario9a.composite
similarity index 100%
rename from itest/builder/src/main/resources/scenario9/scenario9a.composite
rename to testing/itest/builder/src/main/resources/scenario9/scenario9a.composite
diff --git a/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java b/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
new file mode 100644
index 0000000..b0c9f77
--- /dev/null
+++ b/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
@@ -0,0 +1,814 @@
+/*
+ * 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.sca.itest.builder;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.xml.namespace.QName;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Load and build some composites and inspect the results.
+ *
+ * @version $Rev$ $Date$
+ */
+public class BuilderTestCase {
+ private CustomCompositeBuilder customBuilder;
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /* OASIS doesn't take notice of top level composite services
+ *
+ // Scenario 1: <binding.ws> on outer composite service CompositeA/Service1
+ @Ignore
+ @Test
+ public void testScenario1() throws Exception {
+ System.out.println("====>Running testScenario1");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario1Results(false);
+ }
+
+ @Ignore
+ @Test
+ public void testScenario1NonWiring() throws Exception {
+ System.out.println("====>Running testScenario1NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario1.composite", "TestContribution", "src/main/resources/scenario1/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario1Results(true);
+ }
+
+ private void checkScenario1Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should create component service $promoted$Service1 on innermost component
+ // ComponentD, with <binding.ws> and uri="/Service1"
+ // No other services on ComponentD should have <binding.ws>
+ WebServiceBinding wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("$promoted$Service1".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/Service1".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
+ Definition def = wsBinding.getWSDLDocument();
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ Port port = svc.getPort("Service3Port");
+ assert "/Service1".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$Service1 on innermost component ComponentD
+ // No component services on ComponentD should have <binding.ws>
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$Service1".equals(service.getName());
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // No services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ for (ComponentService service : componentB.getServices()) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+
+ // No services on CompositeC should have <binding.ws>
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario1", "CompositeC"));
+ for (Service service : compositeC.getServices()) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+
+ if (nonWiring) {
+ // Should not add a WSDL document to domain composite service Service1
+ WebServiceBinding wsBinding = null;
+ for (Service service : domainComposite.getServices()) {
+ if ("Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+*/
+
+ // Scenario 2: <binding.ws> on outer component service ComponentB/Service2
+ @Test
+ public void testScenario2() throws Exception {
+ System.out.println("====>Running testScenario2");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario2", false);
+ }
+
+ public void testScenario2NonWiring() throws Exception {
+ System.out.println("====>Running testScenario2NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario2.composite", "TestContribution", "src/main/resources/scenario2/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario2", true);
+ }
+
+ private void checkScenario2and3Results(String namespace, boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Test that endpoint structure matches expected
+ String structure = TestUtils.printStructure(domainComposite, "");
+ System.out.println(structure);
+
+ String expectedStructure = "Component URI - ComponentB\n" +
+ " Component URI - ComponentB/ComponentD\n" +
+ " Endpoint: URI = ComponentB/ComponentD#service-binding(Service3/Service3) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n" +
+ " Endpoint: URI = ComponentB/ComponentD#service-binding(Service3a/Service3a) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n" +
+ "Endpoint: URI = ComponentB#service-binding(Service2/Service2) org.apache.tuscany.sca.binding.ws.impl.WebServiceBindingImpl\n" +
+ "Endpoint: URI = ComponentB#service-binding(Service2a/Service3a) org.apache.tuscany.sca.assembly.impl.SCABindingImpl\n";
+
+ Assert.assertEquals(expectedStructure, structure);
+
+ // Test that generated WSDL matches expected
+ // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
+ // No other services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ WebServiceBinding wsBinding = null;
+
+ for (ComponentService service : componentB.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+
+ Definition def = wsBinding.getGeneratedWSDLDocument();
+ TestUtils.writeWSDL(def);
+
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service2"));
+ Port port = svc.getPort("Service2SOAP11Port");
+ Assert.assertEquals("/ComponentB/Service2",TestUtils.getPortAddress(port));
+
+ }
+/*
+ // Scenario 3: <binding.ws> on inner composite service CompositeC/Service2
+ public void testScenario3() throws Exception {
+ System.out.println("====>Running testScenario3");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario3", false);
+ }
+
+ public void testScenario3NonWiring() throws Exception {
+ System.out.println("====>Running testScenario3NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario3.composite", "TestContribution", "src/main/resources/scenario3/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario2and3Results("http://scenario3", true);
+ }
+
+ // Scenario 4: <binding.ws> on inner component service ComponentD/Service3
+ public void testScenario4() throws Exception {
+ System.out.println("====>Running testScenario4");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario4Results(false);
+ }
+
+ public void testScenario4NonWiring() throws Exception {
+ System.out.println("====>Running testScenario4NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario4.composite", "TestContribution", "src/main/resources/scenario4/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario4Results(true);
+ }
+
+ private void checkScenario4Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should create WSDL document for ComponentD/Service3 with endpoint uri="/ComponentD/Service3"
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ WebServiceBinding wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("Service3".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ Definition def = wsBinding.getWSDLDocument();
+ javax.wsdl.Service svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ Port port = svc.getPort("Service3Port");
+ assert "/ComponentB/ComponentD/Service3".equals(TestUtils.getPortAddress(port));
+
+ // Should add <binding.ws> to inner composite service CompositeC/Service2
+ // No other services on CompositeC should have <binding.ws>
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario4", "CompositeC"));
+ wsBinding = null;
+ for (Service service : compositeC.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+
+ // Should add <binding.ws> to outer component service ComponentB/Service2
+ // Should create WSDL document for ComponentB/Service2 with endpoint uri="/ComponentB/Service2"
+ // No other services on ComponentB should have <binding.ws>
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ wsBinding = null;
+ for (ComponentService service : componentB.getServices()) {
+ WebServiceBinding wsb = service.getBinding(WebServiceBinding.class);
+ if ("Service2".equals(service.getName())) {
+ wsBinding = wsb;
+ } else {
+ assert wsb == null;
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+
+ if (!nonWiring) {
+ // Should create component service $promoted$ComponentB$slash$Service2 on innermost component
+ // ComponentD, with <binding.ws> and uri="/ComponentB/Service2"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/ComponentB/Service2".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$ComponentB$slash$Service2 with endpoint uri="/ComponentB/Service2"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/ComponentB/Service2".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$ComponentB$slash$Service2 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$ComponentB$slash$Service2".equals(service.getName());
+ }
+ }
+
+ // Should add <binding.ws> to outer composite service CompositeA/Service1
+ wsBinding = null;
+ for (Service service : domainComposite.getServices()) {
+ if ("Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert wsBinding != null;
+ if (nonWiring) {
+ // Should not add a WSDL document to domain composite service Service1
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ if (!nonWiring) {
+ // Should create component service $promoted$Service1 on innermost component
+ // ComponentD, with <binding.ws> and uri="/Service1"
+ wsBinding = null;
+ for (ComponentService service : componentD.getServices()) {
+ if ("$promoted$Service1".equals(service.getName())) {
+ wsBinding = service.getBinding(WebServiceBinding.class);
+ }
+ }
+ assert "/Service1".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/$promoted$Service1 with endpoint uri="/Service1"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://builder.itest.sca.tuscany.apache.org/", "Service3Service"));
+ port = svc.getPort("Service3Port");
+ assert "/Service1".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not create component service $promoted$.Service1 on innermost component ComponentD
+ for (ComponentService service : componentD.getServices()) {
+ assert !"$promoted$Service1".equals(service.getName());
+ }
+ }
+
+ // No services on ComponentD should have <binding.ws>, except for Service3,
+ // $promoted$.Service1 and $promoted$.ComponentB.Service2
+ for (ComponentService service : componentD.getServices()) {
+ if (!"Service3".equals(service.getName()) &&
+ !"$promoted$Service1".equals(service.getName()) &&
+ !"$promoted$ComponentB$slash$Service2".equals(service.getName())) {
+ assert service.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+ }
+
+ // Scenario 5: <binding.ws> and <interface.wsdl> on outer composite reference CompositeA/reference1
+ @Test
+ public void testScenario5() throws Exception {
+ System.out.println("====>Running testScenario5");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario5Results(false);
+ }
+
+ @Test
+ public void testScenario5NonWiring() throws Exception {
+ System.out.println("====>Running testScenario5NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario5.composite", "TestContribution", "src/main/resources/scenario5/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario5Results(true);
+ }
+
+ private void checkScenario5Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should not add <binding.ws> to any outer component references
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ for (ComponentReference reference : componentB.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ WebServiceBinding wsBinding;
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
+ // Should set <interface.wsdl> on inner component reference ComponentD/reference3
+ wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
+ }
+ }
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not add <binding.ws> to any inner component references
+ for (ComponentReference reference : componentD.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // Should not add <binding.ws> or <interface.wsdl> to inner composite reference CompositeC/reference2
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario5", "CompositeC"));
+ for (Reference reference : compositeC.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
+ }
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+
+
+ // Scenario 6: <binding.ws> and <interface.wsdl> on outer component reference ComponentB/reference2
+ @Ignore
+ @Test
+ public void testScenario6() throws Exception {
+ System.out.println("====>Running testScenario6");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario6", false);
+ }
+
+ @Ignore
+ @Test
+ public void testScenario6NonWiring() throws Exception {
+ System.out.println("====>Running testScenario6NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario6.composite", "TestContribution", "src/main/resources/scenario6/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario6", true);
+ }
+
+ private void checkScenario6and7Results(String namespace, boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should remove target= on ComponentB/reference2 (for Scenario 6) or
+ // CompositeC/reference2 (for Scenario 7), and add uri="http://foo.com/bar"
+ // to the <binding.ws> element on ComponentB/reference2
+ // For nonWiring, ComponentB/reference2 should have target=
+ // and no uri= should be added
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ WebServiceBinding wsBinding = null;
+ for (ComponentReference reference : componentB.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ if (!nonWiring) {
+ assert reference.getTargets().size() == 0;
+ } else {
+ assert reference.getTargets().size() == 1;
+ }
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ }
+ }
+ if (!nonWiring) {
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+ } else {
+ assert wsBinding.getURI() == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ if (!nonWiring) {
+ // Should create WSDL document for ComponentB/reference2 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ }
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ if (!nonWiring) {
+ // Should add <binding.ws> to inner component reference ComponentD/reference3 with uri="http://foo.com/bar"
+ // Should set <interface.wsdl> on inner component reference ComponentD/reference3
+ wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getBindings().size() == 1;
+ assert reference.getInterfaceContract(wsBinding) instanceof WSDLInterfaceContract;
+ }
+ }
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentB/reference2", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ } else {
+ // Should not add <binding.ws> to any inner component references
+ for (ComponentReference reference : componentD.getReferences()) {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ }
+ }
+
+ // No references on CompositeC should have <binding.ws> or <interface.wsdl>, except for
+ // reference2 in Scenario 7
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName(namespace, "CompositeC"));
+ for (Reference reference : compositeC.getReferences()) {
+ if ("http://scenario7".equals(namespace) && "reference2".equals(reference.getName())) {
+ assert reference.getBinding(WebServiceBinding.class)!= null;
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ } else {
+ assert reference.getBinding(WebServiceBinding.class) == null;
+ assert reference.getInterfaceContract() instanceof JavaInterfaceContract;
+ }
+ }
+
+ // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
+ wsBinding = null;
+ for (Reference reference : domainComposite.getReferences()) {
+ if ("reference1".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should not add a WSDL document to domain composite reference reference1
+ assert wsBinding.getWSDLDocument() == null;
+
+ String expectedEndpoints = "Component - ComponentB\n" +
+ "Service - Service2\n" +
+ "Endpoint - Service2\n" +
+ "Service - Service2a\n" +
+ "Endpoint - Service2a\n" +
+ "Reference - reference2\n" +
+ "Component - ComponentB has composite impl\n" +
+ " Component - ComponentD\n" +
+ " Service - Service3\n" +
+ " Endpoint - Service3\n" +
+ " Service - Service3a\n" +
+ " Endpoint - Service3a\n" +
+ " Reference - reference3";
+
+ String actualEndpoints = TestUtils.printEndpoints(domainComposite);
+ System.out.println(actualEndpoints);
+
+ Assert.assertEquals(expectedEndpoints, actualEndpoints);
+ }
+
+ // Scenario 7: <binding.ws> and <interface.wsdl> on inner composite reference CompositeC/reference2
+ public void testScenario7() throws Exception {
+ System.out.println("====>Running testScenario7");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario7", false);
+ }
+
+ public void testScenario7NonWiring() throws Exception {
+ System.out.println("====>Running testScenario7NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario7.composite", "TestContribution", "src/main/resources/scenario7/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario6and7Results("http://scenario7", true);
+ }
+
+ // Scenario 8: <binding.ws> and <interface.wsdl> on inner component reference ComponentD/reference3
+ public void testScenario8() throws Exception {
+ System.out.println("====>Running testScenario8");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario8Results(false);
+ }
+
+ public void testScenario8NonWiring() throws Exception {
+ System.out.println("====>Running testScenario8NonWiring");
+ customBuilder = new CustomCompositeBuilder(true);
+ customBuilder.loadContribution("scenario8.composite", "TestContribution", "src/main/resources/scenario8/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario8Results(true);
+ }
+
+ private void checkScenario8Results(boolean nonWiring) {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ // Should replace target= on ComponentD/reference3 by uri="http://foo.com/bar" on <binding.ws>
+ // For nonWiring, the original target= is preserved and there is no uri=
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ WebServiceBinding wsBinding = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3".equals(reference.getName())) {
+ if (!nonWiring) {
+ assert reference.getTargets().size() == 0;
+ } else {
+ assert reference.getTargets().size() == 1;
+ }
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ }
+ }
+ if (!nonWiring) {
+ assert "http://foo.com/bar".equals(wsBinding.getURI());
+ } else {
+ assert wsBinding.getURI() == null;
+ }
+
+ Definition def;
+ javax.wsdl.Service svc;
+ Port port;
+ if (!nonWiring) {
+ // Should create WSDL document for ComponentD/reference3 with endpoint uri="http://foo.com/bar"
+ def = wsBinding.getWSDLDocument();
+ svc = def.getService(new QName("http://scenarios/ComponentD/reference3", "Service3aService"));
+ port = svc.getPort("Service3aPort");
+ assert "http://foo.com/bar".equals(TestUtils.getPortAddress(port));
+ }
+
+ // Should add <binding.ws> and <interface.wsdl> to inner composite reference CompositeC/reference2
+ Composite compositeC = TestUtils.getComposite(domainComposite, new QName("http://scenario8", "CompositeC"));
+ wsBinding = null;
+ for (Reference reference : compositeC.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should add <binding.ws> and <interface.wsdl> to outer component reference ComponentB/reference2
+ Component componentB = TestUtils.getComponent(domainComposite, "ComponentB");
+ wsBinding = null;
+ for (ComponentReference reference : componentB.getReferences()) {
+ if ("reference2".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should add <binding.ws> and <interface.wsdl> to outer composite reference CompositeA/reference1
+ wsBinding = null;
+ for (Reference reference : domainComposite.getReferences()) {
+ if ("reference1".equals(reference.getName())) {
+ wsBinding = reference.getBinding(WebServiceBinding.class);
+ assert reference.getInterfaceContract() instanceof WSDLInterfaceContract;
+ }
+ }
+ assert wsBinding.getURI() == null;
+
+ // Should not add a WSDL document to domain composite reference reference1
+ assert wsBinding.getWSDLDocument() == null;
+ }
+
+ // Scenario 9: target in reference CDR3A and binding.ws uri= at CAR1A
+ public void testScenario9() throws Exception {
+ System.out.println("====>Running testScenario9");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario9.composite", "TestContribution", "src/main/resources/scenario9/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario9Results();
+ }
+
+ private void checkScenario9Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ assertTrue(reference.getBindings().get(0) instanceof SCABinding);
+ assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 10: targets in references CBR2A and CDR3A and binding.ws at CBR2A
+ public void testScenario10() throws Exception {
+ System.out.println("====>Running testScenario10");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario10.composite", "TestContribution", "src/main/resources/scenario10/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario10And11Results();
+ }
+
+ // Scenario 11: targets in references CBR2A and CDR3A and binding.ws at CCR2A
+ public void testScenario11() throws Exception {
+ System.out.println("====>Running testScenario11");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario11.composite", "TestContribution", "src/main/resources/scenario11/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario10And11Results();
+ }
+
+ private void checkScenario10And11Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ Binding binding1 = reference.getBindings().get(0);
+ assertTrue(binding1 instanceof SCABinding);
+ assertTrue(reference.getInterfaceContract(binding1) instanceof JavaInterfaceContract);
+ Binding binding2 = reference.getBindings().get(1);
+ assertTrue(binding2 instanceof WebServiceBinding);
+ assertTrue(reference.getInterfaceContract(binding2) instanceof WSDLInterfaceContract);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 12: targets in references CBR2A and CDR3A and binding.ws at CDR3A
+ public void testScenario12() throws Exception {
+ System.out.println("====>Running testScenario12");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario12.composite", "TestContribution", "src/main/resources/scenario12/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario12Results();
+ }
+
+ private void checkScenario12Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 2);
+ assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
+ assertTrue(reference.getBindings().get(1) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+
+ // Scenario 13: target in reference CDR3A
+ public void testScenario13() throws Exception {
+ System.out.println("====>Running testScenario13");
+ customBuilder = new CustomCompositeBuilder(false);
+ customBuilder.loadContribution("scenario13.composite", "TestContribution", "src/main/resources/scenario13/");
+ //TestUtils.printResults(customBuilder);
+ TestUtils.checkProblems(customBuilder);
+ checkScenario13Results();
+ }
+
+ private void checkScenario13Results() {
+ Composite domainComposite = customBuilder.getDomainComposite();
+
+ Component componentD = TestUtils.getComponent(domainComposite, "ComponentD");
+ ComponentReference componentRef = null;
+ for (ComponentReference reference : componentD.getReferences()) {
+ if ("reference3a".equals(reference.getName())) {
+ componentRef = reference;
+ assertTrue(reference.getBindings().size() == 1);
+ assertTrue(reference.getBindings().get(0) instanceof WebServiceBinding);
+ }
+ }
+ assertTrue(componentRef != null);
+ }
+*/
+}
diff --git a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java b/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java
similarity index 100%
rename from itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java
rename to testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/CustomCompositeBuilder.java
diff --git a/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java b/testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
similarity index 100%
rename from itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
rename to testing/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/TestUtils.java
diff --git a/itest/callback-api/pom.xml b/testing/itest/callback-api/pom.xml
similarity index 100%
rename from itest/callback-api/pom.xml
rename to testing/itest/callback-api/pom.xml
diff --git a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java b/testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
similarity index 100%
rename from itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
rename to testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
diff --git a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java b/testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
similarity index 100%
rename from itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
rename to testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
diff --git a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java b/testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
similarity index 100%
rename from itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
rename to testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
diff --git a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java b/testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
similarity index 100%
rename from itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
rename to testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
diff --git a/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java b/testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
similarity index 100%
rename from itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
rename to testing/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
diff --git a/itest/callback-api/src/main/resources/CallBackApiTest.composite b/testing/itest/callback-api/src/main/resources/CallBackApiTest.composite
similarity index 100%
rename from itest/callback-api/src/main/resources/CallBackApiTest.composite
rename to testing/itest/callback-api/src/main/resources/CallBackApiTest.composite
diff --git a/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/callback-api/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java b/testing/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
similarity index 100%
rename from itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
rename to testing/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
diff --git a/itest/callback-basic/pom.xml b/testing/itest/callback-basic/pom.xml
similarity index 100%
rename from itest/callback-basic/pom.xml
rename to testing/itest/callback-basic/pom.xml
diff --git a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
similarity index 100%
rename from itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
rename to testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
diff --git a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
similarity index 100%
rename from itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
rename to testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
diff --git a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
similarity index 100%
rename from itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
rename to testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
diff --git a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
similarity index 100%
rename from itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
rename to testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
diff --git a/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
similarity index 100%
rename from itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
rename to testing/itest/callback-basic/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
diff --git a/itest/callback-basic/src/main/resources/CallBackBasicTest.composite b/testing/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
similarity index 100%
rename from itest/callback-basic/src/main/resources/CallBackBasicTest.composite
rename to testing/itest/callback-basic/src/main/resources/CallBackBasicTest.composite
diff --git a/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/callback-basic/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java b/testing/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
similarity index 100%
rename from itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
rename to testing/itest/callback-basic/src/test/java/org/apache/tuscany/sca/test/CallBackBasicTestCase.java
diff --git a/itest/callback-complex-type/pom.xml b/testing/itest/callback-complex-type/pom.xml
similarity index 100%
rename from itest/callback-complex-type/pom.xml
rename to testing/itest/callback-complex-type/pom.xml
diff --git a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java b/testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
similarity index 100%
rename from itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
rename to testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeCallBack.java
diff --git a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java b/testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
similarity index 100%
rename from itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
rename to testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClient.java
diff --git a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java b/testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
similarity index 100%
rename from itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
rename to testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeClientImpl.java
diff --git a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java b/testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
similarity index 100%
rename from itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
rename to testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeService.java
diff --git a/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java b/testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
similarity index 100%
rename from itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
rename to testing/itest/callback-complex-type/src/main/java/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.java
diff --git a/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite b/testing/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
similarity index 100%
rename from itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
rename to testing/itest/callback-complex-type/src/main/resources/CallBackCTypeClient.composite
diff --git a/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType b/testing/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
similarity index 100%
rename from itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
rename to testing/itest/callback-complex-type/src/main/resources/org/apache/tuscany/sca/test/CallBackCTypeServiceImpl.componentType
diff --git a/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java b/testing/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java
similarity index 100%
rename from itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java
rename to testing/itest/callback-complex-type/src/test/java/org/apache/tuscany/sca/test/CallBackCTypeTestCase.java
diff --git a/itest/callback-multiple-wires/pom.xml b/testing/itest/callback-multiple-wires/pom.xml
similarity index 100%
rename from itest/callback-multiple-wires/pom.xml
rename to testing/itest/callback-multiple-wires/pom.xml
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClient.java
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl1.java
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyClientImpl2.java
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyService.java
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceCallback.java
diff --git a/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java b/testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
similarity index 100%
rename from itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
rename to testing/itest/callback-multiple-wires/src/main/java/org/apache/tuscany/sca/test/callback/MyServiceImpl.java
diff --git a/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/testing/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
similarity index 100%
rename from itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
rename to testing/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
diff --git a/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java b/testing/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
similarity index 100%
rename from itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
rename to testing/itest/callback-multiple-wires/src/test/java/org/apache/tuscany/sca/test/callback/CallbackMultiWireTestCase.java
diff --git a/itest/callback-separatethread/pom.xml b/testing/itest/callback-separatethread/pom.xml
similarity index 100%
rename from itest/callback-separatethread/pom.xml
rename to testing/itest/callback-separatethread/pom.xml
diff --git a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java b/testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
similarity index 100%
rename from itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
rename to testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClient.java
diff --git a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java b/testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
similarity index 100%
rename from itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
rename to testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadClientImpl.java
diff --git a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java b/testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
similarity index 100%
rename from itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
rename to testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorCallBack.java
diff --git a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java b/testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
similarity index 100%
rename from itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
rename to testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorService.java
diff --git a/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java b/testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
similarity index 100%
rename from itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
rename to testing/itest/callback-separatethread/src/main/java/org/apache/tuscany/sca/itest/EventProcessorServiceImpl.java
diff --git a/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/testing/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
similarity index 100%
rename from itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
rename to testing/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
diff --git a/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java b/testing/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
similarity index 100%
rename from itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
rename to testing/itest/callback-separatethread/src/test/java/org/apache/tuscany/sca/itest/CallBackSeparateThreadTestCase.java
diff --git a/itest/callback-two-composites/pom.xml b/testing/itest/callback-two-composites/pom.xml
similarity index 100%
rename from itest/callback-two-composites/pom.xml
rename to testing/itest/callback-two-composites/pom.xml
diff --git a/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
similarity index 100%
rename from itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
rename to testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
diff --git a/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
similarity index 100%
rename from itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
rename to testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
diff --git a/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
similarity index 100%
rename from itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
rename to testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
diff --git a/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
similarity index 100%
rename from itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
rename to testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
diff --git a/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
similarity index 100%
rename from itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
rename to testing/itest/callback-two-composites/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
diff --git a/itest/callback-two-composites/src/main/resources/CallBackReference.composite b/testing/itest/callback-two-composites/src/main/resources/CallBackReference.composite
similarity index 100%
rename from itest/callback-two-composites/src/main/resources/CallBackReference.composite
rename to testing/itest/callback-two-composites/src/main/resources/CallBackReference.composite
diff --git a/itest/callback-two-composites/src/main/resources/CallBackService.composite b/testing/itest/callback-two-composites/src/main/resources/CallBackService.composite
similarity index 100%
rename from itest/callback-two-composites/src/main/resources/CallBackService.composite
rename to testing/itest/callback-two-composites/src/main/resources/CallBackService.composite
diff --git a/itest/callback-two-composites/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/callback-two-composites/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/callback-two-composites/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/callback-two-composites/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/callback-two-composites/src/test/java/org/apache/tuscany/sca/test/CallBackTwoCompositesTestCase.java b/testing/itest/callback-two-composites/src/test/java/org/apache/tuscany/sca/test/CallBackTwoCompositesTestCase.java
similarity index 100%
rename from itest/callback-two-composites/src/test/java/org/apache/tuscany/sca/test/CallBackTwoCompositesTestCase.java
rename to testing/itest/callback-two-composites/src/test/java/org/apache/tuscany/sca/test/CallBackTwoCompositesTestCase.java
diff --git a/testing/itest/callback-two-nodes/pom.xml b/testing/itest/callback-two-nodes/pom.xml
new file mode 100644
index 0000000..bf5dd0e
--- /dev/null
+++ b/testing/itest/callback-two-nodes/pom.xml
@@ -0,0 +1,86 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-callback-two-nodes</artifactId>
+ <name>Apache Tuscany SCA iTest Callback Two Nodes</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <properties>
+ <was.ant.script>${basedir}/../build-was-integration.xml</was.ant.script>
+ <was.python.script>${basedir}/../wasAdmin.py</was.python.script>
+ </properties>
+</project>
diff --git a/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java b/testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
similarity index 100%
rename from itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
rename to testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicCallBack.java
diff --git a/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java b/testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
similarity index 100%
rename from itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
rename to testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClient.java
diff --git a/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java b/testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
similarity index 100%
rename from itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
rename to testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicClientImpl.java
diff --git a/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java b/testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
similarity index 100%
rename from itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
rename to testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicService.java
diff --git a/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java b/testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
similarity index 100%
rename from itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
rename to testing/itest/callback-two-nodes/src/main/java/org/apache/tuscany/sca/test/CallBackBasicServiceImpl.java
diff --git a/itest/callback-two-nodes/src/main/resources/CallBackReference.composite b/testing/itest/callback-two-nodes/src/main/resources/CallBackReference.composite
similarity index 100%
rename from itest/callback-two-nodes/src/main/resources/CallBackReference.composite
rename to testing/itest/callback-two-nodes/src/main/resources/CallBackReference.composite
diff --git a/itest/callback-two-nodes/src/main/resources/CallBackService.composite b/testing/itest/callback-two-nodes/src/main/resources/CallBackService.composite
similarity index 100%
rename from itest/callback-two-nodes/src/main/resources/CallBackService.composite
rename to testing/itest/callback-two-nodes/src/main/resources/CallBackService.composite
diff --git a/itest/callback-two-nodes/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/callback-two-nodes/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/callback-two-nodes/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/callback-two-nodes/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/callback-two-nodes/src/test/java/org/apache/tuscany/sca/test/CallBackTwoNodesTestCase.java b/testing/itest/callback-two-nodes/src/test/java/org/apache/tuscany/sca/test/CallBackTwoNodesTestCase.java
similarity index 100%
rename from itest/callback-two-nodes/src/test/java/org/apache/tuscany/sca/test/CallBackTwoNodesTestCase.java
rename to testing/itest/callback-two-nodes/src/test/java/org/apache/tuscany/sca/test/CallBackTwoNodesTestCase.java
diff --git a/itest/component-type/pom.xml b/testing/itest/component-type/pom.xml
similarity index 100%
rename from itest/component-type/pom.xml
rename to testing/itest/component-type/pom.xml
diff --git a/itest/component-type/src/main/java/calculator/AddService.java b/testing/itest/component-type/src/main/java/calculator/AddService.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/AddService.java
rename to testing/itest/component-type/src/main/java/calculator/AddService.java
diff --git a/itest/component-type/src/main/java/calculator/AddServiceImpl.java b/testing/itest/component-type/src/main/java/calculator/AddServiceImpl.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/AddServiceImpl.java
rename to testing/itest/component-type/src/main/java/calculator/AddServiceImpl.java
diff --git a/itest/component-type/src/main/java/calculator/CalculatorClient.java b/testing/itest/component-type/src/main/java/calculator/CalculatorClient.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/CalculatorClient.java
rename to testing/itest/component-type/src/main/java/calculator/CalculatorClient.java
diff --git a/itest/component-type/src/main/java/calculator/CalculatorService.java b/testing/itest/component-type/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/CalculatorService.java
rename to testing/itest/component-type/src/main/java/calculator/CalculatorService.java
diff --git a/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java b/testing/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
rename to testing/itest/component-type/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/itest/component-type/src/main/java/calculator/DivideService.java b/testing/itest/component-type/src/main/java/calculator/DivideService.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/DivideService.java
rename to testing/itest/component-type/src/main/java/calculator/DivideService.java
diff --git a/itest/component-type/src/main/java/calculator/DivideServiceImpl.java b/testing/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/DivideServiceImpl.java
rename to testing/itest/component-type/src/main/java/calculator/DivideServiceImpl.java
diff --git a/itest/component-type/src/main/java/calculator/MultiplyService.java b/testing/itest/component-type/src/main/java/calculator/MultiplyService.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/MultiplyService.java
rename to testing/itest/component-type/src/main/java/calculator/MultiplyService.java
diff --git a/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java b/testing/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
rename to testing/itest/component-type/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/itest/component-type/src/main/java/calculator/SubtractService.java b/testing/itest/component-type/src/main/java/calculator/SubtractService.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/SubtractService.java
rename to testing/itest/component-type/src/main/java/calculator/SubtractService.java
diff --git a/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java b/testing/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
rename from itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
rename to testing/itest/component-type/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/itest/component-type/src/main/resources/Calculator.composite b/testing/itest/component-type/src/main/resources/Calculator.composite
similarity index 100%
rename from itest/component-type/src/main/resources/Calculator.composite
rename to testing/itest/component-type/src/main/resources/Calculator.composite
diff --git a/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType b/testing/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
similarity index 100%
rename from itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
rename to testing/itest/component-type/src/main/resources/calculator/AddServiceImpl.componentType
diff --git a/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType b/testing/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
similarity index 100%
rename from itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
rename to testing/itest/component-type/src/main/resources/calculator/CalculatorServiceImpl.componentType
diff --git a/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType b/testing/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
similarity index 100%
rename from itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
rename to testing/itest/component-type/src/main/resources/calculator/DivideServiceImpl.componentType
diff --git a/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType b/testing/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
similarity index 100%
rename from itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
rename to testing/itest/component-type/src/main/resources/calculator/MultiplyServiceImpl.componentType
diff --git a/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType b/testing/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
similarity index 100%
rename from itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
rename to testing/itest/component-type/src/main/resources/calculator/SubtractServiceImpl.componentType
diff --git a/itest/component-type/src/test/java/calculator/CalculatorTestCase.java b/testing/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
similarity index 100%
rename from itest/component-type/src/test/java/calculator/CalculatorTestCase.java
rename to testing/itest/component-type/src/test/java/calculator/CalculatorTestCase.java
diff --git a/itest/contribution-folder/pom.xml b/testing/itest/contribution-folder/pom.xml
similarity index 100%
rename from itest/contribution-folder/pom.xml
rename to testing/itest/contribution-folder/pom.xml
diff --git a/itest/contribution-folder/src/test/java/calculator/CalculatorService.java b/testing/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
similarity index 100%
rename from itest/contribution-folder/src/test/java/calculator/CalculatorService.java
rename to testing/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
diff --git a/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java b/testing/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
similarity index 100%
rename from itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
rename to testing/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
diff --git a/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite b/testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
similarity index 100%
rename from itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
rename to testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
diff --git a/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml b/testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
rename to testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
diff --git a/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar b/testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar
similarity index 100%
rename from itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar
rename to testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/service.jar
Binary files differ
diff --git a/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar b/testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar
similarity index 100%
rename from itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar
rename to testing/itest/contribution-folder/src/test/resources/repository/folderWithJars/serviceImpl.jar
Binary files differ
diff --git a/itest/contribution-folder/src/test/resources/repository3/contribution.zip b/testing/itest/contribution-folder/src/test/resources/repository3/contribution.zip
similarity index 100%
rename from itest/contribution-folder/src/test/resources/repository3/contribution.zip
rename to testing/itest/contribution-folder/src/test/resources/repository3/contribution.zip
Binary files differ
diff --git a/itest/contribution-import-export/export-composite/pom.xml b/testing/itest/contribution-import-export/export-composite/pom.xml
similarity index 100%
rename from itest/contribution-import-export/export-composite/pom.xml
rename to testing/itest/contribution-import-export/export-composite/pom.xml
diff --git a/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java b/testing/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
similarity index 100%
rename from itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
rename to testing/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
diff --git a/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java b/testing/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
similarity index 100%
rename from itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
rename to testing/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
diff --git a/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/export-composite/src/main/resources/hello.composite b/testing/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
similarity index 100%
rename from itest/contribution-import-export/export-composite/src/main/resources/hello.composite
rename to testing/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
diff --git a/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java b/testing/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
similarity index 100%
rename from itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
rename to testing/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
diff --git a/itest/contribution-import-export/export-java/pom.xml b/testing/itest/contribution-import-export/export-java/pom.xml
similarity index 100%
rename from itest/contribution-import-export/export-java/pom.xml
rename to testing/itest/contribution-import-export/export-java/pom.xml
diff --git a/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java b/testing/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
rename to testing/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
diff --git a/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType b/testing/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType
similarity index 100%
rename from itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType
rename to testing/itest/contribution-import-export/export-java/src/main/resources/helloworld/HelloWorldImpl.componentType
diff --git a/itest/contribution-import-export/export-resource/pom.xml b/testing/itest/contribution-import-export/export-resource/pom.xml
similarity index 100%
rename from itest/contribution-import-export/export-resource/pom.xml
rename to testing/itest/contribution-import-export/export-resource/pom.xml
diff --git a/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/export-resource/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html b/testing/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html
similarity index 100%
rename from itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html
rename to testing/itest/contribution-import-export/export-resource/src/main/resources/ufservices/store.html
diff --git a/itest/contribution-import-export/export-wsdl/pom.xml b/testing/itest/contribution-import-export/export-wsdl/pom.xml
similarity index 100%
rename from itest/contribution-import-export/export-wsdl/pom.xml
rename to testing/itest/contribution-import-export/export-wsdl/pom.xml
diff --git a/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl b/testing/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
similarity index 100%
rename from itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
rename to testing/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
diff --git a/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd b/testing/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
similarity index 100%
rename from itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
rename to testing/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
diff --git a/itest/contribution-import-export/import-composite/pom.xml b/testing/itest/contribution-import-export/import-composite/pom.xml
similarity index 100%
rename from itest/contribution-import-export/import-composite/pom.xml
rename to testing/itest/contribution-import-export/import-composite/pom.xml
diff --git a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java b/testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
rename to testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
diff --git a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java b/testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
rename to testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
diff --git a/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java b/testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
rename to testing/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
diff --git a/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl b/testing/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
rename to testing/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
diff --git a/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd b/testing/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
rename to testing/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
diff --git a/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite b/testing/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
rename to testing/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
diff --git a/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java b/testing/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
similarity index 100%
rename from itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
rename to testing/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
diff --git a/itest/contribution-import-export/import-java/pom.xml b/testing/itest/contribution-import-export/import-java/pom.xml
similarity index 100%
rename from itest/contribution-import-export/import-java/pom.xml
rename to testing/itest/contribution-import-export/import-java/pom.xml
diff --git a/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java b/testing/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
rename to testing/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
diff --git a/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/import-java/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite b/testing/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
similarity index 100%
rename from itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
rename to testing/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
diff --git a/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/testing/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
similarity index 100%
rename from itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
rename to testing/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
diff --git a/itest/contribution-import-export/import-resource/pom.xml b/testing/itest/contribution-import-export/import-resource/pom.xml
similarity index 100%
rename from itest/contribution-import-export/import-resource/pom.xml
rename to testing/itest/contribution-import-export/import-resource/pom.xml
diff --git a/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/import-resource/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/import-resource/src/main/resources/store.composite b/testing/itest/contribution-import-export/import-resource/src/main/resources/store.composite
similarity index 100%
rename from itest/contribution-import-export/import-resource/src/main/resources/store.composite
rename to testing/itest/contribution-import-export/import-resource/src/main/resources/store.composite
diff --git a/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java b/testing/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java
similarity index 100%
rename from itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java
rename to testing/itest/contribution-import-export/import-resource/src/test/java/org/apache/tuscany/sca/test/contribution/StoreTestCase.java
diff --git a/itest/contribution-import-export/import-wsdl/pom.xml b/testing/itest/contribution-import-export/import-wsdl/pom.xml
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/pom.xml
rename to testing/itest/contribution-import-export/import-wsdl/pom.xml
diff --git a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java b/testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
rename to testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
diff --git a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java b/testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
rename to testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
diff --git a/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java b/testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
rename to testing/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
diff --git a/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite b/testing/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
rename to testing/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
diff --git a/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/testing/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
similarity index 100%
rename from itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
rename to testing/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
diff --git a/itest/contribution-import-export/pom.xml b/testing/itest/contribution-import-export/pom.xml
similarity index 100%
rename from itest/contribution-import-export/pom.xml
rename to testing/itest/contribution-import-export/pom.xml
diff --git a/itest/contribution-zip/pom.xml b/testing/itest/contribution-zip/pom.xml
similarity index 100%
rename from itest/contribution-zip/pom.xml
rename to testing/itest/contribution-zip/pom.xml
diff --git a/itest/contribution-zip/src/test/java/calculator/CalculatorService.java b/testing/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
similarity index 100%
rename from itest/contribution-zip/src/test/java/calculator/CalculatorService.java
rename to testing/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
diff --git a/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java b/testing/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java
similarity index 100%
rename from itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java
rename to testing/itest/contribution-zip/src/test/java/org/apache/tuscany/sca/contribution/zip/ContributionZIPTestCase.java
diff --git a/itest/contribution-zip/src/test/resources/repository/contribution.zip b/testing/itest/contribution-zip/src/test/resources/repository/contribution.zip
similarity index 100%
rename from itest/contribution-zip/src/test/resources/repository/contribution.zip
rename to testing/itest/contribution-zip/src/test/resources/repository/contribution.zip
Binary files differ
diff --git a/itest/corba/pom.xml b/testing/itest/corba/pom.xml
similarity index 100%
rename from itest/corba/pom.xml
rename to testing/itest/corba/pom.xml
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFiveTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFiveTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFiveTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFiveTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioFourTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioOneTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioOneTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioOneTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioOneTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioSixTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioSixTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioSixTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioSixTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioThreeTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioThreeTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioThreeTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioThreeTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioTwoTestCase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioTwoTestCase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioTwoTestCase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/ScenarioTwoTestCase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHost.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHost.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHost.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHost.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHostModuleActivator.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHostModuleActivator.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHostModuleActivator.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/TestCorbaHostModuleActivator.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/AnnotatedStructHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/Color.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/Color.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/Color.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/Color.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ColorHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerStructHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnion.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnion.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnion.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnion.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/InnerUnionHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/LongSequenceHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichStructHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnion.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnion.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnion.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnion.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/RichUnionHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOne.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOne.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOne.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOne.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneOperations.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneOperations.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneOperations.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioOneOperations.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSix.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSix.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSix.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSix.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixOperations.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixOperations.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixOperations.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioSixOperations.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwo.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwo.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwo.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwo.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoOperations.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoOperations.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoOperations.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/ScenarioTwoOperations.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringArrayHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/StringSequenceHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/TwoDimLongSequenceHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedException.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedException.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedException.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedException.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/UnexpectedExceptionHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColor.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColor.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColor.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColor.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHelper.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHelper.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHelper.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHelper.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHolder.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHolder.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHolder.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/WrongColorHolder.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneImplBase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneImplBase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneImplBase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneImplBase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneStub.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneStub.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneStub.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioOneStub.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixImplBase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixImplBase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixImplBase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixImplBase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixStub.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixStub.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixStub.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioSixStub.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoImplBase.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoImplBase.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoImplBase.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoImplBase.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoStub.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoStub.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoStub.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/generated/_ScenarioTwoStub.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFive.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFive.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFive.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFive.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveImpl.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveImpl.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveImpl.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFiveImpl.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFour.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourException.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourImpl.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioFourStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioOneServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioSixServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioSixServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioSixServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioSixServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioTwoServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioTwoServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioTwoServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/ScenarioTwoServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TAnnotatedStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TAnnotatedStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TAnnotatedStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TAnnotatedStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TColor.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TColor.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TColor.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TColor.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerUnion.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerUnion.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerUnion.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TInnerUnion.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichStruct.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichStruct.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichStruct.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichStruct.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichUnion.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichUnion.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichUnion.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TRichUnion.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOne.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOne.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOne.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOne.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioOneServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSix.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSix.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSix.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSix.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioSixServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThree.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThree.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThree.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThree.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioThreeServant.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwo.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwo.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwo.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwo.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoComponent.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoComponent.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoComponent.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoComponent.java
diff --git a/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoServant.java b/testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoServant.java
similarity index 100%
rename from itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoServant.java
rename to testing/itest/corba/src/test/java/org/apache/tuscany/sca/test/corba/types/TScenarioTwoServant.java
diff --git a/itest/corba/src/test/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/testing/itest/corba/src/test/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
similarity index 100%
rename from itest/corba/src/test/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
rename to testing/itest/corba/src/test/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
diff --git a/itest/corba/src/test/resources/ScenarioFive.composite b/testing/itest/corba/src/test/resources/ScenarioFive.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioFive.composite
rename to testing/itest/corba/src/test/resources/ScenarioFive.composite
diff --git a/itest/corba/src/test/resources/ScenarioFour.composite b/testing/itest/corba/src/test/resources/ScenarioFour.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioFour.composite
rename to testing/itest/corba/src/test/resources/ScenarioFour.composite
diff --git a/itest/corba/src/test/resources/ScenarioOne.composite b/testing/itest/corba/src/test/resources/ScenarioOne.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioOne.composite
rename to testing/itest/corba/src/test/resources/ScenarioOne.composite
diff --git a/itest/corba/src/test/resources/ScenarioSix.composite b/testing/itest/corba/src/test/resources/ScenarioSix.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioSix.composite
rename to testing/itest/corba/src/test/resources/ScenarioSix.composite
diff --git a/itest/corba/src/test/resources/ScenarioThree.composite b/testing/itest/corba/src/test/resources/ScenarioThree.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioThree.composite
rename to testing/itest/corba/src/test/resources/ScenarioThree.composite
diff --git a/itest/corba/src/test/resources/ScenarioTwo.composite b/testing/itest/corba/src/test/resources/ScenarioTwo.composite
similarity index 100%
rename from itest/corba/src/test/resources/ScenarioTwo.composite
rename to testing/itest/corba/src/test/resources/ScenarioTwo.composite
diff --git a/itest/corba/src/test/resources/itest_scenario.idl b/testing/itest/corba/src/test/resources/itest_scenario.idl
similarity index 100%
rename from itest/corba/src/test/resources/itest_scenario.idl
rename to testing/itest/corba/src/test/resources/itest_scenario.idl
diff --git a/itest/corba/src/test/resources/scenariofour.xsd b/testing/itest/corba/src/test/resources/scenariofour.xsd
similarity index 100%
rename from itest/corba/src/test/resources/scenariofour.xsd
rename to testing/itest/corba/src/test/resources/scenariofour.xsd
diff --git a/itest/databindings/jaxb-bottom-up/pom.xml b/testing/itest/databindings/jaxb-bottom-up/pom.xml
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/pom.xml
rename to testing/itest/databindings/jaxb-bottom-up/pom.xml
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AClientService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/AService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean1.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean1.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean1.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean1.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean10.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean10.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean10.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean10.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean11.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean11.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean11.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean11.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean2.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean2.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean2.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean2.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean3.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean3.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean3.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean3.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean31.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean31.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean31.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/Bean31.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsLocalService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsLocalService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsLocalService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsLocalService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsServiceClient.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsServiceClient.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsServiceClient.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloLocalServiceSimple.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloLocalServiceSimple.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloLocalServiceSimple.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloLocalServiceSimple.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimple.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimple.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimple.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimple.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimpleClient.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimpleClient.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimpleClient.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceSimpleClient.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesLocalService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesLocalService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesLocalService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesLocalService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesLocalService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesLocalService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesLocalService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesLocalService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AClientServiceImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/AServiceImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsLocalServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsLocalServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsLocalServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsLocalServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsServiceImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsTransformer.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsTransformer.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsTransformer.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/GenericsTransformer.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloLocalServiceSimpleClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloLocalServiceSimpleClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloLocalServiceSimpleClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloLocalServiceSimpleClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceSimpleImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesLocalServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesLocalServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesLocalServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesLocalServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesLocalServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesLocalServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesLocalServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesLocalServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java b/testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
rename to testing/itest/databindings/jaxb-bottom-up/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/aservice.wsdl
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/doclitbarewsdl.composite
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/generics-service.composite b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/generics-service.composite
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/generics-service.composite
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/generics-service.composite
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/helloservice.composite b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/helloservice.composite
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/helloservice.composite
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/helloservice.composite
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/primitivesservice.composite b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/primitivesservice.composite
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/primitivesservice.composite
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/primitivesservice.composite
diff --git a/itest/databindings/jaxb-bottom-up/src/main/resources/standard-types-service.composite b/testing/itest/databindings/jaxb-bottom-up/src/main/resources/standard-types-service.composite
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/main/resources/standard-types-service.composite
rename to testing/itest/databindings/jaxb-bottom-up/src/main/resources/standard-types-service.composite
diff --git a/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DatabindingTestCase.java b/testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DatabindingTestCase.java
rename to testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DatabindingTestCase.java
diff --git a/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java b/testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java
rename to testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/DocLitBareWsdlTestCase.java
diff --git a/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsDatabindingTestCase.java b/testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsDatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsDatabindingTestCase.java
rename to testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/GenericsDatabindingTestCase.java
diff --git a/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesDatabindingTestCase.java b/testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesDatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesDatabindingTestCase.java
rename to testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesDatabindingTestCase.java
diff --git a/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesDatabindingTestCase.java b/testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesDatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesDatabindingTestCase.java
rename to testing/itest/databindings/jaxb-bottom-up/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesDatabindingTestCase.java
diff --git a/itest/databindings/jaxb-top-down/pom.xml b/testing/itest/databindings/jaxb-top-down/pom.xml
similarity index 100%
rename from itest/databindings/jaxb-top-down/pom.xml
rename to testing/itest/databindings/jaxb-top-down/pom.xml
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloService.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/HelloServiceClient.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesService.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/PrimitivesServiceClient.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesService.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/StandardTypesServiceClient.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceClientImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/HelloServiceImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceClientImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/PrimitivesServiceImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceClientImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesServiceImpl.java
diff --git a/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java b/testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
rename to testing/itest/databindings/jaxb-top-down/src/main/java/org/apache/tuscany/sca/itest/databindings/jaxb/impl/StandardTypesTransformer.java
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/hello-service.wsdl
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/helloservice.composite
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitives-service.wsdl b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitives-service.wsdl
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitives-service.wsdl
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitives-service.wsdl
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitivesservice.composite b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitivesservice.composite
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitivesservice.composite
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/primitivesservice.composite
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.composite b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.composite
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.composite
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.composite
diff --git a/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.wsdl b/testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.wsdl
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.wsdl
rename to testing/itest/databindings/jaxb-top-down/src/main/resources/wsdl/wrapped/standard-types-service.wsdl
diff --git a/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java b/testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java
rename to testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/DatabindingTestCase.java
diff --git a/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/PrimitivesDatabindingTestCase.java b/testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/PrimitivesDatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/PrimitivesDatabindingTestCase.java
rename to testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/PrimitivesDatabindingTestCase.java
diff --git a/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/StandardTypesDatabindingTestCase.java b/testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/StandardTypesDatabindingTestCase.java
similarity index 100%
rename from itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/StandardTypesDatabindingTestCase.java
rename to testing/itest/databindings/jaxb-top-down/src/test/java/org/apache/tuscany/sca/itest/databindings/jaxb/topdown/StandardTypesDatabindingTestCase.java
diff --git a/itest/databindings/pom.xml b/testing/itest/databindings/pom.xml
similarity index 100%
rename from itest/databindings/pom.xml
rename to testing/itest/databindings/pom.xml
diff --git a/testing/itest/distribution/bin-distro-unzip/build.xml b/testing/itest/distribution/bin-distro-unzip/build.xml
new file mode 100644
index 0000000..6e6a1ea
--- /dev/null
+++ b/testing/itest/distribution/bin-distro-unzip/build.xml
@@ -0,0 +1,27 @@
+<!--
+ * 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 name="itest-unzip" default="unzip">
+
+ <target name="unzip">
+ <delete dir="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir"/>
+ <unzip src="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.zip"
+ dest="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir"/>
+ </target>
+
+</project>
diff --git a/itest/distribution/bin-distro-unzip/pom.xml b/testing/itest/distribution/bin-distro-unzip/pom.xml
similarity index 100%
rename from itest/distribution/bin-distro-unzip/pom.xml
rename to testing/itest/distribution/bin-distro-unzip/pom.xml
diff --git a/testing/itest/distribution/contribution-binding-jsonrpc-calculator/build.xml b/testing/itest/distribution/contribution-binding-jsonrpc-calculator/build.xml
new file mode 100644
index 0000000..3822085
--- /dev/null
+++ b/testing/itest/distribution/contribution-binding-jsonrpc-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/binding-jsonrpc/calculator-contribution"/>
+
+ </target>
+
+</project>
diff --git a/testing/itest/distribution/contribution-binding-jsonrpc-calculator/pom.xml b/testing/itest/distribution/contribution-binding-jsonrpc-calculator/pom.xml
new file mode 100644
index 0000000..227fdb5
--- /dev/null
+++ b/testing/itest/distribution/contribution-binding-jsonrpc-calculator/pom.xml
@@ -0,0 +1,87 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-contribution-binding-jsonrpc-calculator</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Contribution binding-jsonrpc Calculator</name>
+
+ <profiles>
+ <profile>
+ <id>distribution</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tuscany.version" value="${version}" />
+ <property name="java.home" value="${java.home}"/>
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/itest/distribution/contribution-binding-rmi-calculator/build.xml b/testing/itest/distribution/contribution-binding-rmi-calculator/build.xml
new file mode 100644
index 0000000..7550f70
--- /dev/null
+++ b/testing/itest/distribution/contribution-binding-rmi-calculator/build.xml
@@ -0,0 +1,39 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/binding-rmi/calculator-reference-contribution"/>
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/binding-rmi/calculator-service-contribution"/>
+ </target>
+
+</project>
diff --git a/itest/distribution/contribution-binding-rmi-calculator/pom.xml b/testing/itest/distribution/contribution-binding-rmi-calculator/pom.xml
similarity index 100%
rename from itest/distribution/contribution-binding-rmi-calculator/pom.xml
rename to testing/itest/distribution/contribution-binding-rmi-calculator/pom.xml
diff --git a/testing/itest/distribution/contribution-binding-sca-calculator/build.xml b/testing/itest/distribution/contribution-binding-sca-calculator/build.xml
new file mode 100644
index 0000000..aa13cba
--- /dev/null
+++ b/testing/itest/distribution/contribution-binding-sca-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/binding-sca/calculator-contribution"/>
+
+ </target>
+
+</project>
diff --git a/itest/distribution/contribution-binding-sca-calculator/pom.xml b/testing/itest/distribution/contribution-binding-sca-calculator/pom.xml
similarity index 100%
rename from itest/distribution/contribution-binding-sca-calculator/pom.xml
rename to testing/itest/distribution/contribution-binding-sca-calculator/pom.xml
diff --git a/testing/itest/distribution/contribution-binding-ws-calculator/build.xml b/testing/itest/distribution/contribution-binding-ws-calculator/build.xml
new file mode 100644
index 0000000..7b95bed
--- /dev/null
+++ b/testing/itest/distribution/contribution-binding-ws-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/binding-ws/calculator-contribution"/>
+
+ </target>
+
+</project>
diff --git a/itest/distribution/contribution-binding-ws-calculator/pom.xml b/testing/itest/distribution/contribution-binding-ws-calculator/pom.xml
similarity index 100%
rename from itest/distribution/contribution-binding-ws-calculator/pom.xml
rename to testing/itest/distribution/contribution-binding-ws-calculator/pom.xml
diff --git a/testing/itest/distribution/contribution-implementation-java-calculator/build.xml b/testing/itest/distribution/contribution-implementation-java-calculator/build.xml
new file mode 100644
index 0000000..e70619a
--- /dev/null
+++ b/testing/itest/distribution/contribution-implementation-java-calculator/build.xml
@@ -0,0 +1,40 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/learning-more/implementation-java/calculator-contribution"/>
+
+ </target>
+
+</project>
diff --git a/itest/distribution/contribution-implementation-java-calculator/pom.xml b/testing/itest/distribution/contribution-implementation-java-calculator/pom.xml
similarity index 100%
rename from itest/distribution/contribution-implementation-java-calculator/pom.xml
rename to testing/itest/distribution/contribution-implementation-java-calculator/pom.xml
diff --git a/testing/itest/distribution/launcher-embedded-jse/build.xml b/testing/itest/distribution/launcher-embedded-jse/build.xml
new file mode 100644
index 0000000..02c353e
--- /dev/null
+++ b/testing/itest/distribution/launcher-embedded-jse/build.xml
@@ -0,0 +1,57 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-jse"
+ target="sample-binding-sca-calculator-contribution">
+ </ant>
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-jse"
+ target="sample-binding-ws-calculator-contribution">
+ </ant>
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-jse"
+ target="sample-binding-rmi-calculator-contribution">
+ </ant>
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-jse"
+ target="sample-implementation-java-calculator-contribution">
+ </ant>
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-jse"
+ target="sample-implementation-java-calculator-async-contribution">
+ </ant>
+
+ </target>
+
+</project>
diff --git a/itest/distribution/launcher-embedded-jse/pom.xml b/testing/itest/distribution/launcher-embedded-jse/pom.xml
similarity index 100%
rename from itest/distribution/launcher-embedded-jse/pom.xml
rename to testing/itest/distribution/launcher-embedded-jse/pom.xml
diff --git a/testing/itest/distribution/launcher-embedded-osgi/build.xml b/testing/itest/distribution/launcher-embedded-osgi/build.xml
new file mode 100644
index 0000000..0015b13
--- /dev/null
+++ b/testing/itest/distribution/launcher-embedded-osgi/build.xml
@@ -0,0 +1,45 @@
+<!--
+ * 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 name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+<!-- Seems to be hanging in the console at the end of the OSGi run
+ configure it to run no tests for now
+ <ant dir="${distro.root}/samples/launcher-embedded-osgi"
+ target="run-contribution-binding-sca-calculator"/>
+-->
+
+ <ant dir="${distro.root}/samples/running-tuscany/embedded-osgi"/>
+
+ </target>
+
+</project>
diff --git a/itest/distribution/launcher-embedded-osgi/pom.xml b/testing/itest/distribution/launcher-embedded-osgi/pom.xml
similarity index 100%
rename from itest/distribution/launcher-embedded-osgi/pom.xml
rename to testing/itest/distribution/launcher-embedded-osgi/pom.xml
diff --git a/testing/itest/distribution/legal-checks/pom.xml b/testing/itest/distribution/legal-checks/pom.xml
new file mode 100644
index 0000000..f23efa8
--- /dev/null
+++ b/testing/itest/distribution/legal-checks/pom.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-legal-checks</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Legal Checks</name>
+
+ <profiles>
+ <profile>
+ <id>distribution</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.6</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <basedir>../../../../distribution/all/target/apache-tuscany-sca-all-2.0-Beta1.dir</basedir>
+ <excludeSubProjects>false</excludeSubProjects>
+ <excludes>
+ <exclude>tuscany-sca-2.0-Beta1/CHANGES</exclude>
+ <exclude>**/MANIFEST.MF</exclude>
+ <exclude>**/DEPENDENCIES</exclude>
+ <exclude>**/target/**/*.log</exclude>
+ <exclude>**/config.ini</exclude>
+ <exclude>tuscany-sca-2.0-Beta1/features/configuration/config.ini</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/testing/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
new file mode 100644
index 0000000..5ee67ff
--- /dev/null
+++ b/testing/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
@@ -0,0 +1,162 @@
+/*
+ * 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 itest;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.junit.Test;
+
+/**
+ * Checks that all jar files included in the distribution are mentioned in the LICENSE file
+ * and that all jars mentioned in the LICENSE are in the distribution.
+ */
+public class JarsInLICENSETestCase {
+
+ @Test
+ public void testJars() throws Exception {
+ File distroRoot = getUnzipedDistroRoot();
+
+ File licenseFile = new File(distroRoot, "LICENSE");
+ if (!licenseFile.exists()) {
+ throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
+ }
+
+ File libDirectory = new File(distroRoot, "modules");
+ if (!libDirectory.exists()) {
+ throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
+ }
+
+ List<String> jars = getJarsInDistro(libDirectory);
+
+ List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
+ if (bad2.size() > 0) {
+ System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
+ }
+
+ List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
+ if (bad1.size() > 0) {
+ System.err.println("Jars in distribution but not in LICENSE: " + bad1);
+ }
+
+ if (bad1.size() > 0 || bad2.size() > 0) {
+ throw new IllegalStateException("LICENSE problems, check log");
+ }
+ }
+
+ private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.contains(".jar")) {
+ StringTokenizer st = new StringTokenizer(line);
+ while (st.hasMoreTokens()) {
+ String s = st.nextToken();
+ if (s.contains(".jar")) {
+ if (s.startsWith("(")) {
+ s = s.substring(1);
+ }
+ if (s.endsWith(",") || s.endsWith(":")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (s.endsWith(")")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (!jars.contains(s) && !s.startsWith("tuscany-")) {
+ badJars.add(s);
+ }
+ }
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ String licenseText = readLICENSE(licenseFile);
+ for (String jar : jars) {
+ if (!licenseText.contains(jar)) {
+ if (jar.startsWith("tuscany-") || jar.startsWith("sample-") || jar.startsWith("test-") || jar.startsWith("itest-")) {
+ // ignore tuscany jars as they're not mentioned in the LICENSE file
+ } else {
+ badJars.add(jar);
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsInDistro(File directory) {
+ List<String> jars = new ArrayList<String>();
+ for (String fn : directory.list()){
+ if (fn.endsWith(".jar")) {
+ jars.add(fn);
+ } else {
+ File f = new File(directory, fn);
+ if (f.isDirectory()) {
+ jars.addAll(getJarsInDistro(f));
+ }
+ }
+ }
+ return jars;
+ }
+
+ private File getUnzipedDistroRoot() {
+ File distroTarget = new File("../../../../distribution/all/target");
+ File root = null;
+ for (String f : distroTarget.list()) {
+ if (f.endsWith(".dir")) {
+ root = new File(distroTarget, f);
+ break;
+ }
+ }
+ if (root == null) {
+ throw new IllegalStateException("can't find distro root");
+ }
+ if (root.list().length != 1) {
+ throw new IllegalStateException("expecting one directory in distro root");
+ }
+ root = new File(root, root.list()[0]);
+ return root;
+ }
+
+ private static String readLICENSE(File licenseFile) throws java.io.IOException {
+ StringBuffer fileData = new StringBuffer();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ char[] buf = new char[1024];
+ int numRead = 0;
+ while ((numRead = reader.read(buf)) != -1) {
+ String readData = String.valueOf(buf, 0, numRead);
+ fileData.append(readData);
+ buf = new char[1024];
+ }
+ reader.close();
+ return fileData.toString();
+ }
+
+}
diff --git a/testing/itest/distribution/pom.xml b/testing/itest/distribution/pom.xml
new file mode 100644
index 0000000..33dc25a
--- /dev/null
+++ b/testing/itest/distribution/pom.xml
@@ -0,0 +1,87 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-distribution</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-all</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>legal-checks</module>
+ <module>contribution-binding-sca-calculator</module>
+ <module>contribution-binding-ws-calculator</module>
+ <module>contribution-binding-rmi-calculator</module>
+ <module>contribution-binding-jsonrpc-calculator</module>
+ <module>contribution-implementation-java-calculator</module>
+ <module>launcher-embedded-jse</module>
+ <module>launcher-embedded-osgi</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>distribution</id>
+ <activation>
+ <property>
+ <name>buildZips</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <modules>
+ <module>src-distro-unzip</module>
+ <module>src-distro-rat</module>
+ <module>bin-distro-unzip</module>
+ <module>legal-checks</module>
+ <module>contribution-binding-sca-calculator</module>
+ <module>contribution-binding-ws-calculator</module>
+ <module>contribution-binding-rmi-calculator</module>
+ <module>contribution-binding-jsonrpc-calculator</module>
+ <module>contribution-implementation-java-calculator</module>
+ <module>launcher-embedded-jse</module>
+ <module>launcher-embedded-osgi</module>
+ </modules>
+ </profile>
+ </profiles>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+</project>
diff --git a/testing/itest/distribution/src-distro-rat/pom.xml b/testing/itest/distribution/src-distro-rat/pom.xml
new file mode 100644
index 0000000..ba61b06
--- /dev/null
+++ b/testing/itest/distribution/src-distro-rat/pom.xml
@@ -0,0 +1,90 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-src-dsitro-rat</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Src Distro RAT</name>
+
+ <profiles>
+ <profile>
+ <id>distribution</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-src-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <version>0.6</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <basedir>../../../../distribution/all/target/apache-tuscany-sca-all-2.0-Beta1-src.dir</basedir>
+ <excludeSubProjects>false</excludeSubProjects>
+ <excludes>
+ <exclude>tuscany-sca-2.0-Beta1-src/CHANGES</exclude>
+ <exclude>**/*.MF</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/testing/compliance-tests/binding-ws/sca_variables.dtd</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/testing/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/repository/modules/modules.list</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/binding-ws-runtime-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/repository/services/services.list</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-tie/src/main/resources/META-INF/spring.handlers</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-tie/src/main/resources/META-INF/spring.schemas</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.handlers</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-spring-runtime/src/main/resources/META-INF/spring.schemas</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/maven/archetypes/binding/src/test/resources/projects/basic/goal.txt</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-python-runtime/src/main/resources/django/__init__.py</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-python-runtime/src/main/resources/django/utils/__init__.py</exclude>
+
+ <!-- these ones we need to implement RAT license processors to handle the non-AL headers, just exclude for now -->
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/assembly-xsd/**/*.*</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/sca-api/**/*.*</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-web-runtime/src/main/resources/META-INF/sca.tld</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/assembly-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd03.xml</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryFinderImpl.java</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/binding-comet-runtime/src/main/resources/jquery.json-2.2.min.js</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/modules/implementation-python-runtime/src/main/resources/django/utils/simplejson/*</exclude>
+ <exclude>tuscany-sca-2.0-Beta1-src/testing/compliance-tests/binding-jms/src/test/resources/tuscany-oasis-sca-tests-errors.properties</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/itest/distribution/src-distro-unzip/build.xml b/testing/itest/distribution/src-distro-unzip/build.xml
new file mode 100644
index 0000000..db9fe4a
--- /dev/null
+++ b/testing/itest/distribution/src-distro-unzip/build.xml
@@ -0,0 +1,27 @@
+<!--
+ * 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 name="itest-unzip" default="unzip">
+
+ <target name="unzip">
+ <delete dir="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.dir"/>
+ <unzip src="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.zip"
+ dest="../../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-src.dir"/>
+ </target>
+
+</project>
diff --git a/itest/distribution/src-distro-unzip/pom.xml b/testing/itest/distribution/src-distro-unzip/pom.xml
similarity index 100%
rename from itest/distribution/src-distro-unzip/pom.xml
rename to testing/itest/distribution/src-distro-unzip/pom.xml
diff --git a/testing/itest/domains/distributed/pom.xml b/testing/itest/domains/distributed/pom.xml
new file mode 100644
index 0000000..46faac3
--- /dev/null
+++ b/testing/itest/domains/distributed/pom.xml
@@ -0,0 +1,51 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-domains-distributed</artifactId>
+ <name>Apache Tuscany SCA itest domain distributed</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime-nodep</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/itest/domains/distributed/src/test/java/itest/Helloworld.java b/testing/itest/domains/distributed/src/test/java/itest/Helloworld.java
similarity index 100%
rename from itest/domains/distributed/src/test/java/itest/Helloworld.java
rename to testing/itest/domains/distributed/src/test/java/itest/Helloworld.java
diff --git a/itest/domains/distributed/src/test/java/itest/StandaloneTestCase.java b/testing/itest/domains/distributed/src/test/java/itest/StandaloneTestCase.java
similarity index 100%
rename from itest/domains/distributed/src/test/java/itest/StandaloneTestCase.java
rename to testing/itest/domains/distributed/src/test/java/itest/StandaloneTestCase.java
diff --git a/itest/domains/helloworld/pom.xml b/testing/itest/domains/helloworld/pom.xml
similarity index 100%
rename from itest/domains/helloworld/pom.xml
rename to testing/itest/domains/helloworld/pom.xml
diff --git a/itest/domains/helloworld/src/main/java/itest/HelloworldImpl.java b/testing/itest/domains/helloworld/src/main/java/itest/HelloworldImpl.java
similarity index 100%
rename from itest/domains/helloworld/src/main/java/itest/HelloworldImpl.java
rename to testing/itest/domains/helloworld/src/main/java/itest/HelloworldImpl.java
diff --git a/itest/domains/helloworld/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/domains/helloworld/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/domains/helloworld/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/domains/helloworld/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/domains/helloworld/src/main/resources/helloworld.composite b/testing/itest/domains/helloworld/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/domains/helloworld/src/main/resources/helloworld.composite
rename to testing/itest/domains/helloworld/src/main/resources/helloworld.composite
diff --git a/itest/domains/interfaces/pom.xml b/testing/itest/domains/interfaces/pom.xml
similarity index 100%
rename from itest/domains/interfaces/pom.xml
rename to testing/itest/domains/interfaces/pom.xml
diff --git a/itest/domains/interfaces/src/main/java/itest/Helloworld.java b/testing/itest/domains/interfaces/src/main/java/itest/Helloworld.java
similarity index 100%
rename from itest/domains/interfaces/src/main/java/itest/Helloworld.java
rename to testing/itest/domains/interfaces/src/main/java/itest/Helloworld.java
diff --git a/itest/domains/pom.xml b/testing/itest/domains/pom.xml
similarity index 100%
rename from itest/domains/pom.xml
rename to testing/itest/domains/pom.xml
diff --git a/itest/domains/standalone/pom.xml b/testing/itest/domains/standalone/pom.xml
similarity index 100%
rename from itest/domains/standalone/pom.xml
rename to testing/itest/domains/standalone/pom.xml
diff --git a/itest/domains/standalone/src/test/java/itest/StandaloneTestCase.java b/testing/itest/domains/standalone/src/test/java/itest/StandaloneTestCase.java
similarity index 100%
rename from itest/domains/standalone/src/test/java/itest/StandaloneTestCase.java
rename to testing/itest/domains/standalone/src/test/java/itest/StandaloneTestCase.java
diff --git a/itest/endpoints/pom.xml b/testing/itest/endpoints/pom.xml
similarity index 100%
rename from itest/endpoints/pom.xml
rename to testing/itest/endpoints/pom.xml
diff --git a/itest/endpoints/src/test/java/helloworld/HelloWorldImpl.java b/testing/itest/endpoints/src/test/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from itest/endpoints/src/test/java/helloworld/HelloWorldImpl.java
rename to testing/itest/endpoints/src/test/java/helloworld/HelloWorldImpl.java
diff --git a/itest/endpoints/src/test/java/helloworld/HelloWorldService.java b/testing/itest/endpoints/src/test/java/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/endpoints/src/test/java/helloworld/HelloWorldService.java
rename to testing/itest/endpoints/src/test/java/helloworld/HelloWorldService.java
diff --git a/itest/endpoints/src/test/java/test/EndpointsTestCase.java b/testing/itest/endpoints/src/test/java/test/EndpointsTestCase.java
similarity index 100%
rename from itest/endpoints/src/test/java/test/EndpointsTestCase.java
rename to testing/itest/endpoints/src/test/java/test/EndpointsTestCase.java
diff --git a/itest/endpoints/src/test/java/test/NestedEndpointsTestCase.java b/testing/itest/endpoints/src/test/java/test/NestedEndpointsTestCase.java
similarity index 100%
rename from itest/endpoints/src/test/java/test/NestedEndpointsTestCase.java
rename to testing/itest/endpoints/src/test/java/test/NestedEndpointsTestCase.java
diff --git a/itest/endpoints/src/test/java/test/Utils.java b/testing/itest/endpoints/src/test/java/test/Utils.java
similarity index 100%
rename from itest/endpoints/src/test/java/test/Utils.java
rename to testing/itest/endpoints/src/test/java/test/Utils.java
diff --git a/itest/endpoints/src/test/resources/helloworld.composite b/testing/itest/endpoints/src/test/resources/helloworld.composite
similarity index 100%
rename from itest/endpoints/src/test/resources/helloworld.composite
rename to testing/itest/endpoints/src/test/resources/helloworld.composite
diff --git a/itest/endpoints/src/test/resources/nested.composite b/testing/itest/endpoints/src/test/resources/nested.composite
similarity index 100%
rename from itest/endpoints/src/test/resources/nested.composite
rename to testing/itest/endpoints/src/test/resources/nested.composite
diff --git a/itest/exceptions/pom.xml b/testing/itest/exceptions/pom.xml
similarity index 100%
rename from itest/exceptions/pom.xml
rename to testing/itest/exceptions/pom.xml
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/Checked.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionHandler.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionRemoteThrower.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/ExceptionThrower.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/UnChecked.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionHandlerImpl.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionRemoteThrowerImpl.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ExceptionThrowerImpl.java
diff --git a/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java b/testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
similarity index 100%
rename from itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
rename to testing/itest/exceptions/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/RemoteExceptionHandlerImpl.java
diff --git a/itest/exceptions/src/main/resources/ExceptionTest.composite b/testing/itest/exceptions/src/main/resources/ExceptionTest.composite
similarity index 100%
rename from itest/exceptions/src/main/resources/ExceptionTest.composite
rename to testing/itest/exceptions/src/main/resources/ExceptionTest.composite
diff --git a/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java b/testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
similarity index 100%
rename from itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
rename to testing/itest/exceptions/src/test/java/org/apache/tuscany/sca/test/exceptions/ExceptionsTestCase.java
diff --git a/testing/itest/implementation-spring/pom.xml b/testing/itest/implementation-spring/pom.xml
new file mode 100644
index 0000000..098bad7
--- /dev/null
+++ b/testing/itest/implementation-spring/pom.xml
@@ -0,0 +1,56 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-implementation-spring</artifactId>
+ <name>Apache Tuscany SCA iTest Spring Implementation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>6.1.19</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java b/testing/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
rename to testing/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
diff --git a/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java b/testing/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
rename to testing/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/AddService.java b/testing/itest/implementation-spring/src/main/java/calculator/AddService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/AddService.java
rename to testing/itest/implementation-spring/src/main/java/calculator/AddService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java b/testing/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
diff --git a/itest/implementation-spring/src/main/java/calculator/CalculatorService.java b/testing/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/CalculatorService.java
rename to testing/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java b/testing/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
diff --git a/itest/implementation-spring/src/main/java/calculator/DivideService.java b/testing/itest/implementation-spring/src/main/java/calculator/DivideService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/DivideService.java
rename to testing/itest/implementation-spring/src/main/java/calculator/DivideService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java b/testing/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
diff --git a/itest/implementation-spring/src/main/java/calculator/MultiplyService.java b/testing/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/MultiplyService.java
rename to testing/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java b/testing/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
diff --git a/itest/implementation-spring/src/main/java/calculator/SubtractService.java b/testing/itest/implementation-spring/src/main/java/calculator/SubtractService.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/SubtractService.java
rename to testing/itest/implementation-spring/src/main/java/calculator/SubtractService.java
diff --git a/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java b/testing/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
diff --git a/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java b/testing/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
rename to testing/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
diff --git a/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java b/testing/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
rename to testing/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
diff --git a/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java b/testing/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
rename to testing/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
diff --git a/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java b/testing/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
rename to testing/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
diff --git a/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java b/testing/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
rename to testing/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
diff --git a/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java b/testing/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
rename to testing/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
diff --git a/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java b/testing/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
rename to testing/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestBean.java b/testing/itest/implementation-spring/src/main/java/mock/TestBean.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestBean.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestBean.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java b/testing/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java b/testing/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestReference.java b/testing/itest/implementation-spring/src/main/java/mock/TestReference.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestReference.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestReference.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java b/testing/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
diff --git a/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java b/testing/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
rename to testing/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
diff --git a/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java b/testing/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
similarity index 100%
rename from itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
rename to testing/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
diff --git a/itest/implementation-spring/src/main/resources/context/access/CalculatorService-context.xml b/testing/itest/implementation-spring/src/main/resources/context/access/CalculatorService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/access/CalculatorService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/context/access/CalculatorService-context.xml
diff --git a/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite b/testing/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
rename to testing/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
diff --git a/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite b/testing/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
rename to testing/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
diff --git a/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/CalculatorService-context.xml b/testing/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/CalculatorService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/CalculatorService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/CalculatorService-context.xml
diff --git a/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/SpringImport-context.xml b/testing/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/SpringImport-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/SpringImport-context.xml
rename to testing/itest/implementation-spring/src/main/resources/context/imports/META-INF/spring/SpringImport-context.xml
diff --git a/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite b/testing/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
rename to testing/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
diff --git a/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/MANIFEST.MF b/testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/MANIFEST.MF
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/MANIFEST.MF
rename to testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/MANIFEST.MF
diff --git a/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/SpringHelloWorld-context.xml b/testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/SpringHelloWorld-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/SpringHelloWorld-context.xml
rename to testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/SpringHelloWorld-context.xml
diff --git a/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/StockQuoteService-context.xml b/testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/StockQuoteService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/StockQuoteService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/StockQuoteService-context.xml
diff --git a/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/beanRefContext.xml b/testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/beanRefContext.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/beanRefContext.xml
rename to testing/itest/implementation-spring/src/main/resources/context/multiple/springapp/META-INF/spring/beanRefContext.xml
diff --git a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config b/testing/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config
similarity index 100%
rename from itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config
rename to testing/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorJass.config
diff --git a/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties b/testing/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
similarity index 100%
rename from itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
rename to testing/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
diff --git a/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite b/testing/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
rename to testing/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
diff --git a/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/definitions.xml b/testing/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/definitions.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/implementation/policies/META-INF/definitions.xml
rename to testing/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/definitions.xml
diff --git a/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/spring/CalculatorService-context.xml b/testing/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/spring/CalculatorService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/implementation/policies/META-INF/spring/CalculatorService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/implementation/policies/META-INF/spring/CalculatorService-context.xml
diff --git a/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite b/testing/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
rename to testing/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
diff --git a/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/MANIFEST.MF b/testing/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/MANIFEST.MF
similarity index 100%
rename from itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/MANIFEST.MF
rename to testing/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/MANIFEST.MF
diff --git a/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/spring/SpringSCAProperty-context.xml b/testing/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/spring/SpringSCAProperty-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/spring/SpringSCAProperty-context.xml
rename to testing/itest/implementation-spring/src/main/resources/location/folder/springapp/META-INF/spring/SpringSCAProperty-context.xml
diff --git a/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite b/testing/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
rename to testing/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
diff --git a/itest/implementation-spring/src/main/resources/location/jar/spring-context.jar b/testing/itest/implementation-spring/src/main/resources/location/jar/spring-context.jar
similarity index 100%
rename from itest/implementation-spring/src/main/resources/location/jar/spring-context.jar
rename to testing/itest/implementation-spring/src/main/resources/location/jar/spring-context.jar
Binary files differ
diff --git a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringDelegationHelloWorld-context.xml b/testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringDelegationHelloWorld-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringDelegationHelloWorld-context.xml
rename to testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringDelegationHelloWorld-context.xml
diff --git a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringHelloWorld-context.xml b/testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringHelloWorld-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringHelloWorld-context.xml
rename to testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/META-INF/spring/SpringHelloWorld-context.xml
diff --git a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite b/testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
rename to testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
diff --git a/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite b/testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
rename to testing/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
diff --git a/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringExplicitReference-context.xml b/testing/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringExplicitReference-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringExplicitReference-context.xml
rename to testing/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringExplicitReference-context.xml
diff --git a/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringImplicitReference-context.xml b/testing/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringImplicitReference-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringImplicitReference-context.xml
rename to testing/itest/implementation-spring/src/main/resources/sca/references/META-INF/spring/SpringImplicitReference-context.xml
diff --git a/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite b/testing/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
rename to testing/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
diff --git a/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite b/testing/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
rename to testing/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
diff --git a/testing/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml b/testing/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml
new file mode 100644
index 0000000..5fe57ed
--- /dev/null
+++ b/testing/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringExplicitService-context.xml
@@ -0,0 +1,41 @@
+<?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.
+-->
+<!-- Application context for the SpringExplicitHelloWorld testcase
+In this case, the service offered by the Spring application is specified
+explicitly using an sca:service element -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xmlns:spec="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="fooService"
+ type="helloworld.HelloWorld"
+ target="testBean"/>
+ <!-- requires="spec:serverAuthentication" -->
+
+ <bean id="testBean"
+ class="mock.TestHelloWorldBean"
+ lazy-init="true">
+ </bean>
+
+</beans>
\ No newline at end of file
diff --git a/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringImplicitService-context.xml b/testing/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringImplicitService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringImplicitService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/sca/services/META-INF/spring/SpringImplicitService-context.xml
diff --git a/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite b/testing/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
rename to testing/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
diff --git a/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite b/testing/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
rename to testing/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
diff --git a/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite b/testing/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
similarity index 100%
rename from itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
rename to testing/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
diff --git a/itest/implementation-spring/src/main/resources/spring/annotations/CalculatorService-context.xml b/testing/itest/implementation-spring/src/main/resources/spring/annotations/CalculatorService-context.xml
similarity index 100%
rename from itest/implementation-spring/src/main/resources/spring/annotations/CalculatorService-context.xml
rename to testing/itest/implementation-spring/src/main/resources/spring/annotations/CalculatorService-context.xml
diff --git a/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java b/testing/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
rename to testing/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
diff --git a/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java b/testing/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
rename to testing/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
diff --git a/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java b/testing/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
rename to testing/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
diff --git a/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java b/testing/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
rename to testing/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
diff --git a/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java b/testing/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
rename to testing/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
diff --git a/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java b/testing/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
rename to testing/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
diff --git a/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java b/testing/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
rename to testing/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
diff --git a/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java b/testing/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
rename to testing/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
diff --git a/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java b/testing/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
rename to testing/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
diff --git a/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java b/testing/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
rename to testing/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
diff --git a/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java b/testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
rename to testing/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
diff --git a/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java b/testing/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
rename to testing/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
diff --git a/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java b/testing/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
rename to testing/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
diff --git a/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java b/testing/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
rename to testing/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
diff --git a/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java b/testing/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
rename to testing/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
diff --git a/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java b/testing/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
rename to testing/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
diff --git a/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java b/testing/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
similarity index 100%
rename from itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
rename to testing/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
diff --git a/itest/import-export/exports/pom.xml b/testing/itest/import-export/exports/pom.xml
similarity index 100%
rename from itest/import-export/exports/pom.xml
rename to testing/itest/import-export/exports/pom.xml
diff --git a/itest/import-export/exports/src/main/java/org/apache/tuscany/sca/itest/exports/Helloworld.java b/testing/itest/import-export/exports/src/main/java/org/apache/tuscany/sca/itest/exports/Helloworld.java
similarity index 100%
rename from itest/import-export/exports/src/main/java/org/apache/tuscany/sca/itest/exports/Helloworld.java
rename to testing/itest/import-export/exports/src/main/java/org/apache/tuscany/sca/itest/exports/Helloworld.java
diff --git a/itest/import-export/exports/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/import-export/exports/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/import-export/exports/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/import-export/exports/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/import-export/imports/pom.xml b/testing/itest/import-export/imports/pom.xml
similarity index 100%
rename from itest/import-export/imports/pom.xml
rename to testing/itest/import-export/imports/pom.xml
diff --git a/itest/import-export/imports/src/main/java/org/apache/tuscany/sca/itest/imports/HelloworldImpl.java b/testing/itest/import-export/imports/src/main/java/org/apache/tuscany/sca/itest/imports/HelloworldImpl.java
similarity index 100%
rename from itest/import-export/imports/src/main/java/org/apache/tuscany/sca/itest/imports/HelloworldImpl.java
rename to testing/itest/import-export/imports/src/main/java/org/apache/tuscany/sca/itest/imports/HelloworldImpl.java
diff --git a/itest/import-export/imports/src/main/resources/Helloworld.composite b/testing/itest/import-export/imports/src/main/resources/Helloworld.composite
similarity index 100%
rename from itest/import-export/imports/src/main/resources/Helloworld.composite
rename to testing/itest/import-export/imports/src/main/resources/Helloworld.composite
diff --git a/itest/import-export/imports/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/import-export/imports/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/import-export/imports/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/import-export/imports/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/import-export/pom.xml b/testing/itest/import-export/pom.xml
similarity index 100%
rename from itest/import-export/pom.xml
rename to testing/itest/import-export/pom.xml
diff --git a/testing/itest/import-export/tests/pom.xml b/testing/itest/import-export/tests/pom.xml
new file mode 100644
index 0000000..d01e936
--- /dev/null
+++ b/testing/itest/import-export/tests/pom.xml
@@ -0,0 +1,40 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-import-export-tests</artifactId>
+ <name>Apache Tuscany SCA iTest Import Export Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/itest/import-export/tests/src/test/java/org/apache/tuscany/sca/itests/TestTestCase.java b/testing/itest/import-export/tests/src/test/java/org/apache/tuscany/sca/itests/TestTestCase.java
similarity index 100%
rename from itest/import-export/tests/src/test/java/org/apache/tuscany/sca/itests/TestTestCase.java
rename to testing/itest/import-export/tests/src/test/java/org/apache/tuscany/sca/itests/TestTestCase.java
diff --git a/itest/interfaces/pom.xml b/testing/itest/interfaces/pom.xml
similarity index 100%
rename from itest/interfaces/pom.xml
rename to testing/itest/interfaces/pom.xml
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalCallbackInterface.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponent.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalClientComponentImpl.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponent.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/LocalServiceComponentImpl.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/ParameterObject.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteCallbackInterface.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponent.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteClientComponentImpl.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponent.java
diff --git a/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java b/testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
similarity index 100%
rename from itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
rename to testing/itest/interfaces/src/main/java/org/apache/tuscany/sca/itest/interfaces/RemoteServiceComponentImpl.java
diff --git a/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/invalid/InvalidRemoteAttribute.composite b/testing/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/invalid/InvalidRemoteAttribute.composite
similarity index 100%
rename from itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/invalid/InvalidRemoteAttribute.composite
rename to testing/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/invalid/InvalidRemoteAttribute.composite
diff --git a/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/valid/InterfacesTest.composite b/testing/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/valid/InterfacesTest.composite
similarity index 100%
rename from itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/valid/InterfacesTest.composite
rename to testing/itest/interfaces/src/main/resources/org/apache/tuscany/sca/itest/interfaces/valid/InterfacesTest.composite
diff --git a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java b/testing/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
similarity index 100%
rename from itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
rename to testing/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InterfacesTestCase.java
diff --git a/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InvalidRemoteAttributeTestCase.java b/testing/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InvalidRemoteAttributeTestCase.java
similarity index 100%
rename from itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InvalidRemoteAttributeTestCase.java
rename to testing/itest/interfaces/src/test/java/org/apache/tuscany/sca/itest/interfaces/InvalidRemoteAttributeTestCase.java
diff --git a/itest/jaxws-asyncclient/pom.xml b/testing/itest/jaxws-asyncclient/pom.xml
similarity index 100%
rename from itest/jaxws-asyncclient/pom.xml
rename to testing/itest/jaxws-asyncclient/pom.xml
diff --git a/itest/jaxws-asyncclient/src/main/java/stock/StockQuote.java b/testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuote.java
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/java/stock/StockQuote.java
rename to testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuote.java
diff --git a/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteClient.java b/testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteClient.java
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/java/stock/StockQuoteClient.java
rename to testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteClient.java
diff --git a/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteImpl.java b/testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteImpl.java
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/java/stock/StockQuoteImpl.java
rename to testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteImpl.java
diff --git a/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteRef.java b/testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteRef.java
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/java/stock/StockQuoteRef.java
rename to testing/itest/jaxws-asyncclient/src/main/java/stock/StockQuoteRef.java
diff --git a/itest/jaxws-asyncclient/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jaxws-asyncclient/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jaxws-asyncclient/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jaxws-asyncclient/src/main/resources/StockQuote.composite b/testing/itest/jaxws-asyncclient/src/main/resources/StockQuote.composite
similarity index 100%
rename from itest/jaxws-asyncclient/src/main/resources/StockQuote.composite
rename to testing/itest/jaxws-asyncclient/src/main/resources/StockQuote.composite
diff --git a/itest/jaxws-asyncclient/src/test/java/itest/AsyncServiceTestCase.java b/testing/itest/jaxws-asyncclient/src/test/java/itest/AsyncServiceTestCase.java
similarity index 100%
rename from itest/jaxws-asyncclient/src/test/java/itest/AsyncServiceTestCase.java
rename to testing/itest/jaxws-asyncclient/src/test/java/itest/AsyncServiceTestCase.java
diff --git a/itest/jaxws/pom.xml b/testing/itest/jaxws/pom.xml
similarity index 100%
rename from itest/jaxws/pom.xml
rename to testing/itest/jaxws/pom.xml
diff --git a/itest/jaxws/src/test/java/stock/AsyncServiceTestCase.java b/testing/itest/jaxws/src/test/java/stock/AsyncServiceTestCase.java
similarity index 100%
rename from itest/jaxws/src/test/java/stock/AsyncServiceTestCase.java
rename to testing/itest/jaxws/src/test/java/stock/AsyncServiceTestCase.java
diff --git a/itest/jaxws/src/test/java/stock/StockQuote.java b/testing/itest/jaxws/src/test/java/stock/StockQuote.java
similarity index 100%
rename from itest/jaxws/src/test/java/stock/StockQuote.java
rename to testing/itest/jaxws/src/test/java/stock/StockQuote.java
diff --git a/itest/jaxws/src/test/java/stock/StockQuoteImpl.java b/testing/itest/jaxws/src/test/java/stock/StockQuoteImpl.java
similarity index 100%
rename from itest/jaxws/src/test/java/stock/StockQuoteImpl.java
rename to testing/itest/jaxws/src/test/java/stock/StockQuoteImpl.java
diff --git a/itest/jaxws/src/test/resources/StockQuote.composite b/testing/itest/jaxws/src/test/resources/StockQuote.composite
similarity index 100%
rename from itest/jaxws/src/test/resources/StockQuote.composite
rename to testing/itest/jaxws/src/test/resources/StockQuote.composite
diff --git a/testing/itest/jms/DynamicReplyQ/pom.xml b/testing/itest/jms/DynamicReplyQ/pom.xml
new file mode 100644
index 0000000..420e7ba
--- /dev/null
+++ b/testing/itest/jms/DynamicReplyQ/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-dynamic-replyq</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with dynamic replyq</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/DynamicReplyQ/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/DynamicReplyQ/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/DynamicReplyQ/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/DynamicReplyQ/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/DynamicReplyQ/src/main/resources/dynamic/client.composite b/testing/itest/jms/DynamicReplyQ/src/main/resources/dynamic/client.composite
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/resources/dynamic/client.composite
rename to testing/itest/jms/DynamicReplyQ/src/main/resources/dynamic/client.composite
diff --git a/itest/jms/DynamicReplyQ/src/main/resources/jndi.properties b/testing/itest/jms/DynamicReplyQ/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/resources/jndi.properties
rename to testing/itest/jms/DynamicReplyQ/src/main/resources/jndi.properties
diff --git a/itest/jms/DynamicReplyQ/src/main/resources/simple/service.composite b/testing/itest/jms/DynamicReplyQ/src/main/resources/simple/service.composite
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/main/resources/simple/service.composite
rename to testing/itest/jms/DynamicReplyQ/src/main/resources/simple/service.composite
diff --git a/itest/jms/DynamicReplyQ/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java b/testing/itest/jms/DynamicReplyQ/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java
similarity index 100%
rename from itest/jms/DynamicReplyQ/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java
rename to testing/itest/jms/DynamicReplyQ/src/test/java/org/apache/tuscany/sca/binding/jms/DynamicReplyQTestCase.java
diff --git a/testing/itest/jms/args/pom.xml b/testing/itest/jms/args/pom.xml
new file mode 100644
index 0000000..9fc91f3
--- /dev/null
+++ b/testing/itest/jms/args/pom.xml
@@ -0,0 +1,32 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-args</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Args</name>
+
+</project>
diff --git a/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
similarity index 100%
rename from itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
rename to testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
diff --git a/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java b/testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
similarity index 100%
rename from itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
rename to testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
diff --git a/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java b/testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
similarity index 100%
rename from itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
rename to testing/itest/jms/args/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
diff --git a/itest/jms/args/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/args/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/args/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/args/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/args/src/main/resources/jndi.properties b/testing/itest/jms/args/src/main/resources/jndi.properties
new file mode 100644
index 0000000..7f82eb4
--- /dev/null
+++ b/testing/itest/jms/args/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory, ConnectionFactory2
+
+# register some queues in JNDI using the form
+queue.MyService = MyService
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+topic.ServiceTopic = ServiceTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/args/src/main/resources/selectors/selectors.composite b/testing/itest/jms/args/src/main/resources/selectors/selectors.composite
new file mode 100644
index 0000000..fcda648
--- /dev/null
+++ b/testing/itest/jms/args/src/main/resources/selectors/selectors.composite
@@ -0,0 +1,38 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="DefinitionsTests">
+
+ <component name="Client1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:MyService" />
+ </reference>
+ </component>
+
+ <component name="Service1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
+ <service name="MyService">
+ <binding.jms />
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/args/src/test/java/org/apache/tuscany/sca/binding/jms/ArgsTestCase.java b/testing/itest/jms/args/src/test/java/org/apache/tuscany/sca/binding/jms/ArgsTestCase.java
similarity index 100%
rename from itest/jms/args/src/test/java/org/apache/tuscany/sca/binding/jms/ArgsTestCase.java
rename to testing/itest/jms/args/src/test/java/org/apache/tuscany/sca/binding/jms/ArgsTestCase.java
diff --git a/testing/itest/jms/callbacks/pom.xml b/testing/itest/jms/callbacks/pom.xml
new file mode 100644
index 0000000..dec562d
--- /dev/null
+++ b/testing/itest/jms/callbacks/pom.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-jms-callbacks</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Tests For Callbacks</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java b/testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
similarity index 100%
rename from itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
rename to testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
diff --git a/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClientImpl.java b/testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClientImpl.java
similarity index 100%
rename from itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClientImpl.java
rename to testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClientImpl.java
diff --git a/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSService.java b/testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSService.java
similarity index 100%
rename from itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSService.java
rename to testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSService.java
diff --git a/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceCallback.java b/testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceCallback.java
similarity index 100%
rename from itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceCallback.java
rename to testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceCallback.java
diff --git a/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceImpl.java b/testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceImpl.java
similarity index 100%
rename from itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceImpl.java
rename to testing/itest/jms/callbacks/src/main/java/org/apache/tuscany/sca/binding/jms/JMSServiceImpl.java
diff --git a/itest/jms/callbacks/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/callbacks/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/callbacks/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/callbacks/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/callbacks/src/main/resources/jndi.properties b/testing/itest/jms/callbacks/src/main/resources/jndi.properties
new file mode 100644
index 0000000..b8c4b1c
--- /dev/null
+++ b/testing/itest/jms/callbacks/src/main/resources/jndi.properties
@@ -0,0 +1,40 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.ServiceQueue = ServiceQueue
+queue.TQServiceQueue = TQServiceQueue
+queue.CallbackQueue = CallbackQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/callbacks/src/main/resources/simple/client.composite b/testing/itest/jms/callbacks/src/main/resources/simple/client.composite
new file mode 100644
index 0000000..64d45f1
--- /dev/null
+++ b/testing/itest/jms/callbacks/src/main/resources/simple/client.composite
@@ -0,0 +1,44 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="CallbackClientComposite">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSClientImpl" />
+ <reference name="myService">
+ <binding.jms uri="jms:jndi:ServiceQueue"/>
+ <callback>
+ <binding.jms uri="jms:jndi:CallbackQueue"/>
+ </callback>
+ </reference>
+ </component>
+
+ <component name="ServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSServiceImpl" />
+ <service name="JMSService">
+ <binding.jms uri="jms:jndi:ServiceQueue"/>
+ <callback>
+ <binding.jms uri="jms:jndi:CallbackQueue"/>
+ </callback>
+ </service>
+ </component>
+
+</composite>
diff --git a/testing/itest/jms/callbacks/src/main/resources/simple/tempq.composite b/testing/itest/jms/callbacks/src/main/resources/simple/tempq.composite
new file mode 100644
index 0000000..f9bcced
--- /dev/null
+++ b/testing/itest/jms/callbacks/src/main/resources/simple/tempq.composite
@@ -0,0 +1,50 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="CallbackTempQComposite">
+
+<!--
+
+The client component does not define the callback destination so a temporary queue should be used
+
+-->
+
+ <component name="TQClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSClientImpl" />
+ <reference name="myService">
+ <binding.jms uri="jms:jndi:TQServiceQueue"/>
+ <callback>
+ <binding.jms />
+ </callback>
+ </reference>
+ </component>
+
+ <component name="TQServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.JMSServiceImpl" />
+ <service name="JMSService">
+ <binding.jms uri="jms:jndi:TQServiceQueue"/>
+ <callback>
+ <binding.jms />
+ </callback>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/CallbackTestCase.java b/testing/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/CallbackTestCase.java
similarity index 100%
rename from itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/CallbackTestCase.java
rename to testing/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/CallbackTestCase.java
diff --git a/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/TempCallbackQTestCase.java b/testing/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/TempCallbackQTestCase.java
similarity index 100%
rename from itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/TempCallbackQTestCase.java
rename to testing/itest/jms/callbacks/src/test/java/org/apache/tuscany/sca/binding/jms/TempCallbackQTestCase.java
diff --git a/testing/itest/jms/defaults/pom.xml b/testing/itest/jms/defaults/pom.xml
new file mode 100644
index 0000000..26c9787
--- /dev/null
+++ b/testing/itest/jms/defaults/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-defaults</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Defaults</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/defaults/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/defaults/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/defaults/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/defaults/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/defaults/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/defaults/src/main/resources/defaults/client.composite b/testing/itest/jms/defaults/src/main/resources/defaults/client.composite
new file mode 100644
index 0000000..ebafbb6
--- /dev/null
+++ b/testing/itest/jms/defaults/src/main/resources/defaults/client.composite
@@ -0,0 +1,31 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="DefaultClientComposite">
+
+ <component name="HelloWorldClient">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:HelloWorldService" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/itest/jms/defaults/src/main/resources/defaults/service.composite b/testing/itest/jms/defaults/src/main/resources/defaults/service.composite
similarity index 100%
rename from itest/jms/defaults/src/main/resources/defaults/service.composite
rename to testing/itest/jms/defaults/src/main/resources/defaults/service.composite
diff --git a/testing/itest/jms/defaults/src/main/resources/jndi.properties b/testing/itest/jms/defaults/src/main/resources/jndi.properties
new file mode 100644
index 0000000..c8b186a
--- /dev/null
+++ b/testing/itest/jms/defaults/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.HelloWorldService = HelloWorldService
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/itest/jms/defaults/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java b/testing/itest/jms/defaults/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java
similarity index 100%
rename from itest/jms/defaults/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java
rename to testing/itest/jms/defaults/src/test/java/org/apache/tuscany/sca/binding/jms/DefaultsTestCase.java
diff --git a/testing/itest/jms/definitions/pom.xml b/testing/itest/jms/definitions/pom.xml
new file mode 100644
index 0000000..1e21b48
--- /dev/null
+++ b/testing/itest/jms/definitions/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-definitions</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Tests For Properties</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java b/testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
similarity index 100%
rename from itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
rename to testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
diff --git a/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java b/testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
similarity index 100%
rename from itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
rename to testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
diff --git a/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java b/testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
similarity index 100%
rename from itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
rename to testing/itest/jms/definitions/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
diff --git a/itest/jms/definitions/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/definitions/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/definitions/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/definitions/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/definitions/src/main/resources/definitions.xml b/testing/itest/jms/definitions/src/main/resources/definitions.xml
similarity index 100%
rename from itest/jms/definitions/src/main/resources/definitions.xml
rename to testing/itest/jms/definitions/src/main/resources/definitions.xml
diff --git a/itest/jms/definitions/src/main/resources/definitions/definitions.composite b/testing/itest/jms/definitions/src/main/resources/definitions/definitions.composite
similarity index 100%
rename from itest/jms/definitions/src/main/resources/definitions/definitions.composite
rename to testing/itest/jms/definitions/src/main/resources/definitions/definitions.composite
diff --git a/itest/jms/definitions/src/main/resources/jndi.properties b/testing/itest/jms/definitions/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/definitions/src/main/resources/jndi.properties
rename to testing/itest/jms/definitions/src/main/resources/jndi.properties
diff --git a/itest/jms/definitions/src/test/java/org/apache/tuscany/sca/binding/jms/DefinitionsTestCase.java b/testing/itest/jms/definitions/src/test/java/org/apache/tuscany/sca/binding/jms/DefinitionsTestCase.java
similarity index 100%
rename from itest/jms/definitions/src/test/java/org/apache/tuscany/sca/binding/jms/DefinitionsTestCase.java
rename to testing/itest/jms/definitions/src/test/java/org/apache/tuscany/sca/binding/jms/DefinitionsTestCase.java
diff --git a/testing/itest/jms/exceptions/pom.xml b/testing/itest/jms/exceptions/pom.xml
new file mode 100644
index 0000000..ea26039
--- /dev/null
+++ b/testing/itest/jms/exceptions/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-nonscaclient-exceptions</artifactId>
+ <name>Apache Tuscany SCA iTest JMS NonSCA Client Exceptions</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
diff --git a/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java b/testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
similarity index 100%
rename from itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
rename to testing/itest/jms/exceptions/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
diff --git a/itest/jms/exceptions/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/exceptions/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/exceptions/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/exceptions/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/exceptions/src/main/resources/exceptions/service.composite b/testing/itest/jms/exceptions/src/main/resources/exceptions/service.composite
similarity index 100%
rename from itest/jms/exceptions/src/main/resources/exceptions/service.composite
rename to testing/itest/jms/exceptions/src/main/resources/exceptions/service.composite
diff --git a/itest/jms/exceptions/src/main/resources/jndi.properties b/testing/itest/jms/exceptions/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/exceptions/src/main/resources/jndi.properties
rename to testing/itest/jms/exceptions/src/main/resources/jndi.properties
diff --git a/testing/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/testing/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
new file mode 100644
index 0000000..b266517
--- /dev/null
+++ b/testing/itest/jms/exceptions/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
@@ -0,0 +1,210 @@
+/*
+ * 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.sca.binding.jms;
+
+import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class ExceptionsTestCase {
+
+ private Node node;
+ private Session session;
+ private InitialContext context;
+ private Connection connection;
+
+ private static final String CHECKED_XML =
+ "<ns2:CheckedExcpetion xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>foo</message></ns2:CheckedExcpetion>";
+ private static final String CHECKED_NOARGS_XML = "<ns2:CheckedExcpetionNoArgs xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\" />";
+ private static final String CHECKED_2ARGS_XML =
+ "<ns2:CheckedExcpetion2Args xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>foo</message></ns2:CheckedExcpetion2Args>";
+ private static final String CHECKED_CHAINED_XML =
+ "<ns2:CheckedExcpetionChained xmlns:ns2=\"http://jms.binding.sca.tuscany.apache.org/\"><message>java.lang.Exception: bla</message></ns2:CheckedExcpetionChained>";
+
+ @Before
+ public void init() {
+ node = NodeFactory.newInstance().createNode().start();
+ }
+
+ @Test
+ public void testTextChecked() throws NamingException, JMSException, SAXException, IOException {
+ sendJMSTextRequest("throwChecked");
+ Message m = receiveJMSResponse();
+ assertXMLEqual(CHECKED_XML, ((TextMessage)m).getText());
+ }
+
+ @Test
+ public void testTextCheckedNoArgs() throws NamingException, JMSException, SAXException, IOException {
+ sendJMSTextRequest("throwCheckedNoArgs");
+ Message m = receiveJMSResponse();
+ assertXMLEqual(CHECKED_NOARGS_XML, ((TextMessage)m).getText());
+ }
+
+ @Test
+ public void testTextChecked2Args() throws NamingException, JMSException, SAXException, IOException {
+ sendJMSTextRequest("throwChecked2Args");
+ Message m = receiveJMSResponse();
+ assertXMLEqual(CHECKED_2ARGS_XML, ((TextMessage)m).getText());
+ }
+
+ @Test
+ public void testTextCheckedChained() throws NamingException, JMSException, SAXException, IOException {
+ sendJMSTextRequest("throwCheckedChained");
+ Message m = receiveJMSResponse();
+ assertXMLEqual(CHECKED_CHAINED_XML, ((TextMessage)m).getText());
+ }
+
+ @Test
+ public void testTextUnChecked() throws NamingException, JMSException, SAXException, IOException {
+ sendJMSTextRequest("throwUnChecked");
+ Message m = receiveJMSResponse();
+
+ // FIXME: what should the response message be for unchecked exceptions with wireFormat.textXML???
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof RuntimeException);
+ assertTrue(((RuntimeException)o).getMessage().startsWith("Message = bla"));
+ }
+
+ @Test
+ public void testObjectChecked() throws NamingException, JMSException {
+ sendJMSObjectRequest("throwChecked");
+ Message m = receiveJMSResponse();
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof CheckedExcpetion);
+ assertEquals("foo", ((CheckedExcpetion)o).getMessage());
+ }
+
+ @Test
+ public void testObjectCheckedNoArgs() throws NamingException, JMSException {
+ sendJMSObjectRequest("throwCheckedNoArgs");
+ Message m = receiveJMSResponse();
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof CheckedExcpetionNoArgs);
+ }
+
+ @Test
+ public void testObjectChecked2Args() throws NamingException, JMSException {
+ sendJMSObjectRequest("throwChecked2Args");
+ Message m = receiveJMSResponse();
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof CheckedExcpetion2Args);
+ assertEquals("foo", ((CheckedExcpetion2Args)o).getMessage());
+ assertEquals("bla", ((CheckedExcpetion2Args)o).getCause().getMessage());
+ }
+
+ @Test
+ public void testObjectCheckedChained() throws NamingException, JMSException {
+ sendJMSObjectRequest("throwCheckedChained");
+ Message m = receiveJMSResponse();
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof CheckedExcpetionChained);
+ assertEquals("bla", ((CheckedExcpetionChained)o).getCause().getMessage());
+ }
+
+ @Test
+ public void testObjectUnChecked() throws NamingException, JMSException {
+ sendJMSObjectRequest("throwUnChecked");
+ Message m = receiveJMSResponse();
+ Object o = ((ObjectMessage)m).getObject();
+ assertTrue(o instanceof RuntimeException);
+ assertTrue(((RuntimeException)o).getMessage().startsWith("Message = bla"));
+ }
+
+ @After
+ public void end() throws JMSException {
+ if (node != null) {
+ node.stop();
+ }
+ if (connection != null) {
+ connection.close();
+ }
+ }
+
+ private void sendJMSTextRequest(String operationName) throws NamingException, JMSException {
+ context = new InitialContext(new Properties());
+ ConnectionFactory cf = (ConnectionFactory)context.lookup("ConnectionFactory");
+ connection = cf.createConnection();
+ connection.start();
+
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Destination toDest = (Destination)context.lookup("TextExceptionService");
+
+ TextMessage m = session.createTextMessage();
+ m.setStringProperty("scaOperationName", operationName);
+ m.setJMSReplyTo((Destination)context.lookup("ResponseQueue"));
+ m.setText("<_ns_:" + operationName + " xmlns:_ns_=\"http://jms.binding.sca.tuscany.apache.org/\" />");
+
+ MessageProducer producer = session.createProducer(toDest);
+ producer.send(m);
+ }
+
+ private void sendJMSObjectRequest(String operationName) throws NamingException, JMSException {
+ context = new InitialContext(new Properties());
+ ConnectionFactory cf = (ConnectionFactory)context.lookup("ConnectionFactory");
+ connection = cf.createConnection();
+ connection.start();
+
+ session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Destination toDest = (Destination)context.lookup("ObjectExceptionService");
+
+ ObjectMessage m = session.createObjectMessage();
+ m.setStringProperty("scaOperationName", operationName);
+ m.setJMSReplyTo((Destination)context.lookup("ResponseQueue"));
+ m.setObject(new Object[0]);
+
+ MessageProducer producer = session.createProducer(toDest);
+ producer.send(m);
+ }
+
+ private Message receiveJMSResponse() throws NamingException, JMSException {
+ Destination replyDest = (Destination)context.lookup("ResponseQueue");
+ MessageConsumer consumer = session.createConsumer(replyDest);
+ Message m = consumer.receive(5000);
+ if (m == null) {
+ throw new RuntimeException("No reply message received");
+ }
+ return m;
+ }
+}
diff --git a/testing/itest/jms/exceptions1/pom.xml b/testing/itest/jms/exceptions1/pom.xml
new file mode 100644
index 0000000..cd31d77
--- /dev/null
+++ b/testing/itest/jms/exceptions1/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-exceptions1</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Exceptions1</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetion2Args.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionChained.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/CheckedExcpetionNoArgs.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionService.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceClient.java
diff --git a/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java b/testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
similarity index 100%
rename from itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
rename to testing/itest/jms/exceptions1/src/main/java/org/apache/tuscany/sca/binding/jms/ExceptionServiceImpl.java
diff --git a/itest/jms/exceptions1/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/exceptions1/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/exceptions1/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/exceptions1/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/exceptions1/src/main/resources/exceptions/client.composite b/testing/itest/jms/exceptions1/src/main/resources/exceptions/client.composite
new file mode 100644
index 0000000..86451dc
--- /dev/null
+++ b/testing/itest/jms/exceptions1/src/main/resources/exceptions/client.composite
@@ -0,0 +1,31 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="ExceptionClientComposite">
+
+ <component name="ExceptionServiceClient">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ExceptionServiceClient"/>
+ <reference name="service">
+ <binding.jms uri="jms:jndi:ExceptionService" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/itest/jms/exceptions1/src/main/resources/exceptions/service.composite b/testing/itest/jms/exceptions1/src/main/resources/exceptions/service.composite
similarity index 100%
rename from itest/jms/exceptions1/src/main/resources/exceptions/service.composite
rename to testing/itest/jms/exceptions1/src/main/resources/exceptions/service.composite
diff --git a/testing/itest/jms/exceptions1/src/main/resources/jndi.properties b/testing/itest/jms/exceptions1/src/main/resources/jndi.properties
new file mode 100644
index 0000000..f7875b5
--- /dev/null
+++ b/testing/itest/jms/exceptions1/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.ExceptionService = ExceptionService
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java b/testing/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
new file mode 100644
index 0000000..9d3a557
--- /dev/null
+++ b/testing/itest/jms/exceptions1/src/test/java/org/apache/tuscany/sca/binding/jms/ExceptionsTestCase.java
@@ -0,0 +1,111 @@
+/*
+ * 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.sca.binding.jms;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class ExceptionsTestCase {
+
+ private static Node node;
+
+ @Before
+ public void init() {
+ node = NodeFactory.newInstance().createNode().start();
+ }
+
+ @Test
+ public void testChecked() {
+ ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
+ try {
+ service.throwChecked();
+ fail();
+ } catch (CheckedExcpetion e) {
+ assertEquals("foo", e.getMessage());
+ } catch (Throwable e) {
+ fail();
+ }
+ }
+
+ @Test
+ public void testCheckedNoArgs() {
+ ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
+ try {
+ service.throwCheckedNoArgs();
+ fail();
+ } catch (CheckedExcpetionNoArgs e) {
+ // ok
+ }
+ }
+
+ @Test
+ public void testChecked2Args() {
+ ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
+ try {
+ service.throwChecked2Args();
+ fail();
+ } catch (CheckedExcpetion2Args e) {
+ assertEquals("foo", e.getMessage());
+// FIXME: TUSCANY-2848: lost the cause!
+// assertNotNull(e.getCause());
+// assertEquals("bla", e.getCause().getMessage());
+ }
+ }
+
+ @Test
+ public void testCheckedChained() {
+ ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
+ try {
+ service.throwCheckedChained();
+ fail();
+ } catch (CheckedExcpetionChained e) {
+ // FIXME: TUSCANY-2848: lost the cause!
+// assertNotNull(e.getCause());
+// assertEquals("bla", e.getCause().getMessage());
+ }
+ }
+
+ @Test
+ public void testUnChecked() {
+ ExceptionService service = node.getService(ExceptionService.class, "ExceptionServiceClient");
+ try {
+ service.throwUnChecked();
+ fail();
+ } catch (Exception e) {
+ assertTrue(e.getCause().getMessage().startsWith("Message = bla"));
+ }
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/testing/itest/jms/externalBroker/pom.xml b/testing/itest/jms/externalBroker/pom.xml
new file mode 100644
index 0000000..c613400
--- /dev/null
+++ b/testing/itest/jms/externalBroker/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-external-broker</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with External JMS Broker</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/externalBroker/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/externalBroker/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/externalBroker/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/externalBroker/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/externalBroker/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/externalBroker/src/main/resources/external/client.composite b/testing/itest/jms/externalBroker/src/main/resources/external/client.composite
similarity index 100%
rename from itest/jms/externalBroker/src/main/resources/external/client.composite
rename to testing/itest/jms/externalBroker/src/main/resources/external/client.composite
diff --git a/itest/jms/externalBroker/src/main/resources/external/service.composite b/testing/itest/jms/externalBroker/src/main/resources/external/service.composite
similarity index 100%
rename from itest/jms/externalBroker/src/main/resources/external/service.composite
rename to testing/itest/jms/externalBroker/src/main/resources/external/service.composite
diff --git a/itest/jms/externalBroker/src/main/resources/jndi.properties b/testing/itest/jms/externalBroker/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/externalBroker/src/main/resources/jndi.properties
rename to testing/itest/jms/externalBroker/src/main/resources/jndi.properties
diff --git a/itest/jms/externalBroker/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java b/testing/itest/jms/externalBroker/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java
similarity index 100%
rename from itest/jms/externalBroker/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java
rename to testing/itest/jms/externalBroker/src/test/java/org/apache/tuscany/sca/binding/jms/ExternalBrokerTestCase.java
diff --git a/testing/itest/jms/format-jmsbytes/pom.xml b/testing/itest/jms/format-jmsbytes/pom.xml
new file mode 100644
index 0000000..fc464e5
--- /dev/null
+++ b/testing/itest/jms/format-jmsbytes/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmsbytes</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmsbytes</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmsbytes/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmsbytes/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmsbytes/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmsbytes/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmsbytes/src/main/resources/jmsbytes/helloworld.composite b/testing/itest/jms/format-jmsbytes/src/main/resources/jmsbytes/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/resources/jmsbytes/helloworld.composite
rename to testing/itest/jms/format-jmsbytes/src/main/resources/jmsbytes/helloworld.composite
diff --git a/itest/jms/format-jmsbytes/src/main/resources/jndi.properties b/testing/itest/jms/format-jmsbytes/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmsbytes/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmsbytes/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmsbytes/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java b/testing/itest/jms/format-jmsbytes/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
similarity index 100%
rename from itest/jms/format-jmsbytes/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
rename to testing/itest/jms/format-jmsbytes/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesTestCase.java
diff --git a/testing/itest/jms/format-jmsbytesxml/pom.xml b/testing/itest/jms/format-jmsbytesxml/pom.xml
new file mode 100644
index 0000000..1828b14
--- /dev/null
+++ b/testing/itest/jms/format-jmsbytesxml/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmsbytesxml</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmsbytesxml</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java b/testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsbytesxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsbytesxml/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmsbytesxml/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmsbytesxml/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmsbytesxml/src/main/resources/jmsbytesxml/helloworld.composite b/testing/itest/jms/format-jmsbytesxml/src/main/resources/jmsbytesxml/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/resources/jmsbytesxml/helloworld.composite
rename to testing/itest/jms/format-jmsbytesxml/src/main/resources/jmsbytesxml/helloworld.composite
diff --git a/itest/jms/format-jmsbytesxml/src/main/resources/jndi.properties b/testing/itest/jms/format-jmsbytesxml/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmsbytesxml/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesXMLTestCase.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesXMLTestCase.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesXMLTestCase.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSBytesXMLTestCase.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmsbytesxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/testing/itest/jms/format-jmsdefault/pom.xml b/testing/itest/jms/format-jmsdefault/pom.xml
new file mode 100644
index 0000000..bbf9451
--- /dev/null
+++ b/testing/itest/jms/format-jmsdefault/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmsdefault</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmsdefault</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java b/testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
rename to testing/itest/jms/format-jmsdefault/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
diff --git a/itest/jms/format-jmsdefault/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmsdefault/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmsdefault/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite b/testing/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite
new file mode 100644
index 0000000..56285ad
--- /dev/null
+++ b/testing/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.composite
@@ -0,0 +1,94 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:hw="http://helloworld"
+ name="helloworld">
+
+ <component name="HelloWorldReferenceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldReferenceImpl" />
+ <reference name="helloWorldService1" >
+ <binding.jms>
+ <destination jndiName="HelloWorldService1"/>
+ </binding.jms>
+ </reference>
+ <reference name="helloWorldService2" >
+ <binding.jms>
+ <wireFormat.jmsDefault/>
+ <destination jndiName="HelloWorldService2"/>
+ </binding.jms>
+ </reference>
+ <reference name="helloWorldService3" >
+ <binding.jms>
+ <wireFormat.jmsDefault/>
+ <destination jndiName="HelloWorldService3"/>
+ </binding.jms>
+ </reference>
+ <reference name="helloWorldService4" >
+ <binding.jms>
+ <wireFormat.jmsDefault/>
+ <destination jndiName="HelloWorldService4"/>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="HelloWorldServiceComponent1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <binding.jms>
+ <destination jndiName="HelloWorldService1"/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="HelloWorldServiceComponent2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <interface.java interface="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldService" />
+ <binding.jms>
+ <destination jndiName="HelloWorldService2"/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="HelloWorldServiceComponent3">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <!--interface.wsdl interface="http://helloworld/textxml#wsdl.interface(HelloWorld)" /-->
+ <binding.jms>
+ <wireFormat.jmsDefault />
+ <destination jndiName="HelloWorldService3"/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="HelloWorldServiceComponent4">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.format.jmsdefault.helloworld.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <!--interface.wsdl interface="http://helloworld/textxml#wsdl.interface(HelloWorld)" /-->
+ <binding.jms>
+ <wireFormat.jmsDefault />
+ <destination jndiName="HelloWorldService4"/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.wsdl b/testing/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.wsdl
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.wsdl
rename to testing/itest/jms/format-jmsdefault/src/main/resources/jmsdefault/helloworld.wsdl
diff --git a/itest/jms/format-jmsdefault/src/main/resources/jndi.properties b/testing/itest/jms/format-jmsdefault/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmsdefault/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmsdefault/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmsdefault/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java b/testing/itest/jms/format-jmsdefault/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java
similarity index 100%
rename from itest/jms/format-jmsdefault/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java
rename to testing/itest/jms/format-jmsdefault/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSDefaultTestCase.java
diff --git a/testing/itest/jms/format-jmsmessage/pom.xml b/testing/itest/jms/format-jmsmessage/pom.xml
new file mode 100644
index 0000000..4e57f39
--- /dev/null
+++ b/testing/itest/jms/format-jmsmessage/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmsmessage</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmsmessage</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
diff --git a/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README b/testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
rename to testing/itest/jms/format-jmsmessage/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
diff --git a/itest/jms/format-jmsmessage/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmsmessage/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmsmessage/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.composite b/testing/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.composite
rename to testing/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.composite
diff --git a/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.wsdl b/testing/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.wsdl
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.wsdl
rename to testing/itest/jms/format-jmsmessage/src/main/resources/jmsmessage/helloworld.wsdl
diff --git a/itest/jms/format-jmsmessage/src/main/resources/jndi.properties b/testing/itest/jms/format-jmsmessage/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmsmessage/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmsmessage/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmsmessage/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java b/testing/itest/jms/format-jmsmessage/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
similarity index 100%
rename from itest/jms/format-jmsmessage/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
rename to testing/itest/jms/format-jmsmessage/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSMessageTestCase.java
diff --git a/testing/itest/jms/format-jmsobject/pom.xml b/testing/itest/jms/format-jmsobject/pom.xml
new file mode 100644
index 0000000..4a043c0
--- /dev/null
+++ b/testing/itest/jms/format-jmsobject/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmsobject</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmsobject</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
diff --git a/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
new file mode 100644
index 0000000..04d4a02
--- /dev/null
+++ b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
@@ -0,0 +1,112 @@
+/*
+ * 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.sca.binding.jms.format.jmsobject.helloworld;
+
+import org.oasisopen.sca.annotation.Reference;
+
+
+public class HelloWorldReferenceImpl implements HelloWorldReference {
+
+ @Reference
+ protected HelloWorldService helloWorldServiceWrapSingle;
+
+ @Reference
+ protected HelloWorldService helloWorldServiceDontWrapSingle;
+
+ public String getGreetingsWrapSingle(String firstName, String lastName){
+ Person person = new Person();
+ person.setFirstName(firstName);
+ person.setLastName(lastName);
+
+ String returnString = "";
+
+ Person returnPerson = helloWorldServiceWrapSingle.getPersonGreetings(person);
+ returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName();
+
+ Person returnNullPerson = helloWorldServiceWrapSingle.getNullReturnGreetings(person);
+
+ if (returnNullPerson == null){
+ returnString += " Hello2 null";
+ }
+
+ String returnGreeting = helloWorldServiceWrapSingle.getArrayGreeting(new String[]{firstName, lastName});
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName});
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceWrapSingle.getMultiGreetings(firstName, lastName);
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceWrapSingle.getObjectGreeting(person);
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceWrapSingle.getObjectArrayGreeting(new Object[]{person});
+ returnString += " " + returnGreeting;
+
+ return returnString;
+ }
+
+ public String getGreetingsDontWrapSingle(String firstName, String lastName){
+ Person person = new Person();
+ person.setFirstName(firstName);
+ person.setLastName(lastName);
+
+ String returnString = "";
+
+ Person returnPerson = helloWorldServiceDontWrapSingle.getPersonGreetings(person);
+ returnString = returnPerson.getFirstName() + " " + returnPerson.getLastName();
+
+ Person returnNullPerson = helloWorldServiceDontWrapSingle.getNullReturnGreetings(person);
+
+ if (returnNullPerson == null){
+ returnString += " Hello2 null";
+ }
+
+ String returnGreeting = helloWorldServiceDontWrapSingle.getArrayGreeting(new String[]{firstName, lastName});
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceDontWrapSingle.getMultiArrayGreetings(new String[]{firstName, firstName},new String[]{lastName, lastName});
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceDontWrapSingle.getMultiGreetings(firstName, lastName);
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceDontWrapSingle.getObjectGreeting(person);
+ returnString += " " + returnGreeting;
+
+ returnGreeting = helloWorldServiceDontWrapSingle.getObjectArrayGreeting(new Object[]{person});
+ returnString += " " + returnGreeting;
+
+ try {
+ helloWorldServiceDontWrapSingle.throwChecked(person);
+ } catch (CheckedException e) {
+ returnString += " " + e.getMessage();
+ }
+
+ try {
+ helloWorldServiceDontWrapSingle.throwUnChecked(person);
+ } catch (Exception e) {
+ returnString += " " + (e.getCause().getMessage().startsWith("Message = bla") ? "bla" : e.getCause().getMessage());
+ }
+
+ return returnString;
+ }
+}
+
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java b/testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
rename to testing/itest/jms/format-jmsobject/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
diff --git a/itest/jms/format-jmsobject/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmsobject/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmsobject/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmsobject/src/main/resources/jmsobject/helloworld.composite b/testing/itest/jms/format-jmsobject/src/main/resources/jmsobject/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/resources/jmsobject/helloworld.composite
rename to testing/itest/jms/format-jmsobject/src/main/resources/jmsobject/helloworld.composite
diff --git a/itest/jms/format-jmsobject/src/main/resources/jndi.properties b/testing/itest/jms/format-jmsobject/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmsobject/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmsobject/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmsobject/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java b/testing/itest/jms/format-jmsobject/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java
similarity index 100%
rename from itest/jms/format-jmsobject/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java
rename to testing/itest/jms/format-jmsobject/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSObjectTestCase.java
diff --git a/testing/itest/jms/format-jmstext/pom.xml b/testing/itest/jms/format-jmstext/pom.xml
new file mode 100644
index 0000000..b363b36
--- /dev/null
+++ b/testing/itest/jms/format-jmstext/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmstext</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmstext</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmstext/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmstext/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmstext/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmstext/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmstext/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmstext/src/main/resources/jmstext/helloworld.composite b/testing/itest/jms/format-jmstext/src/main/resources/jmstext/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmstext/src/main/resources/jmstext/helloworld.composite
rename to testing/itest/jms/format-jmstext/src/main/resources/jmstext/helloworld.composite
diff --git a/itest/jms/format-jmstext/src/main/resources/jndi.properties b/testing/itest/jms/format-jmstext/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmstext/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmstext/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmstext/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextTestCase.java b/testing/itest/jms/format-jmstext/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextTestCase.java
similarity index 100%
rename from itest/jms/format-jmstext/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextTestCase.java
rename to testing/itest/jms/format-jmstext/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextTestCase.java
diff --git a/testing/itest/jms/format-jmstextxml/pom.xml b/testing/itest/jms/format-jmstextxml/pom.xml
new file mode 100644
index 0000000..4c27a56
--- /dev/null
+++ b/testing/itest/jms/format-jmstextxml/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmstextxml</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmstextxml</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java b/testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
rename to testing/itest/jms/format-jmstextxml/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
diff --git a/itest/jms/format-jmstextxml/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmstextxml/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmstextxml/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.composite b/testing/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.composite
rename to testing/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.composite
diff --git a/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.wsdl b/testing/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.wsdl
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.wsdl
rename to testing/itest/jms/format-jmstextxml/src/main/resources/jmstextxml/helloworld.wsdl
diff --git a/itest/jms/format-jmstextxml/src/main/resources/jndi.properties b/testing/itest/jms/format-jmstextxml/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmstextxml/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmstextxml/src/main/resources/jndi.properties
diff --git a/itest/jms/format-jmstextxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java b/testing/itest/jms/format-jmstextxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java
similarity index 100%
rename from itest/jms/format-jmstextxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java
rename to testing/itest/jms/format-jmstextxml/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLTestCase.java
diff --git a/testing/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml b/testing/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml
new file mode 100644
index 0000000..8330855
--- /dev/null
+++ b/testing/itest/jms/format-jmstextxmlinjmsobjectout/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-format-jmstextxmlinjmsobjectout</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Message Format jmstextxmlinjmsobjectout</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytes/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsbytesxml/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsdefault/helloworld/Person.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/HelloWorldServiceReferenceSide.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsmessage/helloworld/README
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmsobject/helloworld/Person.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstext/helloworld/HelloWorldServiceReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/CheckedException.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReference.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxml/helloworld/Person.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldReferenceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldService.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/HelloWorldServiceImpl.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/Person.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/Person.java
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/Person.java
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/java/org/apache/tuscany/sca/binding/jms/format/jmstextxmlinjmsobjectout/helloworld/Person.java
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.composite b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.composite
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.composite
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.composite
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.wsdl b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.wsdl
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.wsdl
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jmstextxmlinjmsobjectout/helloworld.wsdl
diff --git a/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jndi.properties b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jndi.properties
rename to testing/itest/jms/format-jmstextxmlinjmsobjectout/src/main/resources/jndi.properties
diff --git a/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java
new file mode 100644
index 0000000..5c4d3cb
--- /dev/null
+++ b/testing/itest/jms/format-jmstextxmlinjmsobjectout/src/test/java/org/apache/tuscany/sca/binding/jms/format/FormatJMSTextXMLInJMSObjectOutTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.sca.binding.jms.format;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.binding.jms.format.jmstextxmlinjmsobjectout.helloworld.HelloWorldService;
+import org.apache.tuscany.sca.binding.jms.format.jmstextxmlinjmsobjectout.helloworld.Person;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+
+/**
+ * This shows how to test the JMS binding using a simple HelloWorld application.
+ */
+public class FormatJMSTextXMLInJMSObjectOutTestCase {
+
+ private static Node node;
+
+ @Before
+ public void init() {
+ node = NodeFactory.newInstance().createNode().start();
+ }
+
+ @Test
+ @Ignore("TUSCANY-3654")
+ public void testHelloWorldCreate() throws Exception {
+ HelloWorldService helloWorldService = node.getService(HelloWorldService.class, "HelloWorldReferenceComponent");
+
+ assertEquals("Hello Fred Bloggs", helloWorldService.getGreetings("Fred Bloggs"));
+
+ Person person = new Person();
+ person.setFirstName("Fred");
+ person.setLastName("Bloggs");
+ assertEquals("Hello Fred Bloggs", helloWorldService.getPersonGreetings(person));
+ }
+
+ @After
+ public void end() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/testing/itest/jms/non-sca-client/pom.xml b/testing/itest/jms/non-sca-client/pom.xml
new file mode 100644
index 0000000..0080b36
--- /dev/null
+++ b/testing/itest/jms/non-sca-client/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-non-sca-client-broker</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Non SCA Client</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java b/testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
similarity index 100%
rename from itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
rename to testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
diff --git a/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java b/testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
similarity index 100%
rename from itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
rename to testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
diff --git a/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java b/testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
similarity index 100%
rename from itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
rename to testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
diff --git a/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java b/testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
similarity index 100%
rename from itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
rename to testing/itest/jms/non-sca-client/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
diff --git a/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/non-sca-client/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/non-sca-client/src/main/resources/jndi.properties b/testing/itest/jms/non-sca-client/src/main/resources/jndi.properties
new file mode 100644
index 0000000..03690b1
--- /dev/null
+++ b/testing/itest/jms/non-sca-client/src/main/resources/jndi.properties
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.TextDest = TextDest
+queue.ObjectDest = ObjectDest
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite b/testing/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
new file mode 100644
index 0000000..67d5038
--- /dev/null
+++ b/testing/itest/jms/non-sca-client/src/main/resources/nonSCAclient/service.composite
@@ -0,0 +1,54 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="ServiceComposite">
+
+ <component name="DefaultService">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
+ <service name="OneWayService">
+ <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623">
+ <tuscany:wireFormat.jmsTextXML/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="TextService">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
+ <service name="OneWayService">
+ <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
+ uri="jms:jndi:TextDest">
+ <tuscany:wireFormat.jmsText/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="ObjectService">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.OneWayObjectServiceImpl"/>
+ <service name="OneWayObjectService">
+ <binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory" jndiURL="tcp://localhost:61623"
+ uri="jms:jndi:ObjectDest">
+ <tuscany:wireFormat.jmsObject /> <!-- test that wrapSingle default works -->
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java b/testing/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java
similarity index 100%
rename from itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java
rename to testing/itest/jms/non-sca-client/src/test/java/org/apache/tuscany/sca/binding/jms/NonSCAClientTestCase.java
diff --git a/testing/itest/jms/noreplyto/pom.xml b/testing/itest/jms/noreplyto/pom.xml
new file mode 100644
index 0000000..37fd911
--- /dev/null
+++ b/testing/itest/jms/noreplyto/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-noreplyto</artifactId>
+ <name>Apache Tuscany SCA iTest JMS No replyTo</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/noreplyto/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/noreplyto/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/noreplyto/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/noreplyto/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/noreplyto/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/noreplyto/src/main/resources/jndi.properties b/testing/itest/jms/noreplyto/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/noreplyto/src/main/resources/jndi.properties
rename to testing/itest/jms/noreplyto/src/main/resources/jndi.properties
diff --git a/itest/jms/noreplyto/src/main/resources/service.composite b/testing/itest/jms/noreplyto/src/main/resources/service.composite
similarity index 100%
rename from itest/jms/noreplyto/src/main/resources/service.composite
rename to testing/itest/jms/noreplyto/src/main/resources/service.composite
diff --git a/itest/jms/noreplyto/src/test/java/org/apache/tuscany/sca/binding/jms/NoReplyToTestCase.java b/testing/itest/jms/noreplyto/src/test/java/org/apache/tuscany/sca/binding/jms/NoReplyToTestCase.java
similarity index 100%
rename from itest/jms/noreplyto/src/test/java/org/apache/tuscany/sca/binding/jms/NoReplyToTestCase.java
rename to testing/itest/jms/noreplyto/src/test/java/org/apache/tuscany/sca/binding/jms/NoReplyToTestCase.java
diff --git a/testing/itest/jms/nulls/pom.xml b/testing/itest/jms/nulls/pom.xml
new file mode 100644
index 0000000..31cdc32
--- /dev/null
+++ b/testing/itest/jms/nulls/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-nulls</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Nulls</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
similarity index 100%
rename from itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
rename to testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
diff --git a/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java b/testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
similarity index 100%
rename from itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
rename to testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/MyService.java
diff --git a/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java b/testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
similarity index 100%
rename from itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
rename to testing/itest/jms/nulls/src/main/java/org/apache/tuscany/sca/binding/jms/ServiceImpl.java
diff --git a/itest/jms/nulls/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/nulls/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/nulls/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/nulls/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/nulls/src/main/resources/jndi.properties b/testing/itest/jms/nulls/src/main/resources/jndi.properties
new file mode 100644
index 0000000..4bada51
--- /dev/null
+++ b/testing/itest/jms/nulls/src/main/resources/jndi.properties
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false&broker.useJmx=false&broker.useShutdownHook=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory, ConnectionFactory2
+
+# register some queues in JNDI using the form
+queue.MyService = MyService
+queue.MyService2 = MyService2
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+topic.ServiceTopic = ServiceTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/nulls/src/main/resources/nulls.composite b/testing/itest/jms/nulls/src/main/resources/nulls.composite
new file mode 100644
index 0000000..1aa1780
--- /dev/null
+++ b/testing/itest/jms/nulls/src/main/resources/nulls.composite
@@ -0,0 +1,57 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="Nulls">
+
+ <component name="Client1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:MyService" />
+ </reference>
+ </component>
+
+ <component name="Service1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
+ <service name="MyService">
+ <binding.jms />
+ </service>
+ </component>
+
+ <component name="Client2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:MyService2">
+ <tuscany:wireFormat.jmsObject/>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="Service2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ServiceImpl"/>
+ <service name="MyService">
+ <binding.jms uri="jms:jndi:MyService2">
+ <tuscany:wireFormat.jmsObject/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java b/testing/itest/jms/nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java
similarity index 100%
rename from itest/jms/nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java
rename to testing/itest/jms/nulls/src/test/java/org/apache/tuscany/sca/binding/jms/NullsTestCase.java
diff --git a/testing/itest/jms/oneway-nocf/pom.xml b/testing/itest/jms/oneway-nocf/pom.xml
new file mode 100644
index 0000000..67a04e7
--- /dev/null
+++ b/testing/itest/jms/oneway-nocf/pom.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-jms-oneway-nocf</artifactId>
+ <name>Apache Tuscany SCA iTest JMS for a oneway service</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java b/testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
rename to testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
diff --git a/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java b/testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
rename to testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
diff --git a/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java b/testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
rename to testing/itest/jms/oneway-nocf/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
diff --git a/itest/jms/oneway-nocf/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/oneway-nocf/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/oneway-nocf/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/oneway-nocf/src/main/resources/jndi.properties b/testing/itest/jms/oneway-nocf/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/resources/jndi.properties
rename to testing/itest/jms/oneway-nocf/src/main/resources/jndi.properties
diff --git a/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayClient.composite b/testing/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayClient.composite
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/resources/oneway/OneWayClient.composite
rename to testing/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayClient.composite
diff --git a/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayService.composite b/testing/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayService.composite
similarity index 100%
rename from itest/jms/oneway-nocf/src/main/resources/oneway/OneWayService.composite
rename to testing/itest/jms/oneway-nocf/src/main/resources/oneway/OneWayService.composite
diff --git a/itest/jms/oneway-nocf/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java b/testing/itest/jms/oneway-nocf/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
similarity index 100%
rename from itest/jms/oneway-nocf/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
rename to testing/itest/jms/oneway-nocf/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
diff --git a/testing/itest/jms/oneway/pom.xml b/testing/itest/jms/oneway/pom.xml
new file mode 100644
index 0000000..c649d34
--- /dev/null
+++ b/testing/itest/jms/oneway/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-oneway</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Oneway</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java b/testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
similarity index 100%
rename from itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
rename to testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
diff --git a/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java b/testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
similarity index 100%
rename from itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
rename to testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectService.java
diff --git a/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java b/testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
similarity index 100%
rename from itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
rename to testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayObjectServiceImpl.java
diff --git a/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java b/testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
similarity index 100%
rename from itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
rename to testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
diff --git a/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java b/testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
similarity index 100%
rename from itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
rename to testing/itest/jms/oneway/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
diff --git a/itest/jms/oneway/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/oneway/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/oneway/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/oneway/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/oneway/src/main/resources/jndi.properties b/testing/itest/jms/oneway/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/oneway/src/main/resources/jndi.properties
rename to testing/itest/jms/oneway/src/main/resources/jndi.properties
diff --git a/itest/jms/oneway/src/main/resources/oneway/OneWayClient.composite b/testing/itest/jms/oneway/src/main/resources/oneway/OneWayClient.composite
similarity index 100%
rename from itest/jms/oneway/src/main/resources/oneway/OneWayClient.composite
rename to testing/itest/jms/oneway/src/main/resources/oneway/OneWayClient.composite
diff --git a/itest/jms/oneway/src/main/resources/oneway/OneWayService.composite b/testing/itest/jms/oneway/src/main/resources/oneway/OneWayService.composite
similarity index 100%
rename from itest/jms/oneway/src/main/resources/oneway/OneWayService.composite
rename to testing/itest/jms/oneway/src/main/resources/oneway/OneWayService.composite
diff --git a/itest/jms/oneway/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java b/testing/itest/jms/oneway/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
similarity index 100%
rename from itest/jms/oneway/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
rename to testing/itest/jms/oneway/src/test/java/org/apache/tuscany/sca/binding/jms/OneWayTestCase.java
diff --git a/testing/itest/jms/policy-headers/pom.xml b/testing/itest/jms/policy-headers/pom.xml
new file mode 100644
index 0000000..7aadf1e
--- /dev/null
+++ b/testing/itest/jms/policy-headers/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-policy-headers</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Policy Headers</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
diff --git a/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java b/testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
similarity index 100%
rename from itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
rename to testing/itest/jms/policy-headers/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
diff --git a/itest/jms/policy-headers/src/main/resources/META-INF/definitions.xml b/testing/itest/jms/policy-headers/src/main/resources/META-INF/definitions.xml
similarity index 100%
rename from itest/jms/policy-headers/src/main/resources/META-INF/definitions.xml
rename to testing/itest/jms/policy-headers/src/main/resources/META-INF/definitions.xml
diff --git a/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/policy-headers/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/policy-headers/src/main/resources/jndi.properties b/testing/itest/jms/policy-headers/src/main/resources/jndi.properties
new file mode 100644
index 0000000..f0b9fbd
--- /dev/null
+++ b/testing/itest/jms/policy-headers/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.ServiceQueue = ServiceQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite b/testing/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
new file mode 100644
index 0000000..68f9366
--- /dev/null
+++ b/testing/itest/jms/policy-headers/src/main/resources/policyHeaders/policyHeaders.composite
@@ -0,0 +1,45 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="PropertiesClientComposite">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgClientImpl" />
+ <reference name="myService" requires="priority.medium">
+ <binding.jms uri="jms:jndi:ServiceQueue">
+ <headers type="myType"
+ deliveryMode="persistent"
+ timeToLive="4321"
+ priority="7">
+ <property name="headP1">myHeadP1</property>
+ </headers>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="ServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgServiceImpl" />
+ <service name="MsgService">
+ <binding.jms uri="jms:jndi:ServiceQueue"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java b/testing/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java
similarity index 100%
rename from itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java
rename to testing/itest/jms/policy-headers/src/test/java/org/apache/tuscany/sca/binding/jms/PolicyHeadersTestCase.java
diff --git a/testing/itest/jms/pom.xml b/testing/itest/jms/pom.xml
new file mode 100644
index 0000000..45787ac
--- /dev/null
+++ b/testing/itest/jms/pom.xml
@@ -0,0 +1,98 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-jms</artifactId>
+ <name>Apache Tuscany SCA iTest JMS</name>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ <version>5.2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <modules>
+ <module>args</module>
+ <module>callbacks</module>
+ <module>defaults</module>
+ <module>DynamicReplyQ</module>
+ <module>exceptions</module>
+ <module>exceptions1</module>
+ <module>externalBroker</module>
+ <module>format-jmsbytes</module>
+ <module>format-jmsbytesxml</module>
+ <module>format-jmsdefault</module>
+ <module>format-jmsmessage</module>
+ <module>format-jmsobject</module>
+ <module>format-jmstext</module>
+ <module>format-jmstextxml</module>
+ <module>format-jmstextxmlinjmsobjectout</module>
+ <module>non-sca-client</module>
+ <module>noreplyto</module>
+ <module>nulls</module>
+ <module>oneway</module>
+ <module>oneway-nocf</module>
+ <module>policy-headers</module>
+ <module>properties</module>
+ <module>responsecf</module>
+ <module>rpc</module>
+ <module>selectors</module>
+ <module>topics</module>
+ <module>ttl</module>
+ <module>uri-rpc</module>
+
+<!-- still to bring up in 2.x
+ <module>definitions</module>
+-->
+
+ </modules>
+
+</project>
diff --git a/testing/itest/jms/properties/pom.xml b/testing/itest/jms/properties/pom.xml
new file mode 100644
index 0000000..0c23abf
--- /dev/null
+++ b/testing/itest/jms/properties/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-properties</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with Properties</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/JMSClient.java
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClient.java
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientImpl.java
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgClientService.java
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgService.java
diff --git a/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java b/testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
similarity index 100%
rename from itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
rename to testing/itest/jms/properties/src/main/java/org/apache/tuscany/sca/binding/jms/MsgServiceImpl.java
diff --git a/itest/jms/properties/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/properties/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/properties/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/properties/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/properties/src/main/resources/jndi.properties b/testing/itest/jms/properties/src/main/resources/jndi.properties
new file mode 100644
index 0000000..c44da27
--- /dev/null
+++ b/testing/itest/jms/properties/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.ServiceQueue = RequestQueue
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/properties/src/main/resources/properties/properties.composite b/testing/itest/jms/properties/src/main/resources/properties/properties.composite
new file mode 100644
index 0000000..85babc8
--- /dev/null
+++ b/testing/itest/jms/properties/src/main/resources/properties/properties.composite
@@ -0,0 +1,53 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="PropertiesClientComposite">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgClientImpl" />
+ <reference name="myService">
+ <binding.jms uri="jms:jndi:ServiceQueue">
+ <headers type="myType"
+ deliveryMode="persistent"
+ timeToLive="4321"
+ priority="7">
+ <property name="headP1">myHeadP1</property>
+ </headers>
+ <operationProperties name="op2" selectedOperation="nativeOp2">
+ <headers type="op2Type"
+ deliveryMode="nonpersistent"
+ timeToLive="6000"
+ priority="8">
+ <property name="op2P2">foo</property>
+ </headers>
+ </operationProperties>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="ServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.MsgServiceImpl" />
+ <service name="MsgService">
+ <binding.jms uri="jms:jndi:ServiceQueue"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/properties/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java b/testing/itest/jms/properties/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java
similarity index 100%
rename from itest/jms/properties/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java
rename to testing/itest/jms/properties/src/test/java/org/apache/tuscany/sca/binding/jms/PropertiesTestCase.java
diff --git a/testing/itest/jms/responsecf/pom.xml b/testing/itest/jms/responsecf/pom.xml
new file mode 100644
index 0000000..48c99cd
--- /dev/null
+++ b/testing/itest/jms/responsecf/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-responsecf</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Response ConnectionFactory</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/responsecf/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/responsecf/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/responsecf/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/responsecf/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/responsecf/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/responsecf/src/main/resources/cf/client.composite b/testing/itest/jms/responsecf/src/main/resources/cf/client.composite
similarity index 100%
rename from itest/jms/responsecf/src/main/resources/cf/client.composite
rename to testing/itest/jms/responsecf/src/main/resources/cf/client.composite
diff --git a/itest/jms/responsecf/src/main/resources/cf/service.composite b/testing/itest/jms/responsecf/src/main/resources/cf/service.composite
similarity index 100%
rename from itest/jms/responsecf/src/main/resources/cf/service.composite
rename to testing/itest/jms/responsecf/src/main/resources/cf/service.composite
diff --git a/itest/jms/responsecf/src/main/resources/jndi.properties b/testing/itest/jms/responsecf/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/responsecf/src/main/resources/jndi.properties
rename to testing/itest/jms/responsecf/src/main/resources/jndi.properties
diff --git a/itest/jms/responsecf/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java b/testing/itest/jms/responsecf/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
similarity index 100%
rename from itest/jms/responsecf/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
rename to testing/itest/jms/responsecf/src/test/java/org/apache/tuscany/sca/binding/jms/ResponseCFTestCase.java
diff --git a/testing/itest/jms/rpc/pom.xml b/testing/itest/jms/rpc/pom.xml
new file mode 100644
index 0000000..3fb0a62
--- /dev/null
+++ b/testing/itest/jms/rpc/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-rpc</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with RPC</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/rpc/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/rpc/src/main/resources/jndi.properties b/testing/itest/jms/rpc/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/rpc/src/main/resources/jndi.properties
rename to testing/itest/jms/rpc/src/main/resources/jndi.properties
diff --git a/itest/jms/rpc/src/main/resources/simple/client.composite b/testing/itest/jms/rpc/src/main/resources/simple/client.composite
similarity index 100%
rename from itest/jms/rpc/src/main/resources/simple/client.composite
rename to testing/itest/jms/rpc/src/main/resources/simple/client.composite
diff --git a/itest/jms/rpc/src/main/resources/simple/service.composite b/testing/itest/jms/rpc/src/main/resources/simple/service.composite
similarity index 100%
rename from itest/jms/rpc/src/main/resources/simple/service.composite
rename to testing/itest/jms/rpc/src/main/resources/simple/service.composite
diff --git a/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java b/testing/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
similarity index 100%
rename from itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
rename to testing/itest/jms/rpc/src/test/java/org/apache/tuscany/sca/binding/jms/RPCTestCase.java
diff --git a/testing/itest/jms/selectors/pom.xml b/testing/itest/jms/selectors/pom.xml
new file mode 100644
index 0000000..dfab9f0
--- /dev/null
+++ b/testing/itest/jms/selectors/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-selectors</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Tests For Selectors</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorService.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorService.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorService.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorService.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl1.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl1.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl1.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl1.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl2.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl2.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl2.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl2.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl3.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl3.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl3.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/SelectorServiceImpl3.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReference.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReference.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReference.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReference.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReferenceImpl.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReferenceImpl.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldReferenceImpl.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldService.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldService.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldService.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldService.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldServiceImpl.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldServiceImpl.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsdefault/HelloWorldServiceImpl.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReference.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReference.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReference.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReference.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReferenceImpl.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReferenceImpl.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReferenceImpl.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldReferenceImpl.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldService.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldService.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldService.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldService.java
diff --git a/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldServiceImpl.java b/testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldServiceImpl.java
rename to testing/itest/jms/selectors/src/main/java/org/apache/tuscany/sca/binding/jms/operationselector/jmsuserprop/HelloWorldServiceImpl.java
diff --git a/itest/jms/selectors/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/selectors/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/selectors/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/selectors/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite b/testing/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite
new file mode 100644
index 0000000..d8c9d05
--- /dev/null
+++ b/testing/itest/jms/selectors/src/main/resources/jmsdefault/helloworld.composite
@@ -0,0 +1,69 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:hw="http://helloworld"
+ name="helloworld">
+
+ <component name="HelloWorldReferenceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldReferenceImpl" />
+ <reference name="helloWorldService1" >
+ <binding.jms>
+ <destination jndiName="HelloWorldService1"/>
+ </binding.jms>
+ </reference>
+ <reference name="helloWorldService2" >
+ <binding.jms>
+ <destination jndiName="HelloWorldService2"/>
+ <operationProperties name="getGreetingsOne" >
+ <headers>
+ <property name="scaOperationName">getGreetingsThree</property>
+ </headers>
+ </operationProperties>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="HelloWorldServiceComponent1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <binding.jms>
+ <destination jndiName="HelloWorldService1"/>
+ <operationProperties name="getGreetingsThree" selectedOperation="getGreetingsFour">
+ <headers>
+ <property name="blaNotUsed">getGreetingsThree</property>
+ </headers>
+ </operationProperties>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="HelloWorldServiceComponent2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsdefault.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <binding.jms>
+ <operationSelector.jmsDefault/>
+ <destination jndiName="HelloWorldService2"/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/testing/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite b/testing/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite
new file mode 100644
index 0000000..a3f1d08
--- /dev/null
+++ b/testing/itest/jms/selectors/src/main/resources/jmsuserprop/helloworld.composite
@@ -0,0 +1,65 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:hw="http://helloworld"
+ name="helloworldUP">
+
+ <component name="HelloWorldReferenceComponent1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsuserprop.HelloWorldReferenceImpl" />
+ <reference name="helloWorldService1" >
+ <binding.jms>
+ <destination jndiName="HelloWorldService4"/>
+ <operationProperties name="getGreetingsOne" >
+ <headers>
+ <property name="myProperty">getGreetingsOne</property>
+ </headers>
+ </operationProperties>
+ <operationProperties name="getGreetingsTwo" >
+ <headers>
+ <property name="myProperty">getGreetingsThree</property>
+ </headers>
+ </operationProperties>
+ <operationProperties name="getGreetingsThree" >
+ <headers>
+ <property name="myProperty">getGreetingsTwo</property>
+ </headers>
+ </operationProperties>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="HelloWorldServiceComponent3">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.operationselector.jmsuserprop.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <binding.jms>
+ <tuscany:operationSelector.jmsUserProp propertyName="myProperty"/>
+ <destination jndiName="HelloWorldService4"/>
+ <operationProperties name="getGreetingsThree" selectedOperation="getGreetingsFour">
+ <headers>
+ <property name="blaNotUsed2">getGreetingsThree</property>
+ </headers>
+ </operationProperties>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/selectors/src/main/resources/jndi.properties b/testing/itest/jms/selectors/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/selectors/src/main/resources/jndi.properties
rename to testing/itest/jms/selectors/src/main/resources/jndi.properties
diff --git a/testing/itest/jms/selectors/src/main/resources/selectors/selectors.composite b/testing/itest/jms/selectors/src/main/resources/selectors/selectors.composite
new file mode 100644
index 0000000..1a408df
--- /dev/null
+++ b/testing/itest/jms/selectors/src/main/resources/selectors/selectors.composite
@@ -0,0 +1,68 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ xmlns:itest="http://jms"
+ name="Selectors">
+
+ <component name="Client1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:ServiceTopic" >
+ <headers type="type1" />
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="Client2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.ClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:ServiceTopic" >
+ <headers type="type2" />
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="Service1">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl1"/>
+ <service name="SelectorService">
+ <binding.jms uri="jms:jndi:ServiceTopic" />
+ </service>
+ </component>
+
+ <component name="Service2">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl2"/>
+ <service name="SelectorService">
+ <binding.jms uri="jms:jndi:ServiceTopic" >
+ <messageSelection selector="JMSType = 'type1'"/>
+ </binding.jms>
+ </service>
+ </component>
+
+ <component name="Service3">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.SelectorServiceImpl3"/>
+ <service name="SelectorService">
+ <binding.jms uri="jms:jndi:ServiceTopic" >
+ <messageSelection selector="JMSType = 'type2'"/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSDefaultTestCase.java b/testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSDefaultTestCase.java
similarity index 100%
rename from itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSDefaultTestCase.java
rename to testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSDefaultTestCase.java
diff --git a/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSUserPropTestCase.java b/testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSUserPropTestCase.java
similarity index 100%
rename from itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSUserPropTestCase.java
rename to testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/OperationselectorJMSUserPropTestCase.java
diff --git a/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/SelectorsTestCase.java b/testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/SelectorsTestCase.java
similarity index 100%
rename from itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/SelectorsTestCase.java
rename to testing/itest/jms/selectors/src/test/java/org/apache/tuscany/sca/binding/jms/SelectorsTestCase.java
diff --git a/testing/itest/jms/topics/pom.xml b/testing/itest/jms/topics/pom.xml
new file mode 100644
index 0000000..83da11d
--- /dev/null
+++ b/testing/itest/jms/topics/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-topics</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Tests for topics</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java b/testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
similarity index 100%
rename from itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
rename to testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayClientImpl.java
diff --git a/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java b/testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
similarity index 100%
rename from itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
rename to testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayService.java
diff --git a/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java b/testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
similarity index 100%
rename from itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
rename to testing/itest/jms/topics/src/main/java/org/apache/tuscany/sca/binding/jms/OneWayServiceImpl.java
diff --git a/itest/jms/topics/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/topics/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/topics/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/topics/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/topics/src/main/resources/jndi.properties b/testing/itest/jms/topics/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/topics/src/main/resources/jndi.properties
rename to testing/itest/jms/topics/src/main/resources/jndi.properties
diff --git a/itest/jms/topics/src/main/resources/topics/TopicsClient.composite b/testing/itest/jms/topics/src/main/resources/topics/TopicsClient.composite
similarity index 100%
rename from itest/jms/topics/src/main/resources/topics/TopicsClient.composite
rename to testing/itest/jms/topics/src/main/resources/topics/TopicsClient.composite
diff --git a/itest/jms/topics/src/main/resources/topics/TopicsService.composite b/testing/itest/jms/topics/src/main/resources/topics/TopicsService.composite
similarity index 100%
rename from itest/jms/topics/src/main/resources/topics/TopicsService.composite
rename to testing/itest/jms/topics/src/main/resources/topics/TopicsService.composite
diff --git a/itest/jms/topics/src/test/java/org/apache/tuscany/sca/binding/jms/TopicsTestCase.java b/testing/itest/jms/topics/src/test/java/org/apache/tuscany/sca/binding/jms/TopicsTestCase.java
similarity index 100%
rename from itest/jms/topics/src/test/java/org/apache/tuscany/sca/binding/jms/TopicsTestCase.java
rename to testing/itest/jms/topics/src/test/java/org/apache/tuscany/sca/binding/jms/TopicsTestCase.java
diff --git a/testing/itest/jms/ttl/pom.xml b/testing/itest/jms/ttl/pom.xml
new file mode 100644
index 0000000..09aa105
--- /dev/null
+++ b/testing/itest/jms/ttl/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-ttl</artifactId>
+ <name>Apache Tuscany SCA iTest JMS Time To Live</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/ttl/src/main/java/itest/MockInitialContextFactory.java b/testing/itest/jms/ttl/src/main/java/itest/MockInitialContextFactory.java
similarity index 100%
rename from itest/jms/ttl/src/main/java/itest/MockInitialContextFactory.java
rename to testing/itest/jms/ttl/src/main/java/itest/MockInitialContextFactory.java
diff --git a/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java b/testing/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
similarity index 100%
rename from itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
rename to testing/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientIface.java
diff --git a/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java b/testing/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
similarity index 100%
rename from itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
rename to testing/itest/jms/ttl/src/main/java/org/apache/tuscany/sca/binding/jms/ClientImpl.java
diff --git a/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/ttl/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/jms/ttl/src/main/resources/jndi.properties b/testing/itest/jms/ttl/src/main/resources/jndi.properties
similarity index 100%
rename from itest/jms/ttl/src/main/resources/jndi.properties
rename to testing/itest/jms/ttl/src/main/resources/jndi.properties
diff --git a/itest/jms/ttl/src/main/resources/ttl.composite b/testing/itest/jms/ttl/src/main/resources/ttl.composite
similarity index 100%
rename from itest/jms/ttl/src/main/resources/ttl.composite
rename to testing/itest/jms/ttl/src/main/resources/ttl.composite
diff --git a/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java b/testing/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
similarity index 100%
rename from itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
rename to testing/itest/jms/ttl/src/test/java/org/apache/tuscany/sca/binding/jms/TTLTestCase.java
diff --git a/testing/itest/jms/uri-rpc/pom.xml b/testing/itest/jms/uri-rpc/pom.xml
new file mode 100644
index 0000000..95b4f8f
--- /dev/null
+++ b/testing/itest/jms/uri-rpc/pom.xml
@@ -0,0 +1,35 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-jms</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-jms-uri-rpc</artifactId>
+ <name>Apache Tuscany SCA iTest JMS with URI RPC</name>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java b/testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
similarity index 100%
rename from itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
rename to testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldClientImpl.java
diff --git a/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java b/testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
similarity index 100%
rename from itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
rename to testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldService.java
diff --git a/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java b/testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
similarity index 100%
rename from itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
rename to testing/itest/jms/uri-rpc/src/main/java/org/apache/tuscany/sca/binding/jms/HelloWorldServiceImpl.java
diff --git a/itest/jms/uri-rpc/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/jms/uri-rpc/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/jms/uri-rpc/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/jms/uri-rpc/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/jms/uri-rpc/src/main/resources/jndi.properties b/testing/itest/jms/uri-rpc/src/main/resources/jndi.properties
new file mode 100644
index 0000000..f6dfc8e
--- /dev/null
+++ b/testing/itest/jms/uri-rpc/src/main/resources/jndi.properties
@@ -0,0 +1,38 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# START SNIPPET: jndi
+
+java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# use the following property to configure the default connector
+java.naming.provider.url = vm://localhost?broker.persistent=false
+
+# use the following property to specify the JNDI name the connection factory
+# should appear as.
+#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
+connectionFactoryNames = ConnectionFactory
+
+# register some queues in JNDI using the form
+# queue.[jndiName] = [physicalName]
+queue.DestQueueA = DestQueueA
+
+# register some topics in JNDI using the form
+# topic.[jndiName] = [physicalName]
+#topic.MyTopic = example.MyTopic
+
+# END SNIPPET: jndi
diff --git a/testing/itest/jms/uri-rpc/src/main/resources/simple/service.composite b/testing/itest/jms/uri-rpc/src/main/resources/simple/service.composite
new file mode 100644
index 0000000..99ed243
--- /dev/null
+++ b/testing/itest/jms/uri-rpc/src/main/resources/simple/service.composite
@@ -0,0 +1,37 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="SimpleServiceComposite">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldServiceImpl"/>
+ <service name="HelloWorldService">
+ <binding.jms>
+ <destination jndiName="DestQueueA" >
+ </destination>
+ <response>
+ <destination jndiName="RespQueueA"/>
+ </response>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
diff --git a/testing/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite b/testing/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite
new file mode 100644
index 0000000..8295fb1
--- /dev/null
+++ b/testing/itest/jms/uri-rpc/src/main/resources/simple/uriclient.composite
@@ -0,0 +1,31 @@
+<?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://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://itest"
+ name="URIClientComposite">
+
+ <component name="HelloWorldClient">
+ <implementation.java class="org.apache.tuscany.sca.binding.jms.HelloWorldClientImpl"/>
+ <reference name="serviceA">
+ <binding.jms uri="jms:jndi:DestQueueA" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/itest/jms/uri-rpc/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java b/testing/itest/jms/uri-rpc/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java
similarity index 100%
rename from itest/jms/uri-rpc/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java
rename to testing/itest/jms/uri-rpc/src/test/java/org/apache/tuscany/sca/binding/jms/URIRPCTestCase.java
diff --git a/itest/node-launcher-equinox/pom.xml b/testing/itest/node-launcher-equinox/pom.xml
similarity index 100%
rename from itest/node-launcher-equinox/pom.xml
rename to testing/itest/node-launcher-equinox/pom.xml
diff --git a/itest/node-launcher-equinox/src/test/java/hello/HelloWorld.java b/testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorld.java
similarity index 100%
rename from itest/node-launcher-equinox/src/test/java/hello/HelloWorld.java
rename to testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorld.java
diff --git a/itest/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java b/testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
similarity index 100%
rename from itest/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
rename to testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorldClient.java
diff --git a/itest/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java b/testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
similarity index 100%
rename from itest/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
rename to testing/itest/node-launcher-equinox/src/test/java/hello/HelloWorldImpl.java
diff --git a/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java b/testing/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
similarity index 100%
rename from itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
rename to testing/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHostTestCase.java
diff --git a/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java b/testing/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
similarity index 100%
rename from itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
rename to testing/itest/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
diff --git a/itest/node-launcher-equinox/src/test/resources/HelloWorld.composite b/testing/itest/node-launcher-equinox/src/test/resources/HelloWorld.composite
similarity index 100%
rename from itest/node-launcher-equinox/src/test/resources/HelloWorld.composite
rename to testing/itest/node-launcher-equinox/src/test/resources/HelloWorld.composite
diff --git a/testing/itest/nodes/binding-sca-hazelcast/pom.xml b/testing/itest/nodes/binding-sca-hazelcast/pom.xml
new file mode 100644
index 0000000..5d6623f
--- /dev/null
+++ b/testing/itest/nodes/binding-sca-hazelcast/pom.xml
@@ -0,0 +1,73 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-binding-sca-hazelcast</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes binding.sca Using Hazelcast Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-runtime-axis2</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <reportFormat>brief</reportFormat>
+ <useFile>true</useFile>
+ <forkMode>once</forkMode>
+ <argLine>-ea -Xmx256m</argLine>
+ <parallel>off</parallel>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite b/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite b/testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java b/testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-hazelcast/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/pom.xml b/testing/itest/nodes/binding-sca-tribes/pom.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/pom.xml
rename to testing/itest/nodes/binding-sca-tribes/pom.xml
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Client.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/ClientImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Customer.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/CustomerNotFoundException.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Local.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/LocalServiceImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/Remote.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/RemoteServiceImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java b/testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/main/java/org/apache/tuscany/sca/itest/bindingsca/SCAClientImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite b/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
rename to testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Client.composite
diff --git a/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite b/testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
rename to testing/itest/nodes/binding-sca-tribes/src/main/resources/org/apache/tuscany/sca/itest/bindingsca/Service.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/AsynchTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/CallbackTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/PromotionTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/SimpleTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldCallbackRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldClient.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackOnewayRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceCallbackRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceLocal.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/HelloWorldServiceRemote2.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientLocalImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemote2Impl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldClientRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceLocalImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/axis2/helloworld/impl/HelloWorldServiceRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/AsynchTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/CallbackTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/PromotionTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/SimpleTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldCallbackRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldClient.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackOnewayRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceCallbackRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceLocal.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/HelloWorldServiceRemote2.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientLocalImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemote2Impl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldClientRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackOnewayRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceCallbackRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceLocalImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceMultipleServicesImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/binding/sca/rmi/helloworld/impl/HelloWorldServiceRemoteImpl.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/BindingSCATestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedCustomerTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientNodeSharedLocalTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedCustomerTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ClientSharedLocalTestCase.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/ServiceNode.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java b/testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
rename to testing/itest/nodes/binding-sca-tribes/src/test/java/org/apache/tuscany/sca/itest/bindingsca/TestCaseRunner.java
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/asynchService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/callbackService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/promotionService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/rmi/simpleService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/asynchService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/callbackService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/HelloWorldComponent.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/promotionService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleReference/META-INF/sca-contribution.xml
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/HelloWorld.composite
diff --git a/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml b/testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
rename to testing/itest/nodes/binding-sca-tribes/src/test/resources/ws/simpleService/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-client/pom.xml b/testing/itest/nodes/helloworld-client/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-client/pom.xml
rename to testing/itest/nodes/helloworld-client/pom.xml
diff --git a/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java b/testing/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
similarity index 100%
rename from itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
rename to testing/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
diff --git a/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite b/testing/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
similarity index 100%
rename from itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
rename to testing/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
diff --git a/itest/nodes/helloworld-iface/pom.xml b/testing/itest/nodes/helloworld-iface/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-iface/pom.xml
rename to testing/itest/nodes/helloworld-iface/pom.xml
diff --git a/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java b/testing/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
similarity index 100%
rename from itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
rename to testing/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
diff --git a/itest/nodes/helloworld-service-a/pom.xml b/testing/itest/nodes/helloworld-service-a/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-service-a/pom.xml
rename to testing/itest/nodes/helloworld-service-a/pom.xml
diff --git a/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java b/testing/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java
rename to testing/itest/nodes/helloworld-service-a/src/main/java/itest/nodes/HelloworldImpl.java
diff --git a/itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-service-a/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-service-a/src/main/resources/service-a.composite b/testing/itest/nodes/helloworld-service-a/src/main/resources/service-a.composite
similarity index 100%
rename from itest/nodes/helloworld-service-a/src/main/resources/service-a.composite
rename to testing/itest/nodes/helloworld-service-a/src/main/resources/service-a.composite
diff --git a/itest/nodes/helloworld-service-and-client/pom.xml b/testing/itest/nodes/helloworld-service-and-client/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/pom.xml
rename to testing/itest/nodes/helloworld-service-and-client/pom.xml
diff --git a/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java b/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java
rename to testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/Helloworld.java
diff --git a/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java b/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java
rename to testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldClientImpl.java
diff --git a/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java b/testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java
rename to testing/itest/nodes/helloworld-service-and-client/src/main/java/itest/nodes/sac/HelloworldServiceImpl.java
diff --git a/itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-service-and-client/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite b/testing/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite
similarity index 100%
rename from itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite
rename to testing/itest/nodes/helloworld-service-and-client/src/main/resources/helloworld-service.composite
diff --git a/itest/nodes/helloworld-service-b/pom.xml b/testing/itest/nodes/helloworld-service-b/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-service-b/pom.xml
rename to testing/itest/nodes/helloworld-service-b/pom.xml
diff --git a/itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java b/testing/itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java
rename to testing/itest/nodes/helloworld-service-b/src/main/java/itest/nodes/HelloworldImpl.java
diff --git a/itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-service-b/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-service-b/src/main/resources/service-b.composite b/testing/itest/nodes/helloworld-service-b/src/main/resources/service-b.composite
similarity index 100%
rename from itest/nodes/helloworld-service-b/src/main/resources/service-b.composite
rename to testing/itest/nodes/helloworld-service-b/src/main/resources/service-b.composite
diff --git a/itest/nodes/helloworld-service-c/pom.xml b/testing/itest/nodes/helloworld-service-c/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-service-c/pom.xml
rename to testing/itest/nodes/helloworld-service-c/pom.xml
diff --git a/itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java b/testing/itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java
rename to testing/itest/nodes/helloworld-service-c/src/main/java/itest/nodes/HelloworldImpl.java
diff --git a/itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-service-c/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-service-c/src/main/resources/service-c.composite b/testing/itest/nodes/helloworld-service-c/src/main/resources/service-c.composite
similarity index 100%
rename from itest/nodes/helloworld-service-c/src/main/resources/service-c.composite
rename to testing/itest/nodes/helloworld-service-c/src/main/resources/service-c.composite
diff --git a/itest/nodes/helloworld-service/pom.xml b/testing/itest/nodes/helloworld-service/pom.xml
similarity index 100%
rename from itest/nodes/helloworld-service/pom.xml
rename to testing/itest/nodes/helloworld-service/pom.xml
diff --git a/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java b/testing/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
similarity index 100%
rename from itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
rename to testing/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
diff --git a/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite b/testing/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
similarity index 100%
rename from itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
rename to testing/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
diff --git a/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml b/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml
new file mode 100644
index 0000000..e5b6101
--- /dev/null
+++ b/testing/itest/nodes/one-jvm-hazelcast-client/pom.xml
@@ -0,0 +1,50 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-jvm-hazelcast-client</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast and client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+ <build>
+ </build>
+</project>
diff --git a/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java b/testing/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java
rename to testing/itest/nodes/one-jvm-hazelcast-client/src/test/java/itest/ClientTestCase.java
diff --git a/testing/itest/nodes/one-jvm-hazelcast/pom.xml b/testing/itest/nodes/one-jvm-hazelcast/pom.xml
new file mode 100644
index 0000000..c979b91
--- /dev/null
+++ b/testing/itest/nodes/one-jvm-hazelcast/pom.xml
@@ -0,0 +1,53 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-jvm-hazelcast</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One JVM Using Hazelcast Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-service-and-client</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java b/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java
rename to testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeOneContributionTestCase.java
diff --git a/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java b/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java
rename to testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/OneNodeTestCase.java
diff --git a/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java b/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java
rename to testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoNodeTestCase.java
diff --git a/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java b/testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java
rename to testing/itest/nodes/one-jvm-hazelcast/src/test/java/itest/TwoRemoteNodesTestCase.java
diff --git a/itest/nodes/one-jvm-tribes/pom.xml b/testing/itest/nodes/one-jvm-tribes/pom.xml
similarity index 100%
rename from itest/nodes/one-jvm-tribes/pom.xml
rename to testing/itest/nodes/one-jvm-tribes/pom.xml
diff --git a/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java b/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java
rename to testing/itest/nodes/one-jvm-tribes/src/test/java/itest/OneNodeTestCase.java
diff --git a/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java b/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java
rename to testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoNodeTestCase.java
diff --git a/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java b/testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java
rename to testing/itest/nodes/one-jvm-tribes/src/test/java/itest/TwoRemoteNodesTestCase.java
diff --git a/itest/nodes/one-jvm/pom.xml b/testing/itest/nodes/one-jvm/pom.xml
similarity index 100%
rename from itest/nodes/one-jvm/pom.xml
rename to testing/itest/nodes/one-jvm/pom.xml
diff --git a/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java b/testing/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java
rename to testing/itest/nodes/one-jvm/src/test/java/itest/OneNodeTestCase.java
diff --git a/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java b/testing/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java
rename to testing/itest/nodes/one-jvm/src/test/java/itest/TwoNodeTestCase.java
diff --git a/itest/nodes/one-node-test/pom.xml b/testing/itest/nodes/one-node-test/pom.xml
similarity index 100%
rename from itest/nodes/one-node-test/pom.xml
rename to testing/itest/nodes/one-node-test/pom.xml
diff --git a/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/testing/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
similarity index 100%
rename from itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
rename to testing/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
diff --git a/itest/nodes/pom.xml b/testing/itest/nodes/pom.xml
similarity index 100%
rename from itest/nodes/pom.xml
rename to testing/itest/nodes/pom.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/build.xml b/testing/itest/nodes/three-nodes-three-vms-test/build.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/build.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/build.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/client.xml b/testing/itest/nodes/three-nodes-three-vms-test/client.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/client.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/client.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/pom.xml b/testing/itest/nodes/three-nodes-three-vms-test/pom.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/pom.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/pom.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/server.xml b/testing/itest/nodes/three-nodes-three-vms-test/server.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/server.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/server.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/service-a-config.xml b/testing/itest/nodes/three-nodes-three-vms-test/service-a-config.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/service-a-config.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/service-a-config.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/service-b-config.xml b/testing/itest/nodes/three-nodes-three-vms-test/service-b-config.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/service-b-config.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/service-b-config.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/service-c-config.xml b/testing/itest/nodes/three-nodes-three-vms-test/service-c-config.xml
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/service-c-config.xml
rename to testing/itest/nodes/three-nodes-three-vms-test/service-c-config.xml
diff --git a/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java b/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java
rename to testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceA.java
diff --git a/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java b/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java
rename to testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceB.java
diff --git a/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java b/testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java
similarity index 100%
rename from itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java
rename to testing/itest/nodes/three-nodes-three-vms-test/src/test/java/itest/ServiceC.java
diff --git a/itest/nodes/two-nodes-test/pom.xml b/testing/itest/nodes/two-nodes-test/pom.xml
similarity index 100%
rename from itest/nodes/two-nodes-test/pom.xml
rename to testing/itest/nodes/two-nodes-test/pom.xml
diff --git a/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java b/testing/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
similarity index 100%
rename from itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
rename to testing/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
diff --git a/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java b/testing/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
similarity index 100%
rename from itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
rename to testing/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
diff --git a/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java b/testing/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java
similarity index 100%
rename from itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java
rename to testing/itest/nodes/two-nodes-test/src/test/java/itest/StopStartNodesTestCase.java
diff --git a/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java b/testing/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
similarity index 100%
rename from itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
rename to testing/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
diff --git a/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/testing/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
similarity index 100%
rename from itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
rename to testing/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/build.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/build.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/build.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/build.xml
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/client-config.xml
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/client.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/client.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/client.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/client.xml
diff --git a/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml
new file mode 100644
index 0000000..56678bd
--- /dev/null
+++ b/testing/itest/nodes/two-nodes-two-vms-hazelcast/pom.xml
@@ -0,0 +1,109 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-two-nodes-two-vms-hazelcast</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Two Nodes Two VMs Test using Hazelcast registry</name>
+
+ <dependencies>
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-node</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks unless="maven.test.skip">
+ <property name="tuscany.version" value="${version}" />
+ <property name="runtime_classpath" refid="maven.runtime.classpath"/>
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/scaclient.xml
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/server-config.xml
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/server.xml b/testing/itest/nodes/two-nodes-two-vms-hazelcast/server.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/server.xml
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/server.xml
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java b/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Client.java
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java b/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/SCAClient.java
diff --git a/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java b/testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
rename to testing/itest/nodes/two-nodes-two-vms-hazelcast/src/test/java/itest/Service.java
diff --git a/itest/nodes/two-nodes-two-vms-test/build.xml b/testing/itest/nodes/two-nodes-two-vms-test/build.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/build.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/build.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/client-config.xml b/testing/itest/nodes/two-nodes-two-vms-test/client-config.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/client-config.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/client-config.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/client.xml b/testing/itest/nodes/two-nodes-two-vms-test/client.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/client.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/client.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/pom.xml b/testing/itest/nodes/two-nodes-two-vms-test/pom.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/pom.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/pom.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/server-config.xml b/testing/itest/nodes/two-nodes-two-vms-test/server-config.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/server-config.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/server-config.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/server.xml b/testing/itest/nodes/two-nodes-two-vms-test/server.xml
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/server.xml
rename to testing/itest/nodes/two-nodes-two-vms-test/server.xml
diff --git a/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java b/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java
rename to testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Client.java
diff --git a/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java b/testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java
similarity index 100%
rename from itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java
rename to testing/itest/nodes/two-nodes-two-vms-test/src/test/java/itest/Service.java
diff --git a/itest/oneway/build.xml b/testing/itest/oneway/build.xml
similarity index 100%
rename from itest/oneway/build.xml
rename to testing/itest/oneway/build.xml
diff --git a/itest/oneway/pom.xml b/testing/itest/oneway/pom.xml
similarity index 100%
rename from itest/oneway/pom.xml
rename to testing/itest/oneway/pom.xml
diff --git a/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java b/testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java
similarity index 100%
rename from itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java
rename to testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayClient.java
diff --git a/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java b/testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java
similarity index 100%
rename from itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java
rename to testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/OneWayService.java
diff --git a/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java b/testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java
similarity index 100%
rename from itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java
rename to testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayClientImpl.java
diff --git a/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java b/testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java
similarity index 100%
rename from itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java
rename to testing/itest/oneway/src/main/java/org/apache/tuscany/sca/itest/oneway/impl/OneWayServiceImpl.java
diff --git a/itest/oneway/src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite b/testing/itest/oneway/src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite
similarity index 100%
rename from itest/oneway/src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite
rename to testing/itest/oneway/src/main/resources/OneWayContribution/META-INF/sca-deployables/oneWay.composite
diff --git a/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java b/testing/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java
similarity index 100%
rename from itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java
rename to testing/itest/oneway/src/test/java/org/apache/tuscany/sca/itest/oneway/OneWayTestCase.java
diff --git a/itest/operation-overloading/pom.xml b/testing/itest/operation-overloading/pom.xml
similarity index 100%
rename from itest/operation-overloading/pom.xml
rename to testing/itest/operation-overloading/pom.xml
diff --git a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java b/testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
similarity index 100%
rename from itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
rename to testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
diff --git a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java b/testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
similarity index 100%
rename from itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
rename to testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
diff --git a/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java b/testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
similarity index 100%
rename from itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
rename to testing/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
diff --git a/itest/operation-overloading/src/main/resources/OperationOverload.composite b/testing/itest/operation-overloading/src/main/resources/OperationOverload.composite
similarity index 100%
rename from itest/operation-overloading/src/main/resources/OperationOverload.composite
rename to testing/itest/operation-overloading/src/main/resources/OperationOverload.composite
diff --git a/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java b/testing/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
similarity index 100%
rename from itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
rename to testing/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
diff --git a/itest/policies/pom.xml b/testing/itest/policies/pom.xml
similarity index 100%
rename from itest/policies/pom.xml
rename to testing/itest/policies/pom.xml
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
diff --git a/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java b/testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
similarity index 100%
rename from itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
rename to testing/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
diff --git a/itest/policies/src/main/resources/Customer.composite b/testing/itest/policies/src/main/resources/Customer.composite
similarity index 100%
rename from itest/policies/src/main/resources/Customer.composite
rename to testing/itest/policies/src/main/resources/Customer.composite
diff --git a/itest/policies/src/main/resources/LoggingMessages.properties b/testing/itest/policies/src/main/resources/LoggingMessages.properties
similarity index 100%
rename from itest/policies/src/main/resources/LoggingMessages.properties
rename to testing/itest/policies/src/main/resources/LoggingMessages.properties
diff --git a/testing/itest/policies/src/main/resources/META-INF/definitions.xml b/testing/itest/policies/src/main/resources/META-INF/definitions.xml
new file mode 100644
index 0000000..d607832
--- /dev/null
+++ b/testing/itest/policies/src/main/resources/META-INF/definitions.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <policySet name="JDKLoggingPolicy"
+ provides="tuscany:logging"
+ appliesTo="//binding | //implementation">
+ <tuscany:jdkLogger name="test.logger">
+ <tuscany:logLevel>FINE</tuscany:logLevel>
+ <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
+ </tuscany:jdkLogger>
+
+ </policySet>
+
+ <policySet name="JDKLoggingImplPolicy"
+ provides="tuscany:logging"
+ appliesTo="//implementation.java"
+ attachTo="//sca:component[@name='CreditCardPayment']">
+ <tuscany:jdkLogger name="test.logger">
+ <tuscany:logLevel>INFO</tuscany:logLevel>
+ <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
+ </tuscany:jdkLogger>
+
+ </policySet>
+
+ <!-- A set of policy sets introduced just to ensure that intents are resolved -->
+
+ <policySet name="SuspendsTransactionPolicy"
+ provides="sca:suspendsTransaction"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:suspendsTransaction')"/>
+
+ <policySet name="AuthorizationFineGrainPolicy"
+ provides="sca:authorization.fineGrain"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:authorization') | IntentRefs('sca:authorization.fineGrain')"/>
+
+ <policySet name="ConfidentialityTransportPolicy"
+ provides="sca:confidentiality.transport"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:confidentiality.transport')"/>
+
+ <policySet name="ConfidentialityMessagePolicy"
+ provides="sca:confidentiality.message"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:confidentiality.message')"/>
+
+ <policySet name="ClientAuthenticationTransportPolicy"
+ provides="sca:clientAuthentication.transport"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:clientAuthentication.transport') | //sca:service[@name='CreditCardPayment']"/>
+
+ <policySet name="IntegrityTransportPolicy"
+ provides="sca:integrity.transport"
+ appliesTo="//binding.sca | //implementation.java"
+ attachTo="IntentRefs('sca:integrity.transport')"/>
+
+ <policySet name="ManagedTransactionGlobalPolicy"
+ provides="sca:managedTransaction.global"
+ appliesTo="//implementation.composite | //implementation.java"
+ attachTo="IntentRefs('sca:managedTransaction.global')"/>
+</definitions>
\ No newline at end of file
diff --git a/itest/policies/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/policies/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/policies/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/policies/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/policies/src/main/resources/Payment.composite b/testing/itest/policies/src/main/resources/Payment.composite
similarity index 100%
rename from itest/policies/src/main/resources/Payment.composite
rename to testing/itest/policies/src/main/resources/Payment.composite
diff --git a/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java b/testing/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
similarity index 100%
rename from itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
rename to testing/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
diff --git a/itest/policy-transaction/pom.xml b/testing/itest/policy-transaction/pom.xml
similarity index 100%
rename from itest/policy-transaction/pom.xml
rename to testing/itest/policy-transaction/pom.xml
diff --git a/itest/policy-transaction/src/main/java/customer/Customer.java b/testing/itest/policy-transaction/src/main/java/customer/Customer.java
similarity index 100%
rename from itest/policy-transaction/src/main/java/customer/Customer.java
rename to testing/itest/policy-transaction/src/main/java/customer/Customer.java
diff --git a/itest/policy-transaction/src/main/java/customer/CustomerRegistry.java b/testing/itest/policy-transaction/src/main/java/customer/CustomerRegistry.java
similarity index 100%
rename from itest/policy-transaction/src/main/java/customer/CustomerRegistry.java
rename to testing/itest/policy-transaction/src/main/java/customer/CustomerRegistry.java
diff --git a/itest/policy-transaction/src/main/java/customer/impl/CustomerRegistryImpl.java b/testing/itest/policy-transaction/src/main/java/customer/impl/CustomerRegistryImpl.java
similarity index 100%
rename from itest/policy-transaction/src/main/java/customer/impl/CustomerRegistryImpl.java
rename to testing/itest/policy-transaction/src/main/java/customer/impl/CustomerRegistryImpl.java
diff --git a/itest/policy-transaction/src/main/resources/Customer.composite b/testing/itest/policy-transaction/src/main/resources/Customer.composite
similarity index 100%
rename from itest/policy-transaction/src/main/resources/Customer.composite
rename to testing/itest/policy-transaction/src/main/resources/Customer.composite
diff --git a/itest/policy-transaction/src/test/java/org/apache/tuscany/sca/itest/policy/transaction/CustomerTestCase.java b/testing/itest/policy-transaction/src/test/java/org/apache/tuscany/sca/itest/policy/transaction/CustomerTestCase.java
similarity index 100%
rename from itest/policy-transaction/src/test/java/org/apache/tuscany/sca/itest/policy/transaction/CustomerTestCase.java
rename to testing/itest/policy-transaction/src/test/java/org/apache/tuscany/sca/itest/policy/transaction/CustomerTestCase.java
diff --git a/itest/policy/matching/pom.xml b/testing/itest/policy/matching/pom.xml
similarity index 100%
rename from itest/policy/matching/pom.xml
rename to testing/itest/policy/matching/pom.xml
diff --git a/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorld.java b/testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorld.java
similarity index 100%
rename from itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorld.java
rename to testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorld.java
diff --git a/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldClient.java b/testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldClient.java
rename to testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldClient.java
diff --git a/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldService.java b/testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldService.java
rename to testing/itest/policy/matching/src/main/java/org/apache/tuscany/sca/policy/matching/helloworld/HelloWorldService.java
diff --git a/itest/policy/matching/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/policy/matching/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/policy/matching/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/policy/matching/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/policy/matching/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/testing/itest/policy/matching/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
similarity index 100%
rename from itest/policy/matching/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
rename to testing/itest/policy/matching/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
diff --git a/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml b/testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml
similarity index 100%
rename from itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml
rename to testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/definitions.xml
diff --git a/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite b/testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite
similarity index 100%
rename from itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite
rename to testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.composite
diff --git a/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.wsdl b/testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.wsdl
rename to testing/itest/policy/matching/src/main/resources/org/apache/tuscany/sca/policy/matching/helloworld/helloworld.wsdl
diff --git a/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java b/testing/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java
similarity index 100%
rename from itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java
rename to testing/itest/policy/matching/src/test/java/org/apache/tuscany/sca/policy/matching/MatchingTestCase.java
diff --git a/itest/policy/pom.xml b/testing/itest/policy/pom.xml
similarity index 100%
rename from itest/policy/pom.xml
rename to testing/itest/policy/pom.xml
diff --git a/itest/policy/wspolicy/pom.xml b/testing/itest/policy/wspolicy/pom.xml
similarity index 100%
rename from itest/policy/wspolicy/pom.xml
rename to testing/itest/policy/wspolicy/pom.xml
diff --git a/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorld.java b/testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorld.java
similarity index 100%
rename from itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorld.java
rename to testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorld.java
diff --git a/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldClient.java b/testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldClient.java
rename to testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldClient.java
diff --git a/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldService.java b/testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldService.java
rename to testing/itest/policy/wspolicy/src/main/java/org/apache/tuscany/sca/policy/wspolicy/helloworld/HelloWorldService.java
diff --git a/itest/policy/wspolicy/src/main/resources/LoggingMessages.properties b/testing/itest/policy/wspolicy/src/main/resources/LoggingMessages.properties
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/LoggingMessages.properties
rename to testing/itest/policy/wspolicy/src/main/resources/LoggingMessages.properties
diff --git a/itest/policy/wspolicy/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/policy/wspolicy/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/policy/wspolicy/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/policy/wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/testing/itest/policy/wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
rename to testing/itest/policy/wspolicy/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
diff --git a/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml b/testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml
rename to testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/definitions.xml
diff --git a/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.composite b/testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.composite
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.composite
rename to testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.composite
diff --git a/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.wsdl b/testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.wsdl
rename to testing/itest/policy/wspolicy/src/main/resources/org/apache/tuscany/sca/policy/wspolicy/helloworld/helloworld.wsdl
diff --git a/itest/policy/wspolicy/src/test/java/org/apache/tuscany/sca/policy/wspolicy/WSPolicyTestCase.java b/testing/itest/policy/wspolicy/src/test/java/org/apache/tuscany/sca/policy/wspolicy/WSPolicyTestCase.java
similarity index 100%
rename from itest/policy/wspolicy/src/test/java/org/apache/tuscany/sca/policy/wspolicy/WSPolicyTestCase.java
rename to testing/itest/policy/wspolicy/src/test/java/org/apache/tuscany/sca/policy/wspolicy/WSPolicyTestCase.java
diff --git a/testing/itest/pom.xml b/testing/itest/pom.xml
new file mode 100644
index 0000000..b6352aa
--- /dev/null
+++ b/testing/itest/pom.xml
@@ -0,0 +1,111 @@
+<?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.
+--><project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-itest</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Integration Tests</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+ <modules>
+ <module>base</module>
+ <module>builder</module>
+ <module>bpel</module>
+ <module>callback-api</module>
+ <module>callback-basic</module>
+ <module>callback-complex-type</module>
+ <module>callback-multiple-wires</module>
+ <module>callback-separatethread</module>
+ <module>callback-two-composites</module>
+ <module>callback-two-nodes</module>
+ <module>component-type</module>
+ <module>contribution-folder</module>
+ <module>contribution-zip</module>
+<!-- why commented out?
+ <module>definitions-multiple</module>
+-->
+ <module>databindings</module>
+ <module>distribution</module>
+ <module>exceptions</module>
+ <module>implementation-spring</module>
+ <module>import-export</module>
+ <module>interfaces</module>
+ <module>jms</module>
+ <module>nodes</module>
+ <module>node-launcher-equinox</module>
+ <module>oneway</module>
+<!-- why commented out?
+ <module>operation-overloading</module>
+-->
+ <module>policy</module>
+ <module>policies</module>
+ <module>policy-transaction</module>
+<!-- wait until databinding-sdo is in
+ <module>properties</module>
+-->
+ <module>recursive-multi-level</module>
+ <module>references</module>
+ <module>scaclient-api</module>
+<!-- TUSCANY-3424 - SCAClient in JSE with OSGi runtime not yet supported
+ <module>scaclient-api-jse-osgi</module>
+-->
+ <module>scaclient-api-osgi</module>
+ <module>scaclient-api-remote</module>
+ <module>scopes</module>
+ <module>scdl</module>
+ <module>services</module>
+ <module>service-reference</module>
+ <module>wires</module>
+ <module>ws</module>
+ <module>ws-jaxws</module>
+ <module>async-interactions</module>
+ </modules>
+
+ <!-- We don't want to deploy any of the test modules -->
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/itest/properties/pom.xml b/testing/itest/properties/pom.xml
similarity index 100%
rename from itest/properties/pom.xml
rename to testing/itest/properties/pom.xml
diff --git a/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java b/testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
similarity index 100%
rename from itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
rename to testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
diff --git a/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java b/testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
similarity index 100%
rename from itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
rename to testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
diff --git a/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java b/testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
similarity index 100%
rename from itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
rename to testing/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Bar.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo1.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo2.java
diff --git a/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java b/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
similarity index 100%
rename from itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
rename to testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/cdi/Foo3.java
diff --git a/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java b/testing/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
similarity index 100%
rename from itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
rename to testing/itest/properties/src/main/java/test/jaxb/props/ObjectFactory.java
diff --git a/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java b/testing/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
similarity index 100%
rename from itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
rename to testing/itest/properties/src/main/java/test/jaxb/props/ReturnCodeProperties.java
diff --git a/itest/properties/src/main/java/test/jaxb/props/package-info.java b/testing/itest/properties/src/main/java/test/jaxb/props/package-info.java
similarity index 100%
rename from itest/properties/src/main/java/test/jaxb/props/package-info.java
rename to testing/itest/properties/src/main/java/test/jaxb/props/package-info.java
diff --git a/itest/properties/src/main/resources/ConstructorPropertyInjection.composite b/testing/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
similarity index 100%
rename from itest/properties/src/main/resources/ConstructorPropertyInjection.composite
rename to testing/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
diff --git a/itest/properties/src/main/resources/Outer.composite b/testing/itest/properties/src/main/resources/Outer.composite
similarity index 100%
rename from itest/properties/src/main/resources/Outer.composite
rename to testing/itest/properties/src/main/resources/Outer.composite
diff --git a/itest/properties/src/main/resources/OuterPropertyTest.composite b/testing/itest/properties/src/main/resources/OuterPropertyTest.composite
similarity index 100%
rename from itest/properties/src/main/resources/OuterPropertyTest.composite
rename to testing/itest/properties/src/main/resources/OuterPropertyTest.composite
diff --git a/itest/properties/src/main/resources/PropertyTest.composite b/testing/itest/properties/src/main/resources/PropertyTest.composite
similarity index 100%
rename from itest/properties/src/main/resources/PropertyTest.composite
rename to testing/itest/properties/src/main/resources/PropertyTest.composite
diff --git a/itest/properties/src/main/resources/customer.xsd b/testing/itest/properties/src/main/resources/customer.xsd
similarity index 100%
rename from itest/properties/src/main/resources/customer.xsd
rename to testing/itest/properties/src/main/resources/customer.xsd
diff --git a/itest/properties/src/main/resources/fileProperty.txt b/testing/itest/properties/src/main/resources/fileProperty.txt
similarity index 100%
rename from itest/properties/src/main/resources/fileProperty.txt
rename to testing/itest/properties/src/main/resources/fileProperty.txt
diff --git a/itest/properties/src/main/resources/foo.xsd b/testing/itest/properties/src/main/resources/foo.xsd
similarity index 100%
rename from itest/properties/src/main/resources/foo.xsd
rename to testing/itest/properties/src/main/resources/foo.xsd
diff --git a/itest/properties/src/main/resources/manyValuesFileProperty.txt b/testing/itest/properties/src/main/resources/manyValuesFileProperty.txt
similarity index 100%
rename from itest/properties/src/main/resources/manyValuesFileProperty.txt
rename to testing/itest/properties/src/main/resources/manyValuesFileProperty.txt
diff --git a/itest/properties/src/main/resources/mySimpleService.composite b/testing/itest/properties/src/main/resources/mySimpleService.composite
similarity index 100%
rename from itest/properties/src/main/resources/mySimpleService.composite
rename to testing/itest/properties/src/main/resources/mySimpleService.composite
diff --git a/itest/properties/src/main/resources/rcProps.txt b/testing/itest/properties/src/main/resources/rcProps.txt
similarity index 100%
rename from itest/properties/src/main/resources/rcProps.txt
rename to testing/itest/properties/src/main/resources/rcProps.txt
diff --git a/itest/properties/src/main/resources/rcprops.xsd b/testing/itest/properties/src/main/resources/rcprops.xsd
similarity index 100%
rename from itest/properties/src/main/resources/rcprops.xsd
rename to testing/itest/properties/src/main/resources/rcprops.xsd
diff --git a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java b/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
similarity index 100%
rename from itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
rename to testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
diff --git a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java b/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
similarity index 100%
rename from itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
rename to testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
diff --git a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java b/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
similarity index 100%
rename from itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
rename to testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
diff --git a/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java b/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
similarity index 100%
rename from itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
rename to testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/cdi/ConstructorPropertyInjectionTestCase.java
diff --git a/itest/recursive-multi-level/pom.xml b/testing/itest/recursive-multi-level/pom.xml
similarity index 100%
rename from itest/recursive-multi-level/pom.xml
rename to testing/itest/recursive-multi-level/pom.xml
diff --git a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java b/testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
similarity index 100%
rename from itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
rename to testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyService.java
diff --git a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java b/testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
similarity index 100%
rename from itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
rename to testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MyServiceImpl.java
diff --git a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java b/testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
similarity index 100%
rename from itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
rename to testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalService.java
diff --git a/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java b/testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
similarity index 100%
rename from itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
rename to testing/itest/recursive-multi-level/src/main/java/mysca/test/myservice/MySimpleTotalServiceImpl.java
diff --git a/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite b/testing/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
similarity index 100%
rename from itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
rename to testing/itest/recursive-multi-level/src/main/resources/TotalService1Auto.composite
diff --git a/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite b/testing/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
similarity index 100%
rename from itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
rename to testing/itest/recursive-multi-level/src/main/resources/TotalService2Auto.composite
diff --git a/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite b/testing/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
similarity index 100%
rename from itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
rename to testing/itest/recursive-multi-level/src/main/resources/TotalService3Auto.composite
diff --git a/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java b/testing/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
similarity index 100%
rename from itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
rename to testing/itest/recursive-multi-level/src/test/java/test/sca/tests/MultiLevelTestCase.java
diff --git a/itest/recursive-ws/pom.xml b/testing/itest/recursive-ws/pom.xml
similarity index 100%
rename from itest/recursive-ws/pom.xml
rename to testing/itest/recursive-ws/pom.xml
diff --git a/itest/recursive-ws/src/main/java/policy/Target.java b/testing/itest/recursive-ws/src/main/java/policy/Target.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/policy/Target.java
rename to testing/itest/recursive-ws/src/main/java/policy/Target.java
diff --git a/itest/recursive-ws/src/main/java/policy/TargetClientImpl.java b/testing/itest/recursive-ws/src/main/java/policy/TargetClientImpl.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/policy/TargetClientImpl.java
rename to testing/itest/recursive-ws/src/main/java/policy/TargetClientImpl.java
diff --git a/itest/recursive-ws/src/main/java/policy/TargetServiceImpl.java b/testing/itest/recursive-ws/src/main/java/policy/TargetServiceImpl.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/policy/TargetServiceImpl.java
rename to testing/itest/recursive-ws/src/main/java/policy/TargetServiceImpl.java
diff --git a/itest/recursive-ws/src/main/java/recursive/Composer.java b/testing/itest/recursive-ws/src/main/java/recursive/Composer.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/recursive/Composer.java
rename to testing/itest/recursive-ws/src/main/java/recursive/Composer.java
diff --git a/itest/recursive-ws/src/main/java/recursive/ComposerClient.java b/testing/itest/recursive-ws/src/main/java/recursive/ComposerClient.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/recursive/ComposerClient.java
rename to testing/itest/recursive-ws/src/main/java/recursive/ComposerClient.java
diff --git a/itest/recursive-ws/src/main/java/recursive/ComposerClientImpl.java b/testing/itest/recursive-ws/src/main/java/recursive/ComposerClientImpl.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/recursive/ComposerClientImpl.java
rename to testing/itest/recursive-ws/src/main/java/recursive/ComposerClientImpl.java
diff --git a/itest/recursive-ws/src/main/java/recursive/ComposerImpl.java b/testing/itest/recursive-ws/src/main/java/recursive/ComposerImpl.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/recursive/ComposerImpl.java
rename to testing/itest/recursive-ws/src/main/java/recursive/ComposerImpl.java
diff --git a/itest/recursive-ws/src/main/java/recursive/ComposerServer.java b/testing/itest/recursive-ws/src/main/java/recursive/ComposerServer.java
similarity index 100%
rename from itest/recursive-ws/src/main/java/recursive/ComposerServer.java
rename to testing/itest/recursive-ws/src/main/java/recursive/ComposerServer.java
diff --git a/itest/recursive-ws/src/main/resources/Client.composite b/testing/itest/recursive-ws/src/main/resources/Client.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/Client.composite
rename to testing/itest/recursive-ws/src/main/resources/Client.composite
diff --git a/itest/recursive-ws/src/main/resources/Inner.composite b/testing/itest/recursive-ws/src/main/resources/Inner.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/Inner.composite
rename to testing/itest/recursive-ws/src/main/resources/Inner.composite
diff --git a/itest/recursive-ws/src/main/resources/Outer.composite b/testing/itest/recursive-ws/src/main/resources/Outer.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/Outer.composite
rename to testing/itest/recursive-ws/src/main/resources/Outer.composite
diff --git a/itest/recursive-ws/src/main/resources/bindingoverride/InnerComposite.composite b/testing/itest/recursive-ws/src/main/resources/bindingoverride/InnerComposite.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/bindingoverride/InnerComposite.composite
rename to testing/itest/recursive-ws/src/main/resources/bindingoverride/InnerComposite.composite
diff --git a/itest/recursive-ws/src/main/resources/bindingoverride/OuterComposite.composite b/testing/itest/recursive-ws/src/main/resources/bindingoverride/OuterComposite.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/bindingoverride/OuterComposite.composite
rename to testing/itest/recursive-ws/src/main/resources/bindingoverride/OuterComposite.composite
diff --git a/itest/recursive-ws/src/main/resources/policy/PolicyInnerComposite.composite b/testing/itest/recursive-ws/src/main/resources/policy/PolicyInnerComposite.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/policy/PolicyInnerComposite.composite
rename to testing/itest/recursive-ws/src/main/resources/policy/PolicyInnerComposite.composite
diff --git a/itest/recursive-ws/src/main/resources/policy/PolicyOuterComposite.composite b/testing/itest/recursive-ws/src/main/resources/policy/PolicyOuterComposite.composite
similarity index 100%
rename from itest/recursive-ws/src/main/resources/policy/PolicyOuterComposite.composite
rename to testing/itest/recursive-ws/src/main/resources/policy/PolicyOuterComposite.composite
diff --git a/itest/recursive-ws/src/main/resources/policy/definitions.xml b/testing/itest/recursive-ws/src/main/resources/policy/definitions.xml
similarity index 100%
rename from itest/recursive-ws/src/main/resources/policy/definitions.xml
rename to testing/itest/recursive-ws/src/main/resources/policy/definitions.xml
diff --git a/itest/recursive-ws/src/test/java/bindingoverride/BindingOverrideTestCase.java b/testing/itest/recursive-ws/src/test/java/bindingoverride/BindingOverrideTestCase.java
similarity index 100%
rename from itest/recursive-ws/src/test/java/bindingoverride/BindingOverrideTestCase.java
rename to testing/itest/recursive-ws/src/test/java/bindingoverride/BindingOverrideTestCase.java
diff --git a/itest/recursive-ws/src/test/java/policy/PolicyTestCase.java b/testing/itest/recursive-ws/src/test/java/policy/PolicyTestCase.java
similarity index 100%
rename from itest/recursive-ws/src/test/java/policy/PolicyTestCase.java
rename to testing/itest/recursive-ws/src/test/java/policy/PolicyTestCase.java
diff --git a/itest/recursive-ws/src/test/java/recursive/ComposerClientTestCase.java b/testing/itest/recursive-ws/src/test/java/recursive/ComposerClientTestCase.java
similarity index 100%
rename from itest/recursive-ws/src/test/java/recursive/ComposerClientTestCase.java
rename to testing/itest/recursive-ws/src/test/java/recursive/ComposerClientTestCase.java
diff --git a/itest/recursive-ws/src/test/java/recursive/ComposerTestServer.java b/testing/itest/recursive-ws/src/test/java/recursive/ComposerTestServer.java
similarity index 100%
rename from itest/recursive-ws/src/test/java/recursive/ComposerTestServer.java
rename to testing/itest/recursive-ws/src/test/java/recursive/ComposerTestServer.java
diff --git a/itest/references/pom.xml b/testing/itest/references/pom.xml
similarity index 100%
rename from itest/references/pom.xml
rename to testing/itest/references/pom.xml
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponent.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/AComponentImpl.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponent.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentImpl.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/BComponentWrongTargetImpl.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponent.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/CComponentImpl.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponent.java
diff --git a/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java b/testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
similarity index 100%
rename from itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
rename to testing/itest/references/src/main/java/org/apache/tuscany/sca/itest/references/DComponentImpl.java
diff --git a/itest/references/src/main/resources/AutoWiredReferencesTest.composite b/testing/itest/references/src/main/resources/AutoWiredReferencesTest.composite
similarity index 100%
rename from itest/references/src/main/resources/AutoWiredReferencesTest.composite
rename to testing/itest/references/src/main/resources/AutoWiredReferencesTest.composite
diff --git a/itest/references/src/main/resources/InnerReferencesTest.composite b/testing/itest/references/src/main/resources/InnerReferencesTest.composite
similarity index 100%
rename from itest/references/src/main/resources/InnerReferencesTest.composite
rename to testing/itest/references/src/main/resources/InnerReferencesTest.composite
diff --git a/itest/references/src/main/resources/ManualWiredReferencesTest.composite b/testing/itest/references/src/main/resources/ManualWiredReferencesTest.composite
similarity index 100%
rename from itest/references/src/main/resources/ManualWiredReferencesTest.composite
rename to testing/itest/references/src/main/resources/ManualWiredReferencesTest.composite
diff --git a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java b/testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
similarity index 100%
rename from itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
rename to testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/AutoWiredReferenceTestCase.java
diff --git a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java b/testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
similarity index 100%
rename from itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
rename to testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/InnerReferenceTestCase.java
diff --git a/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java b/testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
similarity index 100%
rename from itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
rename to testing/itest/references/src/test/java/org/apache/tuscany/sca/itest/references/ManualWiredReferenceTestCase.java
diff --git a/itest/samples/helloworld/pom.xml b/testing/itest/samples/helloworld/pom.xml
similarity index 100%
rename from itest/samples/helloworld/pom.xml
rename to testing/itest/samples/helloworld/pom.xml
diff --git a/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java b/testing/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
similarity index 100%
rename from itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
rename to testing/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
diff --git a/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java b/testing/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
similarity index 100%
rename from itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
rename to testing/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
diff --git a/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java b/testing/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
similarity index 100%
rename from itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
rename to testing/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
diff --git a/itest/scaclient-api-jse-osgi/pom.xml b/testing/itest/scaclient-api-jse-osgi/pom.xml
similarity index 100%
rename from itest/scaclient-api-jse-osgi/pom.xml
rename to testing/itest/scaclient-api-jse-osgi/pom.xml
diff --git a/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldService.java b/testing/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldService.java
similarity index 100%
rename from itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldService.java
rename to testing/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldService.java
diff --git a/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldServiceImpl.java b/testing/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldServiceImpl.java
similarity index 100%
rename from itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldServiceImpl.java
rename to testing/itest/scaclient-api-jse-osgi/src/main/java/itest/HelloworldServiceImpl.java
diff --git a/itest/scaclient-api-jse-osgi/src/main/resources/Helloworld.composite b/testing/itest/scaclient-api-jse-osgi/src/main/resources/Helloworld.composite
similarity index 100%
rename from itest/scaclient-api-jse-osgi/src/main/resources/Helloworld.composite
rename to testing/itest/scaclient-api-jse-osgi/src/main/resources/Helloworld.composite
diff --git a/itest/scaclient-api-jse-osgi/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/scaclient-api-jse-osgi/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/scaclient-api-jse-osgi/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/scaclient-api-jse-osgi/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java b/testing/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
similarity index 100%
rename from itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
rename to testing/itest/scaclient-api-jse-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
diff --git a/itest/scaclient-api-osgi/META-INF/MANIFEST.MF b/testing/itest/scaclient-api-osgi/META-INF/MANIFEST.MF
similarity index 100%
rename from itest/scaclient-api-osgi/META-INF/MANIFEST.MF
rename to testing/itest/scaclient-api-osgi/META-INF/MANIFEST.MF
diff --git a/itest/scaclient-api-osgi/pom.xml b/testing/itest/scaclient-api-osgi/pom.xml
similarity index 100%
rename from itest/scaclient-api-osgi/pom.xml
rename to testing/itest/scaclient-api-osgi/pom.xml
diff --git a/itest/scaclient-api-osgi/src/main/java/itest/HelloworldService.java b/testing/itest/scaclient-api-osgi/src/main/java/itest/HelloworldService.java
similarity index 100%
rename from itest/scaclient-api-osgi/src/main/java/itest/HelloworldService.java
rename to testing/itest/scaclient-api-osgi/src/main/java/itest/HelloworldService.java
diff --git a/itest/scaclient-api-osgi/src/main/java/itest/HelloworldServiceImpl.java b/testing/itest/scaclient-api-osgi/src/main/java/itest/HelloworldServiceImpl.java
similarity index 100%
rename from itest/scaclient-api-osgi/src/main/java/itest/HelloworldServiceImpl.java
rename to testing/itest/scaclient-api-osgi/src/main/java/itest/HelloworldServiceImpl.java
diff --git a/itest/scaclient-api-osgi/src/main/resources/Helloworld.composite b/testing/itest/scaclient-api-osgi/src/main/resources/Helloworld.composite
similarity index 100%
rename from itest/scaclient-api-osgi/src/main/resources/Helloworld.composite
rename to testing/itest/scaclient-api-osgi/src/main/resources/Helloworld.composite
diff --git a/itest/scaclient-api-osgi/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/scaclient-api-osgi/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/scaclient-api-osgi/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/scaclient-api-osgi/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java b/testing/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
similarity index 100%
rename from itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
rename to testing/itest/scaclient-api-osgi/src/test/java/test/scaclient/SCAClientTestCase.java
diff --git a/testing/itest/scaclient-api-remote/pom.xml b/testing/itest/scaclient-api-remote/pom.xml
new file mode 100644
index 0000000..3fd7268
--- /dev/null
+++ b/testing/itest/scaclient-api-remote/pom.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-scaclient-api-remote</artifactId>
+ <name>Apache Tuscany SCA iTest SCAClient API with Hazelcast client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/itest/scaclient-api-remote/src/main/java/itest/HelloworldService.java b/testing/itest/scaclient-api-remote/src/main/java/itest/HelloworldService.java
similarity index 100%
rename from itest/scaclient-api-remote/src/main/java/itest/HelloworldService.java
rename to testing/itest/scaclient-api-remote/src/main/java/itest/HelloworldService.java
diff --git a/itest/scaclient-api-remote/src/main/java/itest/HelloworldServiceImpl.java b/testing/itest/scaclient-api-remote/src/main/java/itest/HelloworldServiceImpl.java
similarity index 100%
rename from itest/scaclient-api-remote/src/main/java/itest/HelloworldServiceImpl.java
rename to testing/itest/scaclient-api-remote/src/main/java/itest/HelloworldServiceImpl.java
diff --git a/itest/scaclient-api-remote/src/main/resources/Helloworld.composite b/testing/itest/scaclient-api-remote/src/main/resources/Helloworld.composite
similarity index 100%
rename from itest/scaclient-api-remote/src/main/resources/Helloworld.composite
rename to testing/itest/scaclient-api-remote/src/main/resources/Helloworld.composite
diff --git a/itest/scaclient-api-remote/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/scaclient-api-remote/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/scaclient-api-remote/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/scaclient-api-remote/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java b/testing/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java
new file mode 100644
index 0000000..432d51d
--- /dev/null
+++ b/testing/itest/scaclient-api-remote/src/test/java/test/scaclient/SCAClientTestCase.java
@@ -0,0 +1,121 @@
+/*
+ * 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 test.scaclient;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import itest.HelloworldService;
+
+import java.net.URI;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev: 904064 $ $Date: 2010-01-28 12:31:36 +0000 (Thu, 28 Jan 2010) $
+ */
+public class SCAClientTestCase {
+
+ private Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+ @Test
+ public void testDefault() throws Exception {
+
+ node = NodeFactory.newInstance().createNode((String)null, new String[] {"target/classes"});
+ node.start();
+
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Test
+ public void testURIconfig() throws Exception {
+
+ node = NodeFactory.newInstance("uri:somedomain").createNode((String)null, new String[] {"target/classes"});
+ node.start();
+
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("somedomain")).getService(HelloworldService.class, "HelloworldComponent");
+ assertEquals("Hello petra", service.sayHello("petra"));
+ try {
+ service = SCAClientFactory.newInstance(URI.create("nosuchdomain")).getService(HelloworldService.class, "HelloworldComponent");
+ service.sayHello("petra");
+ fail();
+ } catch (NoSuchDomainException e) {
+ //expected
+ }
+ }
+
+ @Test
+ public void testExplicit() throws Exception {
+ node = NodeFactory.newInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+ node.start();
+
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Test
+ public void testExplicitRemote() throws Exception {
+ node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
+ node.start();
+
+ // TUSCANY-3670 - why factory takes URI while node factory take configuration string?
+ // hacked this for now to make the client domain name match the domain
+ // name that's pulled out of the factory URI
+ //HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Test
+ public void testExplicitRemote2() throws Exception {
+ node = NodeFactory.newInstance("uri:myFooDomain?bind=127.0.0.1:14821").createNode((String)null, new String[] {"target/classes"});
+ node.start();
+
+ // TUSCANY-3670 - why factory takes URI while node factory take configuration string?
+ // hacked this for now to make the client domain name match the domain
+ // name that's pulled out of the factory URI
+ //HelloworldService service = SCAClientFactory.newInstance(URI.create("uri:myFooDomain?wka=127.0.0.1:14821")).getService(HelloworldService.class, "HelloworldComponent");
+ HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/itest/scaclient-api/pom.xml b/testing/itest/scaclient-api/pom.xml
similarity index 100%
rename from itest/scaclient-api/pom.xml
rename to testing/itest/scaclient-api/pom.xml
diff --git a/itest/scaclient-api/src/main/java/itest/HelloworldService.java b/testing/itest/scaclient-api/src/main/java/itest/HelloworldService.java
similarity index 100%
rename from itest/scaclient-api/src/main/java/itest/HelloworldService.java
rename to testing/itest/scaclient-api/src/main/java/itest/HelloworldService.java
diff --git a/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java b/testing/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
similarity index 100%
rename from itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
rename to testing/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
diff --git a/itest/scaclient-api/src/main/java/itest/RemoteHelloworldService.java b/testing/itest/scaclient-api/src/main/java/itest/RemoteHelloworldService.java
similarity index 100%
rename from itest/scaclient-api/src/main/java/itest/RemoteHelloworldService.java
rename to testing/itest/scaclient-api/src/main/java/itest/RemoteHelloworldService.java
diff --git a/itest/scaclient-api/src/main/resources/Helloworld.composite b/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
similarity index 100%
rename from itest/scaclient-api/src/main/resources/Helloworld.composite
rename to testing/itest/scaclient-api/src/main/resources/Helloworld.composite
diff --git a/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java b/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
new file mode 100644
index 0000000..c64350e
--- /dev/null
+++ b/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
@@ -0,0 +1,125 @@
+/*
+ * 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 test.scaclient;
+
+import itest.HelloworldService;
+import itest.RemoteHelloworldService;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCAClientTestCase extends TestCase {
+
+ private Node node;
+
+ @Test
+ public void testDefault() throws Exception {
+
+ node = NodeFactory.getInstance().createNode((String)null, new String[] {"target/classes"});
+ node.start();
+
+ SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("default"));
+ HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
+ assertEquals("Hello petra", service.sayHello("petra"));
+
+ RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
+ assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
+
+ }
+
+ @Test
+ public void testExplicit() throws Exception {
+ node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+ node.start();
+
+ SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
+ HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent/HelloworldService");
+ assertEquals("Hello petra", service.sayHello("petra"));
+
+ RemoteHelloworldService remoteService = clientFactory.getService(RemoteHelloworldService.class, "HelloworldComponent/RemoteHelloworldService");
+ assertEquals("Hello petra", remoteService.sayHelloRemote("petra"));
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+// @Test
+// public void testWithoutServiceName() throws Exception {
+// node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+// node.start();
+//
+// SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
+// HelloworldService service = clientFactory.getService(HelloworldService.class, "HelloworldComponent");
+// assertEquals("Hello petra", service.sayHello("petra"));
+// }
+
+ @Test
+ public void testWithBadServiceName() throws Exception {
+ node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+ node.start();
+
+ SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
+ try {
+ clientFactory.getService(HelloworldService.class, "HelloworldComponent/foo");
+ fail();
+ } catch (NoSuchServiceException e) {
+ // expected
+ }
+ }
+
+ @Test
+ public void testWithBadDomainName() throws Exception {
+ node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+ node.start();
+
+ try {
+ SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("someBadDomainName"));
+ fail();
+ } catch (NoSuchDomainException e) {
+ // expected
+ }
+ }
+
+ // @Test @Ignore
+// public void testHTTPURI() throws Exception {
+// node = NodeFactory.getInstance().createNode(URI.create("http://defaultDomain"), new String[] {"target/classes"});
+// node.start();
+//
+// HelloworldService service = SCAClientFactory.newInstance(URI.create("http://defaultDomain")).getService(HelloworldService.class, "HelloworldComponent");
+// assertEquals("Hello petra", service.sayHello("petra"));
+// }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/itest/scdl/pom.xml b/testing/itest/scdl/pom.xml
similarity index 100%
rename from itest/scdl/pom.xml
rename to testing/itest/scdl/pom.xml
diff --git a/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java b/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java
new file mode 100644
index 0000000..50587ca
--- /dev/null
+++ b/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ContributionTestCase.java
@@ -0,0 +1,80 @@
+/*
+ * 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.sca.itest.scdl;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.deployment.DefaultDeployer;
+import org.apache.tuscany.sca.deployment.Deployer;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for reading and writing SCDL
+ */
+public class ContributionTestCase {
+
+ @Test
+ public void testRead() throws Exception {
+ Deployer deployer = new DefaultDeployer();
+ File file = new File("../../../samples/learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar");
+ URL url = file.toURI().toURL();
+ Monitor monitor = deployer.createMonitor();
+ Contribution contribution = deployer.loadContribution(url.toURI(), url, monitor);
+ deployer.build(Arrays.asList(contribution), Arrays.asList(contribution), null, monitor);
+
+ // Ferkle around in the contribution verifying it looks as expected
+ Assert.assertNotNull(contribution);
+ List<Composite> deployables = contribution.getDeployables();
+ Assert.assertEquals(2, deployables.size());
+ Composite calculatorComposte = deployables.get(0);
+ Assert.assertEquals("Calculator", calculatorComposte.getName().getLocalPart());
+ Assert.assertEquals(5, calculatorComposte.getComponents().size());
+ Component calcComp = calculatorComposte.getComponent("CalculatorServiceComponent");
+ Assert.assertNotNull(calcComp);
+ Assert.assertEquals(4, calcComp.getReferences().size());
+ Reference ref = calcComp.getReference("addService");
+ Assert.assertEquals("AddServiceComponent", ref.getTargets().get(0).getName());
+ Implementation impl = calcComp.getImplementation();
+ Assert.assertTrue(impl instanceof JavaImplementation);
+ Assert.assertEquals("calculator.CalculatorServiceImpl", ((JavaImplementation)impl).getJavaClass().getName());
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+}
diff --git a/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java b/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
similarity index 100%
rename from itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
rename to testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
diff --git a/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java b/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java
new file mode 100644
index 0000000..7923492
--- /dev/null
+++ b/testing/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/ValidateDependenciesTestCase.java
@@ -0,0 +1,85 @@
+/*
+ * 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.sca.itest.scdl;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+/**
+ * Test case for verifying only SCDL jars are needed
+ *
+ * Uses maven-dependency-plugin config in the pom.xml
+ *
+ * Current required jars are:
+ *
+ * activation-1.1.jar
+ * asm-3.1.jar
+ * geronimo-stax-api_1.0_spec-1.0.1.jar
+ * jaxb-api-2.1.jar
+ * jaxb-impl-2.1.12.jar
+ * jaxws-api-2.1.jar
+ * jsr181-api-1.0-MR1.jar
+ * jsr250-api-1.0.jar
+ * junit-4.8.1.jar
+ * tuscany-assembly-2.0-SNAPSHOT.jar
+ * tuscany-assembly-xml-2.0-SNAPSHOT.jar
+ * tuscany-assembly-xsd-2.0-SNAPSHOT.jar
+ * tuscany-binding-http-2.0-SNAPSHOT.jar
+ * tuscany-binding-jms-2.0-SNAPSHOT.jar
+ * tuscany-binding-jsonp-2.0-SNAPSHOT.jar
+ * tuscany-binding-rmi-2.0-SNAPSHOT.jar
+ * tuscany-binding-ws-2.0-SNAPSHOT.jar
+ * tuscany-builder-2.0-SNAPSHOT.jar
+ * tuscany-common-java-2.0-SNAPSHOT.jar
+ * tuscany-common-xml-2.0-SNAPSHOT.jar
+ * tuscany-contribution-2.0-SNAPSHOT.jar
+ * tuscany-core-spi-2.0-SNAPSHOT.jar
+ * tuscany-databinding-2.0-SNAPSHOT.jar
+ * tuscany-databinding-jaxb-2.0-SNAPSHOT.jar
+ * tuscany-deployment-2.0-SNAPSHOT.jar
+ * tuscany-extensibility-2.0-SNAPSHOT.jar
+ * tuscany-implementation-java-2.0-SNAPSHOT.jar
+ * tuscany-interface-java-2.0-SNAPSHOT.jar
+ * tuscany-interface-java-jaxws-2.0-SNAPSHOT.jar
+ * tuscany-interface-wsdl-2.0-SNAPSHOT.jar
+ * tuscany-monitor-2.0-SNAPSHOT.jar
+ * tuscany-sca-api-2.0-SNAPSHOT.jar
+ * tuscany-xsd-2.0-SNAPSHOT.jar
+ * wsdl4j-1.6.2.jar
+ * wstx-asl-3.2.4.jar
+ * XmlSchema-1.4.3.jar
+ *
+ * TODO: WS binding drags in all runtime
+ */
+public class ValidateDependenciesTestCase {
+
+ @Test
+ public void countDependencies() {
+
+ File dependenciesDir = new File("target/dependency");
+ Assert.assertTrue(dependenciesDir.exists());
+
+ File[] dependencyFiles = dependenciesDir.listFiles();
+ Assert.assertEquals(36, dependencyFiles.length);
+ }
+}
diff --git a/itest/scdl/src/test/resources/test.composite b/testing/itest/scdl/src/test/resources/test.composite
similarity index 100%
rename from itest/scdl/src/test/resources/test.composite
rename to testing/itest/scdl/src/test/resources/test.composite
diff --git a/itest/scopes/pom.xml b/testing/itest/scopes/pom.xml
similarity index 100%
rename from itest/scopes/pom.xml
rename to testing/itest/scopes/pom.xml
diff --git a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java b/testing/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
similarity index 100%
rename from itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
rename to testing/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/CompositeScopeStateVerifierImpl.java
diff --git a/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java b/testing/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
similarity index 100%
rename from itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
rename to testing/itest/scopes/src/main/java/org/apache/tuscany/sca/itest/scopes/StateVerifier.java
diff --git a/itest/scopes/src/main/resources/scopes.composite b/testing/itest/scopes/src/main/resources/scopes.composite
similarity index 100%
rename from itest/scopes/src/main/resources/scopes.composite
rename to testing/itest/scopes/src/main/resources/scopes.composite
diff --git a/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java b/testing/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
similarity index 100%
rename from itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
rename to testing/itest/scopes/src/test/java/org/apache/tuscany/sca/test/ScopeTestCase.java
diff --git a/itest/service-reference/pom.xml b/testing/itest/service-reference/pom.xml
similarity index 100%
rename from itest/service-reference/pom.xml
rename to testing/itest/service-reference/pom.xml
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponent.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponent.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponent.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponent.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponentImpl.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponentImpl.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponentImpl.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/AComponentImpl.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponent.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponent.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponent.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponent.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponentImpl.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponentImpl.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponentImpl.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/BComponentImpl.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/Base64Binary.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/Base64Binary.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/Base64Binary.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/Base64Binary.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponent.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponent.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponent.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponent.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponentImpl.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponentImpl.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponentImpl.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/CComponentImpl.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponent.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponent.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponent.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponent.java
diff --git a/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponentImpl.java b/testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponentImpl.java
similarity index 100%
rename from itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponentImpl.java
rename to testing/itest/service-reference/src/main/java/org/apache/tuscany/sca/itest/serviceref/DComponentImpl.java
diff --git a/itest/service-reference/src/main/resources/nodeA/CompositeA.composite b/testing/itest/service-reference/src/main/resources/nodeA/CompositeA.composite
similarity index 100%
rename from itest/service-reference/src/main/resources/nodeA/CompositeA.composite
rename to testing/itest/service-reference/src/main/resources/nodeA/CompositeA.composite
diff --git a/itest/service-reference/src/main/resources/nodeB/CompositeB.composite b/testing/itest/service-reference/src/main/resources/nodeB/CompositeB.composite
similarity index 100%
rename from itest/service-reference/src/main/resources/nodeB/CompositeB.composite
rename to testing/itest/service-reference/src/main/resources/nodeB/CompositeB.composite
diff --git a/itest/service-reference/src/main/resources/servicereference/ServiceReferenceTest.composite b/testing/itest/service-reference/src/main/resources/servicereference/ServiceReferenceTest.composite
similarity index 100%
rename from itest/service-reference/src/main/resources/servicereference/ServiceReferenceTest.composite
rename to testing/itest/service-reference/src/main/resources/servicereference/ServiceReferenceTest.composite
diff --git a/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/CallableReferenceRemoteTestCase.java b/testing/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/CallableReferenceRemoteTestCase.java
similarity index 100%
rename from itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/CallableReferenceRemoteTestCase.java
rename to testing/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/CallableReferenceRemoteTestCase.java
diff --git a/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/ServiceReferenceTestCase.java b/testing/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/ServiceReferenceTestCase.java
similarity index 100%
rename from itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/ServiceReferenceTestCase.java
rename to testing/itest/service-reference/src/test/java/org/apache/tuscany/sca/itest/serviceref/ServiceReferenceTestCase.java
diff --git a/itest/services/pom.xml b/testing/itest/services/pom.xml
similarity index 100%
rename from itest/services/pom.xml
rename to testing/itest/services/pom.xml
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponent.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/AComponentImpl.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponent.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/BComponentImpl.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponent.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/CComponentImpl.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/D1Component.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponent.java
diff --git a/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java b/testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
similarity index 100%
rename from itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
rename to testing/itest/services/src/main/java/org/apache/tuscany/sca/itest/services/DComponentImpl.java
diff --git a/itest/services/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/services/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/services/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/services/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/services/src/main/resources/ServicesTest.composite b/testing/itest/services/src/main/resources/ServicesTest.composite
similarity index 100%
rename from itest/services/src/main/resources/ServicesTest.composite
rename to testing/itest/services/src/main/resources/ServicesTest.composite
diff --git a/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java b/testing/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
similarity index 100%
rename from itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
rename to testing/itest/services/src/test/java/org/apache/tuscany/sca/itest/services/ServicesTestCase.java
diff --git a/itest/wires/pom.xml b/testing/itest/wires/pom.xml
similarity index 100%
rename from itest/wires/pom.xml
rename to testing/itest/wires/pom.xml
diff --git a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java b/testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
similarity index 100%
rename from itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
rename to testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClient.java
diff --git a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java b/testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
similarity index 100%
rename from itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
rename to testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireClientImpl.java
diff --git a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java b/testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
similarity index 100%
rename from itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
rename to testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireService.java
diff --git a/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java b/testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
similarity index 100%
rename from itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
rename to testing/itest/wires/src/main/java/org/apache/tuscany/sca/itest/WireServiceImpl.java
diff --git a/itest/wires/src/main/resources/WireTest.composite b/testing/itest/wires/src/main/resources/WireTest.composite
similarity index 100%
rename from itest/wires/src/main/resources/WireTest.composite
rename to testing/itest/wires/src/main/resources/WireTest.composite
diff --git a/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java b/testing/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
similarity index 100%
rename from itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
rename to testing/itest/wires/src/test/java/org/apache/tuscany/sca/itest/WireTestCase.java
diff --git a/itest/ws-jaxws/README b/testing/itest/ws-jaxws/README
similarity index 100%
rename from itest/ws-jaxws/README
rename to testing/itest/ws-jaxws/README
diff --git a/itest/ws-jaxws/contribution-java-first/pom.xml b/testing/itest/ws-jaxws/contribution-java-first/pom.xml
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/pom.xml
rename to testing/itest/ws-jaxws/contribution-java-first/pom.xml
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Bar.java b/testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Bar.java
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Bar.java
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Bar.java
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Foo.java b/testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Foo.java
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Foo.java
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/Foo.java
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorld.java b/testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorld.java
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorld.java
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorld.java
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorldImpl.java b/testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorldImpl.java
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/HelloWorldImpl.java
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws-jaxws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws-jaxws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld.composite b/testing/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld.composite
rename to testing/itest/ws-jaxws/contribution-java-first/src/main/resources/helloworld.composite
diff --git a/itest/ws-jaxws/contribution-wsdl-first/pom.xml b/testing/itest/ws-jaxws/contribution-wsdl-first/pom.xml
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/pom.xml
rename to testing/itest/ws-jaxws/contribution-wsdl-first/pom.xml
diff --git a/itest/ws-jaxws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/impl/HelloWorldImpl.java b/testing/itest/ws-jaxws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/impl/HelloWorldImpl.java
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/impl/HelloWorldImpl.java
rename to testing/itest/ws-jaxws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/impl/HelloWorldImpl.java
diff --git a/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-external.wsdl b/testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-external.wsdl
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-external.wsdl
rename to testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-external.wsdl
diff --git a/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-sca.wsdl b/testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-sca.wsdl
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-sca.wsdl
rename to testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld-sca.wsdl
diff --git a/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld.composite b/testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld.composite
rename to testing/itest/ws-jaxws/contribution-wsdl-first/src/main/resources/helloworld.composite
diff --git a/itest/ws-jaxws/external-client/pom.xml b/testing/itest/ws-jaxws/external-client/pom.xml
similarity index 100%
rename from itest/ws-jaxws/external-client/pom.xml
rename to testing/itest/ws-jaxws/external-client/pom.xml
diff --git a/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java b/testing/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
similarity index 100%
rename from itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
rename to testing/itest/ws-jaxws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
diff --git a/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl b/testing/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl
similarity index 100%
rename from itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl
rename to testing/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService.wsdl
diff --git a/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd b/testing/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
similarity index 100%
rename from itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
rename to testing/itest/ws-jaxws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
diff --git a/itest/ws-jaxws/external-service/pom.xml b/testing/itest/ws-jaxws/external-service/pom.xml
similarity index 100%
rename from itest/ws-jaxws/external-service/pom.xml
rename to testing/itest/ws-jaxws/external-service/pom.xml
diff --git a/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java b/testing/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
similarity index 100%
rename from itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
rename to testing/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
diff --git a/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java b/testing/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
similarity index 100%
rename from itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
rename to testing/itest/ws-jaxws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
diff --git a/itest/ws-jaxws/launcher-ri/pom.xml b/testing/itest/ws-jaxws/launcher-ri/pom.xml
similarity index 100%
rename from itest/ws-jaxws/launcher-ri/pom.xml
rename to testing/itest/ws-jaxws/launcher-ri/pom.xml
diff --git a/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/JavaFirstTestCase.java b/testing/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/JavaFirstTestCase.java
similarity index 100%
rename from itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/JavaFirstTestCase.java
rename to testing/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/JavaFirstTestCase.java
diff --git a/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/WSDLFirstTestCaseOFF.java b/testing/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/WSDLFirstTestCaseOFF.java
similarity index 100%
rename from itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/WSDLFirstTestCaseOFF.java
rename to testing/itest/ws-jaxws/launcher-ri/src/test/java/org/apache/tuscany/sca/binding/ws/jaxws/launcher/WSDLFirstTestCaseOFF.java
diff --git a/itest/ws-jaxws/pom.xml b/testing/itest/ws-jaxws/pom.xml
similarity index 100%
rename from itest/ws-jaxws/pom.xml
rename to testing/itest/ws-jaxws/pom.xml
diff --git a/itest/ws/README b/testing/itest/ws/README
similarity index 100%
rename from itest/ws/README
rename to testing/itest/ws/README
diff --git a/itest/ws/authentication-basic/pom.xml b/testing/itest/ws/authentication-basic/pom.xml
similarity index 100%
rename from itest/ws/authentication-basic/pom.xml
rename to testing/itest/ws/authentication-basic/pom.xml
diff --git a/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java b/testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
similarity index 100%
rename from itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
rename to testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
diff --git a/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java b/testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
rename to testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
diff --git a/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java b/testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
rename to testing/itest/ws/authentication-basic/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
diff --git a/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/authentication-basic/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/testing/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
similarity index 100%
rename from itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
rename to testing/itest/ws/authentication-basic/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
diff --git a/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml b/testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
similarity index 100%
rename from itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
rename to testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
diff --git a/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite b/testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
similarity index 100%
rename from itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
rename to testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
diff --git a/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl b/testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
rename to testing/itest/ws/authentication-basic/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
diff --git a/testing/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java b/testing/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java
new file mode 100644
index 0000000..380fc5b
--- /dev/null
+++ b/testing/itest/ws/authentication-basic/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloworldTestCase.java
@@ -0,0 +1,52 @@
+/*
+ * 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.sca.binding.ws.axis2;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Ignore;
+
+//@Ignore("TUSCANY-3631")
+public class HelloworldTestCase extends TestCase {
+
+ private Node node;
+ private HelloWorld helloWorld;
+
+ public void testCalculator() throws Exception {
+ assertEquals("Hello fred myname", helloWorld.getGreetings("fred"));
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes"));
+ node.start();
+ helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/itest/ws/contribution-callback-forwardspec/pom.xml b/testing/itest/ws/contribution-callback-forwardspec/pom.xml
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/pom.xml
rename to testing/itest/ws/contribution-callback-forwardspec/pom.xml
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java b/testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java b/testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java b/testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-callback-forwardspec/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-callback-forwardspec/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-callback-forwardspec/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-callback-fullspec/pom.xml b/testing/itest/ws/contribution-callback-fullspec/pom.xml
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/pom.xml
rename to testing/itest/ws/contribution-callback-fullspec/pom.xml
diff --git a/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java b/testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
rename to testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
diff --git a/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java b/testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
rename to testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
diff --git a/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java b/testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
rename to testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
diff --git a/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
rename to testing/itest/ws/contribution-callback-fullspec/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
diff --git a/itest/ws/contribution-callback-fullspec/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-callback-fullspec/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-callback-fullspec/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-callback-fullspec/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-callback-fullspec/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-callback-fullspec/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-callback-fullspec/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-callback-fullspec/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-callback-promotion/pom.xml b/testing/itest/ws/contribution-callback-promotion/pom.xml
similarity index 100%
rename from itest/ws/contribution-callback-promotion/pom.xml
rename to testing/itest/ws/contribution-callback-promotion/pom.xml
diff --git a/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java b/testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
rename to testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
diff --git a/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java b/testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
rename to testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
diff --git a/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java b/testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
rename to testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
diff --git a/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
rename to testing/itest/ws/contribution-callback-promotion/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-callback-promotion/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-callback-promotion/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/helloworldcallbackservice-bottom.composite b/testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworldcallbackservice-bottom.composite
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/helloworldcallbackservice-bottom.composite
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworldcallbackservice-bottom.composite
diff --git a/itest/ws/contribution-callback-promotion/src/main/resources/helloworldservice-bottom.composite b/testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworldservice-bottom.composite
similarity index 100%
rename from itest/ws/contribution-callback-promotion/src/main/resources/helloworldservice-bottom.composite
rename to testing/itest/ws/contribution-callback-promotion/src/main/resources/helloworldservice-bottom.composite
diff --git a/itest/ws/contribution-callback/pom.xml b/testing/itest/ws/contribution-callback/pom.xml
similarity index 100%
rename from itest/ws/contribution-callback/pom.xml
rename to testing/itest/ws/contribution-callback/pom.xml
diff --git a/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java b/testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
similarity index 100%
rename from itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
rename to testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallback.java
diff --git a/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java b/testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
similarity index 100%
rename from itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
rename to testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackService.java
diff --git a/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java b/testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
similarity index 100%
rename from itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
rename to testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldCallbackServiceImpl.java
diff --git a/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
rename to testing/itest/ws/contribution-callback/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
diff --git a/itest/ws/contribution-callback/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-callback/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-callback/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-callback/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-callback/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-callback/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-callback/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-callback/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-callback/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-callback/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-callback/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-callback/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-callback/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-callback/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-callback/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-callback/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-doc-lit-wrapped/pom.xml b/testing/itest/ws/contribution-doc-lit-wrapped/pom.xml
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/pom.xml
rename to testing/itest/ws/contribution-doc-lit-wrapped/pom.xml
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit.wsdl b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit.wsdl
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit.wsdl
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit.wsdl
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit1.xsd b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit1.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit1.xsd
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit1.xsd
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit2.xsd b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit2.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit2.xsd
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldImplService-doclit2.xsd
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-doc-lit-wrapped/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-doc-lit/pom.xml b/testing/itest/ws/contribution-doc-lit/pom.xml
similarity index 100%
rename from itest/ws/contribution-doc-lit/pom.xml
rename to testing/itest/ws/contribution-doc-lit/pom.xml
diff --git a/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java b/testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
rename to testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
diff --git a/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java b/testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
rename to testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
diff --git a/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldBare.java b/testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldBare.java
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldBare.java
rename to testing/itest/ws/contribution-doc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldBare.java
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit.wsdl b/testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit.wsdl
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit.wsdl
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit.wsdl
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit1.xsd b/testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit1.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit1.xsd
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit1.xsd
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit2.xsd b/testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit2.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit2.xsd
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldImplService-doclit2.xsd
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-doc-lit/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-doc-lit/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-doc-lit/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-doc-lit/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-doc-lit/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-doc-lit/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-java-first/pom.xml b/testing/itest/ws/contribution-java-first/pom.xml
similarity index 100%
rename from itest/ws/contribution-java-first/pom.xml
rename to testing/itest/ws/contribution-java-first/pom.xml
diff --git a/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
rename to testing/itest/ws/contribution-java-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
diff --git a/itest/ws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-java-first/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-java-first/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-java-first/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-java-first/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-java-first/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-java-first/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-java-first/src/main/resources/helloworld.composite
diff --git a/itest/ws/contribution-rpc-lit/README b/testing/itest/ws/contribution-rpc-lit/README
similarity index 100%
rename from itest/ws/contribution-rpc-lit/README
rename to testing/itest/ws/contribution-rpc-lit/README
diff --git a/itest/ws/contribution-rpc-lit/pom.xml b/testing/itest/ws/contribution-rpc-lit/pom.xml
similarity index 100%
rename from itest/ws/contribution-rpc-lit/pom.xml
rename to testing/itest/ws/contribution-rpc-lit/pom.xml
diff --git a/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
rename to testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
diff --git a/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java b/testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
rename to testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld1Impl.java
diff --git a/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java b/testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
rename to testing/itest/ws/contribution-rpc-lit/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld2Impl.java
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit.wsdl b/testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit.wsdl
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit.wsdl
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit.wsdl
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit1.xsd b/testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit1.xsd
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit1.xsd
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit1.xsd
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit2.xsd b/testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit2.xsd
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit2.xsd
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldImplService-rpclit2.xsd
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/HelloWorldServiceService_schema1.xsd
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-rpc-lit/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-rpc-lit/src/main/resources/helloworld-external-service.wsdl
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/helloworld-external-service.wsdl
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/helloworld-external-service.wsdl
diff --git a/itest/ws/contribution-rpc-lit/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-rpc-lit/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-rpc-lit/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-rpc-lit/src/main/resources/helloworld.composite
diff --git a/testing/itest/ws/contribution-wsdl-first/pom.xml b/testing/itest/ws/contribution-wsdl-first/pom.xml
new file mode 100644
index 0000000..8cd2898
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/pom.xml
@@ -0,0 +1,125 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-ws-contribution-wsdl-first</artifactId>
+ <name>Apache Tuscany SCA iTest WS Contribution WSDL First</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/jaxws-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxws-maven-plugin</artifactId>
+ <version>1.12</version>
+ <!-- Explicitly add the transitive dependencies for jaxws-api
+ http://jira.codehaus.org/browse/MEV-498
+ -->
+ <dependencies>
+ <dependency>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ <version>1.0-MR1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <!-- execution>
+ <id>wsimport1</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <packageName>org.apache.tuscany.sca.binding.ws.sca</packageName>
+ <wsdlDirectory>${basedir}/target/classes</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>HelloWorldImplService.wsdl</wsdlFile>
+ </wsdlFiles>
+ <staleFile>${project.build.directory}/jaxws/stale/.wsimport1StaleFlag</staleFile>
+ </configuration>
+ </execution-->
+ <execution>
+ <id>wsimport2</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>wsimport</goal>
+ </goals>
+ <configuration>
+ <packageName>org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface</packageName>
+ <wsdlDirectory>${basedir}/target/classes</wsdlDirectory>
+ <wsdlFiles>
+ <wsdlFile>helloworld-external-service.wsdl</wsdlFile>
+ </wsdlFiles>
+ <staleFile>${project.build.directory}/jaxws/stale/.wsimport2StaleFlag</staleFile>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <target>2.1</target>
+ <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
+ <verbose>true</verbose>
+ <xnocompile>true</xnocompile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java b/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
new file mode 100644
index 0000000..c9c1038
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorld.java
@@ -0,0 +1,37 @@
+/*
+ * 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.sca.binding.ws;
+
+import javax.jws.WebMethod;
+
+import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.Foo;
+import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorld {
+
+ String getGreetings(String s);
+ String getGreetingsException(String s) throws ServiceRuntimeException;
+ Foo getGreetingsComplex(Foo foo);
+
+ @WebMethod(operationName = "GetGreetingsCaps")
+ String getGreetingsCaps(String s);
+}
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java b/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
new file mode 100644
index 0000000..d88a765
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/java/org/apache/tuscany/sca/binding/ws/HelloWorldImpl.java
@@ -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.sca.binding.ws;
+
+import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.Foo;
+import org.apache.tuscany.sca.binding.ws.jaxws.external.service.iface.HelloWorldService;
+import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.annotation.Reference;
+
+public class HelloWorldImpl implements HelloWorld {
+
+ @Reference
+ public HelloWorldService helloWorldExternal;
+
+ public String getGreetings(String s) {
+ System.out.println("Entering SCA HelloWorld.getGreetings: " + s);
+ String response = helloWorldExternal.getGreetings(s);
+ System.out.println("Leaving SCA HelloWorld.getGreetings: " + response);
+ return response;
+ }
+
+ public String getGreetingsException(String s) throws ServiceRuntimeException {
+ System.out.println("Entering SCA HelloWorld.getGreetingsException: " + s);
+ String response = helloWorldExternal.getGreetings(s);
+ System.out.println("Leaving SCA HelloWorld.getGreetings: " + response);
+ throw new ServiceRuntimeException(response);
+ }
+
+ public Foo getGreetingsComplex(Foo foo){
+ System.out.println("Entering SCA HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ Foo response = helloWorldExternal.getGreetingsComplex(foo);
+ System.out.println("Leaving SCA HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ return response;
+ }
+
+ public String getGreetingsCaps(String s) {
+ System.out.println("Entering SCA HelloWorld.getGreetingsCaps: " + s);
+ String response = helloWorldExternal.getGreetingsCaps(s);
+ System.out.println("Leaving SCA HelloWorld.getGreetingsCaps: " + response);
+ return response;
+ }
+
+}
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl
new file mode 100644
index 0000000..59fce9d
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService.wsdl
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<definitions targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
+ name="HelloWorldImplService"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://ws.binding.sca.tuscany.apache.org/"
+ schemaLocation="HelloWorldImplService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="getGreetings">
+ <part name="parameters" element="tns:getGreetings"/>
+ </message>
+ <message name="getGreetingsResponse">
+ <part name="parameters" element="tns:getGreetingsResponse"/>
+ </message>
+ <message name="getGreetingsException">
+ <part name="parameters" element="tns:getGreetingsException"/>
+ </message>
+ <message name="getGreetingsExceptionResponse">
+ <part name="parameters" element="tns:getGreetingsExceptionResponse"/>
+ </message>
+ <message name="Exception">
+ <part name="fault" element="tns:Exception"/>
+ </message>
+ <message name="getGreetingsComplex">
+ <part name="parameters" element="tns:getGreetingsComplex"/>
+ </message>
+ <message name="getGreetingsComplexResponse">
+ <part name="parameters" element="tns:getGreetingsComplexResponse"/>
+ </message>
+ <message name="GetGreetingsCaps">
+ <part name="parameters" element="tns:GetGreetingsCaps"/>
+ </message>
+ <message name="GetGreetingsCapsResponse">
+ <part name="parameters" element="tns:GetGreetingsCapsResponse"/>
+ </message>
+ <portType name="HelloWorldImpl">
+ <operation name="getGreetings">
+ <input message="tns:getGreetings"/>
+ <output message="tns:getGreetingsResponse"/>
+ </operation>
+ <operation name="getGreetingsException">
+ <input message="tns:getGreetingsException"/>
+ <output message="tns:getGreetingsExceptionResponse"/>
+ <fault message="tns:Exception" name="Exception"/>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <input message="tns:getGreetingsComplex"/>
+ <output message="tns:getGreetingsComplexResponse"/>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <input message="tns:GetGreetingsCaps"/>
+ <output message="tns:GetGreetingsCapsResponse"/>
+ </operation>
+ </portType>
+ <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="getGreetings">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="getGreetingsException">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="Exception">
+ <soap:fault name="Exception" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="HelloWorldImplService">
+ <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
+ <soap:address location="http://localhost:8085/HelloWorldService/HelloWorld"/>
+ </port>
+ </service>
+</definitions>
+
+
+
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd
new file mode 100644
index 0000000..2d8adf3
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema1.xsd
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<xs:schema version="1.0" targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:tns2="http://helloworld/external"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:import namespace="http://helloworld/external" schemaLocation="./HelloWorldImplService_schema2.xsd"/>
+
+ <xs:element name="Exception" type="tns:Exception"/>
+
+ <xs:element name="getGreetings" type="tns:getGreetings"/>
+
+ <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
+
+ <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
+
+ <xs:element name="getGreetingsException" type="tns:getGreetingsException"/>
+
+ <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/>
+
+ <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
+
+ <xs:element name="GetGreetingsCaps" type="tns:GetGreetingsCaps"/>
+
+ <xs:element name="GetGreetingsCapsResponse" type="tns:GetGreetingsCapsResponse"/>
+
+ <xs:complexType name="getGreetingsException">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsExceptionResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="Exception">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetings">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplex">
+ <xs:sequence>
+ <xs:element name="arg0" type="tns2:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplexResponse">
+ <xs:sequence>
+ <xs:element name="return" type="tns2:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCaps">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCapsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema2.xsd b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema2.xsd
similarity index 100%
rename from itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema2.xsd
rename to testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldImplService_schema2.xsd
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd
new file mode 100644
index 0000000..467eeb9
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/resources/HelloWorldServiceService_schema1.xsd
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<xs:schema version="1.0" targetNamespace="http://helloworld/external" xmlns:tns="http://helloworld/external" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="getGreetings" type="tns:getGreetings"/>
+
+ <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
+
+ <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
+
+ <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
+
+ <xs:element name="GetGreetingsCaps" type="tns:GetGreetingsCaps"/>
+
+ <xs:element name="GetGreetingsCapsResponse" type="tns:GetGreetingsCapsResponse"/>
+
+ <xs:complexType name="getGreetings">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string" form="qualified" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsResponse">
+ <xs:sequence>
+ <xs:element name="getGreetingsReturn" type="xs:string" form="qualified" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplex">
+ <xs:sequence>
+ <xs:element name="arg0" type="tns:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="foo">
+ <xs:sequence>
+ <xs:element name="bars" type="tns:bar" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="bar">
+ <xs:sequence>
+ <xs:element name="b" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="s" type="xs:string" minOccurs="0"/>
+ <xs:element name="x" type="xs:int"/>
+ <xs:element name="y" type="xs:int" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplexResponse">
+ <xs:sequence>
+ <xs:element name="return" type="tns:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCaps">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCapsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
+
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/contribution-wsdl-first/src/main/resources/META-INF/sca-contribution.xml
diff --git a/testing/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl b/testing/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl
new file mode 100644
index 0000000..c38f629
--- /dev/null
+++ b/testing/itest/ws/contribution-wsdl-first/src/main/resources/helloworld-external-service.wsdl
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.7-b01-. -->
+<definitions targetNamespace="http://helloworld/external" name="HelloWorldServiceService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://helloworld/external" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://helloworld/external" schemaLocation="HelloWorldServiceService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="getGreetings">
+ <part name="parameters" element="tns:getGreetings"/>
+ </message>
+ <message name="getGreetingsResponse">
+ <part name="parameters" element="tns:getGreetingsResponse"/>
+ </message>
+ <message name="getGreetingsComplex">
+ <part name="parameters" element="tns:getGreetingsComplex"/>
+ </message>
+ <message name="getGreetingsComplexResponse">
+ <part name="parameters" element="tns:getGreetingsComplexResponse"/>
+ </message>
+ <message name="GetGreetingsCaps">
+ <part name="parameters" element="tns:GetGreetingsCaps"/>
+ </message>
+ <message name="GetGreetingsCapsResponse">
+ <part name="parameters" element="tns:GetGreetingsCapsResponse"/>
+ </message>
+ <portType name="HelloWorldService">
+ <operation name="getGreetings">
+ <input message="tns:getGreetings"/>
+ <output message="tns:getGreetingsResponse"/>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <input message="tns:getGreetingsComplex"/>
+ <output message="tns:getGreetingsComplexResponse"/>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <input message="tns:GetGreetingsCaps"/>
+ <output message="tns:GetGreetingsCapsResponse"/>
+ </operation>
+ </portType>
+ <binding name="HelloWorldServicePortBinding" type="tns:HelloWorldService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="getGreetings">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="HelloWorldServiceService">
+ <port name="HelloWorldServicePort" binding="tns:HelloWorldServicePortBinding">
+ <soap:address location="http://localhost:8086/External/HelloWorld"/>
+ </port>
+ </service>
+ <service name="HelloWorldImplService">
+ <port name="HelloWorldImplPort" binding="tns:HelloWorldServicePortBinding">
+ <soap:address location="http://localhost:8085/HelloWorldService/HelloWorld"/>
+ </port>
+ </service>
+</definitions>
diff --git a/itest/ws/contribution-wsdl-first/src/main/resources/helloworld.composite b/testing/itest/ws/contribution-wsdl-first/src/main/resources/helloworld.composite
similarity index 100%
rename from itest/ws/contribution-wsdl-first/src/main/resources/helloworld.composite
rename to testing/itest/ws/contribution-wsdl-first/src/main/resources/helloworld.composite
diff --git a/itest/ws/defaults/pom.xml b/testing/itest/ws/defaults/pom.xml
similarity index 100%
rename from itest/ws/defaults/pom.xml
rename to testing/itest/ws/defaults/pom.xml
diff --git a/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java b/testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java
similarity index 100%
rename from itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java
rename to testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Bar.java
diff --git a/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java b/testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java
similarity index 100%
rename from itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java
rename to testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Foo.java
diff --git a/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
similarity index 100%
rename from itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
rename to testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
diff --git a/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java b/testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java
similarity index 100%
rename from itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java
rename to testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldClient.java
diff --git a/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
similarity index 100%
rename from itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
rename to testing/itest/ws/defaults/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
diff --git a/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/defaults/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite b/testing/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite
similarity index 100%
rename from itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite
rename to testing/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.composite
diff --git a/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/testing/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
similarity index 100%
rename from itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
rename to testing/itest/ws/defaults/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
diff --git a/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java b/testing/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java
similarity index 100%
rename from itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java
rename to testing/itest/ws/defaults/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultsTestCase.java
diff --git a/itest/ws/endpoint-references/pom.xml b/testing/itest/ws/endpoint-references/pom.xml
similarity index 100%
rename from itest/ws/endpoint-references/pom.xml
rename to testing/itest/ws/endpoint-references/pom.xml
diff --git a/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
similarity index 100%
rename from itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
rename to testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
diff --git a/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java b/testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java
similarity index 100%
rename from itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java
rename to testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldComponent.java
diff --git a/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
similarity index 100%
rename from itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
rename to testing/itest/ws/endpoint-references/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
diff --git a/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite b/testing/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite
similarity index 100%
rename from itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite
rename to testing/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.composite
diff --git a/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/testing/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
similarity index 100%
rename from itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
rename to testing/itest/ws/endpoint-references/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
diff --git a/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java b/testing/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java
similarity index 100%
rename from itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java
rename to testing/itest/ws/endpoint-references/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldTestCase.java
diff --git a/itest/ws/endpoints/pom.xml b/testing/itest/ws/endpoints/pom.xml
similarity index 100%
rename from itest/ws/endpoints/pom.xml
rename to testing/itest/ws/endpoints/pom.xml
diff --git a/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java b/testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java
similarity index 100%
rename from itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java
rename to testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldMultiService.java
diff --git a/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java b/testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
similarity index 100%
rename from itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
rename to testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
diff --git a/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java b/testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java
similarity index 100%
rename from itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java
rename to testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM2.java
diff --git a/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java b/testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
similarity index 100%
rename from itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
rename to testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
diff --git a/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java b/testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
similarity index 100%
rename from itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
rename to testing/itest/ws/endpoints/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiService.composite
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleService.composite
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURI.composite
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURI.composite
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-relative-uri.wsdl
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-uri.wsdl
diff --git a/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl b/testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl
similarity index 100%
rename from itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl
rename to testing/itest/ws/endpoints/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om.wsdl
diff --git a/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java b/testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java
similarity index 100%
rename from itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java
rename to testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/AbstractHelloWorldOMTestCase.java
diff --git a/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java b/testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java
similarity index 100%
rename from itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java
rename to testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultMultiServiceTestCase.java
diff --git a/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java b/testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java
similarity index 100%
rename from itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java
rename to testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/DefaultSingleServiceTestCase.java
diff --git a/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java b/testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java
similarity index 100%
rename from itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java
rename to testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLExplicitURITestCase.java
diff --git a/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java b/testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java
similarity index 100%
rename from itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java
rename to testing/itest/ws/endpoints/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/WSDLRelativeURITestCase.java
diff --git a/itest/ws/external-client/pom.xml b/testing/itest/ws/external-client/pom.xml
similarity index 100%
rename from itest/ws/external-client/pom.xml
rename to testing/itest/ws/external-client/pom.xml
diff --git a/testing/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java b/testing/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
new file mode 100644
index 0000000..ccecf56
--- /dev/null
+++ b/testing/itest/ws/external-client/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/client/HelloWorldClientLauncher.java
@@ -0,0 +1,91 @@
+/*
+ * 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.sca.binding.ws.jaxws.external.client;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.apache.tuscany.sca.binding.ws.jaxws.sca.Exception_Exception;
+import org.apache.tuscany.sca.binding.ws.jaxws.sca.Foo;
+import org.apache.tuscany.sca.binding.ws.jaxws.sca.HelloWorldImpl;
+
+public class HelloWorldClientLauncher {
+
+ public HelloWorldImpl wsProxy;
+
+ public HelloWorldClientLauncher(){
+ }
+
+ public void createClient() throws Exception{
+ System.out.println(">>> Starting external JAXWS client ");
+
+ // default JVM JAXWS support
+ QName serviceName = new QName("http://ws.binding.sca.tuscany.apache.org/", "HelloWorldImplService");
+ QName portName = new QName("http://ws.binding.sca.tuscany.apache.org/", "HelloWorldImplPort");
+ //URL wsdlLocation = new File("../external-client/target/classes/helloworld-sca.wsdl").toURL();
+ URL wsdlLocation = new File("../external-client/target/classes/HelloWorldImplService.wsdl").toURL();
+ javax.xml.ws.Service webService = Service.create(wsdlLocation, serviceName);
+ wsProxy = (HelloWorldImpl) webService.getPort(portName, HelloWorldImpl.class);
+ }
+
+ public void destroyClient(){
+ System.out.println(">>> Stopping external JAXWS client: ");
+ // TODO
+ }
+
+ public String getGreetings(String name){
+ System.out.println("Entering External Client HelloWorld.getGreetings: " + name);
+ String response = wsProxy.getGreetings(name);
+ System.out.println("Leaving External Client HelloWorld.getGreetings: " + response);
+ return response;
+ }
+
+ public String getGreetingsException(String name) throws Exception_Exception {
+ System.out.println("Entering External Client HelloWorld.getGreetingsException: " + name);
+ String response = wsProxy.getGreetingsException(name);
+ System.out.println("Leaving External Client HelloWorld.getGreetingsException: " + response);
+ return response;
+ }
+
+ public Foo getGreetingsComplex(Foo f) throws Exception_Exception {
+ System.out.println("Entering External Client HelloWorld.getGreetingsComplex: " + f.getBars().get(0).getS());
+ Foo response = wsProxy.getGreetingsComplex(f);
+ System.out.println("Leaving External Client HelloWorld.getGreetingsComplex: " + response.getBars().get(0).getS());
+ return response;
+ }
+
+ public String getGreetingsCaps(String s) throws Exception_Exception {
+ System.out.println("Entering External Client HelloWorld.getGreetingsCaps: " + s);
+ String response = wsProxy.getGreetingsCaps(s);
+ System.out.println("Leaving External Client HelloWorld.getGreetingsCaps: " + response);
+ return response;
+ }
+
+ public static void main(String[] args) throws Exception {
+ HelloWorldClientLauncher launcher = new HelloWorldClientLauncher();
+ launcher.createClient();
+ launcher.getGreetings("Fred");
+ launcher.destroyClient();
+ }
+
+}
diff --git a/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl b/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl
new file mode 100644
index 0000000..d175589
--- /dev/null
+++ b/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService.wsdl
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<definitions targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
+ name="HelloWorldImplService"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://ws.binding.sca.tuscany.apache.org/"
+ schemaLocation="HelloWorldImplService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="getGreetings">
+ <part name="parameters" element="tns:getGreetings"/>
+ </message>
+ <message name="getGreetingsResponse">
+ <part name="parameters" element="tns:getGreetingsResponse"/>
+ </message>
+ <message name="getGreetingsException">
+ <part name="parameters" element="tns:getGreetingsException"/>
+ </message>
+ <message name="getGreetingsExceptionResponse">
+ <part name="parameters" element="tns:getGreetingsExceptionResponse"/>
+ </message>
+ <message name="Exception">
+ <part name="fault" element="tns:Exception"/>
+ </message>
+ <message name="getGreetingsComplex">
+ <part name="parameters" element="tns:getGreetingsComplex"/>
+ </message>
+ <message name="getGreetingsComplexResponse">
+ <part name="parameters" element="tns:getGreetingsComplexResponse"/>
+ </message>
+ <message name="GetGreetingsCaps">
+ <part name="parameters" element="tns:GetGreetingsCaps"/>
+ </message>
+ <message name="GetGreetingsCapsResponse">
+ <part name="parameters" element="tns:GetGreetingsCapsResponse"/>
+ </message>
+ <portType name="HelloWorldImpl">
+ <operation name="getGreetings">
+ <input message="tns:getGreetings"/>
+ <output message="tns:getGreetingsResponse"/>
+ </operation>
+ <operation name="getGreetingsException">
+ <input message="tns:getGreetingsException"/>
+ <output message="tns:getGreetingsExceptionResponse"/>
+ <fault message="tns:Exception" name="Exception"/>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <input message="tns:getGreetingsComplex"/>
+ <output message="tns:getGreetingsComplexResponse"/>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <input message="tns:GetGreetingsCaps"/>
+ <output message="tns:GetGreetingsCapsResponse"/>
+ </operation>
+ </portType>
+ <binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="getGreetings">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="getGreetingsException">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ <fault name="Exception">
+ <soap:fault name="Exception" use="literal"/>
+ </fault>
+ </operation>
+ <operation name="getGreetingsComplex">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="GetGreetingsCaps">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="HelloWorldImplService">
+ <port name="HelloWorldImplPort" binding="tns:HelloWorldImplPortBinding">
+ <soap:address location="http://localhost:8085/HelloWorldService/HelloWorld"/>
+ </port>
+ </service>
+</definitions>
+
+
+
diff --git a/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd b/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
new file mode 100644
index 0000000..c9c0acb
--- /dev/null
+++ b/testing/itest/ws/external-client/src/main/resources/HelloWorldImplService_schema1.xsd
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ * 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.
+-->
+<xs:schema version="1.0" targetNamespace="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:tns="http://ws.binding.sca.tuscany.apache.org/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="Exception" type="tns:Exception"/>
+
+ <xs:element name="getGreetings" type="tns:getGreetings"/>
+
+ <xs:element name="getGreetingsComplex" type="tns:getGreetingsComplex"/>
+
+ <xs:element name="getGreetingsComplexResponse" type="tns:getGreetingsComplexResponse"/>
+
+ <xs:element name="getGreetingsException" type="tns:getGreetingsException"/>
+
+ <xs:element name="getGreetingsExceptionResponse" type="tns:getGreetingsExceptionResponse"/>
+
+ <xs:element name="getGreetingsResponse" type="tns:getGreetingsResponse"/>
+
+ <xs:element name="GetGreetingsCaps" type="tns:GetGreetingsCaps"/>
+
+ <xs:element name="GetGreetingsCapsResponse" type="tns:GetGreetingsCapsResponse"/>
+
+ <xs:complexType name="getGreetingsException">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsExceptionResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="Exception">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetings">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplex">
+ <xs:sequence>
+ <xs:element name="arg0" type="tns:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="foo">
+ <xs:sequence>
+ <xs:element name="bars" type="tns:bar" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="bar">
+ <xs:sequence>
+ <xs:element name="b" type="xs:boolean" minOccurs="0"/>
+ <xs:element name="s" type="xs:string" minOccurs="0"/>
+ <xs:element name="x" type="xs:int"/>
+ <xs:element name="y" type="xs:int" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getGreetingsComplexResponse">
+ <xs:sequence>
+ <xs:element name="return" type="tns:foo" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCaps">
+ <xs:sequence>
+ <xs:element name="arg0" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="GetGreetingsCapsResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
diff --git a/itest/ws/external-service/pom.xml b/testing/itest/ws/external-service/pom.xml
similarity index 100%
rename from itest/ws/external-service/pom.xml
rename to testing/itest/ws/external-service/pom.xml
diff --git a/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java b/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java
similarity index 100%
rename from itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java
rename to testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Bar.java
diff --git a/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java b/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java
similarity index 100%
rename from itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java
rename to testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/Foo.java
diff --git a/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java b/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
new file mode 100644
index 0000000..129365b
--- /dev/null
+++ b/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldService.java
@@ -0,0 +1,64 @@
+/*
+ * 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.sca.binding.ws.jaxws.external.service;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+@WebService(name = "HelloWorldService", targetNamespace = "http://helloworld/external")
+public class HelloWorldService {
+
+ @WebMethod
+ @WebResult(name = "getGreetingsReturn", targetNamespace = "http://helloworld/external")
+ @RequestWrapper(localName = "getGreetings", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetings")
+ @ResponseWrapper(localName = "getGreetingsResponse", targetNamespace = "http://helloworld/external", className = "org.apache.tuscany.sca.binding.ws.jaxws.external.service.GetGreetingsResponse")
+ public String getGreetings( @WebParam(name = "name", targetNamespace = "http://helloworld/external")
+ String name) {
+ System.out.println("Entering External Service HelloWorld.getGreetings: " + name);
+ String response = "Hello " + name;
+ System.out.println("Leaving External Service HelloWorld.getGreetings: " + response);
+ return response;
+ }
+
+ public Foo getGreetingsComplex(Foo foo){
+ System.out.println("Entering External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ Foo response = foo;
+ Bar b3 = new Bar();
+ b3.setS("simon");
+ b3.setX(7);
+ b3.setY(new Integer(8));
+ b3.setB(Boolean.TRUE);
+ response.getBars().add(b3);
+ System.out.println("Leaving External Service HelloWorld.getGreetingsComplex: " + foo.getBars().get(0).getS());
+ return response;
+ }
+
+ public String GetGreetingsCaps(String name) {
+ System.out.println("Entering External Service HelloWorld.GetGreetingsCaps: " + name);
+ String response = "Hello " + name;
+ System.out.println("Leaving External Service HelloWorld.GetGreetingsCaps: " + response);
+ return response;
+ }
+
+}
diff --git a/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java b/testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
similarity index 100%
rename from itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
rename to testing/itest/ws/external-service/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/external/service/HelloWorldServiceLauncher.java
diff --git a/itest/ws/http-ssl/README b/testing/itest/ws/http-ssl/README
similarity index 100%
rename from itest/ws/http-ssl/README
rename to testing/itest/ws/http-ssl/README
diff --git a/itest/ws/http-ssl/pom.xml b/testing/itest/ws/http-ssl/pom.xml
similarity index 100%
rename from itest/ws/http-ssl/pom.xml
rename to testing/itest/ws/http-ssl/pom.xml
diff --git a/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java b/testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
similarity index 100%
rename from itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
rename to testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorld.java
diff --git a/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java b/testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
similarity index 100%
rename from itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
rename to testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldClient.java
diff --git a/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java b/testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
similarity index 100%
rename from itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
rename to testing/itest/ws/http-ssl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/helloworld/HelloWorldService.java
diff --git a/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml b/testing/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml
rename to testing/itest/ws/http-ssl/src/main/resources/META-INF/sca-contribution.xml
diff --git a/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/testing/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
rename to testing/itest/ws/http-ssl/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
diff --git a/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml b/testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
rename to testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/definitions.xml
diff --git a/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite b/testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
rename to testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.composite
diff --git a/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl b/testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
rename to testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/helloworld.wsdl
diff --git a/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks b/testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks
similarity index 100%
rename from itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks
rename to testing/itest/ws/http-ssl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld/tuscany.jks
Binary files differ
diff --git a/testing/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java b/testing/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java
new file mode 100644
index 0000000..d58f761
--- /dev/null
+++ b/testing/itest/ws/http-ssl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HTTPSTestCase.java
@@ -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.sca.binding.ws.axis2;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.binding.ws.axis2.helloworld.HelloWorld;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.Ignore;
+
+@Ignore("TUSCANY-3632")
+public class HTTPSTestCase extends TestCase {
+
+ private Node node;
+ private HelloWorld helloWorld;
+ private HelloWorld helloWorld2;
+ private HelloWorld helloWorld3;
+
+ @Override
+ protected void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode(new Contribution("test", "target/classes"));
+ node.start();
+ helloWorld = node.getService(HelloWorld.class, "HelloWorldClient");
+ helloWorld2 = node.getService(HelloWorld.class, "HelloWorldClient2");
+ helloWorld3 = node.getService(HelloWorld.class, "HelloWorldClient3");
+ }
+
+ public void testCalculator() throws Exception {
+ assertEquals("Hello petra", helloWorld.getGreetings("petra"));
+ assertEquals("Hello petra", helloWorld2.getGreetings("petra"));
+ // TODO - check policy matching for unconfigure reference
+ //assertEquals("Hello petra", helloWorld3.getGreetings("petra"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/itest/ws/launcher-axis2/pom.xml b/testing/itest/ws/launcher-axis2/pom.xml
similarity index 100%
rename from itest/ws/launcher-axis2/pom.xml
rename to testing/itest/ws/launcher-axis2/pom.xml
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackForwardSpecTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackForwardSpecTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackForwardSpecTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackForwardSpecTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackFullSpecTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackFullSpecTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackFullSpecTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackFullSpecTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackPromotionTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackPromotionTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackPromotionTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackPromotionTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/CallbackTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitWrappedTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitWrappedTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitWrappedTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/DocLitWrappedTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/JavaFirstTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/JavaFirstTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/JavaFirstTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/JavaFirstTestCase.java
diff --git a/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/RpcLitTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/RpcLitTestCase.java
similarity index 100%
rename from itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/RpcLitTestCase.java
rename to testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/RpcLitTestCase.java
diff --git a/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java
new file mode 100644
index 0000000..7ed4829
--- /dev/null
+++ b/testing/itest/ws/launcher-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/axis2/WSDLFirstTestCase.java
@@ -0,0 +1,130 @@
+/*
+ * 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.sca.binding.ws.launcher.axis2;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.binding.ws.jaxws.external.client.HelloWorldClientLauncher;
+import org.apache.tuscany.sca.binding.ws.jaxws.external.service.HelloWorldServiceLauncher;
+import org.apache.tuscany.sca.binding.ws.jaxws.sca.Bar;
+import org.apache.tuscany.sca.binding.ws.jaxws.sca.Foo;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class WSDLFirstTestCase extends TestCase {
+
+ private Node node;
+ private HelloWorldServiceLauncher externalService;
+ private HelloWorldClientLauncher externalClient;
+
+ @Before
+ public void setUp() throws Exception {
+ // Start the external service
+ externalService = new HelloWorldServiceLauncher();
+ externalService.createService();
+
+ // Start the SCA contribution
+ node = NodeFactory.newInstance().createNode(new Contribution("wsdl-first", "../contribution-wsdl-first/target/itest-ws-contribution-wsdl-first.jar"));
+ node.start();
+
+ // start the external client
+ try {
+ externalClient = new HelloWorldClientLauncher();
+ externalClient.createClient();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw ex;
+ }
+ }
+
+/*
+ @Test
+ public void testWait() throws Exception {
+ System.out.println("Press a key");
+ System.in.read();
+ }
+*/
+
+ @Test
+ public void testGetGreetings() throws Exception {
+ assertEquals("Hello Fred", externalClient.getGreetings("Fred"));
+ }
+
+ @Test
+ @Ignore
+ public void testGetGreetingsException() throws Exception {
+ try {
+ externalClient.getGreetingsException("Fred");
+ } catch (Exception ex) {
+ return;
+ }
+
+ fail("expecting exception");
+ }
+
+ @Test
+ public void testGetGreetingsComplex() throws Exception {
+ Foo f = new Foo();
+ Bar b1 = new Bar();
+ b1.setS("petra");
+ b1.setX(1);
+ b1.setY(new Integer(2));
+ b1.setB(Boolean.TRUE);
+ Bar b2 = new Bar();
+ b2.setS("beate");
+ b2.setX(3);
+ b2.setY(new Integer(4));
+ b2.setB(Boolean.FALSE);
+ f.getBars().add(b1);
+ f.getBars().add(b2);
+
+ Foo f2 = externalClient.getGreetingsComplex(f);
+
+ assertEquals("petra", f2.getBars().get(0).getS());
+ assertEquals(1, f2.getBars().get(0).getX());
+ assertEquals(2, f2.getBars().get(0).getY().intValue());
+ assertTrue(f2.getBars().get(0).isB());
+ assertEquals("simon", f2.getBars().get(2).getS());
+ assertEquals(7, f2.getBars().get(2).getX());
+ assertEquals(8, f2.getBars().get(2).getY().intValue());
+ assertTrue(f2.getBars().get(2).isB().booleanValue());
+ }
+
+ @Test
+ public void testGetGreetingsCaps() throws Exception {
+ assertEquals("Hello Fred", externalClient.getGreetingsCaps("Fred"));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ externalClient.destroyClient();
+ externalService.destoryService();
+ }
+
+}
diff --git a/testing/itest/ws/launcher-base/pom.xml b/testing/itest/ws/launcher-base/pom.xml
new file mode 100644
index 0000000..215669b
--- /dev/null
+++ b/testing/itest/ws/launcher-base/pom.xml
@@ -0,0 +1,59 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-Beta1</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>itest-ws-launcher-base</artifactId>
+ <name>Apache Tuscany SCA iTest WS Launcher Base</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <!-- Test resources -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-ws-external-client</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-ws-external-service</artifactId>
+ <version>2.0-Beta1</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+
+ </build>
+
+</project>
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackForwardSpecTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackForwardSpecTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackForwardSpecTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackForwardSpecTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackFullSpecTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackFullSpecTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackFullSpecTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackFullSpecTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackPromotionTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackPromotionTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackPromotionTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackPromotionTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/CallbackTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/DocLitWrappedTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/DocLitWrappedTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/DocLitWrappedTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/DocLitWrappedTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/JavaFirstTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/JavaFirstTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/JavaFirstTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/JavaFirstTestCase.java
diff --git a/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/WSDLFirstTestCase.java b/testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/WSDLFirstTestCase.java
similarity index 100%
rename from itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/WSDLFirstTestCase.java
rename to testing/itest/ws/launcher-base/src/test/java/org/apache/tuscany/sca/binding/ws/launcher/base/WSDLFirstTestCase.java
diff --git a/itest/ws/pom.xml b/testing/itest/ws/pom.xml
similarity index 100%
rename from itest/ws/pom.xml
rename to testing/itest/ws/pom.xml
diff --git a/itest/ws/wsdl/pom.xml b/testing/itest/ws/wsdl/pom.xml
similarity index 100%
rename from itest/ws/wsdl/pom.xml
rename to testing/itest/ws/wsdl/pom.xml
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Account.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AccountService.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/CustomerProfileData.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorld.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOM.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMComponent.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldOMService.java
diff --git a/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
similarity index 100%
rename from itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
rename to testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldService.java
diff --git a/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java
new file mode 100644
index 0000000..805a515
--- /dev/null
+++ b/testing/itest/ws/wsdl/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://accounts")
+package org.apache.tuscany.sca.binding.ws.axis2;
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdata.xsd
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerdefs.xsd
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/customerinfo.xsd
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.composite
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld-om-merged.wsdl
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/helloworld.wsdl
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import-nested.wsdl
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-import.wsdl
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-include.wsdl
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite
diff --git a/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite b/testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite
similarity index 100%
rename from itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite
rename to testing/itest/ws/wsdl/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite
diff --git a/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java
similarity index 100%
rename from itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java
rename to testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/HelloWorldWSDLMergedTestCase.java
diff --git a/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java
new file mode 100644
index 0000000..e48e1bc
--- /dev/null
+++ b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLImportTestCase.java
@@ -0,0 +1,99 @@
+/*
+ * 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.sca.binding.ws.axis2;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class QuestionMarkWSDLImportTestCase extends TestCase {
+
+ private Node node;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLImportPortEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments", true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://account2/AccountService/Account", "Account"));
+ Port port = service.getPort("AccountSOAP11Port");
+
+ String endpoint = getEndpoint(port);
+ // String ip = HttpUtils.getIpAddress();
+ assertEquals("http://localhost:8086/AccountService", endpoint);
+ }
+
+ private String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = "target/classes";
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-import.composite", new Contribution("test", contribution));
+ node.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java
new file mode 100644
index 0000000..173d952
--- /dev/null
+++ b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLIncludeTestCase.java
@@ -0,0 +1,98 @@
+/*
+ * 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.sca.binding.ws.axis2;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class QuestionMarkWSDLIncludeTestCase extends TestCase {
+
+ private Node node;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLIncludePortEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments", true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://accounts/AccountService/Account", "Account"));
+ Port port = service.getPort("AccountSOAP11Port");
+
+ String endpoint = getEndpoint(port);
+ assertEquals("http://localhost:8085/AccountService", endpoint);
+ }
+
+ private String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = "target/classes";
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl-include.composite", new Contribution("test", contribution));
+ node.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java
new file mode 100644
index 0000000..635c49b
--- /dev/null
+++ b/testing/itest/ws/wsdl/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/QuestionMarkWSDLTestCase.java
@@ -0,0 +1,126 @@
+/*
+ * 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.sca.binding.ws.axis2;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class QuestionMarkWSDLTestCase extends TestCase {
+
+ private Node node;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLPortEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8085/services/HelloWorldWebService2?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/services/HelloWorldWebService2?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://helloworld/HelloWorldService/HelloWorld",
+ "HelloWorld"));
+ Port port = service.getPort("ep2SOAP11Port");
+
+ String endpoint = getEndpoint(port);
+ assertEquals("http://localhost:8085/services/HelloWorldWebService2", endpoint);
+ }
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI
+ */
+ public void testCustomEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8085/foo/bar?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose",false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments",true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/foo/bar?wsdl");
+ assertNotNull(definition);
+ Service service = definition.getService(new QName("http://axis2.ws.binding.sca.tuscany.apache.org/",
+ "HelloWorld"));
+ Port port = service.getPort("ep1SOAP11Port");
+
+ String endpoint = getEndpoint(port);
+ // TODO - used to get the real host here but WSDL seems to have localhost in it atm?
+ assertEquals("http://localhost:8085/foo/bar", endpoint);
+ }
+
+ protected String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = "target/classes";
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/questionmark-wsdl.composite", new Contribution("test", contribution));
+ node.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}