Examples of RubyRuntimeFactory


Examples of org.torquebox.core.runtime.RubyRuntimeFactory

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertTrue( factory.isProfileApi() );
    }   
View Full Code Here

Examples of org.torquebox.core.runtime.RubyRuntimeFactory

        deploy( phaseContext );

        ServiceName factoryServiceName = CoreServices.runtimeFactoryName( unit );
        MockServiceBuilder<?> factoryBuilder = phaseContext.getMockServiceTarget().getMockServiceBuilder( factoryServiceName );
        Value<?> factoryValue = factoryBuilder.getValue();
        RubyRuntimeFactory factory = (RubyRuntimeFactory) factoryValue.getValue();

        assertNotNull( factory );
        assertFalse( factory.isProfileApi() );
    }      
View Full Code Here

Examples of org.torquebox.core.runtime.RubyRuntimeFactory

        RubyAppMetaData rubyAppMetaData = unit.getAttachment( RubyAppMetaData.ATTACHMENT_KEY );
        RubyRuntimeMetaData runtimeMetaData = unit.getAttachment( RubyRuntimeMetaData.ATTACHMENT_KEY );

        if (rubyAppMetaData != null && runtimeMetaData != null) {
            RubyRuntimeFactory factory = new RubyRuntimeFactory( runtimeMetaData.getRuntimeInitializer(),
                    runtimeMetaData.getRuntimePreparer() );

            List<String> loadPaths = new ArrayList<String>();

            for (RubyLoadPathMetaData loadPath : runtimeMetaData.getLoadPaths()) {
                loadPaths.add( loadPath.getPath().getAbsolutePath() );
            }

            Module module = unit.getAttachment( Attachments.MODULE );

            if (module != null) {
                factory.setClassLoader( module.getClassLoader() );
            }

            factory.setServiceRegistry( phaseContext.getServiceRegistry() );
            factory.setLoadPaths( loadPaths );
            factory.setApplicationName( rubyAppMetaData.getApplicationName() );
            factory.setUseJRubyHomeEnvVar( this.useJRubyHomeEnvVar );
            factory.setApplicationEnvironment( rubyAppMetaData.getEnvironmentVariables() );
            factory.setDebug( runtimeMetaData.isDebug() );
            factory.setInteractive( runtimeMetaData.isInteractive() );
            factory.setProfileApi( runtimeMetaData.isProfileApi() );

            if (runtimeMetaData.getVersion() == RubyRuntimeMetaData.Version.V1_9) {
                factory.setRubyVersion( CompatVersion.RUBY1_9 );
            } else if (runtimeMetaData.getVersion() == RubyRuntimeMetaData.Version.V1_8) {
                factory.setRubyVersion( CompatVersion.RUBY1_8 );
            } else if (runtimeMetaData.getVersion() == RubyRuntimeMetaData.Version.V2_0) {
                factory.setRubyVersion( CompatVersion.RUBY2_0 );
            }

            RubyRuntimeMetaData.CompileMode compileMode = runtimeMetaData.getCompileMode();

            if (compileMode == RubyRuntimeMetaData.CompileMode.JIT) {
                factory.setCompileMode( CompileMode.JIT );
            } else if (compileMode == RubyRuntimeMetaData.CompileMode.OFF) {
                factory.setCompileMode( CompileMode.OFF );
            } else if (compileMode == RubyRuntimeMetaData.CompileMode.FORCE) {
                factory.setCompileMode( CompileMode.FORCE );
            }

            RubyRuntimeFactoryService service = new RubyRuntimeFactoryService( factory );
            ServiceName name = CoreServices.runtimeFactoryName( unit );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.