servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r359607 [1/2] - in /incubator/servicemix/trunk/servicemix-sca: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/servicemix/ src/main/java/org/apache/servicemix/sca/ src/main/java/org/apa...
Date Wed, 28 Dec 2005 19:23:27 GMT
Author: gnodet
Date: Wed Dec 28 11:23:05 2005
New Revision: 359607

URL: http://svn.apache.org/viewcvs?rev=359607&view=rev
Log:
Add unfinished sca / tuscany Service Engine

Added:
    incubator/servicemix/trunk/servicemix-sca/   (with props)
    incubator/servicemix/trunk/servicemix-sca/pom.xml
    incubator/servicemix/trunk/servicemix-sca/src/
    incubator/servicemix/trunk/servicemix-sca/src/main/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/CommonsLoggingLogProvider.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaBootstrap.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiAssemblyFactory.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiBinding.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiAssemblyFactoryImpl.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/DocumentRoot.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyFactory.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyPackage.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceHandler.java
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/
    incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/JbiBinding.java
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.componentType
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/sca.fragment
    incubator/servicemix/trunk/servicemix-sca/src/main/resources/tuscany-model.config
    incubator/servicemix/trunk/servicemix-sca/src/test/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTestCase.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReport.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.wsdl
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/AccountDataService.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/AccountDataServiceImpl.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/CheckingAccount.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/SavingsAccount.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/accountdata/StockAccount.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java
    incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteWebService.wsdl
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/servicemix/sca/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/servicemix/sca/bigbank/
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/servicemix/sca/bigbank/sca.module
    incubator/servicemix/trunk/servicemix-sca/src/test/resources/org/apache/servicemix/sca/bigbank/tuscany-model.config

Propchange: incubator/servicemix/trunk/servicemix-sca/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Dec 28 11:23:05 2005
@@ -0,0 +1,5 @@
+.settings
+.project
+.wtpmodules
+target
+.classpath

