Examples of loadScriptingEngine()


Examples of com.ibm.bsf.BSFManager.loadScriptingEngine()

public class BSF implements Script {
    public Object run(String language, String name, String scriptStr, String methodName, Object[] argValues)
            throws Exception {
        BSFManager manager = new BSFManager();
        BSFEngine engine = manager.loadScriptingEngine(language);

        manager.exec(language, "service script for '" +
                name + "'", 0, 0, scriptStr);

        Object result = engine.call(null, methodName, argValues);
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

        mgr.registerBean("context", context);

        // pre-load the engine to make sure we were called right
        org.apache.bsf.BSFEngine bsfEngine = null;
        try {
            bsfEngine = mgr.loadScriptingEngine(modelService.engineName);
        } catch (BSFException e) {
            throw new GenericServiceException("Problems loading org.apache.bsf.BSFEngine: " + modelService.engineName, e);
        }

        // source the script into a string
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

        mgr.registerBean("context", context);

        // pre-load the engine to make sure we were called right
        org.apache.bsf.BSFEngine bsfEngine = null;
        try {
            bsfEngine = mgr.loadScriptingEngine(modelService.engineName);
        } catch (BSFException e) {
            throw new GenericServiceException("Problems loading org.apache.bsf.BSFEngine: " + modelService.engineName, e);
        }

        // source the script into a string
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

            //mgr.declareBean("ResponseMessage", "OK", String.class); // $NON-NLS-1$
            //mgr.declareBean("IsSuccess", Boolean.TRUE, Boolean.class); // $NON-NLS-1$

            // N.B. some engines (e.g. Javascript) cannot handle certain declareBean() calls
            // after the engine has been initialised, so create the engine last
            bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());

            Object bsfOut = null;
            if (fileName.length()>0) {
                res.setSamplerData("File: "+fileName);
                is = new BufferedInputStream(new FileInputStream(fileName));
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

      //mgr.declareBean("ResponseMessage", "OK", String.class); // $NON-NLS-1$
      //mgr.declareBean("IsSuccess", Boolean.TRUE, Boolean.class); // $NON-NLS-1$

      // N.B. some engines (e.g. Javascript) cannot handle certain declareBean() calls
      // after the engine has been initialised, so create the engine last
      bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());

      Object bsfOut = null;
      if (fileName.length()>0) {
        res.setSamplerData("File: "+fileName);
        is = new FileInputStream(fileName);
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

            //mgr.declareBean("ResponseMessage", "OK", String.class); // $NON-NLS-1$
            //mgr.declareBean("IsSuccess", Boolean.TRUE, Boolean.class); // $NON-NLS-1$

            // N.B. some engines (e.g. Javascript) cannot handle certain declareBean() calls
            // after the engine has been initialised, so create the engine last
            bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());

            Object bsfOut = null;
            if (fileName.length()>0) {
                res.setSamplerData("File: "+fileName);
                is = new BufferedInputStream(new FileInputStream(fileName));
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

            //mgr.declareBean("ResponseMessage", "OK", String.class); // $NON-NLS-1$
            //mgr.declareBean("IsSuccess", Boolean.TRUE, Boolean.class); // $NON-NLS-1$

            // N.B. some engines (e.g. Javascript) cannot handle certain declareBean() calls
            // after the engine has been initialised, so create the engine last
            bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());

            Object bsfOut = null;
            if (fileName.length()>0) {
                res.setSamplerData("File: "+fileName);
                is = new FileInputStream(fileName);
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

    @Test
    public void testPathTyp() throws BSFException {
        logger1.info("PathType");
        BSFManager.registerScriptingEngine("jruby", "org.jruby.embed.bsf.JRubyEngine", new String[] {"rb"});
        BSFManager manager = new BSFManager();
        JRubyEngine instance = (JRubyEngine) manager.loadScriptingEngine("jruby");
        Object receiver = instance.eval("org/jruby/embed/ruby/radioactive_decay.rb", 0, 0, PathType.CLASSPATH);
        String method = "amount_after_years";
        Object[] args = new Object[2];
        args[0] = 10.0; args[1] = 1000;
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

    @Test
    public void testRubyVersion() throws BSFException {
        logger1.info("RubyVersion");
        BSFManager.registerScriptingEngine("jruby", "org.jruby.embed.bsf.JRubyEngine", new String[] {"rb"});
        BSFManager manager = new BSFManager();
        JRubyEngine instance = (JRubyEngine) manager.loadScriptingEngine("jruby");
        Object result = instance.eval("org/jruby/embed/ruby/block-param-scope.rb", 0, 0, PathType.CLASSPATH);
        String expResult = "cat";
        assertEquals(expResult, ((String)result).trim());

        // Ruby 1.9 mode is somehow broken in 1.5.0dev
View Full Code Here

Examples of org.apache.bsf.BSFManager.loadScriptingEngine()

        String expResult = "cat";
        assertEquals(expResult, ((String)result).trim());

        // Ruby 1.9 mode is somehow broken in 1.5.0dev
        BSFManager.registerScriptingEngine("jruby19", "org.jruby.embed.bsf.JRubyEngine", new String[] {"rb"});
        instance = (JRubyEngine) manager.loadScriptingEngine("jruby19");
        result = instance.eval("org/jruby/embed/ruby/block-param-scope.rb", 0, 0, PathType.CLASSPATH);
        expResult = "bear";
        assertEquals(expResult, ((String)result).trim());
    }
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.