You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2011/07/15 10:46:44 UTC

svn commit: r1147029 - in /tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime: ./ src/main/java/org/apache/tuscany/sca/implementation/scala/ src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ src/main/java/o...

Author: slaws
Date: Fri Jul 15 08:46:43 2011
New Revision: 1147029

URL: http://svn.apache.org/viewvc?rev=1147029&view=rev
Log:
TUSCANY-3898 - Apply Guilherme's patch to start adding invoker function to implementation-scala-runtime. Thanks for the patch Guilherme

Added:
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/ScalaException.java
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/   (with props)
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/ScalaEngine.java
Modified:
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/pom.xml
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProvider.java
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProviderFactory.java
    tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaInvoker.java

Modified: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/pom.xml?rev=1147029&r1=1147028&r2=1147029&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/pom.xml (original)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/pom.xml Fri Jul 15 08:46:43 2011
@@ -1,170 +1,219 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
+<!-- * Licensed to the Apache Software Foundation (ASF) under one * or more 
+	contributor license agreements. See the NOTICE file * distributed with this 
+	work for additional information * regarding copyright ownership. The ASF 
+	licenses this file * to you under the Apache License, Version 2.0 (the * 
+	"License"); you may not use this file except in compliance * with the License. 
+	You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 
+	* * Unless required by applicable law or agreed to in writing, * software 
+	distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT 
+	WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the 
+	License for the * specific language governing permissions and limitations 
+	* under the License. -->
 <project>
 
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-modules</artifactId>
-        <version>2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>tuscany-implementation-scala-runtime</artifactId>
-    <name>Apache Tuscany SCA Scala Implementation Extension</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-sca-api</artifactId>
-            <version>2.0-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-scala</artifactId>
-            <version>2.0-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-core</artifactId>
-            <version>2.0-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-databinding</artifactId>
-            <version>2.0-SNAPSHOT</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.bsf</groupId>
-            <artifactId>bsf-utils</artifactId>
-            <version>3.1</version>    
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.bsf</groupId>
-                    <artifactId>bsf-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.bsf</groupId>
-                    <artifactId>bsf-engines</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.ws.commons.axiom</groupId>
-                    <artifactId>axiom-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.apache.ws.commons.axiom</groupId>
-                    <artifactId>axiom-impl</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>stax</groupId>
-                    <artifactId>stax-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>xmlbeans</groupId>
-                    <artifactId>xbean</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>javax.servlet</groupId>
-                    <artifactId>servlet-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.codehaus.woodstox</groupId>
-                    <artifactId>wstx-asl</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-interface-wsdl</artifactId>
-            <version>2.0-SNAPSHOT</version>
-        </dependency>
-
-       <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-api</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>xerces</groupId>
-                    <artifactId>xercesImpl</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>javax.mail</groupId>
-                    <artifactId>mail</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>commons-logging</groupId>
-                    <artifactId>commons-logging</artifactId>
-                </exclusion>                 
-                <exclusion>
-                    <groupId>xml-apis</groupId>
-                    <artifactId>xml-apis</artifactId>
-                </exclusion>
-            </exclusions>
-            <version>1.2.10</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-impl</artifactId>
-            <version>1.2.10</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>                                      
-            <artifactId>junit</artifactId>
-            <version>4.8.1</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-node-impl</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-           <groupId>commons-logging</groupId>
-           <artifactId>commons-logging</artifactId>
-           <version>1.1.1</version>
-           <exclusions>
-               <exclusion>
-                   <groupId>javax.servlet</groupId>
-                   <artifactId>servlet-api</artifactId>
-               </exclusion>
-           </exclusions>
-        </dependency>
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.tuscany.sca</groupId>
+		<artifactId>tuscany-modules</artifactId>
+		<version>2.0-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+
+	<artifactId>tuscany-implementation-scala-runtime</artifactId>
+	<name>Apache Tuscany SCA Scala Implementation Extension</name>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-sca-api</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-implementation-scala</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-core</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-databinding</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.bsf</groupId>
+			<artifactId>bsf-utils</artifactId>
+			<version>3.1</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.bsf</groupId>
+					<artifactId>bsf-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.apache.bsf</groupId>
+					<artifactId>bsf-engines</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.apache.ws.commons.axiom</groupId>
+					<artifactId>axiom-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.apache.ws.commons.axiom</groupId>
+					<artifactId>axiom-impl</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>stax</groupId>
+					<artifactId>stax-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>xmlbeans</groupId>
+					<artifactId>xbean</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>org.codehaus.woodstox</groupId>
+					<artifactId>wstx-asl</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-interface-wsdl</artifactId>
+			<version>2.0-SNAPSHOT</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.ws.commons.axiom</groupId>
+			<artifactId>axiom-api</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>xerces</groupId>
+					<artifactId>xercesImpl</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.mail</groupId>
+					<artifactId>mail</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>commons-logging</groupId>
+					<artifactId>commons-logging</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>xml-apis</groupId>
+					<artifactId>xml-apis</artifactId>
+				</exclusion>
+			</exclusions>
+			<version>1.2.10</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.ws.commons.axiom</groupId>
+			<artifactId>axiom-impl</artifactId>
+			<version>1.2.10</version>
+			<scope>runtime</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-node-impl</artifactId>
+			<version>2.0-SNAPSHOT</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-implementation-java-runtime</artifactId>
+			<version>2.0-SNAPSHOT</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>1.1.1</version>
+			<exclusions>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.tuscany.sca</groupId>
+			<artifactId>tuscany-base-runtime</artifactId>
+			<version>2.0-SNAPSHOT</version>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.scala-lang</groupId>
+			<artifactId>scala-library</artifactId>
+			<version>2.8.0</version>
+			<scope>test</scope>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+	    
+		<sourceDirectory>src/main/java</sourceDirectory>
+		<testSourceDirectory>src/test/java</testSourceDirectory>
+
+		<plugins>
+			<plugin>
+				<groupId>org.scala-tools</groupId>
+				<artifactId>maven-scala-plugin</artifactId>
+				<version>2.15.0</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>compile</goal>
+							<goal>testCompile</goal>
+						</goals>
+						<configuration>
+							<args>
+								<arg>-make:transitive</arg>
+								<arg>-dependencyfile</arg>
+								<arg>${project.build.directory}/.scala_dependencies</arg>
+							</args>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.tuscany.maven.plugins</groupId>
+				<artifactId>maven-tuscany-plugin</artifactId>
+				<version>2.0-SNAPSHOT</version>
+				<dependencies>
+					<dependency>
+						<groupId>org.scala-lang</groupId>
+						<artifactId>scala-library</artifactId>
+						<version>2.8.0</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+		</plugins>
 
