public class IsolatedScriptingContainer extends ScriptingContainer
setEnvironment(Map)
this will be honored.
It also allows to add a classloaders to LOAD_PATH or GEM_PATH.
This container also sets option classloader.delegate to false, i.e. the JRubyClassloader
for each runtime will lookup classes first on itself before looking into the parent
classloader.
WARNING: this can give problems when joda-time is used inside the
JRubyClassloader or with current version of nokogiri (1.6.7.2) as it uses
(sun-)jdk classes which conflicts with classes nokogiri loaded into the
JRubyClassloader.
With any classloader related problem the first thing is to try
container.getProvider().getRubyInstanceConfig().setClassloaderDelegate(true);
to solve it.Constructor and Description |
---|
IsolatedScriptingContainer() |
IsolatedScriptingContainer(LocalContextScope scope) |
IsolatedScriptingContainer(LocalContextScope scope,
LocalVariableBehavior behavior) |
IsolatedScriptingContainer(LocalContextScope scope,
LocalVariableBehavior behavior,
boolean lazy) |
IsolatedScriptingContainer(LocalVariableBehavior behavior) |
Modifier and Type | Method and Description |
---|---|
void |
setEnvironment(java.util.Map environment)
Changes an environment variables' map.
|
addClassLoader, addGemPath, addGemPath, addLoadPath, addLoadPath, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, callSuper, clear, finalize, get, get, getArgv, getAttribute, getAttributeMap, getClassLoader, getClassloaderDelegate, getCompatVersion, getCompileMode, getCurrentDirectory, getEnvironment, getErr, getError, getErrorWriter, getHomeDirectory, getIn, getInput, getInstance, getJitLogEvery, getJitMax, getJitMaxSize, getJitThreshold, getKCode, getLoadPaths, getLoadServiceCreator, getOut, getOutput, getProfile, getProfileOutput, getProfilingMode, getProperty, getProvider, getReader, getRecordSeparator, getRuntime, getScriptFilename, getSupportedRubyVersion, getVarMap, getWriter, isNativeEnabled, isObjectSpaceEnabled, isRunRubyInProcess, newObjectAdapter, newRuntimeAdapter, parse, parse, parse, parse, put, put, remove, remove, removeAttribute, resetErrorWriter, resetWriter, runRubyMethod, runRubyMethod, runScriptlet, runScriptlet, runScriptlet, runScriptlet, setArgv, setAttribute, setClassLoader, setClassloaderDelegate, setCompatVersion, setCompileMode, setCurrentDirectory, setError, setError, setErrorWriter, setHomeDirectory, setInput, setInput, setJitLogEvery, setJitMax, setJitMaxSize, setJitThreshold, setKCode, setLoadPaths, setLoadServiceCreator, setNativeEnabled, setObjectSpaceEnabled, setOutput, setOutput, setProfile, setProfile, setProfileOutput, setProfilingMode, setReader, setRecordSeparator, setRunRubyInProcess, setScriptFilename, setWriter, terminate
public IsolatedScriptingContainer()
public IsolatedScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior)
public IsolatedScriptingContainer(LocalContextScope scope)
public IsolatedScriptingContainer(LocalVariableBehavior behavior)
public IsolatedScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy)
public void setEnvironment(java.util.Map environment)
ScriptingContainer
setEnvironment
in interface EmbedRubyInstanceConfigAdapter
setEnvironment
in class ScriptingContainer
environment
- a new map of environment variables.Copyright © 2001-2017 JRuby. All Rights Reserved.