public class OSGiScriptingContainer extends ScriptingContainer
Currently:
TODO: look into using the LoadService of jruby. Look if it would be possible to reuse the base runtime and minimize the cost of new jruby runtimes.
| Constructor and Description |
|---|
OSGiScriptingContainer(org.osgi.framework.Bundle creator) |
OSGiScriptingContainer(org.osgi.framework.Bundle creator,
LocalContextScope scope,
LocalVariableBehavior behavior) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToClassPath(org.osgi.framework.Bundle bundle) |
JRubyOSGiBundleClassLoader |
getOSGiBundleClassLoader() |
EmbedEvalUnit |
parse(org.osgi.framework.Bundle bundle,
String path,
int... lines)
Parses a script given by a input stream and return an object which can be run().
|
Object |
runScriptlet(org.osgi.framework.Bundle bundle,
String path) |
Object |
runScriptlet(String bundleSymbolicName,
String path) |
addGemPath, addGemPath, addLoadPath, addLoadPath, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, callSuper, clear, finalize, get, get, getArgv, getAttribute, getAttributeMap, getClassLoader, getClassloaderDelegate, getCompatVersion, getCompileMode, getCurrentDirectory, getEnvironment, getErr, getError, getErrorWriter, getHomeDirectory, getIn, getInput, getInstance, getJitLogEvery, getJitMax, getJitMaxSize, getJitThreshold, getKCode, getLoadPaths, getLoadServiceCreator, getOut, getOutput, getProfile, getProfileOutput, getProfilingMode, getProperty, getProvider, getReader, getRecordSeparator, getRuntime, getScriptFilename, getSupportedRubyVersion, getVarMap, getWriter, isNativeEnabled, isObjectSpaceEnabled, isRunRubyInProcess, newObjectAdapter, newRuntimeAdapter, parse, parse, parse, parse, put, put, remove, remove, removeAttribute, resetErrorWriter, resetWriter, runRubyMethod, runRubyMethod, runScriptlet, runScriptlet, runScriptlet, runScriptlet, setArgv, setAttribute, setClassLoader, setClassloaderDelegate, setCompatVersion, setCompileMode, setCurrentDirectory, setEnvironment, setError, setError, setErrorWriter, setHomeDirectory, setInput, setInput, setJitLogEvery, setJitMax, setJitMaxSize, setJitThreshold, setKCode, setLoadPaths, setLoadServiceCreator, setNativeEnabled, setObjectSpaceEnabled, setOutput, setOutput, setProfile, setProfile, setProfileOutput, setProfilingMode, setReader, setRecordSeparator, setRunRubyInProcess, setScriptFilename, setWriter, terminatepublic OSGiScriptingContainer(org.osgi.framework.Bundle creator)
public OSGiScriptingContainer(org.osgi.framework.Bundle creator,
LocalContextScope scope,
LocalVariableBehavior behavior)
scope - if null, LocalContextScope.SINGLETHREADbehavior - if null, LocalVariableBehavior.TRANSIENTpublic Object runScriptlet(String bundleSymbolicName, String path)
bundleSymbolicName - The bundle where the script is located. Lazily added to the
loader of the OSGiScriptingContainer. (require bundle:/... is implicitly done here)path - The entry in the bundlepublic Object runScriptlet(org.osgi.framework.Bundle bundle, String path)
bundle - The bundle where the script is located. Lazily added to the
loader of the OSGiScriptingContainer. (require bundle:/... is implicitly done here)path - The entry in the bundlepublic EmbedEvalUnit parse(org.osgi.framework.Bundle bundle, String path, int... lines) throws IOException
bundle - is where the script is locatedpath - is the entry in the bundle.lines - are linenumbers to display for parse errors and backtraces.
This field is optional. Only the first argument is used for parsing.
When no line number is specified, 0 is applied to.IOExceptionpublic void addToClassPath(org.osgi.framework.Bundle bundle)
bundle - Add a bundle to the jruby classloader.
Equivalent to require "bundle:/#{bundle.symbolic.name}"public JRubyOSGiBundleClassLoader getOSGiBundleClassLoader()
Copyright © 2001-2015 JRuby. All Rights Reserved.