You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/06/15 08:53:28 UTC
svn commit: r547551 [1/2] - in
/incubator/tuscany/java/sca/modules/implementation-das: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/sca/
src/main/java/o...
Author: lresende
Date: Thu Jun 14 23:53:23 2007
New Revision: 547551
URL: http://svn.apache.org/viewvc?view=rev&rev=547551
Log:
First cut of Declarative DAS (implementation.das)
Added:
incubator/tuscany/java/sca/modules/implementation-das/
incubator/tuscany/java/sca/modules/implementation-das/README
incubator/tuscany/java/sca/modules/implementation-das/build.xml
incubator/tuscany/java/sca/modules/implementation-das/pom.xml
incubator/tuscany/java/sca/modules/implementation-das/src/
incubator/tuscany/java/sca/modules/implementation-das/src/main/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationImpl.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationProcessor.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/DASModuleActivator.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngine.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngineManager.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/MissingConfigFileException.java
incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/
incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/
incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/
incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
incubator/tuscany/java/sca/modules/implementation-das/src/test/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java
incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/CompanyConfig.xml
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/company.composite
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/das.composite
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log.ctrl (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/logmirror.ctrl (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c10.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c101.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c111.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c121.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c130.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c141.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c150.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c161.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c171.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c180.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c191.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1a1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1b1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1c0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1d1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1e0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c1f1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c20.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c200.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c211.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c221.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c230.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c241.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c251.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c260.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c271.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c281.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c290.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2a1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2b1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2c1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2d0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2e1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c2f0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c300.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c31.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c311.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c320.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c331.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c340.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c351.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c360.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c371.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c380.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c391.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3a0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3b1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3c0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3d1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3e0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c3f1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c400.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c41.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c411.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c420.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c431.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c440.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c451.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c460.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c471.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c481.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c490.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c4a1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c51.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c60.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c71.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c81.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c90.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/ca1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/cb1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/cc0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/cd1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/ce1.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/cf0.dat (with props)
incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/service.properties
Added: incubator/tuscany/java/sca/modules/implementation-das/README
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/README?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/README (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/README Thu Jun 14 23:53:23 2007
@@ -0,0 +1,78 @@
+Implementation CRUD Sample
+==========================
+This sample demonstrates how new implementation types are constructed for
+Apache Tuscany SCA.
+
+The README in the samples directory (the directory above this) provides
+general instructions about building and running samples. Take a look there
+first.
+
+If you want to try out the crud implementation type that this sample provides
+please see the implementation-crud-client sample that provides the necessary
+client code to bring up an application that uses this implementation-crud
+
+Sample Overview
+---------------
+This sample contains a CRUD implementation type as an example of how to create
+new implementation types. Components using this implementation type always
+expose the same Create, Retrieve, Update and Delete interface. This sample
+uses a singleton ResourceManager to perform the CRUD operations but of course
+a real component would provide a real implementation.
+
+implementation-crud/
+ src/
+ main/
+ java/
+ crud/ - implementation model interfaces
+ crud.backend/ - fake component implementation
+ crud.impl/ - implementations of the model interfaces
+ crud.module/ - gets the implementation-crud module registered
+ with the SCA runtime
+ crud.provider/ - runtime implementation
+ resources/
+ crud.composite - the SCA assembly used during unit testing
+
+ build.xml - the Ant build file
+ pom.xml - the Maven build file
+
+Building The Sample Extension Using Ant
+-----------------------------------------
+With the binary distribution the sample extension can be built using Ant as
+follows
+
+cd implementation-crud
+ant compile
+
+See the sample implementation-crud-client to run a sample that uses this
+binding.
+
+Building The Sample Using Maven
+-------------------------------------------
+With either the binary or source distributions the sample can be built
+using Maven as follows.
+
+cd implementation-crud
+mvn
+
+Maven will also test that the sample extension built properly. You should see
+the following output from the test phase.
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running crud.CRUDTestCase
+Starting CRUDServiceComponent
+create(ABC) in tmp
+retrieve(0)
+update(0)
+retrieve(0)
+delete(0)
+retrieve(0)
+Stopping CRUDServiceComponent
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.212 sec
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
+
+This shows that the Junit test cases have run successfully.
Added: incubator/tuscany/java/sca/modules/implementation-das/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/build.xml?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/build.xml (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/build.xml Thu Jun 14 23:53:23 2007
@@ -0,0 +1,51 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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-crud" default="compile">
+ <property name="test.jar" value="sample-implementation-crud.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="../../lib/tuscany-sca-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="clean">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ </target>
+</project>
Added: incubator/tuscany/java/sca/modules/implementation-das/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/pom.xml?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/pom.xml (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/pom.xml Thu Jun 14 23:53:23 2007
@@ -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-modules</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-das</artifactId>
+ <name>Apache Tuscany Data Access Service Implementation</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.das</groupId>
+ <artifactId>tuscany-das-rdb</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-impl</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sca-api</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java Thu Jun 14 23:53:23 2007
@@ -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 org.apache.tuscany.sca.implementation.das;
+
+/**
+ * Generic constants used in this implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Constants {
+ /**
+ * Identify Relation Database data store
+ */
+ String DATA_ACCESS_TYPE_RDB = "rdb";
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java Thu Jun 14 23:53:23 2007
@@ -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.das;
+
+import commonj.sdo.DataObject;
+
+
+/**
+ * The service interface of a DAS service provided by DAS components.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DAS {
+
+ /**
+ * Execute a DAS Command specified on the DAS config file.
+ * @param commandName The name of the command
+ * @return
+ */
+ DataObject executeCommand(String commandName);
+
+ /**Execute a DAS Command specified on the DAS config file,
+ * and narrow the results based on the provided XPath
+ *
+ * @param commandName The name of the command
+ * @param xPath The xPath filter
+ * @return
+ */
+ DataObject executeCommand(String commandName, String xPath);
+
+
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java Thu Jun 14 23:53:23 2007
@@ -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.das;
+
+import org.apache.tuscany.sca.assembly.Implementation;
+
+/**
+ * The model representing a sample DAS implementation in an SCA assembly model.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DASImplementation extends Implementation {
+
+ /**
+ * Return the DAS configuration side file
+ *
+ * @return the name of the das configuration side file
+ */
+ public String getConfig();
+
+ /**
+ * Sets the DAS configuration side file
+ *
+ * @param config The name of the das configuration side file
+ */
+ public void setConfig(String config);
+
+ /**
+ * Return the data store type being used
+ * @return The data store type
+ */
+ public String getDataAccessType();
+
+ /**
+ * Sets the data store type being used
+ * @param dataAccessType The data store type in use
+ */
+ public void setDataAccessType(String dataAccessType);
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java Thu Jun 14 23:53:23 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.das;
+
+/**
+ * A factory for the sample DAS implementation model.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DASImplementationFactory {
+
+ /**
+ * Creates a new CRUD implementation.
+ *
+ * @return
+ */
+ DASImplementation createDASImplementation();
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java Thu Jun 14 23:53:23 2007
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.das;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.implementation.das.impl.DASImplementationImpl;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospector;
+
+
+/**
+ * A default factory for the DAS implementation model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefaultDASImplementationFactory implements DASImplementationFactory {
+
+ private AssemblyFactory assemblyFactory;
+ private JavaInterfaceFactory javaFactory;
+ private JavaInterfaceIntrospector introspector;
+
+ public DefaultDASImplementationFactory(AssemblyFactory assemblyFactory,
+ JavaInterfaceFactory javaFactory,
+ JavaInterfaceIntrospector introspector) {
+ this.assemblyFactory = assemblyFactory;
+ this.javaFactory = javaFactory;
+ this.introspector = introspector;
+ }
+
+ public DASImplementation createDASImplementation() {
+ return new DASImplementationImpl(assemblyFactory, javaFactory, introspector);
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationImpl.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationImpl.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationImpl.java Thu Jun 14 23:53:23 2007
@@ -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.das.impl;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ConstrainingType;
+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.implementation.das.DAS;
+import org.apache.tuscany.sca.implementation.das.DASImplementation;
+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.java.introspect.JavaInterfaceIntrospector;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+
+/**
+ * The model representing a sample DAS implementation in an SCA assembly model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASImplementationImpl implements DASImplementation {
+
+ private Service dasService;
+ private String dasConfig;
+ private String dataAccessType;
+
+ /**
+ * Constructs a new DAS implementation.
+ */
+ public DASImplementationImpl(AssemblyFactory assemblyFactory,
+ JavaInterfaceFactory javaFactory,
+ JavaInterfaceIntrospector introspector) {
+
+ // DAS implementation always provide a single service exposing
+ // the DAS interface, and have no references and properties
+ dasService = assemblyFactory.createService();
+ dasService.setName("DAS");
+ JavaInterface javaInterface;
+ try {
+ javaInterface = introspector.introspect(DAS.class);
+ } catch (InvalidInterfaceException e) {
+ throw new IllegalArgumentException(e);
+ }
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ interfaceContract.setInterface(javaInterface);
+ dasService.setInterfaceContract(interfaceContract);
+ }
+
+ public String getConfig() {
+ return this.dasConfig;
+ }
+
+ public void setConfig(String config) {
+ this.dasConfig = config;
+ }
+
+ public String getDataAccessType() {
+ return this.dataAccessType;
+ }
+
+ public void setDataAccessType (String dataAccessType) {
+ this.dataAccessType = dataAccessType;
+ }
+
+ public ConstrainingType getConstrainingType() {
+ // The sample DAS implementation does not support constrainingTypes
+ return null;
+ }
+
+ public List<Property> getProperties() {
+ // The sample DAS implementation does not support properties
+ return Collections.emptyList();
+ }
+
+ public List<Service> getServices() {
+ // The sample DAS implementation provides a single fixed CRUD service
+ return Collections.singletonList(dasService);
+ }
+
+ public List<Reference> getReferences() {
+ // The sample DAS implementation does not support properties
+ return Collections.emptyList();
+ }
+
+ public String getURI() {
+ // The sample DAS implementation does not have a URI
+ return null;
+ }
+
+ public void setConstrainingType(ConstrainingType constrainingType) {
+ // The sample DAS implementation does not support constrainingTypes
+ }
+
+ public void setURI(String uri) {
+ // The sample DAS implementation does not have a URI
+ }
+
+ public List<PolicySet> getPolicySets() {
+ // The sample DAS implementation does not support policy sets
+ return Collections.emptyList();
+ }
+
+ public List<Intent> getRequiredIntents() {
+ // The sample DAS implementation does not support intents
+ return Collections.emptyList();
+ }
+
+ public List<Object> getExtensions() {
+ // The sample DAS implementation does not support extensions
+ return Collections.emptyList();
+ }
+
+ public boolean isUnresolved() {
+ // The sample DAS implementation is always resolved
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // The sample DAS implementation is always resolved
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationProcessor.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationProcessor.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/DASImplementationProcessor.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das.impl;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+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.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.implementation.das.DASImplementation;
+import org.apache.tuscany.sca.implementation.das.DASImplementationFactory;
+
+
+/**
+ * Implements a STAX artifact processor for DAS implementations.
+ *
+ * The artifact processor is responsible for processing <implementation.das>
+ * elements in SCA assembly XML composite files and populating the DAS
+ * implementation model, resolving its references to other artifacts in the SCA
+ * contribution, and optionally write the model back to SCA assembly XML.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASImplementationProcessor implements StAXArtifactProcessor<DASImplementation> {
+ private static final QName IMPLEMENTATION_DAS = new QName("http://das", "implementation.das");
+
+ private DASImplementationFactory dasFactory;
+
+ public DASImplementationProcessor(DASImplementationFactory crudFactory) {
+ this.dasFactory = crudFactory;
+ }
+
+ public QName getArtifactType() {
+ // Returns the qname of the XML element processed by this processor
+ return IMPLEMENTATION_DAS;
+ }
+
+ public Class<DASImplementation> getModelType() {
+ // Returns the type of model processed by this processor
+ return DASImplementation.class;
+ }
+
+ public DASImplementation read(XMLStreamReader reader) throws ContributionReadException {
+ assert IMPLEMENTATION_DAS.equals(reader.getName());
+
+ // Read an <implementation.crud> element
+ try {
+ // Read the das config file attribute.
+ // This is das configuration side file to use
+ String config = reader.getAttributeValue(null, "config");
+
+ // Read the data access type attribute
+ // This is the type of data store in use (e.g rdb, xml, etc)
+ String dataAccessType = reader.getAttributeValue(null, "dataAccessType");
+
+ // Create an initialize the DAS implementation model
+ DASImplementation implementation = dasFactory.createDASImplementation();
+ implementation.setConfig(config);
+ implementation.setDataAccessType(dataAccessType);
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && IMPLEMENTATION_DAS.equals(reader.getName())) {
+ break;
+ }
+ }
+
+ return implementation;
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+ public void resolve(DASImplementation impl, ModelResolver resolver) throws ContributionResolveException {
+ }
+
+ public void write(DASImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException {
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/DASModuleActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/DASModuleActivator.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/DASModuleActivator.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/DASModuleActivator.java Thu Jun 14 23:53:23 2007
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.das.module;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ModuleActivator;
+import org.apache.tuscany.sca.implementation.das.DASImplementationFactory;
+import org.apache.tuscany.sca.implementation.das.DefaultDASImplementationFactory;
+import org.apache.tuscany.sca.implementation.das.impl.DASImplementationProcessor;
+import org.apache.tuscany.sca.implementation.das.provider.DASImplementationProviderFactory;
+import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.java.introspect.ExtensibleJavaInterfaceIntrospector;
+import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospector;
+import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint;
+import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
+
+
+/**
+ * Implements a module activator for the DAS implementation extension module.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASModuleActivator implements ModuleActivator {
+
+ public Object[] getExtensionPoints() {
+ // This module extension does not contribute any new extension point
+ return null;
+ }
+
+ public void start(ExtensionPointRegistry registry) {
+
+ // Create the CRUD implementation factory
+ ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
+ AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
+ JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
+ JavaInterfaceIntrospectorExtensionPoint visitors = registry.getExtensionPoint(JavaInterfaceIntrospectorExtensionPoint.class);
+ JavaInterfaceIntrospector introspector = new ExtensibleJavaInterfaceIntrospector(javaFactory, visitors);
+ DASImplementationFactory crudFactory = new DefaultDASImplementationFactory(assemblyFactory, javaFactory, introspector);
+
+ // Add the CRUD implementation extension to the StAXArtifactProcessor
+ // extension point
+ StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ DASImplementationProcessor implementationArtifactProcessor = new DASImplementationProcessor(crudFactory);
+ processors.addArtifactProcessor(implementationArtifactProcessor);
+
+ // Add the CRUD provider factory to the ProviderFactory extension point
+ ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class);
+ providerFactories.addProviderFactory(new DASImplementationProviderFactory());
+ }
+
+ public void stop(ExtensionPointRegistry registry) {
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProvider.java Thu Jun 14 23:53:23 2007
@@ -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.das.provider;
+
+import org.apache.tuscany.das.rdb.DAS;
+import org.apache.tuscany.sca.implementation.das.DASImplementation;
+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;
+
+/**
+ * DAS Implementation provider
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASImplementationProvider implements ImplementationProvider {
+
+ private RuntimeComponent component;
+ private DASImplementation implementation;
+ private final DataAccessEngineManager dataAccessEngineManager;
+
+ /**
+ * Constructs a new DAS implementation.
+ */
+ public DASImplementationProvider(RuntimeComponent component, DASImplementation implementation) {
+ this.component = component;
+ this.implementation = implementation;
+ this.dataAccessEngineManager = new DataAccessEngineManager();
+ }
+
+ public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
+ DAS das = null;
+ try {
+ das = dataAccessEngineManager.getDAS(implementation.getConfig());
+ } catch(Exception e) {
+ e.printStackTrace();
+ //what now ?
+ }
+ DASInvoker invoker = new DASInvoker(operation, new DataAccessEngine(das) );
+ return invoker;
+ }
+
+ public Invoker createCallbackInvoker(Operation operation) {
+ DAS das = null;
+ try {
+ das = dataAccessEngineManager.getDAS(implementation.getConfig());
+ } catch(Exception e) {
+ //what now ?
+ }
+
+ DASInvoker invoker = new DASInvoker(operation, new DataAccessEngine(das) );
+ return invoker;
+ }
+
+ public void start() {
+ System.out.println("Starting " + component.getName());
+ }
+
+ public void stop() {
+ System.out.println("Stopping " + component.getName());
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASImplementationProviderFactory.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das.provider;
+
+import org.apache.tuscany.sca.implementation.das.DASImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * Factory for DAS Implementation Provider
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASImplementationProviderFactory implements ImplementationProviderFactory<DASImplementation> {
+
+ /**
+ * Constructs a new CRUD implementation.
+ */
+ public DASImplementationProviderFactory() {
+ }
+
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component, DASImplementation implementation) {
+ return new DASImplementationProvider(component, implementation);
+ }
+
+ public Class<DASImplementation> getModelType() {
+ return DASImplementation.class;
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DASInvoker.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das.provider;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+
+
+/**
+ * Implements a target invoker for DAS component implementations.
+ *
+ * The target invoker is responsible for dispatching invocations to the particular
+ * component implementation logic. The current component implementation will
+ * dispatch calls to the DAS apis to retrieve the requested data from the backend store
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASInvoker implements Invoker {
+ private final Operation operation;
+ private final DataAccessEngine dataAccessEngine;
+
+ public DASInvoker(Operation operation, DataAccessEngine dataAccessEngine) {
+ this.operation = operation;
+ this.dataAccessEngine = dataAccessEngine;
+ }
+
+ public Message invoke(Message msg) {
+ try {
+ Object[] args = msg.getBody();
+ Object resp = doTheWork(args);
+ msg.setBody(resp);
+ } catch (InvocationTargetException e) {
+ msg.setFaultBody(e.getCause());
+ }
+ return msg;
+ }
+
+ public Object doTheWork(Object[] args) throws InvocationTargetException {
+ if (operation.getName().equals("executeCommand")) {
+ String commandName, xPath;
+
+ //simple execute command by name
+ if( args.length == 1){
+ commandName = (String) args[0];
+ return this.dataAccessEngine.executeCommand(commandName);
+ } else {
+ commandName = (String) args[0];
+ xPath = (String) args[1];
+
+ return this.dataAccessEngine.executeCommand(commandName, xPath);
+ }
+ } else {
+ return null;
+ }
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngine.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngine.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngine.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngine.java Thu Jun 14 23:53:23 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.das.provider;
+
+import org.apache.tuscany.das.rdb.Command;
+import org.apache.tuscany.das.rdb.DAS;
+
+import commonj.sdo.DataObject;
+
+/**
+ * Facade to hide DAS implementation details of handling commands
+ *
+ * @version $Rev$ $Date$
+ */
+public class DataAccessEngine {
+ private final DAS das;
+
+ public DataAccessEngine(DAS das) {
+ this.das = das;
+ }
+
+ public DataObject executeCommand(String commandName) {
+ try {
+ Command command = this.das.getCommand(commandName);
+ return command.executeQuery();
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ DataObject executeCommand(String commandName, String xPath) {
+ DataObject root = executeCommand(commandName);
+ return root.getDataObject(xPath);
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngineManager.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngineManager.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngineManager.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/DataAccessEngineManager.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das.provider;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.das.rdb.DAS;
+
+/**
+ * The DataAccessEngineManager acts like a registry and factory for DAS instances
+ * It holds DAS by it's config file name, reusing the same DAS for all components
+ * using the same config file.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DataAccessEngineManager {
+ private final Map<String, DAS> registry = new HashMap<String, DAS>();
+
+ public DataAccessEngineManager() {
+ super();
+ }
+
+ protected DAS initializeDAS(String config) throws MissingConfigFileException {
+ //load the config file
+ System.out.println("Initializing DAS");
+ DAS das = DAS.FACTORY.createDAS(this.getConfigStream(config));
+
+ return das;
+ }
+
+ protected InputStream getConfigStream(String config) throws MissingConfigFileException{
+ InputStream configStream = null;
+
+ try {
+ configStream = this.getClass().getResourceAsStream(config);
+ } catch (Exception e) {
+ throw new MissingConfigFileException(config);
+ }
+
+ return configStream;
+ }
+
+ public DAS getDAS(String config) throws MissingConfigFileException {
+ DAS das = registry.get(config);
+ if ( das == null) {
+ das = this.initializeDAS(config);
+ this.registry.put(config, das);
+ }
+ return das;
+ }
+
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/MissingConfigFileException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/MissingConfigFileException.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/MissingConfigFileException.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/MissingConfigFileException.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das.provider;
+
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+
+
+/**
+ * Exception to be used when DAS configuration side file is not available
+ *
+ * @version $Rev$ $Date$
+ */
+public class MissingConfigFileException extends ContributionReadException {
+
+ private static final long serialVersionUID = -2616590185174691724L;
+
+ public MissingConfigFileException(String message) {
+ super(message);
+ }
+
+ public MissingConfigFileException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MissingConfigFileException(Throwable cause) {
+ super(cause);
+ }
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator Thu Jun 14 23:53:23 2007
@@ -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 ExtensionActivator
+#
+org.apache.tuscany.sca.implementation.das.module.DASModuleActivator
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java Thu Jun 14 23:53:23 2007
@@ -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.implementation.das;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import commonj.sdo.DataObject;
+
+/**
+ * Tests the DAS service
+ *
+ * @version $Rev$ $Date$
+ */
+public class DASTestCase extends TestCase {
+
+ private SCADomain scaDomain;
+ private DAS dasService;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void setUp() throws Exception {
+ scaDomain = SCADomain.newInstance("das.composite");
+ dasService = scaDomain.getService(DAS.class, "DASServiceComponent");
+
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void tearDown() throws Exception {
+ scaDomain.close();
+ }
+
+
+ public void testExecuteCommand() throws Exception {
+ String commandName = "all companies";
+
+ DataObject resultRoot= dasService.executeCommand(commandName);
+ assertNotNull(resultRoot);
+ assertEquals(3, resultRoot.getList("COMPANY").size());
+ }
+
+ public void testExecuteCommandWithFilter() throws Exception {
+ String commandName = "all companies";
+
+ DataObject resultRoot= dasService.executeCommand(commandName, "COMPANY[1]");
+ assertNotNull(resultRoot);
+ }
+
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyService.java Thu Jun 14 23:53:23 2007
@@ -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.das.company;
+
+import commonj.sdo.DataObject;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public interface CompanyService {
+
+ public DataObject getCompanies();
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java Thu Jun 14 23:53:23 2007
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.das.company;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+import commonj.sdo.DataObject;
+
+/**
+ * Tests the DAS service
+ */
+public class CompanyServiceTestCase extends TestCase {
+
+ //private SCADomain scaDomain;
+ //private CompanyService dasCompanyService;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void setUp() throws Exception {
+ /*
+ scaDomain = SCADomain.newInstance("company.composite");
+ dasCompanyService = scaDomain.getService(CompanyService.class, "CompanyService");
+ */
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void tearDown() throws Exception {
+ /*
+ scaDomain.close();
+ */
+ }
+
+ public void testExecuteCommand() throws Exception {
+ /*
+ DataObject root = dasCompanyService.getCompanies();
+ assertNotNull(root);
+ */
+ }
+
+
+}
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/CompanyConfig.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/CompanyConfig.xml?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/CompanyConfig.xml (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/CompanyConfig.xml Thu Jun 14 23:53:23 2007
@@ -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.
+ -->
+<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">
+
+ <ConnectionInfo>
+ <ConnectionProperties
+ driverClass="org.apache.derby.jdbc.EmbeddedDriver"
+ databaseURL="jdbc:derby:target/test-classes/dastest; create = true"
+ loginTimeout="600000"/>
+ </ConnectionInfo>
+
+ <Command name="all companies" SQL="select * from COMPANY" kind="Select"/>
+
+ <Command name="all companies and departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID" kind="Select"/>
+
+ <Command name="all departments for company" SQL="select * from COMPANY inner join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+ <Command name="company by id with departments" SQL="select * from COMPANY left outer join DEPARTMENT on COMPANY.ID = DEPARTMENT.COMPANYID where COMPANY.ID = ?" kind="Select"/>
+
+ <Table tableName="COMPANY">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Table tableName="DEPARTMENT">
+ <Column columnName="ID" primaryKey="true" generated="true"/>
+ </Table>
+
+ <Relationship name="departments" primaryKeyTable="COMPANY" foreignKeyTable="DEPARTMENT" many="true">
+ <KeyPair primaryKeyColumn="ID" foreignKeyColumn="COMPANYID"/>
+ </Relationship>
+
+
+</Config>
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/company.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/company.composite?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/company.composite (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/company.composite Thu Jun 14 23:53:23 2007
@@ -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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample/das"
+ xmlns:sd="http://sample/das"
+ xmlns:das="http://das"
+ name="das">
+
+ <service name="CompanyServiceComponent" promote="CompanyComponent">
+ <interface.java interface="org.apache.tuscany.sca.implementation.das.company.CompanyService"/>
+ </service>
+
+ <component name="CompanyComponent">
+ <das:implementation.das config="/CompanyConfig.xml" dataAccessType="rdb" />
+ </component>
+</composite>
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/das.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/das.composite?view=auto&rev=547551
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/das.composite (added)
+++ incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/das.composite Thu Jun 14 23:53:23 2007
@@ -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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample/das"
+ xmlns:sd="http://sample/das"
+ xmlns:das="http://das"
+ name="das">
+
+ <component name="DASServiceComponent">
+ <das:implementation.das config="/CompanyConfig.xml" dataAccessType="rdb" />
+ </component>
+
+</composite>
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log.ctrl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log.ctrl?view=auto&rev=547551
==============================================================================
Binary file - no diff available.
Propchange: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log.ctrl
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log1.dat
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log1.dat?view=auto&rev=547551
==============================================================================
Binary file - no diff available.
Propchange: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/log1.dat
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/logmirror.ctrl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/logmirror.ctrl?view=auto&rev=547551
==============================================================================
Binary file - no diff available.
Propchange: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/log/logmirror.ctrl
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c10.dat
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-das/src/test/resources/dastest/seg0/c10.dat?view=auto&rev=547551
==============================================================================
Binary file - no diff available.
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org