Package org.apache.tuscany.container.ruby.rubyscript

Examples of org.apache.tuscany.container.ruby.rubyscript.RubyScript


        for (PropertyValue propertyValue : propValueSettings) {
            propertyValues.put(propertyValue.getName(),
                               propertyValue.getValueFactory().getInstance());
        }
       
        RubyScript rubyScript = implementation.getRubyScript();

        // TODO: have ComponentBuilderExtension pass ScopeContainer in on build method?
        ScopeContainer scopeContainer;
        Scope scope = componentType.getLifecycleScope();
        if (Scope.MODULE == scope) {
View Full Code Here


                                   script);

        LoaderUtil.skipToEndElement(reader);

        RubyImplementation implementation = new RubyImplementation();
        RubyScript rubyScript = new RubyScript(script, source, null, cl);
        implementation.setRubyScript(rubyScript);
        implementation.setRubyClassName(rubyClassName);
        registry.loadComponentType(parent,
                                   implementation,
                                   deploymentContext);
View Full Code Here

                                                          RubyImplementation implementation,
                                                          DeploymentContext deploymentContext) throws
                                                                                               MissingResourceException,
                                                                                               InvalidServiceContractException {

        RubyScript rubyScript = implementation.getRubyScript();
        RubySCAConfig scaConfig = rubyScript.getSCAConfig();
        if (!scaConfig.hasSCAConfig()) {
            throw new IllegalArgumentException(
                "must use either .componentType side file or Ruby Global variable $SCA definition");
        }

        // FIXME this should be a system service, not instantiated here
        RubyComponentType componentType = new RubyIntrospector(null, processorRegistry)
            .introspectScript(scaConfig, rubyScript.getClassLoader());

        return componentType;
    }
View Full Code Here

//        scope.stop();
    }

    protected void setUp() throws Exception {
        super.setUp();
        rubyScript = new RubyScript("test", SCRIPT);
    }
View Full Code Here

        }
    };

    public void testJavaInterface() throws MissingResourceException,
                                   InvalidServiceContractException {
        RubyScript rs = new RubyScript("javaInterfaceTest",
                                       "$SCA = { 'javaInterface' => 'helloworld.HelloWorldService'}",
                                       null,
                                       getClass().getClassLoader());
        RubySCAConfig scaConfig = new RubySCAConfig(rs.getRubyEngine().getGlobalVariables());
        RubyIntrospector introspector = new RubyIntrospector(null,
                                                             new JavaInterfaceProcessorRegistryImpl());
        ComponentType comonentType = introspector.introspectScript(scaConfig,
                                                                   rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1,
                     services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values()
View Full Code Here

    public void testWSDLPortType() throws WSDLException,
                                  IOException,
                                  MissingResourceException,
                                  InvalidServiceContractException {
        RubyScript rs = new RubyScript("wsdlPortType",
                                       "$SCA = { 'wsdlPortType' => 'HelloWorld', 'wsdlNamespace' => 'http://helloworld'}",
                                       null,
                                       getClass().getClassLoader());
        RubySCAConfig scaConfig = new RubySCAConfig(rs.getRubyEngine().getGlobalVariables());

        WSDLDefinitionRegistryImpl wsdlReg = new WSDLDefinitionRegistryImpl();
        wsdlReg.setMonitor(NULL_MONITOR);
        URL wsdlURL = getClass().getClassLoader()
                                .getResource("org/apache/tuscany/container/ruby/jruby/helloworld.wsdl");
        wsdlReg.loadDefinition("http://helloworld",
                               wsdlURL);

        RubyIntrospector introspector = new RubyIntrospector(wsdlReg,
                                                             new JavaInterfaceProcessorRegistryImpl());
        ComponentType comonentType = introspector.introspectScript(scaConfig,
                                                                   rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1,
                     services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values()
View Full Code Here

        scope.stop();
    }

    protected void setUp() throws Exception {
        super.setUp();
        implClass1 = new RubyScript("script1", SCRIPT);
        implClass2 = new RubyScript("script2", SCRIPT2);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.container.ruby.rubyscript.RubyScript

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.