Added: incubator/servicemix/trunk/servicemix-sca/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/pom.xml?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/pom.xml (added)
+++ incubator/servicemix/trunk/servicemix-sca/pom.xml Wed Dec 28 11:23:05 2005
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<!-- $Rev: 359503 $ $Date: 2005-12-28 13:56:03 +0100 (mer., 28 déc. 2005) $ -->
+<project 
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xmlns="http://maven.apache.org/POM/4.0.0">
+    
+    <parent>
+        <groupId>org.apache.servicemix</groupId>
+        <artifactId>servicemix</artifactId>
+        <version>3.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix-sca</artifactId>
+    <packaging>jar</packaging>
+    <name>ServiceMix :: SCA Service Engine</name>
+    <description>SCA service engine</description>
+    <dependencies>
+    
+        <dependency>
+            <groupId>org.apache.servicemix</groupId>
+            <artifactId>servicemix-common</artifactId>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>commonj-sdo</artifactId>
+        	<version>2.1.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>ecore</artifactId>
+        	<version>2.1.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>common</artifactId>
+        	<version>2.1.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>ecore-sdo</artifactId>
+        	<version>2.1.1</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>ecore-change</artifactId>
+        	<version>2.1.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.emf</groupId>
+        	<artifactId>ecore-xmi</artifactId>
+        	<version>2.1.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse.wst</groupId>
+        	<artifactId>wsdl</artifactId>
+        	<version>1.0.0</version>
+        </dependency>
+        <dependency>
+        	<groupId>org.eclipse</groupId>
+        	<artifactId>xsd</artifactId>
+        	<version>2.1.1</version>
+        </dependency>
+        <dependency>
+        	<groupId>servicemix</groupId>
+        	<artifactId>tuscany-common</artifactId>
+        	<version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+        	<groupId>servicemix</groupId>
+        	<artifactId>tuscany-container-java</artifactId>
+        	<version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+        	<groupId>servicemix</groupId>
+        	<artifactId>tuscany-core</artifactId>
+        	<version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+        	<groupId>servicemix</groupId>
+        	<artifactId>tuscany-model</artifactId>
+        	<version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
+        	<groupId>servicemix</groupId>
+        	<artifactId>sca-api</artifactId>
+        	<version>SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+        	<groupId>junit</groupId>
+        	<artifactId>junit</artifactId>
+        	<scope>test</scope>
+        </dependency>
+        <dependency>
+        	<groupId>org.apache.servicemix</groupId>
+        	<artifactId>servicemix-core</artifactId>
+        	<scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                    <include>**/*</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>target/generated</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+             </plugin>
+        </plugins>
+    </build>
+    
+</project>

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/CommonsLoggingLogProvider.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/CommonsLoggingLogProvider.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/CommonsLoggingLogProvider.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/CommonsLoggingLogProvider.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import org.apache.commons.logging.LogFactory;
+import org.apache.tuscany.common.logging.Log;
+import org.apache.tuscany.common.logging.LogProvider;
+
+public class CommonsLoggingLogProvider implements LogProvider {
+
+	public Log getLog(Class clazz) {
+		return new CommonsLoggingLog(LogFactory.getLog(clazz));
+	}
+
+	public Log getLog(Class clazz, String resourceBundleName) {
+		return new CommonsLoggingLog(LogFactory.getLog(clazz));
+	}
+	
+	public static class CommonsLoggingLog implements Log {
+
+		org.apache.commons.logging.Log log;
+		
+		public CommonsLoggingLog(org.apache.commons.logging.Log log) {
+			this.log = log;
+		}
+		
+		public boolean isDebugEnabled() {
+			return log.isDebugEnabled();
+		}
+
+		public boolean isEntryEnabled() {
+			return log.isTraceEnabled();
+		}
+
+		public boolean isEventEnabled() {
+			return log.isTraceEnabled();
+		}
+
+		public void debug(String message) {
+			log.debug(message);
+		}
+
+		public void debug(String message, Object obj) {
+			if (obj instanceof Throwable) {
+				log.debug(message, (Throwable) obj);
+			} else {
+				log.debug(message + ": " + obj);
+			}
+		}
+
+		public void event(String message) {
+			log.trace(message);
+		}
+
+		public void event(String message, Object obj) {
+			if (obj instanceof Throwable) {
+				log.trace(message, (Throwable) obj);
+			} else {
+				log.trace(message + ": " + obj);
+			}
+		}
+
+		public void entry(String message) {
+			log.debug(message);
+		}
+
+		public void entry(String message, Object obj) {
+			if (obj instanceof Throwable) {
+				log.trace(message, (Throwable) obj);
+			} else {
+				log.trace(message + ": " + obj);
+			}
+		}
+
+		public void exit(String message) {
+			log.debug(message);
+		}
+
+		public void exit(String message, Object obj) {
+			if (obj instanceof Throwable) {
+				log.trace(message, (Throwable) obj);
+			} else {
+				log.trace(message + ": " + obj);
+			}
+		}
+
+		public void info(String messageKey) {
+			log.info(messageKey);
+		}
+
+		public void info(String messageKey, Object[] objs) {
+			log.info(messageKey + ": " + objs);
+		}
+
+		public void warning(String messageKey) {
+			log.warn(messageKey);
+		}
+
+		public void warning(String messageKey, Object[] objs) {
+			log.warn(messageKey);
+		}
+
+		public void error(String messageKey) {
+			log.error(messageKey);
+		}
+
+		public void error(String messageKey, Object[] objs) {
+			log.error(messageKey);
+		}
+
+		public void error(String messageKey, Throwable throwable) {
+			log.error(messageKey, throwable);
+		}
+
+		public void fatal(Throwable throwable) {
+			log.fatal(null, throwable);
+		}
+
+		public void fatal(Throwable throwable, Object[] objs) {
+			log.fatal(null, throwable);
+		}
+		
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaBootstrap.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaBootstrap.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaBootstrap.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaBootstrap.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import org.apache.servicemix.common.BaseBootstrap;
+
+public class ScaBootstrap extends BaseBootstrap {
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import org.apache.servicemix.common.BaseComponent;
+import org.apache.servicemix.common.BaseLifeCycle;
+import org.apache.servicemix.common.BaseServiceUnitManager;
+import org.apache.servicemix.common.Deployer;
+
+public class ScaComponent extends BaseComponent {
+
+    /* (non-Javadoc)
+     * @see org.servicemix.common.BaseComponent#createLifeCycle()
+     */
+    protected BaseLifeCycle createLifeCycle() {
+        return new ScaLifeCycle(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.servicemix.common.BaseComponent#createServiceUnitManager()
+     */
+    public BaseServiceUnitManager createServiceUnitManager() {
+        Deployer[] deployers = new Deployer[] { new ScaDeployer(this) };
+        return new BaseServiceUnitManager(this, deployers);
+    }
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import java.io.File;
+
+import javax.jbi.management.DeploymentException;
+
+import org.apache.servicemix.common.AbstractDeployer;
+import org.apache.servicemix.common.BaseComponent;
+import org.apache.servicemix.common.ServiceUnit;
+
+public class ScaDeployer extends AbstractDeployer {
+
+	public static final String SCA_MODULE_FILE = "sca.module";
+	
+	public ScaDeployer(BaseComponent component) {
+		super(component);
+	}
+
+	public boolean canDeploy(String serviceUnitName, String serviceUnitRootPath) {
+		File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
+		return module.exists() && module.isFile();
+	}
+
+	public ServiceUnit deploy(String serviceUnitName, String serviceUnitRootPath)
+			throws DeploymentException {
+		File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
+		if (!module.exists() || !module.isFile()) {
+            throw failure("deploy", "No sca.module found", null);
+		}
+		try {
+			ScaServiceUnit su = new ScaServiceUnit();
+	        su.setComponent(component);
+	        su.setName(serviceUnitName);
+	        su.setRootPath(serviceUnitRootPath);
+	        su.init();
+	        return su;
+		} catch (Exception e) {
+			throw failure("deploy", "Error loading sca module", e);
+		}
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import javax.jbi.component.ComponentContext;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessageExchange.Role;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+import org.apache.tuscany.core.runtime.webapp.TuscanyWebAppRuntime;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.servicemix.common.Endpoint;
+import org.apache.servicemix.common.ExchangeProcessor;
+
+public class ScaEndpoint extends Endpoint implements ExchangeProcessor {
+
+    protected ServiceEndpoint activated;
+    protected EntryPoint entryPoint;
+	
+	public ScaEndpoint(EntryPoint entryPoint) {
+		this.entryPoint = entryPoint;
+	}
+
+	public Role getRole() {
+		return Role.PROVIDER;
+	}
+
+	public void activate() throws Exception {
+        logger = this.serviceUnit.getComponent().getLogger();
+        ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
+        activated = ctx.activateEndpoint(service, endpoint);
+        getProcessor().start();
+	}
+
+	public void deactivate() throws Exception {
+        ServiceEndpoint ep = activated;
+        activated = null;
+        getProcessor().stop();
+        ComponentContext ctx = this.serviceUnit.getComponent().getComponentContext();
+        ctx.deactivateEndpoint(ep);
+	}
+
+	public ExchangeProcessor getProcessor() {
+		return this;
+	}
+
+	public void process(MessageExchange exchange) throws Exception {
+		TuscanyWebAppRuntime sca = ((ScaServiceUnit) getServiceUnit()).getTuscanyRuntime();
+		Object mth = sca.getModuleComponentContext().locateService(entryPoint.getName());
+		
+	}
+
+	public void start() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void stop() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import java.util.List;
+
+import org.apache.tuscany.common.discovery.util.ServiceProviderRegistry;
+import org.apache.tuscany.common.logging.LogProvider;
+import org.apache.servicemix.common.BaseComponent;
+import org.apache.servicemix.common.BaseLifeCycle;
+
+public class ScaLifeCycle extends BaseLifeCycle {
+
+	public ScaLifeCycle(BaseComponent component) {
+		super(component);
+		List l = ServiceProviderRegistry.getInstance().getServiceProviders(LogProvider.class);
+		l.clear();
+		l.add(new CommonsLoggingLogProvider());
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jbi.messaging.MessageExchange.Role;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.factory.WSDLFactory;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.common.resource.loader.ResourceLoader;
+import org.apache.tuscany.common.resource.loader.ResourceLoaderFactory;
+import org.apache.tuscany.core.runtime.EventContext;
+import org.apache.tuscany.core.runtime.TuscanyModuleComponentContext;
+import org.apache.tuscany.core.runtime.config.ConfigurationLoader;
+import org.apache.tuscany.core.runtime.config.impl.EMFConfigurationLoader;
+import org.apache.tuscany.core.runtime.impl.EventContextImpl;
+import org.apache.tuscany.core.runtime.impl.TuscanyModuleComponentContextImpl;
+import org.apache.tuscany.core.runtime.scopes.DefaultScopeStrategy;
+import org.apache.tuscany.core.runtime.webapp.TuscanyWebAppRuntime;
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.Module;
+import org.apache.tuscany.model.assembly.ModuleComponent;
+import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
+import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl;
+import org.apache.tuscany.model.types.wsdl.WSDLTypeHelper;
+import org.osoa.sca.model.Binding;
+import org.osoa.sca.model.JbiBinding;
+import org.apache.servicemix.common.ServiceUnit;
+import org.w3c.dom.Document;
+
+public class ScaServiceUnit extends ServiceUnit {
+
+	protected TuscanyWebAppRuntime tuscanyRuntime;
+	protected ClassLoader classLoader;
+	
+	public void init() throws Exception {
+		createScaRuntime();
+		createEndpoints();
+	}
+	
+	protected void createScaRuntime() throws Exception {
+		File root = new File(getRootPath());
+		File[] files = root.listFiles(new JarFileFilter());
+		URL[] urls = new URL[files.length + 1];
+		for (int i = 0; i < files.length; i++) {
+			urls[i] = files[i].toURL();
+		}
+		urls[urls.length - 1] = root.toURL();
+		classLoader = new URLClassLoader(urls, getClass().getClassLoader());
+        Thread.currentThread().setContextClassLoader(classLoader);
+		
+        ResourceLoader resourceLoader = ResourceLoaderFactory.getResourceLoader(classLoader);
+        AssemblyModelContext modelContext = new AssemblyModelContextImpl(resourceLoader);
+        ConfigurationLoader moduleComponentLoader = new EMFConfigurationLoader(modelContext);
+        ModuleComponent moduleComponent = moduleComponentLoader.loadModuleComponent(getName(), getName());
+        EventContext eventContext = new EventContextImpl();
+        DefaultScopeStrategy scopeStrategy = new DefaultScopeStrategy();
+        TuscanyModuleComponentContext moduleComponentContext = new TuscanyModuleComponentContextImpl(moduleComponent, eventContext, scopeStrategy, modelContext);
+        tuscanyRuntime = new TuscanyWebAppRuntime(moduleComponentContext);
+	}
+	
+	protected void createEndpoints() throws Exception {
+        AssemblyFactory assemblyFactory = new AssemblyFactoryImpl();
+        TuscanyModuleComponentContext moduleComponentContext = tuscanyRuntime.getModuleComponentContext(); 
+        Module module = moduleComponentContext.getModuleComponent().getModuleImplementation();
+        for (Iterator i = module.getEntryPoints().iterator(); i.hasNext();) {
+            EntryPoint entryPoint = (EntryPoint) i.next();
+            Binding binding = (Binding) entryPoint.getBindings().get(0);
+            if (binding instanceof JbiBinding) {
+                JbiBinding jbiBinding = (JbiBinding) binding;
+                Definition definition = null;
+                Document description = null;
+                QName serviceName = null;
+                QName interfaceName = null;
+                String endpointName = null;
+                QName qname = assemblyFactory.createQName(jbiBinding.getPort());
+                if (qname != null) {
+                	try {
+	                    WSDLTypeHelper typeHelper = moduleComponentContext.getAssemblyModelContext().getWSDLTypeHelper();
+	                    definition = typeHelper.getWSDLDefinition(qname.getNamespaceURI());
+	                    for (Iterator itSvc = definition.getServices().values().iterator(); itSvc.hasNext();) {
+	                    	Service svc = (Service) itSvc.next();
+	                    	if (svc.getQName().getNamespaceURI().equals(qname.getNamespaceURI())) {
+	                    		for (Iterator itPort = svc.getPorts().values().iterator(); itPort.hasNext();) {
+	                    			Port port = (Port) itPort.next();
+	                    			if (port.getName().equals(qname.getLocalPart())) {
+	                    				serviceName = svc.getQName();
+	                    				endpointName = port.getName();
+	                    				interfaceName = port.getBinding().getPortType().getQName();
+	                    			}
+	                    		}
+	                    	}
+	                    }
+	                    javax.wsdl.Binding b = definition.getBinding(qname);
+	                    description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
+                	} catch (Exception e) {
+                		// TODO warn
+                	}
+                	if (serviceName == null) {
+                		serviceName = new QName(qname.getNamespaceURI(), entryPoint.getName());
+                	}
+                	if (endpointName == null) {
+                		endpointName = qname.getLocalPart();
+                	}
+                }
+                ScaEndpoint endpoint = new ScaEndpoint(entryPoint);
+                endpoint.setServiceUnit(this);
+                endpoint.setService(serviceName);
+                endpoint.setEndpoint(endpointName);
+                endpoint.setInterfaceName(interfaceName);
+                endpoint.setDefinition(definition);
+                endpoint.setDescription(description);
+                addEndpoint(endpoint);
+            }
+        }
+	}
+	
+	private static class JarFileFilter implements FilenameFilter {
+        public boolean accept(File dir, String name) {
+            return name.endsWith(".jar");
+        }
+	}
+
+	public TuscanyWebAppRuntime getTuscanyRuntime() {
+		return tuscanyRuntime;
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiAssemblyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiAssemblyFactory.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiAssemblyFactory.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiAssemblyFactory.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly;
+
+import org.apache.tuscany.model.assembly.AssemblyFactory;
+import org.osoa.sca.model.JbiBinding;
+
+/**
+ * The <b>Factory</b> for the model.
+ */
+public interface JbiAssemblyFactory extends AssemblyFactory {
+
+    /**
+     * Returns a new object of class '<em>ServiceMix Binding</em>'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return a new object of class '<em>ServiceMix Binding</em>'.
+     * @generated
+     */
+    JbiBinding createJbiBinding();
+
+} //TWebServiceAssemblyFactory

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiBinding.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiBinding.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/JbiBinding.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly;
+
+import org.apache.tuscany.model.assembly.Binding;
+
+public interface JbiBinding extends Binding {
+
+	void setPort(String port);
+	
+	String getPort();
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiAssemblyFactoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiAssemblyFactoryImpl.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiAssemblyFactoryImpl.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiAssemblyFactoryImpl.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly.impl;
+
+import org.apache.servicemix.sca.assembly.JbiAssemblyFactory;
+import org.apache.tuscany.model.assembly.impl.AssemblyFactoryImpl;
+import org.osoa.sca.model.JbiBinding;
+
+/**
+ * An implementation of the model <b>Factory</b>.
+ */
+public class JbiAssemblyFactoryImpl extends AssemblyFactoryImpl implements JbiAssemblyFactory {
+
+    /**
+     * Creates an instance of the factory.
+     */
+    public JbiAssemblyFactoryImpl() {
+        super();
+    }
+
+    /**
+     * @see org.apache.servicemix.sca.assembly#createJbiBinding()
+     */
+    public JbiBinding createJbiBinding() {
+        return new JbiBindingImpl();
+    }
+
+} //WebServiceAssemblyFactoryImpl

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly.impl;
+
+import org.apache.servicemix.sca.assembly.JbiBinding;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.AssemblyModelVisitor;
+import org.apache.tuscany.model.assembly.impl.AssemblyModelVisitorHelperImpl;
+
+/**
+ * An implementation of the model object '<em><b>Web Service Binding</b></em>'.
+ */
+public class JbiBindingImpl extends org.apache.servicemix.sca.assembly.sdo.impl.JbiBindingImpl implements JbiBinding {
+
+    private Object runtimeConfiguration;
+
+    /**
+     * Constructor
+     */
+    protected JbiBindingImpl() {
+    }
+
+    /**
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiBindingImpl#getPort()
+     */
+    public String getPort() {
+        return super.getPort();
+    }
+
+    /**
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiBindingImpl#setPort(java.lang.String)
+     */
+    public void setPort(String newPort) {
+        super.setPort(newPort);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Binding#setURI(java.lang.String)
+     */
+    public void setURI(String value) {
+        super.setUri(value);
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.Binding#getURI()
+     */
+    public String getURI() {
+        return super.getUri();
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredRuntimeObject#getRuntimeConfiguration()
+     */
+    public Object getRuntimeConfiguration() {
+        return runtimeConfiguration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.ConfiguredRuntimeObject#setRuntimeConfiguration(java.lang.Object)
+     */
+    public void setRuntimeConfiguration(Object configuration) {
+        this.runtimeConfiguration = configuration;
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
+     */
+    public void initialize(AssemblyModelContext modelContext) {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#freeze()
+     */
+    public void freeze() {
+    }
+
+    /**
+     * @see org.apache.tuscany.model.assembly.AssemblyModelObject#accept(org.apache.tuscany.model.assembly.AssemblyModelVisitor)
+     */
+    public boolean accept(AssemblyModelVisitor visitor) {
+        return AssemblyModelVisitorHelperImpl.accept(this, visitor);
+    }
+
+} //TWebServiceBindingImpl

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/DocumentRoot.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/DocumentRoot.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/DocumentRoot.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/DocumentRoot.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly.sdo;
+
+import java.util.Map;
+
+import org.osoa.sca.model.JbiBinding;
+
+import commonj.sdo.Sequence;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Document Root</b></em>'.
+ * <!-- end-user-doc -->
+ * <p/>
+ * <p/>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link DocumentRoot#getMixed <em>Mixed</em>}</li>
+ * <li>{@link DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li>
+ * <li>{@link DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}</li>
+ * <li>{@link DocumentRoot#getBindingWs <em>Binding Ws</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @model extendedMetaData="name='' kind='mixed'"
+ * @generated
+ * @see JbiAssemblyPackage#getDocumentRoot()
+ */
+public interface DocumentRoot {
+    /**
+     * Returns the value of the '<em><b>Mixed</b></em>' attribute list.
+     * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}.
+     * <!-- begin-user-doc -->
+     * <p/>
+     * If the meaning of the '<em>Mixed</em>' attribute list isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     *
+     * @return the value of the '<em>Mixed</em>' attribute list.
+     * @model unique="false" dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true"
+     * extendedMetaData="kind='elementWildcard' name=':mixed'"
+     * @generated
+     * @see JbiAssemblyPackage#getDocumentRoot_Mixed()
+     */
+    Sequence getMixed();
+
+    /**
+     * Returns the value of the '<em><b>XMLNS Prefix Map</b></em>' map.
+     * The key is of type {@link String},
+     * and the value is of type {@link String},
+     * <!-- begin-user-doc -->
+     * <p/>
+     * If the meaning of the '<em>XMLNS Prefix Map</em>' map isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     *
+     * @return the value of the '<em>XMLNS Prefix Map</em>' map.
+     * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true"
+     * extendedMetaData="kind='attribute' name='xmlns:prefix'"
+     * @generated
+     * @see JbiAssemblyPackage#getDocumentRoot_XMLNSPrefixMap()
+     */
+    Map getXMLNSPrefixMap();
+
+    /**
+     * Returns the value of the '<em><b>XSI Schema Location</b></em>' map.
+     * The key is of type {@link String},
+     * and the value is of type {@link String},
+     * <!-- begin-user-doc -->
+     * <p/>
+     * If the meaning of the '<em>XSI Schema Location</em>' map isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     *
+     * @return the value of the '<em>XSI Schema Location</em>' map.
+     * @model mapType="org.eclipse.emf.ecore.EStringToStringMapEntry" keyType="java.lang.String" valueType="java.lang.String" transient="true"
+     * extendedMetaData="kind='attribute' name='xsi:schemaLocation'"
+     * @generated
+     * @see JbiAssemblyPackage#getDocumentRoot_XSISchemaLocation()
+     */
+    Map getXSISchemaLocation();
+
+    /**
+     * Returns the value of the '<em><b>Binding Ws</b></em>' containment reference.
+     * <!-- begin-user-doc -->
+     * <p/>
+     * If the meaning of the '<em>Binding Ws</em>' containment reference isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     *
+     * @return the value of the '<em>Binding Ws</em>' containment reference.
+     * @model containment="true" resolveProxies="false" upper="-2" transient="true" volatile="true" derived="true"
+     * extendedMetaData="kind='element' name='binding.ws' namespace='##targetNamespace' affiliation='http://www.osoa.org/xmlns/sca/0.9#binding'"
+     * @generated
+     * @see #setBindingJbi(JbiBinding)
+     * @see JbiAssemblyPackage#getDocumentRoot_BindingJbi()
+     */
+    JbiBinding getBindingJbi();
+
+    /**
+     * Sets the value of the '{@link DocumentRoot#getBindingWs <em>Binding Ws</em>}' containment reference.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @param value the new value of the '<em>Binding Ws</em>' containment reference.
+     * @generated
+     * @see #getBindingJbi()
+     */
+    void setBindingJbi(JbiBinding value);
+
+} // DocumentRoot

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyFactory.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyFactory.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyFactory.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyFactory.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly.sdo;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.osoa.sca.model.JbiBinding;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ * @see JbiAssemblyPackage
+ */
+public interface JbiAssemblyFactory extends EFactory {
+    /**
+     * The singleton instance of the factory.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     */
+    JbiAssemblyFactory eINSTANCE = new org.apache.servicemix.sca.assembly.sdo.impl.JbiAssemblyFactoryImpl();
+
+    /**
+     * Returns a new object of class '<em>Document Root</em>'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return a new object of class '<em>Document Root</em>'.
+     * @generated
+     */
+    DocumentRoot createDocumentRoot();
+
+    /**
+     * Returns a new object of class '<em>Web Service Binding</em>'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return a new object of class '<em>Web Service Binding</em>'.
+     * @generated
+     */
+    JbiBinding createJbiBinding();
+
+    /**
+     * Returns the package supported by this factory.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the package supported by this factory.
+     * @generated
+     */
+    JbiAssemblyPackage getJbiAssemblyPackage();
+
+} //WebServiceAssemblyFactory

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyPackage.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyPackage.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyPackage.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/sdo/JbiAssemblyPackage.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,315 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.assembly.sdo;
+
+import org.apache.tuscany.model.assembly.sdo.AssemblyPackage;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ *
+ * @model kind="package"
+ * @generated
+ * @see JbiAssemblyFactory
+ */
+public interface JbiAssemblyPackage extends EPackage {
+    /**
+     * The package name.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     */
+    String eNAME = "assembly";
+
+    /**
+     * The package namespace URI.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     */
+    String eNS_URI = "http://org.apache.tuscany/xmlns/jbi/0.9";
+
+    /**
+     * The package namespace name.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     */
+    String eNS_PREFIX = "jbi";
+
+    /**
+     * The singleton instance of the package.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     */
+    JbiAssemblyPackage eINSTANCE = org.apache.servicemix.sca.assembly.sdo.impl.JbiAssemblyPackageImpl.init();
+
+    /**
+     * The meta object id for the '{@link org.apache.tuscany.binding.axis.assembly.sdo.impl.DocumentRootImpl <em>Document Root</em>}' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.DocumentRootImpl
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiAssemblyPackageImpl#getDocumentRoot()
+     */
+    int DOCUMENT_ROOT = 0;
+
+    /**
+     * The feature id for the '<em><b>Mixed</b></em>' attribute list.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int DOCUMENT_ROOT__MIXED = 0;
+
+    /**
+     * The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
+
+    /**
+     * The feature id for the '<em><b>XSI Schema Location</b></em>' map.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
+
+    /**
+     * The feature id for the '<em><b>Binding Ws</b></em>' containment reference.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int DOCUMENT_ROOT__BINDING_JBI = 3;
+
+    /**
+     * The number of structural features of the the '<em>Document Root</em>' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int DOCUMENT_ROOT_FEATURE_COUNT = 4;
+
+    /**
+     * The meta object id for the '{@link org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiBindingImpl <em>Web Service Binding</em>}' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiBindingImpl
+     * @see org.apache.tuscany.binding.axis.assembly.sdo.impl.JbiAssemblyPackageImpl#getWebServiceBinding()
+     */
+    int JBI_BINDING = 1;
+
+    /**
+     * The feature id for the '<em><b>Uri</b></em>' attribute.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int JBI_BINDING__URI = AssemblyPackage.BINDING__URI;
+
+    /**
+     * The feature id for the '<em><b>Any</b></em>' attribute list.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int JBI_BINDING__ANY = AssemblyPackage.BINDING_FEATURE_COUNT + 0;
+
+    /**
+     * The feature id for the '<em><b>Port</b></em>' attribute.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int JBI_BINDING__PORT = AssemblyPackage.BINDING_FEATURE_COUNT + 1;
+
+    /**
+     * The feature id for the '<em><b>Any Attribute</b></em>' attribute list.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int JBI_BINDING__ANY_ATTRIBUTE = AssemblyPackage.BINDING_FEATURE_COUNT + 2;
+
+    /**
+     * The number of structural features of the the '<em>Web Service Binding</em>' class.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @generated
+     * @ordered
+     */
+    int JBI_BINDING_FEATURE_COUNT = AssemblyPackage.BINDING_FEATURE_COUNT + 3;
+
+
+    /**
+     * Returns the meta object for class '{@link DocumentRoot <em>Document Root</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for class '<em>Document Root</em>'.
+     * @generated
+     * @see DocumentRoot
+     */
+    EClass getDocumentRoot();
+
+    /**
+     * Returns the meta object for the attribute list '{@link DocumentRoot#getMixed <em>Mixed</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the attribute list '<em>Mixed</em>'.
+     * @generated
+     * @see DocumentRoot#getMixed()
+     * @see #getDocumentRoot()
+     */
+    EAttribute getDocumentRoot_Mixed();
+
+    /**
+     * Returns the meta object for the map '{@link DocumentRoot#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the map '<em>XMLNS Prefix Map</em>'.
+     * @generated
+     * @see DocumentRoot#getXMLNSPrefixMap()
+     * @see #getDocumentRoot()
+     */
+    EReference getDocumentRoot_XMLNSPrefixMap();
+
+    /**
+     * Returns the meta object for the map '{@link DocumentRoot#getXSISchemaLocation <em>XSI Schema Location</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the map '<em>XSI Schema Location</em>'.
+     * @generated
+     * @see DocumentRoot#getXSISchemaLocation()
+     * @see #getDocumentRoot()
+     */
+    EReference getDocumentRoot_XSISchemaLocation();
+
+    /**
+     * Returns the meta object for the containment reference '{@link DocumentRoot#getBindingWs <em>Binding Ws</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the containment reference '<em>Binding Ws</em>'.
+     * @generated
+     * @see DocumentRoot#getBindingJbi()
+     * @see #getDocumentRoot()
+     */
+    EReference getDocumentRoot_BindingJbi();
+
+    /**
+     * Returns the meta object for class '{@link org.apache.servicemix.sca.bigbank.sdo.JbiBinding <em>Web Service Binding</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for class '<em>Web Service Binding</em>'.
+     * @generated
+     * @see org.apache.servicemix.sca.bigbank.sdo.JbiBinding
+     */
+    EClass getJbiBinding();
+
+    /**
+     * Returns the meta object for the attribute list '{@link org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getAny <em>Any</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the attribute list '<em>Any</em>'.
+     * @generated
+     * @see org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getAny()
+     * @see #getWebServiceBinding()
+     */
+    EAttribute getJbiBinding_Any();
+
+    /**
+     * Returns the meta object for the attribute '{@link org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getPort <em>Port</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the attribute '<em>Port</em>'.
+     * @generated
+     * @see org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getPort()
+     * @see #getJbiBinding()
+     */
+    EAttribute getJbiBinding_Port();
+
+    /**
+     * Returns the meta object for the attribute list '{@link org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getAnyAttribute <em>Any Attribute</em>}'.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     *
+     * @return the meta object for the attribute list '<em>Any Attribute</em>'.
+     * @generated
+     * @see org.apache.servicemix.sca.bigbank.sdo.JbiBinding#getAnyAttribute()
+     * @see #getJbiBinding()
+     */
+    EAttribute getJbiBinding_AnyAttribute();
+
+    /**
+     * Returns the factory that creates the instances of the model.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @return the factory that creates the instances of the model.
+     * @generated
+     */
+    JbiAssemblyFactory getJbiAssemblyFactory();
+
+} //WebServiceAssemblyPackage

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.handler;
+
+import java.util.Map;
+
+import org.apache.tuscany.common.logging.Log;
+import org.apache.tuscany.common.logging.LogFactory;
+import org.apache.tuscany.core.addressing.EndpointReference;
+import org.apache.tuscany.core.invocation.InvocationConfiguration;
+import org.apache.tuscany.core.invocation.ProxyConfiguration;
+import org.apache.tuscany.core.message.Message;
+import org.apache.tuscany.core.message.handler.MessageHandler;
+import org.apache.tuscany.core.runtime.TuscanyModuleComponentContext;
+import org.apache.tuscany.model.assembly.Binding;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.Interface;
+import org.apache.tuscany.model.assembly.Part;
+import org.apache.tuscany.model.types.InterfaceType;
+import org.apache.tuscany.model.types.OperationType;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ServiceRuntimeException;
+import org.osoa.sca.model.JbiBinding;
+
+public class ExternalJbiServiceConfigurationHandler implements MessageHandler {
+    public final static Log log = LogFactory.getLog(ExternalJbiServiceConfigurationHandler.class);
+
+    /**
+     * Constructor.
+     */
+    public ExternalJbiServiceConfigurationHandler() {
+        super();
+    }
+
+    /**
+     * @see org.apache.tuscany.core.message.handler.MessageHandler#processMessage(org.apache.tuscany.core.message.Message)
+     */
+    public boolean processMessage(Message message) {
+        if (log.isEntryEnabled())
+            log.entry("processMessage");
+        try {
+
+            // Get the endpoint reference of the target service and the service model element
+            EndpointReference endpointReference = message.getEndpointReference();
+            Object portEndpoint = endpointReference.getConfiguredPort();
+
+            // Return immediately if the target is not an external service
+            if (!(portEndpoint instanceof ConfiguredService))
+                return false;
+            ConfiguredService serviceEndpoint = (ConfiguredService) portEndpoint;
+            Part part = serviceEndpoint.getPart();
+            if (!(part instanceof ExternalService))
+                return false;
+            ExternalService externalService = (ExternalService) part;
+
+            // Return immediately if this is not an external web service
+            Binding binding = externalService.getBindings().get(0);
+            if (!(binding instanceof JbiBinding))
+                return false;
+            JbiBinding jbiBinding = (JbiBinding) binding;
+
+            TuscanyModuleComponentContext context = (TuscanyModuleComponentContext) CurrentModuleContext.getContext();
+
+            // Get the proxy configuration
+            ProxyConfiguration proxyConfiguration=(ProxyConfiguration)message.getBody();
+            Map<OperationType, InvocationConfiguration> invocationConfigurations=proxyConfiguration.getInvocationConfigurations();
+            
+            // Get the business interface
+            Interface targetInterface = serviceEndpoint.getService().getInterfaceContract();
+            InterfaceType targetInterfaceType = targetInterface.getInterfaceType();
+
+            // Create the invocation configurations
+            for (InvocationConfiguration invocationConfiguration : invocationConfigurations.values()) {
+                OperationType targetOperationType=targetInterfaceType.getOperationType(invocationConfiguration.getOperationType().getName());
+
+                // Handle a business method invocation, get a message handler from the port
+                ExternalJbiServiceHandler handler = new ExternalJbiServiceHandler(context, targetOperationType, externalService, jbiBinding, endpointReference);
+                invocationConfiguration.addRequestHandler(handler);
+            }
+
+            return false;
+
+        } catch (Exception e) {
+            log.fatal(e);
+
+            throw new ServiceRuntimeException(e);
+
+        } finally {
+            if (log.isEntryEnabled())
+                log.exit("processMessage");
+        }
+
+    }
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceHandler.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceHandler.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceHandler.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceHandler.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.handler;
+
+import org.apache.tuscany.core.addressing.EndpointReference;
+import org.apache.tuscany.core.message.Message;
+import org.apache.tuscany.core.message.handler.MessageHandler;
+import org.apache.tuscany.core.runtime.TuscanyModuleComponentContext;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.types.OperationType;
+import org.osoa.sca.model.JbiBinding;
+
+public class ExternalJbiServiceHandler implements MessageHandler {
+
+	public ExternalJbiServiceHandler(TuscanyModuleComponentContext context, 
+									 OperationType type, 
+									 ExternalService externalService, 
+									 JbiBinding jbiBinding, 
+									 EndpointReference endpointReference) {
+		// TODO Auto-generated constructor stub
+	}
+
+	public boolean processMessage(Message message) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/JbiBinding.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/JbiBinding.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/JbiBinding.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/java/org/osoa/sca/model/JbiBinding.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.osoa.sca.model;
+
+public interface JbiBinding extends Binding {
+
+	void setPort(String port);
+	
+	String getPort();
+	
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.componentType
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.componentType?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.componentType (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/resources/org/apache/servicemix/sca/handler/ExternalJbiServiceConfigurationHandler.componentType Wed Dec 28 11:23:05 2005
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9">
+
+    <service name="handler">
+        <interface.java interface="org.apache.tuscany.core.message.handler.MessageHandler"/>
+    </service>
+
+</componentType>

Added: incubator/servicemix/trunk/servicemix-sca/src/main/resources/sca.fragment
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/resources/sca.fragment?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/resources/sca.fragment (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/resources/sca.fragment Wed Dec 28 11:23:05 2005
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<moduleFragment xmlns="http://www.osoa.org/xmlns/sca/0.9" 
+                xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+                name="org.apache.servicemix.sca">
+
+    <component name="org.apache.servicemix.sca.handler.ExternalJbiServiceConfigurationHandler">
+        <implementation.extension class="org.apache.servicemix.sca.handler.ExternalJbiServiceConfigurationHandler"/>
+    </component>
+
+    <wire>
+        <source.uri>org.apache.tuscany.core.pipeline.ExternalServiceBindingExtensionPoint/extensions</source.uri>
+        <target.uri>org.apache.servicemix.sca.handler.ExternalJbiServiceConfigurationHandler</target.uri>
+    </wire>
+
+</moduleFragment>

Added: incubator/servicemix/trunk/servicemix-sca/src/main/resources/tuscany-model.config
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/main/resources/tuscany-model.config?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/main/resources/tuscany-model.config (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/main/resources/tuscany-model.config Wed Dec 28 11:23:05 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<config:modelConfiguration xmlns:config="http://org.apache.tuscany/xmlns/model/config/0.9">
+
+    <generatedPackage packageClassName="org.apache.servicemix.sca.assembly.sdo.JbiAssemblyPackage" uri="http://org.apache.tuscany/xmlns/jbi/0.9" preLoad="true"/>
+
+</config:modelConfiguration>

Added: incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTestCase.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTestCase.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTestCase.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.servicemix.sca.assembly.JbiBinding;
+import org.apache.tuscany.model.assembly.AssemblyLoader;
+import org.apache.tuscany.model.assembly.AssemblyModelContext;
+import org.apache.tuscany.model.assembly.Binding;
+import org.apache.tuscany.model.assembly.Component;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.ExternalService;
+import org.apache.tuscany.model.assembly.Module;
+import org.apache.tuscany.model.assembly.impl.AssemblyModelContextImpl;
+
+/**
+ * @author delfinoj
+ */
+public class AssemblyLoaderTestCase extends TestCase {
+
+    private AssemblyModelContext modelContext;
+
+    /**
+     *
+     */
+    public AssemblyLoaderTestCase() {
+        super();
+    }
+
+    public void testLoader() {
+
+        AssemblyLoader loader = modelContext.getAssemblyLoader();
+        Module module = loader.getModule(getClass().getResource("bigbank/sca.module").toString());
+        module.initialize(modelContext);
+
+        Assert.assertTrue(module.getName().equals("org.apache.servicemix.sca.bigbank"));
+
+        Component component = module.getComponent("AccountServiceComponent");
+        Assert.assertTrue(component != null);
+
+        EntryPoint entryPoint = module.getEntryPoint("AccountService");
+        Assert.assertTrue(entryPoint != null);
+
+        ExternalService externalService = module.getExternalService("StockQuoteService");
+        Assert.assertTrue(externalService != null);
+
+        Binding binding = externalService.getBindings().get(0);
+        Assert.assertTrue(binding instanceof JbiBinding);
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        modelContext = new AssemblyModelContextImpl();
+    }
+
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.naming.InitialContext;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tuscany.core.invocation.spi.ProxyFactory;
+import org.apache.tuscany.core.runtime.TuscanyModuleComponentContext;
+import org.apache.tuscany.core.runtime.client.TuscanyRuntime;
+import org.apache.tuscany.model.assembly.ConfiguredReference;
+import org.apache.tuscany.model.assembly.ConfiguredService;
+import org.apache.tuscany.model.assembly.EntryPoint;
+import org.apache.tuscany.model.assembly.Module;
+import org.osoa.sca.CurrentModuleContext;
+import org.osoa.sca.ModuleContext;
+import org.apache.servicemix.jbi.container.JBIContainer;
+import org.apache.servicemix.sca.ScaComponent;
+import org.apache.servicemix.sca.bigbank.account.AccountService;
+
+public class ScaComponentTest extends TestCase {
+
+    private static Log logger =  LogFactory.getLog(ScaComponentTest.class);
+    
+    protected JBIContainer container;
+    
+    protected void setUp() throws Exception {
+        container = new JBIContainer();
+        container.setUseMBeanServer(false);
+        container.setCreateMBeanServer(false);
+        container.setMonitorInstallationDirectory(false);
+        container.setNamingContext(new InitialContext());
+        container.setEmbedded(true);
+        container.init();
+    }
+    
+    protected void tearDown() throws Exception {
+        if (container != null) {
+            container.shutDown();
+        }
+    }
+    
+    public void testDeploy() throws Exception {
+        ScaComponent component = new ScaComponent();
+        container.activateComponent(component, "JSR181Component");
+
+        // Start container
+        container.start();
+        
+        // Deploy SU
+        component.getServiceUnitManager().deploy("su", getServiceUnitPath("org/apache/servicemix/sca/bigbank"));
+        component.getServiceUnitManager().init("su", getServiceUnitPath("org/apache/servicemix/sca/bigbank"));
+        component.getServiceUnitManager().start("su");
+    }
+     
+    protected String getServiceUnitPath(String name) {
+        URL url = getClass().getClassLoader().getResource(name + "/sca.module");
+        File path = new File(url.getFile());
+        path = path.getParentFile();
+        return path.getAbsolutePath();
+    }
+    
+    public static final void main(String[] args) throws Exception {
+
+        //Obtain Tuscany runtime
+        TuscanyRuntime tuscany = new TuscanyRuntime("hello", null);
+
+        tuscany.start(); //Start the runtime.
+
+        //Obtain SCA module context.
+        ModuleContext moduleContext = CurrentModuleContext.getContext();
+        TuscanyModuleComponentContext tModuleContext = (TuscanyModuleComponentContext) moduleContext; 
+        Module module = tModuleContext.getModuleComponent().getModuleImplementation();
+        for (EntryPoint entryPoint : module.getEntryPoints()) {
+            ConfiguredReference referenceValue = entryPoint.getConfiguredReference();
+            ConfiguredService targetServiceEndpoint = referenceValue.getConfiguredServices().get(0);
+        	ProxyFactory proxyFactory = (ProxyFactory) targetServiceEndpoint.getProxyFactory();
+            Object proxy = proxyFactory.createProxy();
+            AccountService svc = (AccountService) proxy;
+            svc.getAccountReport("customer");
+		}
+        
+        tuscany.stop();
+    }
+	
+	
+}

Added: incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReport.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReport.java?rev=359607&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReport.java (added)
+++ incubator/servicemix/trunk/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReport.java Wed Dec 28 11:23:05 2005
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.sca.bigbank.account;
+
+import java.util.List;
+
+/**
+ * @model
+ */
+
+public interface AccountReport {
+
+    /**
+     * @model type="services.account.AccountSummary"
+     */
+
+    List getAccountSummaries();
+}



Mime
View raw message