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.
| Access | Constructor and Description |
|---|---|
| public | OSGiScriptingContainer(Bundle creator)
A scripting container where the classloader can find classes in the osgi creator bundle and where the jruby home is set to point to the one in the jruby's bundle home folder. |
| public | OSGiScriptingContainer(Bundle creator, LocalContextScope
if null, LocalContextScope.SINGLETHREAD scope, LocalVariableBehavior if null, LocalVariableBehavior.TRANSIENT behavior)A scripting container where the classloader can find classes in the osgi creator bundle and where the jruby home is set to point to the one in the jruby's bundle home folder. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addToClassPath(Bundle
Add a bundle to the jruby classloader.
Equivalent to require bundle)"bundle:/#{bundle.symbolic.name}"
|
| private String | Returns: a nice debugging string for the stack traces that is passed as the 'filename' of this script to jruby.
|
| public JRubyOSGiBundleClassLoader | Returns: The ScriptingContainer's classloader casted to a JRubyOSGiBundleClassLoader. It is the parent classloader of the actual's runtime's JRubyClassLoader. It enables finding classes and resources in the OSGi environment.
|
| public EmbedEvalUnit | Returns: an object which can be runis where the script is located bundle, String is the entry in the bundle. path, int... 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. lines)Parses a script given by a input stream and return an object which can be run(). |
| public Object | runScriptlet(String
The bundle where the script is located. Lazily added to the
loader of the OSGiScriptingContainer. (require bundle:/... is implicitly done here) bundleSymbolicName, String The entry in the bundle path)
|
| public Object | runScriptlet(Bundle
The bundle where the script is located. Lazily added to the
loader of the OSGiScriptingContainer. (require bundle:/... is implicitly done here) bundle, String The entry in the bundle path)
|
| OSGiScriptingContainer | back to summary |
|---|---|
| public OSGiScriptingContainer(Bundle creator) A scripting container where the classloader can find classes in the osgi creator bundle and where the jruby home is set to point to the one in the jruby's bundle home folder. scope: LocalContextScope.SINGLETHREAD; behavior: LocalVariableBehavior.TRANSIENT | |
| OSGiScriptingContainer | back to summary |
|---|---|
| public OSGiScriptingContainer(Bundle creator, LocalContextScope scope, LocalVariableBehavior behavior) A scripting container where the classloader can find classes in the osgi creator bundle and where the jruby home is set to point to the one in the jruby's bundle home folder.
| |
| addToClassPath | back to summary |
|---|---|
public void addToClassPath(Bundle bundle)
| |
| getFilename | back to summary |
|---|---|
private String getFilename(Bundle bundle, String path)
| |
| getOSGiBundleClassLoader | back to summary |
|---|---|
public JRubyOSGiBundleClassLoader getOSGiBundleClassLoader()
| |
| parse | back to summary |
|---|---|
| public EmbedEvalUnit parse(Bundle bundle, String path, int... lines) throws IOException Parses a script given by a input stream and return an object which can be run(). This allows the script to be parsed once and evaluated many times.
| |
| runScriptlet | back to summary |
|---|---|
| public Object runScriptlet(String bundleSymbolicName, String path) | |
| runScriptlet | back to summary |
|---|---|
| public Object runScriptlet(Bundle bundle, String path) | |