static LocalContextProvider getProviderInstance(LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy) { switch(scope) { case THREADSAFE : return new ThreadSafeLocalContextProvider(behavior, lazy); case CONCURRENT : return new ConcurrentLocalContextProvider(behavior, lazy); case SINGLETHREAD : return new SingleThreadLocalContextProvider(behavior, lazy); case SINGLETON : default : return SingletonLocalContextProvider.getProvider(behavior, lazy); } }
/** * Removes all of the mappings from this map. * The map will be empty after this call returns. Ruby variables are also * removed from Ruby instance. However, Ruby instance keep having global variable * names with null value. * This is a short cut method of ScriptingContainer#getVarMap().clear(). */ public void clear() { provider.getVarMap().clear(); }
/** * Returns a value of the specified key in a top level of runtime or null * if this map doesn't have a mapping for the key. The key * must be a valid Ruby variable or constant name. * * @param key is a key whose associated value is to be returned * @return a value to which the specified key is mapped, or null if this * map contains no mapping for the key */ public Object get(String key) { return provider.getVarMap().get(key); }
private static void initLocalContext(final LocalVariableBehavior behavior, final boolean lazy) { synchronized( SingletonLocalContextProvider.class ) { if (localContext == null) { localContext = new LocalContext(getGlobalRuntimeConfigOrNew(), behavior, lazy); } } }
public void terminate() { LocalContext context = SingletonLocalContextProvider.getLocalContextInstance(config, behavior, lazy); context.remove(); context = null; } }
public void terminate() { initializeLocalContext(); localContext.remove(); localContext = null; } }
@Override public Map getAttributeMap() { return sharedLocalContext().getAttributeMap(); }
static LocalContextProvider getProviderInstance(LocalContextScope scope, LocalVariableBehavior behavior, boolean lazy) { switch(scope) { case THREADSAFE : return new ThreadSafeLocalContextProvider(behavior, lazy); case CONCURRENT : return new ConcurrentLocalContextProvider(behavior, lazy); case SINGLETHREAD : return new SingleThreadLocalContextProvider(behavior, lazy); case SINGLETON : default : return SingletonLocalContextProvider.getProvider(behavior, lazy); } }
/** * Removes all of the mappings from this map. * The map will be empty after this call returns. Ruby variables are also * removed from Ruby instance. However, Ruby instance keep having global variable * names with null value. * This is a short cut method of ScriptingContainer#getVarMap().clear(). */ public void clear() { provider.getVarMap().clear(); }
/** * Returns a value of the specified key in a top level of runtime or null * if this map doesn't have a mapping for the key. The key * must be a valid Ruby variable or constant name. * * @param key is a key whose associated value is to be returned * @return a value to which the specified key is mapped, or null if this * map contains no mapping for the key */ public Object get(String key) { return provider.getVarMap().get(key); }
private static void initLocalContext(final LocalVariableBehavior behavior, final boolean lazy) { synchronized( SingletonLocalContextProvider.class ) { if (localContext == null) { localContext = new LocalContext(getGlobalRuntimeConfigOrNew(), behavior, lazy); } } }
public void terminate() { LocalContext context = SingletonLocalContextProvider.getLocalContextInstance(config, behavior, lazy); context.remove(); context = null; } }
public void terminate() { initializeLocalContext(); localContext.remove(); localContext = null; } }
/** * Removes all of the mappings from this map. * The map will be empty after this call returns. Ruby variables are also * removed from Ruby instance. However, Ruby instance keep having global variable * names with null value. * This is a short cut method of ScriptingContainer#getVarMap().clear(). */ public void clear() { provider.getVarMap().clear(); }
/** * Returns a value of the specified key in a top level of runtime or null * if this map doesn't have a mapping for the key. The key * must be a valid Ruby variable or constant name. * * @param key is a key whose associated value is to be returned * @return a value to which the specified key is mapped, or null if this * map contains no mapping for the key */ public Object get(String key) { return provider.getVarMap().get(key); }
/** * Removes all of the mappings from this map. * The map will be empty after this call returns. Ruby variables are also * removed from Ruby instance. However, Ruby instance keep having global variable * names with null value. * This is a short cut method of ScriptingContainer#getVarMap().clear(). */ public void clear() { provider.getVarMap().clear(); }