org.jruby.embed.internal
Class SingletonLocalContextProvider

java.lang.Object
  extended by org.jruby.embed.internal.AbstractLocalContextProvider
      extended by org.jruby.embed.internal.SingletonLocalContextProvider
All Implemented Interfaces:
LocalContextProvider

public class SingletonLocalContextProvider
extends AbstractLocalContextProvider

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

Field Summary
 
Fields inherited from class org.jruby.embed.internal.AbstractLocalContextProvider
behavior, config, lazy
 
Constructor Summary
SingletonLocalContextProvider(LocalVariableBehavior behavior, boolean lazy)
           
 
Method Summary
 java.util.Map getAttributeMap()
          Returns an attribute map of a specified scope.
static LocalContext getLocalContextInstance(RubyInstanceConfig config, LocalVariableBehavior behavior, boolean lazy)
           
static LocalVariableBehavior getLocalVariableBehaviorOrNull()
           
 RubyInstanceConfig getRubyInstanceConfig()
          Gets an instance of RubyInstanceConfig.
 Ruby getRuntime()
          Returns a Ruby runtime of a specified scope.
 BiVariableMap getVarMap()
          Returns a BiVariableMap of a specified scope.
 boolean isRuntimeInitialized()
          Tests whether Ruby runtime has been initialized or not.
 void terminate()
          Clears up a variable map.
 
Methods inherited from class org.jruby.embed.internal.AbstractLocalContextProvider
getInstance, getLocalVariableBehavior, setClassCache, setLoadPaths
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonLocalContextProvider

public SingletonLocalContextProvider(LocalVariableBehavior behavior,
                                     boolean lazy)
Method Detail

getLocalContextInstance

public static LocalContext getLocalContextInstance(RubyInstanceConfig config,
                                                   LocalVariableBehavior behavior,
                                                   boolean lazy)

getLocalVariableBehaviorOrNull

public static LocalVariableBehavior getLocalVariableBehaviorOrNull()

getRuntime

public Ruby getRuntime()
Description copied from interface: LocalContextProvider
Returns a Ruby runtime of a specified scope.

Returns:
a Ruby runtime

getRubyInstanceConfig

public RubyInstanceConfig getRubyInstanceConfig()
Description copied from interface: LocalContextProvider
Gets an instance of RubyInstanceConfig.

Specified by:
getRubyInstanceConfig in interface LocalContextProvider
Overrides:
getRubyInstanceConfig in class AbstractLocalContextProvider
Returns:
an instance of RubyInstanceConfig.

getVarMap

public BiVariableMap getVarMap()
Description copied from interface: LocalContextProvider
Returns a BiVariableMap of a specified scope.

Returns:
a variable map

getAttributeMap

public java.util.Map getAttributeMap()
Description copied from interface: LocalContextProvider
Returns an attribute map of a specified scope.

Returns:
an attribute map

isRuntimeInitialized

public boolean isRuntimeInitialized()
Description copied from interface: LocalContextProvider
Tests whether Ruby runtime has been initialized or not.

Returns:
true if initialized, false otherwise.

terminate

public void terminate()
Description copied from interface: LocalContextProvider
Clears up a variable map.



Copyright © 2002-2009 JRuby Team. All Rights Reserved.