Top Description Fields Constructors Methods
org.jruby.embed.osgi.internal

public Class OSGiLoadService

extends LoadService
Class Inheritance
Imports
java.net.URL, java.util.StringTokenizer, org.jruby.Ruby, .RubyInstanceConfig.LoadServiceCreator, org.jruby.embed.osgi.utils.OSGiFileLocator, org.jruby.platform.Platform, org.jruby.runtime.load.Library, .LibrarySearcher, .LoadService, .LoadServiceResource, org.osgi.framework.Bundle

Load scripts and java classes directly from the OSGi bundles. bundle:/symbolic.name/
Author
hmalphettes

Field Summary

Modifier and TypeField and Description
public static final String
public static final RubyInstanceConfig.LoadServiceCreator
Inherited from org.jruby.runtime.load.LoadService:
extensionPatternjarFileslibrarySearcherloadedFeaturesloadPathmainScriptmainScriptPathruntimesourcePattern

Constructor Summary

AccessConstructor and Description
public
OSGiLoadService(Ruby runtime)

Default constructor Optional constructor (why?)

Method Summary

Modifier and TypeMethod and Description
private String
cleanupFindName(String name)

Remove the extension when they are misleading.

protected LibrarySearcher.FoundLibrary
createLibrary(String baseName, String loadName, LoadServiceResource resource)

Overrides org.jruby.runtime.load.LoadService.createLibrary.

Support for 'bundle:/' to look for libraries in osgi bundles.

protected LoadServiceResource

Returns:

the correct file
findFileInClasspath
(String
the file to find, this is a path name
name
)

Overrides org.jruby.runtime.load.LoadService.findFileInClasspath.

Support for 'bundle:/' to look for libraries in osgi bundles or classes or ruby files.

protected String
protected LibrarySearcher.FoundLibrary
searchForLoad(String searchFile)

Overrides org.jruby.runtime.load.LoadService.searchForLoad.

Replaces findLibraryBySearchState but split off for load.

protected LibrarySearcher.FoundLibrary
Inherited from org.jruby.runtime.load.LoadService:
addPathaddPathsaddPathsautoloadRequirecheckEmptyLoadclasspathFilenameFromURLdebugLogFounddebugLogFounddebugLogTryfeatureAlreadyLoadedfeatureAlreadyLoadedfindLibraryWithClassloadersgetClassPathResourcegetLoadedFeaturesgetLoadPathgetLoadPathEntrygetMainScriptgetMainScriptPathgetPathForLocationgetWrapperSelfinitisJarfileLibraryisRequireableloadloadloadFromClassLoaderprovidereflectedLoadrequiresearchForRequiresetMainScripttearDowntryLoadingLibraryOrScriptwarnCircularRequire

Field Detail

OSGI_BUNDLE_CLASSPATH_SCHEMEback to summary
public static final String OSGI_BUNDLE_CLASSPATH_SCHEME
OSGI_DEFAULTback to summary
public static final RubyInstanceConfig.LoadServiceCreator OSGI_DEFAULT

Constructor Detail

OSGiLoadServiceback to summary
public OSGiLoadService(Ruby runtime)

Default constructor Optional constructor (why?)

Method Detail

cleanupFindNameback to summary
private String cleanupFindName(String name)

Remove the extension when they are misleading.

createLibraryback to summary
protected LibrarySearcher.FoundLibrary createLibrary(String baseName, String loadName, LoadServiceResource resource)

Overrides org.jruby.runtime.load.LoadService.createLibrary.

Support for 'bundle:/' to look for libraries in osgi bundles.

Annotations
@Override
findFileInClasspathback to summary
protected LoadServiceResource findFileInClasspath(String name)

Overrides org.jruby.runtime.load.LoadService.findFileInClasspath.

Support for 'bundle:/' to look for libraries in osgi bundles or classes or ruby files.

MRI: rb_find_file

Parameters
name:String

the file to find, this is a path name

Returns:LoadServiceResource

the correct file

Annotations
@Override
resolveLoadNameback to summary
protected String resolveLoadName(LoadServiceResource foundResource, String previousPath)

Overrides org.jruby.runtime.load.LoadService.resolveLoadName.

Annotations
@Override
searchForLoadback to summary
protected LibrarySearcher.FoundLibrary searchForLoad(String searchFile)

Overrides org.jruby.runtime.load.LoadService.searchForLoad.

Doc from org.jruby.runtime.load.LoadService.searchForLoad.

Replaces findLibraryBySearchState but split off for load. Needed for OSGiLoadService to override.

Annotations
@Override
searchForRequireback to summary
protected LibrarySearcher.FoundLibrary searchForRequire(String searchFile)