Package org.jruby.embed.internal
Class SingletonLocalContextProvider
java.lang.Object
org.jruby.embed.internal.AbstractLocalContextProvider
org.jruby.embed.internal.SingletonLocalContextProvider
- All Implemented Interfaces:
LocalContextProvider
Singleton type local context provider.
As of JRuby 1.5.0 Ruby runtime returned from the getRuntime() method is a
classloader-global runtime.
- Author:
- Yoko Harada <[email protected]>
-
Field Summary
Fields inherited from class org.jruby.embed.internal.AbstractLocalContextProvider
behavior, config, lazy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an attribute map of a specified scope.static LocalContext
getLocalContextInstance
(RubyInstanceConfig config, LocalVariableBehavior behavior, boolean lazy) Deprecated.static LocalVariableBehavior
Deprecated.getProvider
(LocalVariableBehavior behavior, boolean lazy) Gets an instance ofRubyInstanceConfig
.Returns a Ruby runtime of a specified scope.Returns aBiVariableMap
of a specified scope.boolean
Tests whether Ruby runtime has been initialized or not.void
Clears up a variable map.Methods inherited from class org.jruby.embed.internal.AbstractLocalContextProvider
getInstance, getLocalVariableBehavior
-
Constructor Details
-
SingletonLocalContextProvider
-
SingletonLocalContextProvider
-
-
Method Details
-
getProvider
public static SingletonLocalContextProvider getProvider(LocalVariableBehavior behavior, boolean lazy) -
getLocalContextInstance
@Deprecated public static LocalContext getLocalContextInstance(RubyInstanceConfig config, LocalVariableBehavior behavior, boolean lazy) Deprecated. -
getLocalVariableBehaviorOrNull
Deprecated. -
getRuntime
Description copied from interface:LocalContextProvider
Returns a Ruby runtime of a specified scope.- Returns:
- a Ruby runtime
-
getRubyInstanceConfig
Description copied from interface:LocalContextProvider
Gets an instance ofRubyInstanceConfig
.- Specified by:
getRubyInstanceConfig
in interfaceLocalContextProvider
- Overrides:
getRubyInstanceConfig
in classAbstractLocalContextProvider
- Returns:
- an instance of RubyInstanceConfig.
-
isRuntimeInitialized
public boolean isRuntimeInitialized()Description copied from interface:LocalContextProvider
Tests whether Ruby runtime has been initialized or not.- Returns:
- true if initialized, false otherwise.
-
getVarMap
Description copied from interface:LocalContextProvider
Returns aBiVariableMap
of a specified scope.- Returns:
- a variable map
-
getAttributeMap
Description copied from interface:LocalContextProvider
Returns an attribute map of a specified scope.- Returns:
- an attribute map
-
terminate
public void terminate()Description copied from interface:LocalContextProvider
Clears up a variable map.
-