Package org.apache.bsf

Examples of org.apache.bsf.BSFDeclaredBean


        super.initialize(manager, language, someDeclaredBeans);

        runtime = JavaEmbedUtils.initialize(getClassPath(manager));

        for (int i = 0, size = someDeclaredBeans.size(); i < size; i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean) someDeclaredBeans.elementAt(i);
            runtime.getGlobalVariables().define(
                GlobalVariable.variableName(bean.name),
                new BeanGlobalVariable(runtime, bean));
        }
View Full Code Here


            @SuppressWarnings("rawtypes") Vector declaredBeans) // super-class does not use generics
            throws BSFException {
        super.initialize(mgr, lang, declaredBeans);
        jc = JexlHelper.createContext();
        for (int i = 0; i < declaredBeans.size(); i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.elementAt(i);
            jc.getVars().put(bean.name, bean.bean);
        }
    }
View Full Code Here

        // declare the bsf manager for callbacks, etc.
        context.put("bsf", mgr);

        for(int i=0; i<declaredBeans.size(); i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i);
            declareBean(bean);
        }
    }
View Full Code Here

            @SuppressWarnings("rawtypes") Vector declaredBeans) // super-class does not use generics
            throws BSFException {
        super.initialize(mgr, lang, declaredBeans);
        jc = JexlHelper.createContext();
        for (int i = 0; i < declaredBeans.size(); i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.elementAt(i);
            jc.getVars().put(bean.name, bean.bean);
        }
    }
View Full Code Here

        } catch (EvalError e) {
            throw new BSFException("bsh internal error: "+e.toString());
        }

        for(int i=0; i<declaredBeans.size(); i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i);
            declareBean(bean);
        }
    }
View Full Code Here

            @SuppressWarnings("rawtypes") Vector declaredBeans) // super-class does not use generics
            throws BSFException {
        super.initialize(mgr, lang, declaredBeans);
        jc = JexlHelper.createContext();
        for (int i = 0; i < declaredBeans.size(); i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean) declaredBeans.elementAt(i);
            jc.getVars().put(bean.name, bean.bean);
        }
    }
View Full Code Here

        logger1.info("declareBean");
        BSFManager manager = new BSFManager();
        JRubyEngine instance = new JRubyEngine();
        instance.initialize(manager, "jruby", null);
        manager.declareBean("abc", "aaabbbccc", String.class);
        BSFDeclaredBean bean = (BSFDeclaredBean) manager.getObjectRegistry().lookup("abc");
        instance.declareBean(bean);
    }
View Full Code Here

        logger1.info("undeclareBean");
        BSFManager manager = new BSFManager();
        JRubyEngine instance = new JRubyEngine();
        instance.initialize(manager, "jruby", null);
        manager.declareBean("abc", "aaabbbccc", String.class);
        BSFDeclaredBean bean = (BSFDeclaredBean) manager.getObjectRegistry().lookup("abc");
        instance.undeclareBean(bean);
    }
View Full Code Here

        }
        Ruby runtime = container.getProvider().getRuntime();

        if (someDeclaredBeans != null && someDeclaredBeans.size() > 0) {
            for (int i = 0; i < someDeclaredBeans.size(); i++) {
                BSFDeclaredBean bean = (BSFDeclaredBean) someDeclaredBeans.get(i);
                setVariable(bean);
            }
        }
        runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this)));
    }
View Full Code Here

        super.initialize(manager, language, someDeclaredBeans);

        runtime = JavaEmbedUtils.initialize(getClassPath(manager));

        for (int i = 0, size = someDeclaredBeans.size(); i < size; i++) {
            BSFDeclaredBean bean = (BSFDeclaredBean) someDeclaredBeans.elementAt(i);
            runtime.getGlobalVariables().define(
                GlobalVariable.variableName(bean.name),
                new BeanGlobalVariable(runtime, bean));
        }
View Full Code Here

TOP

Related Classes of org.apache.bsf.BSFDeclaredBean

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.