tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r441072 - in /incubator/tuscany/java/sca/containers/container.ruby: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/container/ src/main/java/or...
Date Thu, 07 Sep 2006 12:33:41 GMT
Author: antelder
Date: Thu Sep  7 05:33:39 2006
New Revision: 441072

URL: http://svn.apache.org/viewvc?view=rev&rev=441072
Log:
TUSCANY-704, commit the Ruby container from Venkat ported from the one in TUSCANY-365 by Srikanth

Added:
    incubator/tuscany/java/sca/containers/container.ruby/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/pom.xml   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/   (with props)
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.componentType
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.rb
    incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl   (with props)

Propchange: incubator/tuscany/java/sca/containers/container.ruby/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/tuscany/java/sca/containers/container.ruby/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/pom.xml?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/pom.xml (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/pom.xml Thu Sep  7 05:33:39 2006
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+    <parent>
+        <groupId>org.apache.tuscany.containers</groupId>
+        <artifactId>containers</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>ruby</artifactId>
+    <name>Apache Tuscany Ruby Container</name>
+    <description>Apache Tuscany Ruby Container</description>
+
+    <repositories>
+       <repository>
+          <id>codehaus-snapshots-repository</id>
+          <name>Codehaus Snapshots Repository</name>
+          <url>http://snapshots.repository.codehaus.org</url>
+       </repository>
+    </repositories>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany</groupId>
+            <artifactId>core</artifactId>
+            <version>${sca.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+           <groupId>org.jruby</groupId>
+           <artifactId>jruby</artifactId>
+           <version>0.9.1-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany</groupId>
+            <artifactId>test</artifactId>
+            <version>${sca.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymockclassextension</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>1.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>1.0</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

Propchange: incubator/tuscany/java/sca/containers/container.ruby/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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.container.ruby;
+
+import static org.apache.tuscany.spi.idl.java.JavaIDLUtils.findMethod;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tuscany.container.ruby.rubyscript.RubyScript;
+import org.apache.tuscany.container.ruby.rubyscript.RubyScriptInstance;
+import org.apache.tuscany.spi.ObjectCreationException;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.component.TargetException;
+import org.apache.tuscany.spi.component.WorkContext;
+import org.apache.tuscany.spi.extension.AtomicComponentExtension;
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.OutboundWire;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.WireService;
+
+/**
+ * The Ruby component implementation.
+ */
+public class RubyComponent<T> extends AtomicComponentExtension<T> {
+
+    private final List<Class<?>> services;
+
+    private final Map<String, Object> properties;
+
+    private RubyScript rubyScript;
+
+    public RubyComponent(String name,
+                         RubyScript rubyScript,
+                         List<Class<?>> services,
+                         CompositeComponent parent,
+                         ScopeContainer scopeContainer,
+                         WireService wireService,
+                         WorkContext workContext) {
+        super(name, parent, scopeContainer, wireService, workContext, null, 0);
+
+        this.rubyScript = rubyScript;
+        this.services = services;
+        this.scope = scopeContainer.getScope();
+        this.properties = new HashMap<String, Object>();
+    }
+
+    public Object createInstance() throws ObjectCreationException {
+
+        Map<String, Object> context = new HashMap<String, Object>(getProperties());
+
+        for (List<OutboundWire> referenceWires : getOutboundWires().values()) {
+            for (OutboundWire<?> wire : referenceWires) {
+                Object wireProxy = wireService.createProxy(wire);
+                // since all types that may be used in the reference interface may not be known to Rhino
+                // using the wireProxy as is will fail result in type conversion exceptions in cases where
+                // Rhino does not know enough of the tpypes used. Hence introduce a interceptor proxy,
+                // with weak typing (java.lang.Object) so that Rhino's call to the proxy succeeds. Then
+                // within this interceptor proxy perform data mediations required to correctly call the
+                // referenced service.
+                /*
+                 * Class<?> businessInterface = wire.getServiceContract().getInterfaceClass(); /JavaScriptReferenceProxy interceptingProxy = new
+                 * JavaScriptReferenceProxy(businessInterface, wireProxy, rubyScript.createInstanceScope(context));
+                 * context.put(wire.getReferenceName(), interceptingProxy.createProxy());
+                 */
+                context.put(wire.getReferenceName(),
+                            wireProxy);
+            }
+        }
+
+        Object instance = rubyScript.createScriptInstance();
+
+        return instance;
+    }
+
+    public TargetInvoker createTargetInvoker(String targetName, Operation operation) {
+        Method[] methods = operation.getServiceContract().getInterfaceClass().getMethods();
+        Method method = findMethod(operation,
+                                   methods);
+        return new RubyInvoker(method.getName(), this, method.getReturnType());
+    }
+
+    // TODO: move all the following up to AtomicComponentExtension?
+
+    public List<Class<?>> getServiceInterfaces() {
+        return services;
+    }
+
+    public Map<String, Object> getProperties() {
+        return properties;
+    }
+
+    public RubyScriptInstance getTargetInstance() throws TargetException {
+        return (RubyScriptInstance) scopeContainer.getInstance(this);
+    }
+
+    public T getServiceInstance() throws TargetException {
+        return getServiceInstance(null);
+    }
+
+    @SuppressWarnings("unchecked")
+    public T getServiceInstance(String service) throws TargetException {
+        InboundWire<?> wire = getInboundWire(service);
+        if (wire == null) {
+            TargetException e = new TargetException("ServiceDefinition not found"); // TODO better error message
+            e.setIdentifier(service);
+            throw e;
+        }
+        return (T) wireService.createProxy(wire);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.tuscany.container.ruby.rubyscript.RubyScript;
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.builder.BuilderConfigException;
+import org.apache.tuscany.spi.component.Component;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.ScopeContainer;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
+import org.apache.tuscany.spi.model.ComponentDefinition;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+import org.osoa.sca.annotations.Constructor;
+
+/**
+ * Extension point for creating {@link RubyComponent}s from an assembly configuration
+ */
+public class RubyComponentBuilder extends ComponentBuilderExtension<RubyImplementation> {
+
+    private static String head = "var xmlInstanceMap = new Array();";
+
+    private static String part1 = "xmlInstanceMap[\"";
+
+    private static String part2 = "\"] = ";
+
+    private static String part3 = ";";
+
+    private static String getXmlObjectFunction = "function getXmlObject(xmlElementNamespace, xmlElementName){\n"
+            + "return xmlInstanceMap[xmlElementNamespace + \"#\" + xmlElementName];\n}";
+
+    /*XmlInstanceRegistry xmlInstRegistry;
+
+    @Constructor({"xmlInstRegistry"})
+    public RubyComponentBuilder(@Autowire
+    XmlInstanceRegistry reg) {
+        this.xmlInstRegistry = reg;
+    }
+*/
+    protected Class<RubyImplementation> getImplementationType() {
+        return RubyImplementation.class;
+    }
+
+    @SuppressWarnings("unchecked")
+    public Component<?> build(CompositeComponent<?> parent,
+                              ComponentDefinition<RubyImplementation> componentDefinition,
+                              DeploymentContext deploymentContext) throws BuilderConfigException {
+
+        String name = componentDefinition.getName();
+        RubyImplementation implementation = componentDefinition.getImplementation();
+        RubyComponentType componentType = implementation.getComponentType();
+
+        // get list of services provided by this component
+        Collection<ServiceDefinition> collection = componentType.getServices().values();
+        List<Class<?>> services = new ArrayList<Class<?>>(collection.size());
+        for (ServiceDefinition serviceDefinition : collection) {
+            services.add(serviceDefinition.getServiceContract().getInterfaceClass());
+        }
+
+        RubyScript rubyScript = implementation.getRubyScript();
+
+        // TODO: have ComponentBuilderExtension pass ScopeContainer in on build method?
+        ScopeContainer scopeContainer;
+        Scope scope = componentType.getLifecycleScope();
+        if (Scope.MODULE == scope) {
+            scopeContainer = deploymentContext.getModuleScope();
+        } else {
+            scopeContainer = scopeRegistry.getScopeContainer(scope);
+        }
+
+        return new RubyComponent(name, rubyScript, services, parent, scopeContainer, wireService,
+                workContext);
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import org.apache.tuscany.spi.model.ComponentType;
+import org.apache.tuscany.spi.model.Property;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
+import org.apache.tuscany.spi.model.Scope;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+
+public class RubyComponentType extends
+        ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>> {
+
+    private Scope lifecycleScope = Scope.MODULE;
+
+    public RubyComponentType() {
+    }
+
+    @SuppressWarnings("unchecked")
+    public RubyComponentType(ComponentType ct) {
+        // TODO: A bit hacky but this is so the non-Ruby .componentType side file can be used for now
+        setInitLevel(ct.getInitLevel());
+        for (Object property : ct.getProperties().values()) {
+            add((Property) property);
+        }
+        for (Object reference : ct.getReferences().values()) {
+            add((ReferenceDefinition) reference);
+        }
+        for (Object service : ct.getServices().values()) {
+            add((ServiceDefinition) service);
+        }
+    }
+
+    public Scope getLifecycleScope() {
+        return lifecycleScope;
+    }
+
+    public void setLifecycleScope(Scope lifecycleScope) {
+        this.lifecycleScope = lifecycleScope;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentType.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import java.net.URL;
+
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.ComponentTypeLoaderExtension;
+import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.model.ComponentType;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class RubyComponentTypeLoader extends ComponentTypeLoaderExtension<RubyImplementation> {
+
+    private JavaInterfaceProcessorRegistry processorRegistry;
+
+    public RubyComponentTypeLoader(@Autowire
+    JavaInterfaceProcessorRegistry processorRegistry) {
+        this.processorRegistry = processorRegistry;
+    }
+
+    @Override
+    protected Class<RubyImplementation> getImplementationClass() {
+        return RubyImplementation.class;
+    }
+
+    protected String getResourceName(RubyImplementation implementation) {
+        return implementation.getRubyScript().getScriptName();
+    }
+
+    // TODO: must be possible to move all the following up in to ComponentTypeLoaderExtension
+
+    public void load(CompositeComponent<?> parent,
+                     RubyImplementation implementation,
+                     DeploymentContext deploymentContext) throws LoaderException {
+
+        URL resource = implementation.getRubyScript().getClassLoader()
+                .getResource(getSideFileName(implementation));
+        RubyComponentType componentType;
+        componentType = loadFromSidefile(resource,
+                                         deploymentContext);
+        implementation.setComponentType(componentType);
+    }
+
+    protected RubyComponentType loadFromSidefile(URL url, DeploymentContext deploymentContext) throws LoaderException {
+        ComponentType ct = loaderRegistry.load(null,
+                                               url,
+                                               ComponentType.class,
+                                               deploymentContext);
+        RubyComponentType jsct = new RubyComponentType(ct);
+        return jsct;
+    }
+
+    private String getSideFileName(RubyImplementation implementation) {
+        String baseName = getResourceName(implementation);
+        int lastDot = baseName.lastIndexOf('.');
+        if (lastDot != -1) {
+            baseName = baseName.substring(0,
+                                          lastDot);
+        }
+        return baseName + ".componentType";
+    }
+
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyComponentTypeLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import org.apache.tuscany.container.ruby.rubyscript.RubyScript;
+import org.apache.tuscany.spi.model.AtomicImplementation;
+
+/**
+ * Model object for a JavaScript implementation.
+ */
+public class RubyImplementation extends AtomicImplementation<RubyComponentType> {
+
+    private RubyScript rubyScript;
+
+    public RubyScript getRubyScript() {
+        return rubyScript;
+    }
+
+    public void setRubyScript(RubyScript rubyScript) {
+        this.rubyScript = rubyScript;
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementation.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.container.ruby.rubyscript.RubyScript;
+import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.extension.LoaderExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.loader.LoaderRegistry;
+import org.apache.tuscany.spi.loader.LoaderUtil;
+import org.apache.tuscany.spi.loader.MissingResourceException;
+import org.osoa.sca.annotations.Constructor;
+
+/**
+ * Loader for handling JavaScript <js:implementation.js> elements.
+ */
+public class RubyImplementationLoader extends LoaderExtension<RubyImplementation> {
+    private static final QName IMPLEMENTATION_RUBY = new QName(
+            "http://tuscany.apache.org/xmlns/rb/1.0", "implementation.rb");
+
+    @Constructor({"registry"})
+    public RubyImplementationLoader(@Autowire
+    LoaderRegistry registry) {
+        super(registry);
+    }
+
+    public QName getXMLType() {
+        return IMPLEMENTATION_RUBY;
+    }
+
+    public RubyImplementation load(CompositeComponent parent,
+                                   XMLStreamReader reader,
+                                   DeploymentContext deploymentContext) throws XMLStreamException,
+                                                                       LoaderException {
+
+        String script = reader.getAttributeValue(null,
+                                                 "script");
+        if (script == null) {
+            throw new MissingResourceException("No script supplied");
+        }
+
+        ClassLoader cl = deploymentContext.getClassLoader();
+        String source = loadSource(cl,
+                                   script);
+
+        LoaderUtil.skipToEndElement(reader);
+
+        RubyImplementation implementation = new RubyImplementation();
+        RubyScript rubyScript = new RubyScript(script, source, null, cl);
+        implementation.setRubyScript(rubyScript);
+        registry.loadComponentType(parent,
+                                   implementation,
+                                   deploymentContext);
+        return implementation;
+    }
+
+    protected String loadSource(ClassLoader cl, String resource) throws LoaderException {
+        URL url = cl.getResource(resource);
+        if (url == null) {
+            throw new MissingResourceException(resource);
+        }
+        InputStream is;
+        try {
+            is = url.openStream();
+        } catch (IOException e) {
+            MissingResourceException mre = new MissingResourceException(resource, e);
+            mre.setIdentifier(resource);
+            throw mre;
+        }
+        try {
+            Reader reader = new InputStreamReader(is, "UTF-8");
+            char[] buffer = new char[1024];
+            StringBuilder source = new StringBuilder();
+            int count;
+            while ((count = reader.read(buffer)) > 0) {
+                source.append(buffer,
+                              0,
+                              count);
+            }
+            return source.toString();
+        } catch (IOException e) {
+            LoaderException le = new LoaderException(e);
+            le.setIdentifier(resource);
+            throw le;
+        } finally {
+            try {
+                is.close();
+            } catch (IOException e) {
+                // ignore
+            }
+        }
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyImplementationLoader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.tuscany.container.ruby.rubyscript.RubyScriptInstance;
+import org.apache.tuscany.spi.extension.TargetInvokerExtension;
+
+/**
+ * Dispatches to a JavaScript implementation instance
+ * 
+ * @version $$Rev$$ $$Date$$
+ */
+public class RubyInvoker extends TargetInvokerExtension {
+
+    private RubyComponent context;
+
+    private String functionName;
+
+    private Class returnType;
+
+    public RubyInvoker(String functionName, RubyComponent context, Class returnType) {
+        this.functionName = functionName;
+        this.context = context;
+        this.returnType = returnType;
+    }
+
+    /**
+     * Invokes a function on a script instance
+     */
+    public Object invokeTarget(final Object payload) throws InvocationTargetException {
+        RubyScriptInstance target = context.getTargetInstance();
+        return target.invokeFunction(functionName,
+                                     (Object[]) payload,
+                                     returnType);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/RubyInvoker.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby.rubyscript;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+
+import org.jruby.IRuby;
+import org.jruby.javasupport.JavaEmbedUtils;
+
+/**
+ * A RhinoScript represents a compiled JavaScript script
+ */
+public class RubyScript {
+
+    protected String scriptName;
+
+    protected String script;
+
+    protected Map<String, Class> responseClasses;
+
+    protected ClassLoader classLoader;
+
+    private static IRuby rubyEngine = JavaEmbedUtils.initialize(new Vector());
+
+    /**
+     * Create a new RubyScript.
+     * 
+     * @param scriptName
+     *            the name of the script. Can be anything, only used in messages to identify the script
+     * @param script
+     *            the complete script
+     */
+    public RubyScript(String scriptName, String script) {
+        this(scriptName, script, (Map) null, null);
+    }
+
+    /**
+     * Create a new RubyScript.
+     * 
+     * @param scriptName
+     *            the name of the script. Can be anything, only used in messages to identify the script
+     * @param script
+     *            the complete script
+     * @param context
+     *            name-value pairs that are added in to the scope where the script is compiled. May be null. The value objects are made available to
+     *            the script by using a variable with the name.
+     * @param classLoader
+     *            the ClassLoader to be used to locate any user Java classes used in the script
+     */
+    public RubyScript(String scriptName, String script, Map context, ClassLoader classLoader) {
+        this.scriptName = scriptName;
+        this.script = script;
+        this.responseClasses = new HashMap<String, Class>();
+        this.classLoader = classLoader;
+    }
+
+    /**
+     * Create a new invokeable instance of the script
+     * 
+     * @return a IRubyObject
+     */
+    public RubyScriptInstance createScriptInstance() {
+        return new RubyScriptInstance(rubyEngine.evalScript(getScript()), responseClasses);
+    }
+
+    public String getScript() {
+        return script;
+    }
+
+    public String getScriptName() {
+        return scriptName;
+    }
+
+    public Map<String, Class> getResponseClasses() {
+        return responseClasses;
+    }
+
+    public ClassLoader getClassLoader() {
+        return classLoader;
+    }
+
+    /**
+     * Set the Java type of a response value. JavaScript is dynamically typed so Rhino cannot always work out what the intended Java type of a
+     * response should be, for example should the statement "return 42" be a Java int, or Integer or Double etc. When Rhino can't determine the type
+     * it will default to returning a String, using this method enables overriding the Rhino default to use a specific Java type.
+     */
+    public void setResponseClass(String functionName, Class responseClasses) {
+        this.responseClasses.put(functionName,
+                                 responseClasses);
+    }
+
+    public void setScript(String script) {
+        this.script = script;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScript.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby.rubyscript;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jruby.javasupport.JavaEmbedUtils;
+import org.jruby.runtime.builtin.IRubyObject;
+
+/**
+ * An invokeable instance of a JavaScript script.
+ */
+public class RubyScriptInstance {
+
+    private IRubyObject rubyInstance;
+
+    private Map<String, Class> responseClasses;
+
+    public RubyScriptInstance(IRubyObject rubyInstance, Map<String, Class> responseClasses) {
+        this.rubyInstance = rubyInstance;
+        this.responseClasses = responseClasses;
+        if (this.responseClasses == null) {
+            this.responseClasses = new HashMap<String, Class>();
+        }
+    }
+
+    public Object invokeFunction(String functionName, Object[] args, Class returnType) {
+        return JavaEmbedUtils.invokeMethod(rubyInstance.getRuntime(),
+                                           rubyInstance,
+                                           functionName,
+                                           args,
+                                           returnType);
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/java/org/apache/tuscany/container/ruby/rubyscript/RubyScriptInstance.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl Thu Sep  7 05:33:39 2006
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!--
+    Ruby configuration for the launcher environment.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+
+           name="org.apache.tuscany.launcher.RubyImplementation">
+
+    <component name="ruby.implementationLoader">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyImplementationLoader"/>
+    </component>
+
+    <component name="ruby.componentTypeLoader">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyComponentTypeLoader"/>
+    </component>
+
+    <component name="ruby.componentBuilder">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyComponentBuilder"/>
+    </component>
+    
+</composite>

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/default.scdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl Thu Sep  7 05:33:39 2006
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!--
+    Ruby configuration for the launcher environment.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           xmlns:system="http://tuscany.apache.org/xmlns/system/1.0-SNAPSHOT"
+
+           name="org.apache.tuscany.launcher.RubyImplementation">
+
+    <component name="ruby.implementationLoader">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyImplementationLoader"/>
+    </component>
+
+    <component name="ruby.componentTypeLoader">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyComponentTypeLoader"/>
+    </component>
+
+    <component name="ruby.componentBuilder">
+        <system:implementation.system class="org.apache.tuscany.container.ruby.RubyComponentBuilder"/>
+    </component>
+    
+</composite>

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/main/resources/META-INF/sca/js.system.scdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java Thu Sep  7 05:33:39 2006
@@ -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 helloworld;
+
+import org.apache.axiom.om.OMElement;
+
+public interface HelloWorldService {
+
+    String sayHello(String s);
+    OMElement sayE4XHello(OMElement xmlObject);
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package helloworld;
+
+import java.io.ByteArrayInputStream;
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
+
+public class HelloWorldServiceImpl implements HelloWorldService {
+
+    public OMElement sayE4XHello(OMElement xmlObject) {
+
+        String helloString = "<hel:getGreetingsResponse xmlns:hel=\"http://helloworld\">"
+                + "<hel:getGreetingsReturn>Hello from Java Implementation to </hel:getGreetingsReturn>NoString</hel:getGreetingsResponse>";
+
+        try {
+            String inputValue = xmlObject.getFirstElement().getText();
+
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(helloString.getBytes()));
+
+            StAXOMBuilder staxOMBuilder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(), xmlReader);
+            OMElement response = staxOMBuilder.getDocumentElement();
+            response.getFirstElement().setText(response.getFirstElement().getText() + inputValue);
+
+            return response;
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    public String sayHello(String s) {
+        return "Hello " + s;
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/helloworld/HelloWorldServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java Thu Sep  7 05:33:39 2006
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.container.ruby.function;
+
+import helloworld.HelloWorldService;
+
+import org.apache.tuscany.test.SCATestCase;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This shows how to test the HelloWorld service component.
+ */
+public class HelloWorldTestCase extends SCATestCase {
+
+    private HelloWorldService helloWorldService;
+
+    private HelloWorldService introspectableService;
+    
+    private HelloWorldService e4xHelloWorldService;
+
+    protected void setUp() throws Exception {
+        addExtension("JavaScriptContainer", getClass().getClassLoader().getResource("META-INF/sca/default.scdl"));
+        setApplicationSCDL("org/apache/tuscany/container/ruby/function/helloworld.scdl");
+        super.setUp();
+
+        CompositeContext context = CurrentCompositeContext.getContext();
+        helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
+    }
+
+    public void testHelloWorld() throws Exception {
+        assertEquals(helloWorldService.sayHello("petra"), "Hello to petra from the Ruby World!");
+        System.out.println(helloWorldService.sayHello("petra"));
+    }
+}

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/java/org/apache/tuscany/container/ruby/function/HelloWorldTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Sep  7 05:33:39 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.componentType?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.componentType (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.componentType Thu Sep  7 05:33:39 2006
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ASCII"?>
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <service name="HelloWorldService">
+        <interface.java interface="helloworld.HelloWorldService"/>
+    </service>
+</componentType>

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.rb
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.rb?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.rb (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/HelloWorld.rb Thu Sep  7 05:33:39 2006
@@ -0,0 +1,3 @@
+def sayHello(s) 
+	return "Hello to " + s + " from the Ruby World!"
+end

Added: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl?view=auto&rev=441072
==============================================================================
--- incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl (added)
+++ incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl Thu Sep  7 05:33:39 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           xmlns:rb="http://tuscany.apache.org/xmlns/rb/1.0"
+
+           name="HelloWorldComposite">
+
+    <component name="HelloWorldComponent">
+		<rb:implementation.rb script="org/apache/tuscany/container/ruby/function/HelloWorld.rb"/>
+    </component>
+</composite>

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/containers/container.ruby/src/test/resources/org/apache/tuscany/container/ruby/function/helloworld.scdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message