org.jruby.embed.internal
Class ConcurrentLocalContextProvider

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

public class ConcurrentLocalContextProvider
extends AbstractLocalContextProvider

Concurrent type local context provider. Ruby runtime returned from the getRuntime() method is a classloader-global runtime. While variables (except global variables) and constants are thread local.

Author:
Yoko Harada

Field Summary
 
Fields inherited from class org.jruby.embed.internal.AbstractLocalContextProvider
behavior, config, lazy
 
Constructor Summary
ConcurrentLocalContextProvider(LocalVariableBehavior behavior, boolean lazy)
           
 
Method Summary
 java.util.Map getAttributeMap()
          Returns an attribute map of a specified scope.
 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

ConcurrentLocalContextProvider

public ConcurrentLocalContextProvider(LocalVariableBehavior behavior,
                                      boolean lazy)
Method Detail

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.