You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/06/15 10:35:18 UTC
svn commit: r547576 - in /incubator/tuscany/sandbox/ant/implementation-das:
./ src/main/java/org/apache/tuscany/sca/implementation/das/
src/main/java/org/apache/tuscany/sca/implementation/das/impl/
src/main/java/org/apache/tuscany/sca/implementation/da...
Author: antelder
Date: Fri Jun 15 01:35:16 2007
New Revision: 547576
URL: http://svn.apache.org/viewvc?view=rev&rev=547576
Log:
das impl using dynamic simple spi
Added:
incubator/tuscany/sandbox/ant/implementation-das/ (props changed)
- copied from r547564, incubator/tuscany/java/sca/modules/implementation-das/
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java (with props)
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java (with props)
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java (with props)
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java (with props)
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java (with props)
incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator
Removed:
incubator/tuscany/sandbox/ant/implementation-das/README
incubator/tuscany/sandbox/ant/implementation-das/build.xml
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/Constants.java
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DAS.java
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationFactory.java
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DefaultDASImplementationFactory.java
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/impl/
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/module/
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/provider/
incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator
incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/DASTestCase.java
Modified:
incubator/tuscany/sandbox/ant/implementation-das/pom.xml
incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java
incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/CompanyConfig.xml
incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/company.composite
incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/das.composite
Propchange: incubator/tuscany/sandbox/ant/implementation-das/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jun 15 01:35:16 2007
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+
Modified: incubator/tuscany/sandbox/ant/implementation-das/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/pom.xml?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/pom.xml (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/pom.xml Fri Jun 15 01:35:16 2007
@@ -44,56 +44,15 @@
</dependency>
<dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r2.1</artifactId>
<version>1.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
</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>
+ <artifactId>tuscany-extension-helper</artifactId>
<version>1.0-incubating-SNAPSHOT</version>
</dependency>
Modified: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementation.java Fri Jun 15 01:35:16 2007
@@ -18,38 +18,45 @@
*/
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 {
+public class DASImplementation {
+
+ private String config;
+ private String dataAccessType;
/**
* Return the DAS configuration side file
*
* @return the name of the das configuration side file
*/
- public String getConfig();
+ public String getConfig() {
+ return config;
+ }
/**
* Sets the DAS configuration side file
*
* @param config The name of the das configuration side file
*/
- public void setConfig(String config);
+ public void setConfig(String config) {
+ this.config = config;
+ }
/**
* Return the data store type being used
* @return The data store type
*/
- public String getDataAccessType();
+ public String getDataAccessType() {
+ return dataAccessType;
+ }
/**
* Sets the data store type being used
* @param dataAccessType The data store type in use
*/
- public void setDataAccessType(String dataAccessType);
+ public void setDataAccessType(String dataAccessType) {
+ this.dataAccessType = dataAccessType;
+ }
}
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java Fri Jun 15 01:35:16 2007
@@ -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.implementation.das;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.spi.ImplementationActivator;
+import org.apache.tuscany.sca.spi.InvokerFactory;
+
+public class DASImplementationActivator implements ImplementationActivator<DASImplementation>{
+
+ private final DataAccessEngineManager dataAccessEngineManager;
+
+ private static final QName IMPLEMENTATION_DAS = new QName(Constants.SCA10_NS, "implementation.das");
+
+ public DASImplementationActivator() {
+ this.dataAccessEngineManager = new DataAccessEngineManager();
+ }
+
+ public InvokerFactory createInvokerFactory(RuntimeComponent rc, ComponentType ct, DASImplementation impl) {
+ return new DASInvokerFactory(rc, ct, impl, dataAccessEngineManager);
+ }
+
+ public Class<DASImplementation> getImplementationClass() {
+ return DASImplementation.class;
+ }
+
+ public QName getSCDLQName() {
+ return IMPLEMENTATION_DAS;
+ }
+
+}
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASImplementationActivator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java Fri Jun 15 01:35:16 2007
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.das;
+
+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
+ *
+ */
+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) {
+ Object[] args = msg.getBody();
+ Object resp = doTheWork(args);
+ msg.setBody(resp);
+ return msg;
+ }
+
+ public Object doTheWork(Object[] args) {
+ //simple execute command by name
+ if(args==null || args.length < 1){
+ return this.dataAccessEngine.executeCommand(operation.getName());
+ } else {
+ String xPath = (String) args[0];
+ return this.dataAccessEngine.executeCommand(operation.getName(), xPath);
+ }
+ }
+}
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvoker.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java Fri Jun 15 01:35:16 2007
@@ -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.das;
+
+import org.apache.tuscany.das.rdb.DAS;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.spi.InvokerFactory;
+import org.osoa.sca.ServiceRuntimeException;
+
+public class DASInvokerFactory implements InvokerFactory {
+
+ DASImplementation impl;
+ DataAccessEngineManager dataAccessEngineManager;
+
+ public DASInvokerFactory(RuntimeComponent rc, ComponentType ct, DASImplementation impl, DataAccessEngineManager dataAccessEngineManager) {
+ this.impl = impl;
+ this.dataAccessEngineManager = dataAccessEngineManager;
+ }
+
+ public Invoker createInvoker(Operation operation) {
+ DAS das = null;
+ try {
+ das = dataAccessEngineManager.getDAS(impl.getConfig());
+ } catch(Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+ return new DASInvoker(operation, new DataAccessEngine(das) );
+ }
+
+}
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DASInvokerFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java Fri Jun 15 01:35:16 2007
@@ -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.implementation.das;
+
+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
+ */
+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;
+ }
+ }
+
+ public DataObject executeCommand(String commandName, String xPath) {
+ DataObject root = executeCommand(commandName);
+ return root.getDataObject(xPath);
+ }
+
+}
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngine.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java Fri Jun 15 01:35:16 2007
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.das;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.das.rdb.DAS;
+import org.osoa.sca.ServiceRuntimeException;
+
+/**
+ * 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>();
+
+ protected DAS initializeDAS(String config) {
+ //load the config file
+ System.out.println("Initializing DAS");
+ DAS das = DAS.FACTORY.createDAS(this.getConfigStream(config));
+
+ return das;
+ }
+
+ protected InputStream getConfigStream(String config) {
+ InputStream configStream = null;
+
+ try {
+ configStream = this.getClass().getResourceAsStream(config);
+ } catch (Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+
+ return configStream;
+ }
+
+ public DAS getDAS(String config) {
+ DAS das = registry.get(config);
+ if ( das == null) {
+ das = this.initializeDAS(config);
+ this.registry.put(config, das);
+ }
+ return das;
+ }
+
+
+}
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/sandbox/ant/implementation-das/src/main/java/org/apache/tuscany/sca/implementation/das/DataAccessEngineManager.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator?view=auto&rev=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator (added)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/main/resources/META-INF/services/org.apache.tuscany.sca.spi.ImplementationActivator Fri Jun 15 01:35:16 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.DASImplementationActivator
Modified: incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/test/java/org/apache/tuscany/sca/implementation/das/company/CompanyServiceTestCase.java Fri Jun 15 01:35:16 2007
@@ -30,33 +30,27 @@
*/
public class CompanyServiceTestCase extends TestCase {
- //private SCADomain scaDomain;
- //private CompanyService dasCompanyService;
+ 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");
- */
+ dasCompanyService = scaDomain.getService(CompanyService.class, "CompanyComponent");
}
/**
* @throws java.lang.Exception
*/
protected void tearDown() throws Exception {
- /*
scaDomain.close();
- */
}
public void testExecuteCommand() throws Exception {
- /*
DataObject root = dasCompanyService.getCompanies();
assertNotNull(root);
- */
}
Modified: incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/CompanyConfig.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/CompanyConfig.xml?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/CompanyConfig.xml (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/CompanyConfig.xml Fri Jun 15 01:35:16 2007
@@ -26,6 +26,8 @@
loginTimeout="600000"/>
</ConnectionInfo>
+ <Command name="getCompanies" SQL="select * from COMPANY" kind="Select"/>
+
<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"/>
Modified: incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/company.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/company.composite?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/company.composite (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/company.composite Fri Jun 15 01:35:16 2007
@@ -19,8 +19,6 @@
-->
<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">
@@ -28,6 +26,6 @@
</service>
<component name="CompanyComponent">
- <das:implementation.das config="/CompanyConfig.xml" dataAccessType="rdb" />
+ <implementation.das config="/CompanyConfig.xml" dataAccessType="rdb" />
</component>
</composite>
Modified: incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/das.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/das.composite?view=diff&rev=547576&r1=547564&r2=547576
==============================================================================
--- incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/das.composite (original)
+++ incubator/tuscany/sandbox/ant/implementation-das/src/test/resources/das.composite Fri Jun 15 01:35:16 2007
@@ -19,12 +19,10 @@
-->
<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" />
+ <implementation.das config="/CompanyConfig.xml" dataAccessType="rdb" />
</component>
</composite>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org