/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); setLoader(mgr, parent); execScripts = new HashMap<Object, Class>(); evalScripts = new HashMap<Object, Class>(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); // create a shell shell = new GroovyShell(mgr.getClassLoader()); // register the mgr with object name "bsf" shell.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); final ClassLoader finalParent = parent; this.loader = (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setClasspath(mgr.getClassPath()); return new GroovyClassLoader(finalParent, configuration); } }); execScripts = new HashMap(); evalScripts = new HashMap(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); final ClassLoader finalParent = parent; this.loader = (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setClasspath(mgr.getClassPath()); return new GroovyClassLoader(finalParent, configuration); } }); execScripts = new HashMap(); evalScripts = new HashMap(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); final ClassLoader finalParent = parent; this.loader = (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setClasspath(mgr.getClassPath()); return new GroovyClassLoader(finalParent, configuration); } }); execScripts = new HashMap(); evalScripts = new HashMap(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); setLoader(mgr, parent); execScripts = new HashMap<Object, Class>(); evalScripts = new HashMap<Object, Class>(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } }
/** * Initialize the engine. */ public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException { super.initialize(mgr, lang, declaredBeans); ClassLoader parent = mgr.getClassLoader(); if (parent == null) parent = GroovyShell.class.getClassLoader(); final ClassLoader finalParent = parent; this.loader = (GroovyClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setClasspath(mgr.getClassPath()); return new GroovyClassLoader(finalParent, configuration); } }); execScripts = new HashMap(); evalScripts = new HashMap(); context = shell.getContext(); // create a shell // register the mgr with object name "bsf" context.setVariable("bsf", new BSFFunctions(mgr, this)); int size = declaredBeans.size(); for (int i = 0; i < size; i++) { declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); } } }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { 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), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); } runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this)), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { super.initialize(manager, language, someDeclaredBeans); LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON); LocalVariableBehavior behavior = LocalVariableBehavior.BSF; container = new ScriptingContainer(scope, behavior); SystemPropertyCatcher.setConfiguration(container); //container.getProvider().setLoadPaths(getClassPath(manager)); 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)), GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { 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), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); } runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this)), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { 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), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); } runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this)), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { 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), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); } runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this)), org.jruby.internal.runtime.GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { super.initialize(manager, language, someDeclaredBeans); LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON); LocalVariableBehavior behavior = LocalVariableBehavior.BSF; container = new ScriptingContainer(scope, behavior); SystemPropertyCatcher.setConfiguration(container); //container.getProvider().setLoadPaths(getClassPath(manager)); 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)), GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { super.initialize(manager, language, someDeclaredBeans); LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON); LocalVariableBehavior behavior = LocalVariableBehavior.BSF; container = new ScriptingContainer(scope, behavior); SystemPropertyCatcher.setConfiguration(container); //container.getProvider().setLoadPaths(getClassPath(manager)); if (!SystemPropertyCatcher.isRuby19(language)) { container.getProvider().getRubyInstanceConfig().setCompatVersion(CompatVersion.RUBY1_8); } 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)), GlobalVariable.Scope.GLOBAL); }
@Override public void initialize(BSFManager manager, String language, Vector someDeclaredBeans) throws BSFException { super.initialize(manager, language, someDeclaredBeans); LocalContextScope scope = SystemPropertyCatcher.getScope(LocalContextScope.SINGLETON); LocalVariableBehavior behavior = LocalVariableBehavior.BSF; container = new ScriptingContainer(scope, behavior); SystemPropertyCatcher.setConfiguration(container); //container.getProvider().setLoadPaths(getClassPath(manager)); if (!SystemPropertyCatcher.isRuby19(language)) { container.getProvider().getRubyInstanceConfig().setCompatVersion(CompatVersion.RUBY1_8); } 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)), GlobalVariable.Scope.GLOBAL); }