Class IsolatedScriptingContainer

java.lang.Object
org.jruby.embed.ScriptingContainer
org.jruby.embed.IsolatedScriptingContainer
All Implemented Interfaces:
EmbedRubyInstanceConfigAdapter
Direct Known Subclasses:
OSGiIsolatedScriptingContainer

public class IsolatedScriptingContainer extends ScriptingContainer
The IsolatedScriptingContainer does set GEM_HOME and GEM_PATH and JARS_HOME in such a way that it uses only resources which can be reached with classloader. GEM_HOME is uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared GEM_PATH is uri:classloader:// JARS_HOME is uri:classloader://jars But whenever you want to set them via 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.