-    </dependencies>
+	</build>
 
 </project>

Added: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/ScalaException.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/ScalaException.java?rev=1147029&view=auto
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/ScalaException.java (added)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/ScalaException.java Fri Jul 15 08:46:43 2011
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.implementation.scala;
+
+public class ScalaException extends Exception {
+
+	public ScalaException(Exception e) {
+		super(e);
+	}
+}
\ No newline at end of file

Modified: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProvider.java?rev=1147029&r1=1147028&r2=1147029&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProvider.java (original)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProvider.java Fri Jul 15 08:46:43 2011
@@ -19,14 +19,26 @@
 
 package org.apache.tuscany.sca.implementation.scala.provider;
 
+import org.apache.tuscany.sca.implementation.scala.ScalaImplementation;
+import org.apache.tuscany.sca.implementation.scala.util.ScalaEngine;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
 
 
 public class ScalaImplementationProvider implements ImplementationProvider{
 
+    private RuntimeComponent component;
+    private ScalaImplementation implementation;
+    private ScalaEngine scalaEngine;
+	
+	public ScalaImplementationProvider (RuntimeComponent component, ScalaImplementation implementation) {
+		this.component = component;
+		this.implementation = implementation;
+	}
+	
 	@Override
 	public Invoker createInvoker(RuntimeComponentService service,
 			Operation operation) {

Modified: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProviderFactory.java?rev=1147029&r1=1147028&r2=1147029&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProviderFactory.java (original)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaImplementationProviderFactory.java Fri Jul 15 08:46:43 2011
@@ -19,24 +19,26 @@
 
 package org.apache.tuscany.sca.implementation.scala.provider;
 
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
 import org.apache.tuscany.sca.implementation.scala.ScalaImplementation;
 import org.apache.tuscany.sca.provider.ImplementationProvider;
 import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 
-public class ScalaImplementationProviderFactory implements ImplementationProviderFactory<ScalaImplementation>{
+public class ScalaImplementationProviderFactory implements ImplementationProviderFactory<ScalaImplementation> {
 
+    public ScalaImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
+    }
+	
 	@Override
 	public ImplementationProvider createImplementationProvider(
-			RuntimeComponent component, ScalaImplementation Implementation) {
-		// TODO Auto-generated method stub
-		return null;
+			RuntimeComponent component, ScalaImplementation implementation) {
+		return new ScalaImplementationProvider(component, implementation);
 	}
 
 	@Override
 	public Class<ScalaImplementation> getModelType() {
-		// TODO Auto-generated method stub
-		return null;
+		return ScalaImplementation.class;
 	}
 
 }

Modified: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaInvoker.java?rev=1147029&r1=1147028&r2=1147029&view=diff
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaInvoker.java (original)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/provider/ScalaInvoker.java Fri Jul 15 08:46:43 2011
@@ -19,15 +19,43 @@
 
 package org.apache.tuscany.sca.implementation.scala.provider;
 
+import org.apache.tuscany.sca.implementation.scala.util.ScalaEngine;
+import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.Message;
 
 public class ScalaInvoker implements Invoker {
 
+	private Operation operation;
+	private ScalaEngine scalaEngine;
+	
+	public ScalaInvoker(ScalaEngine scalaEngine, Operation operation) {
+		this.operation = operation;
+		this.scalaEngine = scalaEngine;
+	}
+	
+	private Object doInvoke(Object[] objects, Operation op) throws Exception {
+
+        Operation oper = operation;  // static setting
+        if (oper.getName() == null) {  // if no static setting
+            oper = op;  // use dynamic setting
+        }
+		
+        Object response;
+        response = scalaEngine.invokeFunction(oper.getName(), objects);
+        
+        return response;        
+	}
+	
 	@Override
 	public Message invoke(Message msg) {
-		// TODO Auto-generated method stub
-		return null;
+        try {
+            Object resp = doInvoke((Object[])msg.getBody(), msg.getOperation());
+            msg.setBody(resp);
+        } catch (Exception e) {
+            msg.setFaultBody(e.getCause());
+        }
+		return msg;
 	}
 
 }

Propchange: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/ScalaEngine.java
URL: http://svn.apache.org/viewvc/tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/ScalaEngine.java?rev=1147029&view=auto
==============================================================================
--- tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/ScalaEngine.java (added)
+++ tuscany/collaboration/GSoC-2011-Guilherme/modules/implementation-scala-runtime/src/main/java/org/apache/tuscany/sca/implementation/scala/util/ScalaEngine.java Fri Jul 15 08:46:43 2011
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.implementation.scala.util;
+
+import org.apache.tuscany.sca.implementation.scala.ScalaException;
+
+public class ScalaEngine {
+
+	private Class scalaClass;
+	
+	public ScalaEngine(String className) throws ScalaException {
+		try {
+			scalaClass = Class.forName(className);
+		} catch (ClassNotFoundException e) {
+			throw new ScalaException(e);
+		}
+	}
+	
+	public Object invokeFunction(String name, Object[] arguments) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}
\ No newline at end of file