/** * Returns a Ruby runtime in one of {@link LocalContextScope}. * * @deprecated As of JRuby 1.5.0. Use getProvider().getRuntime() method instead. * * @return Ruby runtime of a specified local context */ @Deprecated public Ruby getRuntime() { return provider.getRuntime(); }
/** * Changes a current directory to a given directory. * The current directory can be changed anytime. * * @since JRuby 1.5.0. * * @param directory a new directory to be set. */ public void setCurrentDirectory(String directory) { if (provider.isRuntimeInitialized()) { provider.getRuntime().setCurrentDirectory(directory); } else { provider.getRubyInstanceConfig().setCurrentDirectory(directory); } }
/** * Returns a attribute map in one of {@link LocalContextScope}. Attributes * in this map accept any key value pair, types of which are java.lang.Object. * Ruby scripts do not look up this map. * * @return an attribute map specific to the current thread */ public Map getAttributeMap() { return provider.getAttributeMap(); }
void terminate() { VariableInterceptor.terminateGlobalVariables(provider.getLocalVariableBehavior(), variables, provider.getRuntime()); VariableInterceptor.terminateLocalVariables(provider.getLocalVariableBehavior(), varNames, variables); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { LocalContextProvider provider = getProvider(); if (provider.isRuntimeInitialized()) { provider.getRuntime().tearDown(false); provider.getRuntime().releaseClassLoader(); } provider.terminate(); }
/** * Returns an error stream assigned to STDERR and $stderr. * * @since JRuby 1.5.0. * * @return output stream for error stream */ public PrintStream getError() { return provider.getRubyInstanceConfig().getError(); }
/** * Returns a variable map in one of {@link LocalContextScope}. Variables * in this map is used to share between Java and Ruby. Map keys are Ruby's * variable names, thus they must be valid Ruby names. * * @return a variable map specific to the current thread */ public BiVariableMap getVarMap() { return provider.getVarMap(); }
/** * Returns a local variable behavior * * @return a local variable behavior */ public LocalVariableBehavior getLocalVariableBehavior() { return provider.getLocalVariableBehavior(); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false); getProvider().terminate(); }
/** * Returns currently configured ProfileOutput object, which determines where * the output of profiling operations will be sent. (e.g., a file specified * by --profile.out). * * @since JRuby 1.7.15 * * @return current profiling output location. */ public ProfileOutput getProfileOutput() { return provider.getRubyInstanceConfig().getProfileOutput(); }
/** * Returns a variable map in one of {@link LocalContextScope}. Variables * in this map is used to share between Java and Ruby. Map keys are Ruby's * variable names, thus they must be valid Ruby names. * * @return a variable map specific to the current thread */ public BiVariableMap getVarMap() { return provider.getVarMap(); }
void terminate() { VariableInterceptor.terminateGlobalVariables(provider.getLocalVariableBehavior(), variables, provider.getRuntime()); VariableInterceptor.terminateLocalVariables(provider.getLocalVariableBehavior(), varNames, variables); }
/** * Returns a local variable behavior * * @return a local variable behavior */ public LocalVariableBehavior getLocalVariableBehavior() { return provider.getLocalVariableBehavior(); }
/** * Returns a Ruby runtime in one of {@link LocalContextScope}. * * @deprecated As of JRuby 1.5.0. Use getProvider().getRuntime() method instead. * * @return Ruby runtime of a specified local context */ @Deprecated public Ruby getRuntime() { return provider.getRuntime(); }
/** * Cleanly shut down this ScriptingContainer and any JRuby resources it holds. * All ScriptingContainer instances should be terminated when you are done with * them, rather then leaving them for GC to finalize. * * @since JRuby 1.5.0 */ public void terminate() { if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false); getProvider().terminate(); }
/** * Returns a record separator. The default value is "\n". * * @since JRuby 1.5.0. * * @return a record separator. */ public String getRecordSeparator() { return provider.getRubyInstanceConfig().getRecordSeparator(); }
/** * Returns a variable map in one of {@link LocalContextScope}. Variables * in this map is used to share between Java and Ruby. Map keys are Ruby's * variable names, thus they must be valid Ruby names. * * @return a variable map specific to the current thread */ public BiVariableMap getVarMap() { return provider.getVarMap(); }
/** * Returns a attribute map in one of {@link LocalContextScope}. Attributes * in this map accept any key value pair, types of which are java.lang.Object. * Ruby scripts do not look up this map. * * @return an attribute map specific to the current thread */ public Map getAttributeMap() { return provider.getAttributeMap(); }
/** * Returns a local variable behavior * * @return a local variable behavior */ public LocalVariableBehavior getLocalVariableBehavior() { return provider.getLocalVariableBehavior(); }
/** * Returns a Ruby runtime in one of {@link LocalContextScope}. * * @deprecated As of JRuby 1.5.0. Use getProvider().getRuntime() method instead. * * @return Ruby runtime of a specified local context */ @Deprecated public Ruby getRuntime() { return provider.getRuntime(); }