Package org.jruby.embed

Examples of org.jruby.embed.LocalContextScope


        }
        return new String(sb);
    }

    public ScriptEngine getScriptEngine() {
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = SystemPropertyCatcher.getBehavior(LocalVariableBehavior.GLOBAL);
        boolean lazy = SystemPropertyCatcher.isLazy(false);
        ScriptingContainer container = new ScriptingContainer(scope, behavior, lazy);
        SystemPropertyCatcher.setClassLoader(container);
        SystemPropertyCatcher.setConfiguration(container);
View Full Code Here


     *
     * @param defaultScope a default scope.
     * @return one of three local context scopes.
     */
    public static LocalContextScope getScope(LocalContextScope defaultScope) {
        LocalContextScope scope = defaultScope;
        String s = System.getProperty(PropertyName.LOCALCONTEXT_SCOPE.toString());
        if (s == null) {
            return scope;
        }
        if ("singlethread".equalsIgnoreCase(s)) {
View Full Code Here

    }

    @Override
    public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException {
        super.initialize(manager, language, someDeclaredBeans);
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = LocalVariableBehavior.BSF;
        container = new ScriptingContainer(scope, behavior);
        SystemPropertyCatcher.setConfiguration(container);
        //container.getProvider().setLoadPaths(getClassPath(manager));
        if (SystemPropertyCatcher.isRuby19(language)) {
View Full Code Here

     *
     * @param defaultScope a default scope.
     * @return one of three local context scopes.
     */
    public static LocalContextScope getScope(LocalContextScope defaultScope) {
        LocalContextScope scope = defaultScope;
        String s = SafePropertyAccessor.getProperty(PropertyName.LOCALCONTEXT_SCOPE.toString());
        if (s == null) {
            return scope;
        }
        if ("singlethread".equalsIgnoreCase(s)) {
View Full Code Here

    }

    @Override
    public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException {
        super.initialize(manager, language, someDeclaredBeans);
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = LocalVariableBehavior.BSF;
        container = new ScriptingContainer(scope, behavior);
        SystemPropertyCatcher.setConfiguration(container);
        //container.getProvider().setLoadPaths(getClassPath(manager));
        if (!SystemPropertyCatcher.isRuby19(language)) {
View Full Code Here

     */
    @Test
    public void testGetScope() {
        System.setProperty(PropertyName.LOCALCONTEXT_SCOPE.toString(), "");
       
        LocalContextScope defaultScope = LocalContextScope.SINGLETON;
       
        // no setting
        LocalContextScope result = SystemPropertyCatcher.getScope(defaultScope);
        assertEquals(defaultScope, result);
       
        System.setProperty(PropertyName.LOCALCONTEXT_SCOPE.toString(), "singleton");
        result = SystemPropertyCatcher.getScope(defaultScope);
        assertEquals(LocalContextScope.SINGLETON, result);
View Full Code Here

        }
        return new String(sb);
    }

    public ScriptEngine getScriptEngine() {
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = SystemPropertyCatcher.getBehavior(LocalVariableBehavior.GLOBAL);
        boolean lazy = SystemPropertyCatcher.isLazy(false);
        ScriptingContainer container = new ScriptingContainer(scope, behavior, lazy);
        SystemPropertyCatcher.setClassLoader(container);
        SystemPropertyCatcher.setConfiguration(container);
View Full Code Here

     *
     * @param defaultScope a default scope.
     * @return one of three local context scopes.
     */
    public static LocalContextScope getScope(LocalContextScope defaultScope) {
        LocalContextScope scope = defaultScope;
        String s = SafePropertyAccessor.getProperty(PropertyName.LOCALCONTEXT_SCOPE.toString());
        if (s == null) {
            return scope;
        }
        if ("singlethread".equalsIgnoreCase(s)) {
View Full Code Here

    }

    @Override
    public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException {
        super.initialize(manager, language, someDeclaredBeans);
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = LocalVariableBehavior.BSF;
        container = new ScriptingContainer(scope, behavior);
        SystemPropertyCatcher.setConfiguration(container);
        //container.getProvider().setLoadPaths(getClassPath(manager));
        Ruby runtime = container.getProvider().getRuntime();
View Full Code Here

        }
        return new String(sb);
    }

    public ScriptEngine getScriptEngine() {
        LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON);
        LocalVariableBehavior behavior = SystemPropertyCatcher.getBehavior(LocalVariableBehavior.GLOBAL);
        boolean lazy = SystemPropertyCatcher.isLazy(true);
        ScriptingContainer container = createScriptingContainer(scope, behavior, lazy);
            //new ScriptingContainer(scope, behavior, lazy);
        SystemPropertyCatcher.setClassLoader(container);
View Full Code Here

TOP

Related Classes of org.jruby.embed.LocalContextScope

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.