Package org.jaggeryjs.scriptengine.cache

Examples of org.jaggeryjs.scriptengine.cache.CacheManager


                            String.valueOf(MultitenantConstants.SUPER_TENANT_ID),
                            "<<" +  name + ">>",
                            '/' + path.substring(0, endIndex),
                            path.substring(endIndex));
                }
                CacheManager cacheManager = new CacheManager(null);

                sctx.setSecurityDomain(new RhinoSecurityDomain() {
                    @Override
                    public CodeSource getCodeSource() throws ScriptException {
                        try {
                            URL url = new File(fileName).getCanonicalFile().toURI().toURL();
                            return new CodeSource(url, (Certificate[]) null);
                        } catch (MalformedURLException e) {
                            throw new ScriptException(e);
                        } catch (IOException e) {
                            throw new ScriptException(e);
                        }
                    }
                });
                sctx.setSourceModifiedTime(1);

                Script cachedScript = cacheManager.getScriptObject(reader, sctx);
                if (cachedScript == null) {
                    cacheManager.cacheScript(reader, sctx);
                    cachedScript = cacheManager.getScriptObject(reader, sctx);
                }
                script.setScript(cachedScript);
                module.addScript(script);
            } catch (FileNotFoundException e) {
                String msg = "Error executing script. Script cannot be found, name : " + name + ", path : " + path;
View Full Code Here


        return this.moduleManager;
    }

    public void initialize(String modulesDir, RhinoSecurityController securityController)
            throws ScriptException {
        this.engine = new RhinoEngine(new CacheManager(null), new RhinoContextFactory(securityController));
        this.moduleManager = new ModuleManager(modulesDir);
        exposeDefaultModules(this.engine, this.moduleManager.getModules());
    }
View Full Code Here

TOP

Related Classes of org.jaggeryjs.scriptengine.cache.CacheManager

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.