Top Description Fields Constructors Methods
org.jruby.embed

public Class IsolatedScriptingContainer

extends ScriptingContainer
Class Inheritance
Known Direct Subclasses
org.jruby.embed.osgi.OSGiIsolatedScriptingContainer
Imports
java.net.URL, java.util.HashMap, .Map, .List, .LinkedList, org.jruby.util.ClassesLoader, .UriLikePathHelper

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.

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
setEnvironment(Map<K, V>
a new map of environment variables.
environment
)

Overrides org.jruby.embed.ScriptingContainer.setEnvironment.

Implements org.jruby.embed.EmbedRubyInstanceConfigAdapter.setEnvironment.

Changes an environment variables' map.

Inherited from org.jruby.embed.ScriptingContainer:
addClassLoaderaddGemPathaddGemPathaddLoadPathaddLoadPathcallMethodcallMethodcallMethodcallMethodcallMethodcallMethodcallMethodcallMethodcallMethodcallSupercallSuperclearfinalizegetgetgetArgvgetAttributegetAttributeMapgetClassLoadergetClassloaderDelegategetCompileModegetCurrentDirectorygetEnvironmentgetErrgetErrorgetErrorWritergetHomeDirectorygetIngetInputgetInstancegetJitLogEverygetJitMaxgetJitMaxSizegetJitThresholdgetKCodegetLoadPathsgetLoadServiceCreatorgetOutgetOutputgetProfilegetProfileOutputgetProfilingModegetPropertygetProvidergetProviderInstancegetReadergetRecordSeparatorgetRuntimegetScriptFilenamegetSupportedRubyVersiongetVarMapgetWriterisNativeEnabledisObjectSpaceEnabledisRunRubyInProcessnewObjectAdapternewRuntimeAdapterparseparseparseparseputputremoveremoveremoveAttributeresetErrorWriterresetWriterrunRubyMethodrunRubyMethodrunScriptletrunScriptletrunScriptletrunScriptletsetArgvsetAttributesetClassLoadersetClassloaderDelegatesetCompileModesetCurrentDirectorysetErrorsetErrorsetErrorWritersetHomeDirectorysetInputsetInputsetJitLogEverysetJitMaxsetJitMaxSizesetJitThresholdsetKCodesetLoadPathssetLoadServiceCreatorsetNativeEnabledsetObjectSpaceEnabledsetOutputsetOutputsetProfilesetProfilesetProfileOutputsetProfilingModesetReadersetRecordSeparatorsetRunRubyInProcesssetScriptFilenamesetWriterterminate

Field Detail

URI_CLASSLOADERback to summary
private static final String URI_CLASSLOADER

Constructor Detail

IsolatedScriptingContainerback to summary
public IsolatedScriptingContainer()
IsolatedScriptingContainerback to summary
public IsolatedScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior)
IsolatedScriptingContainerback to summary
public IsolatedScriptingContainer(LocalContextScope scope)
IsolatedScriptingContainerback to summary
public IsolatedScriptingContainer(LocalVariableBehavior behavior)
IsolatedScriptingContainerback to summary
public IsolatedScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy)

Method Detail

setEnvironmentback to summary
public void setEnvironment(Map<K, V> environment)

Overrides org.jruby.embed.ScriptingContainer.setEnvironment.

Implements org.jruby.embed.EmbedRubyInstanceConfigAdapter.setEnvironment.

Doc from org.jruby.embed.ScriptingContainer.setEnvironment.

Changes an environment variables' map. Call this method before you use put/get, runScriptlet, and parse methods so that initial configurations will work.

Parameters
environment:Map<K, V>

a new map of environment variables.

Annotations
@Override