Package bsh

Examples of bsh.NameSpace$CommandPathEntry


        assertEquals("result", 100L, result);
    }

    @Test
    public void testScriptInfoGetNameSpace() throws Throwable {
        NameSpace ns = NameSpace.JAVACODE;
        NameSpace result = new BSHLogListener.ScriptInfo(ns).getNameSpace();
        assertSame("result", ns, result);
    }
View Full Code Here


        assertEquals("scriptInfo.lastModified", 100L, scriptInfo.lastModified);
    }

    @Test
    public void testScriptInfoSetNameSpace() throws Throwable {
        NameSpace ns = NameSpace.JAVACODE;
        BSHLogListener.ScriptInfo scriptInfo = new BSHLogListener.ScriptInfo(ns);
        scriptInfo.getNameSpace();
        scriptInfo.setNameSpace(ns);
        assertSame("scriptInfo.nameSpace", ns, scriptInfo.nameSpace);
    }
View Full Code Here

            String[] sources = replace(cfg.getAll("source"), patterns, new String[] {ev.getTag(), ev.getRealm()});
            for(int i=0; i<sources.length && ret != null; i++){
                try{
                    Interpreter bsh = new Interpreter();
                    BSHLogListener.ScriptInfo info = getScriptInfo(sources[i]);
                    NameSpace ns = (info!=null)?info.getNameSpace():null;
                    if(ns!=null) bsh.setNameSpace(ns);
                    bsh.set("event", ret);
                    bsh.set("cfg", cfg);
                    File f = new File(sources[i]);
                    if(!cfg.getBoolean("preload-scripts")){
View Full Code Here

            o = bsh.eval(expression);
            if (Debug.verboseOn())
                Debug.logVerbose("Evaluated to -- " + o, module);

            // read back the context info
            NameSpace ns = bsh.getNameSpace();
            String[] varNames = ns.getVariableNames();
            for (int x = 0; x < varNames.length; x++) {
                context.put(varNames[x], bsh.get(varNames[x]));
            }
        } catch (EvalError e) {
            Debug.logError(e, "BSH Evaluation error.", module);
View Full Code Here

            }
        }
       
        if (master != null) {
            Interpreter interpreter = new Interpreter(new StringReader(""), System.out, System.err,
                    false, new NameSpace(master, "global"), null, null);
            return interpreter;
        } else {
            Interpreter interpreter = new Interpreter();
            interpreter.setClassLoader(classLoader);
            return interpreter;
View Full Code Here

    PrintStream infoStream = new PrintStream(new ScriptEngineOutputStream(LogLevel.TRACE));
    PrintStream debugStream = new PrintStream(new ScriptEngineOutputStream(LogLevel.DEBUG));
    interpreter = new Interpreter(null, infoStream, debugStream, true);

    NameSpace globalNameSpace = interpreter.getNameSpace();
    scriptNameSpace = new ScriptNameSpace(this, globalNameSpace);
  }
View Full Code Here

TOP

Related Classes of bsh.NameSpace$CommandPathEntry

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.