Package org.jaggeryjs.scriptengine.engine

Examples of org.jaggeryjs.scriptengine.engine.RhinoEngine.exec()


            //Parsing the script
          final Reader source = new ScriptReader(new BufferedInputStream(fstream));
            out.println("\n");
            ShellUtilityService.initializeUtilityServices();
            engine.exec(source, scope, null);
            ShellUtilityService.destroyUtilityServices();
            out.flush();
            out.println("\n");
    }catch (Exception e){
      out.println("\n");
View Full Code Here


         
          RhinoEngine.putContextProperty("jaggeryContext", jaggeryContext);

          //Parsing the script
          ShellUtilityService.initializeUtilityServices();
            engine.exec(new StringReader(expression), scope, null);
            ShellUtilityService.destroyUtilityServices();
            out.flush();
    }catch (Exception e){
      out.println("Error: " + e.getMessage());
    }
View Full Code Here

        includedScripts.put(fileURL, true);
        includesCallstack.push(fileURL);
        if (isJSON) {
            scope = (ScriptableObject) engine.eval(source, scope, sctx);
        } else {
            engine.exec(source, scope, sctx);
        }
        includesCallstack.pop();
        return scope;
    }
View Full Code Here

                            }
                            String path = (String) script;
                            path = path.startsWith("/") ? path : "/" + path;
                            Stack<String> callstack = CommonManager.getCallstack(sharedContext);
                            callstack.push(path);
                            engine.exec(new ScriptReader(servletContext.getResourceAsStream(path)) {
                                @Override
                                protected void build() throws IOException {
                                    try {
                                        sourceReader = new StringReader(HostObjectUtil.streamToString(sourceIn));
                                    } catch (ScriptException e) {
View Full Code Here

                        } catch (ScriptException e) {
                            throw new IOException(e);
                        }
                    }
                };
                engine.exec(sr, clonedScope, null);
            } catch (ScriptException e) {
                log.error(e.getMessage(), e);
            } finally {
                CommonManager.getCallstack(context).pop();
            }
View Full Code Here

                        } catch (ScriptException e) {
                            throw new IOException(e);
                        }
                    }
                };
                engine.exec(sr, clonedScope, null);
            } catch (ScriptException e) {
                log.error(e.getMessage(), e);
            } finally {
                CommonManager.getCallstack(context).pop();
            }
View Full Code Here

                    callstack.push(path);
                    String[] parts = WebAppManager.getKeys(servletContext.getContextPath(), path, path);
                    ScriptCachingContext sctx = new ScriptCachingContext(sharedContext.getTenantId(),
                            parts[0], parts[1], parts[2]);
                    sctx.setSecurityDomain(new JaggerySecurityDomain(path, servletContext));
                    engine.exec(new ScriptReader(servletContext.getResourceAsStream(path)) {
                        @Override
                        protected void build() throws IOException {
                            try {
                                sourceReader = new StringReader(HostObjectUtil.streamToString(sourceIn));
                            } catch (ScriptException e) {
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.