public class LoadService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
LoadService.BailoutSearcher
Deprecated.
|
class |
LoadService.ClassLoaderSearcher
Deprecated.
|
class |
LoadService.ExtensionSearcher
Deprecated.
|
static interface |
LoadService.LoadSearcher
Deprecated.
|
class |
LoadService.NormalSearcher
Deprecated.
|
class |
LoadService.ScriptClassSearcher
Deprecated.
|
static class |
LoadService.SearchState |
class |
LoadService.SourceBailoutSearcher
Deprecated.
|
static class |
LoadService.SuffixType |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,Library> |
builtinLibraries
Deprecated.
|
protected static java.util.regex.Pattern |
extensionPattern |
protected java.util.Map<java.lang.String,java.util.jar.JarFile> |
jarFiles |
protected org.jruby.runtime.load.LibrarySearcher |
librarySearcher |
protected StringArraySet |
loadedFeatures |
protected RubyArray |
loadedFeaturesDup |
protected RubyArray |
loadPath |
protected Ruby |
runtime |
protected static java.util.regex.Pattern |
sourcePattern |
Constructor and Description |
---|
LoadService(Ruby runtime) |
Modifier and Type | Method and Description |
---|---|
void |
addBuiltinLibrary(java.lang.String name,
Library library)
Deprecated.
|
protected void |
addFeatureToIndex(java.lang.String shortName,
java.lang.String name) |
protected void |
addLoadedFeature(java.lang.String name)
Deprecated.
|
protected void |
addLoadedFeature(java.lang.String shortName,
java.lang.String name) |
protected void |
addPath(java.lang.String path) |
void |
addPaths(java.util.List<java.lang.String> additionalDirectories)
Add additional directories to the load path.
|
void |
addPaths(java.lang.String... additionalDirectories)
Add additional directories to the load path.
|
boolean |
autoloadRequire(java.lang.String requireName) |
protected java.lang.String |
buildClassName(java.lang.String className)
Deprecated.
|
protected void |
checkEmptyLoad(java.lang.String file) |
static java.lang.String |
classpathFilenameFromURL(java.lang.String name,
java.net.URL loc,
boolean isClasspathScheme)
Given a URL to a classloader resource, build an appropriate load string.
|
protected Library |
createLibrary(LoadService.SearchState state,
LoadServiceResource resource)
Deprecated.
|
protected void |
debugLogFound(LoadServiceResource resource)
Deprecated.
|
protected void |
debugLogFound(java.lang.String what,
java.lang.String msg)
Deprecated.
|
protected void |
debugLogTry(java.lang.String what,
java.lang.String msg)
Deprecated.
|
boolean |
featureAlreadyLoaded(java.lang.String name) |
protected Library |
findBuiltinLibrary(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
LoadService.SearchState |
findFileForLoad(java.lang.String file) |
protected LoadServiceResource |
findFileInClasspath(java.lang.String name)
this method uses the appropriate lookup strategy to find a file.
|
protected Library |
findLibraryBySearchState(LoadService.SearchState state) |
protected Library |
findLibraryWithClassloaders(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType) |
protected Library |
findLibraryWithoutCWD(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
java.util.List<java.lang.String> |
getBuiltinLibraries()
Deprecated.
|
LoadServiceResource |
getClassPathResource(java.lang.ClassLoader classLoader,
java.lang.String name) |
protected java.lang.String |
getFileName(JRubyFile file,
java.lang.String namePlusSuffix) |
java.util.jar.JarFile |
getJarFile(java.lang.String jarFileName) |
IRubyObject |
getLoadedFeatures() |
IRubyObject |
getLoadPath() |
protected java.lang.String |
getLoadPathEntry(IRubyObject entry) |
void |
init(java.util.List<java.lang.String> prependDirectories)
Called to initialize the load path with a set of optional prepended
directories and then the standard set of dirs.
|
protected boolean |
isFeatureInIndex(java.lang.String shortName) |
protected boolean |
isJarfileLibrary(LoadService.SearchState state,
java.lang.String file) |
protected static boolean |
isRequireable(java.net.URL loc) |
void |
load(java.lang.String file,
boolean wrap) |
void |
loadFromClassLoader(java.lang.ClassLoader classLoader,
java.lang.String file,
boolean wrap) |
protected boolean |
loadPathLooksLikeClasspathURL(java.lang.String loadPathEntry) |
protected boolean |
loadPathLooksLikeJarURL(java.lang.String loadPathEntry) |
void |
provide(java.lang.String shortName,
java.lang.String fullName) |
static void |
reflectedLoad(Ruby runtime,
java.lang.String libraryName,
java.lang.String className,
java.lang.ClassLoader classLoader,
boolean wrap)
Load the org.jruby.runtime.load.Library implementation specified by
className.
|
void |
removeBuiltinLibrary(java.lang.String name)
Deprecated.
|
void |
removeInternalLoadedFeature(java.lang.String name) |
boolean |
require(java.lang.String requireName) |
protected void |
reraiseRaiseExceptions(java.lang.Throwable e) |
protected java.lang.String |
resolveLoadName(LoadServiceResource foundResource,
java.lang.String previousPath) |
boolean |
smartLoad(java.lang.String file)
Deprecated.
|
protected boolean |
tryLoadingLibraryOrScript(Ruby runtime,
LoadService.SearchState state) |
protected LoadServiceResource |
tryResourceAsIs(java.lang.String namePlusSuffix)
Deprecated.
|
protected LoadServiceResource |
tryResourceAsIs(java.lang.String namePlusSuffix,
java.lang.String debugName)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromCWD(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromDotSlash(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromHome(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromJarURL(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromJarURLWithLoadPath(java.lang.String namePlusSuffix,
java.lang.String loadPathEntry)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromLoadPath(java.lang.String namePlusSuffix,
java.lang.String loadPathEntry)
Deprecated.
|
protected LoadServiceResource |
tryResourceFromLoadPathOrURL(LoadService.SearchState state,
java.lang.String baseName,
LoadService.SuffixType suffixType)
Deprecated.
|
protected void |
warnCircularRequire(java.lang.String requireName) |
protected static final java.util.regex.Pattern sourcePattern
protected static final java.util.regex.Pattern extensionPattern
protected RubyArray loadPath
protected StringArraySet loadedFeatures
protected RubyArray loadedFeaturesDup
protected final java.util.Map<java.lang.String,java.util.jar.JarFile> jarFiles
protected final Ruby runtime
protected final org.jruby.runtime.load.LibrarySearcher librarySearcher
@Deprecated protected final java.util.Map<java.lang.String,Library> builtinLibraries
public LoadService(Ruby runtime)
public void init(java.util.List<java.lang.String> prependDirectories)
prependDirectories
- public void addPaths(java.util.List<java.lang.String> additionalDirectories)
additionalDirectories
- a List of additional dirs to append to the load pathpublic void addPaths(java.lang.String... additionalDirectories)
additionalDirectories
- an array of additional dirs to append to the load pathpublic void provide(java.lang.String shortName, java.lang.String fullName)
protected boolean isFeatureInIndex(java.lang.String shortName)
@Deprecated protected void addLoadedFeature(java.lang.String name)
protected void addLoadedFeature(java.lang.String shortName, java.lang.String name)
protected void addFeatureToIndex(java.lang.String shortName, java.lang.String name)
protected void addPath(java.lang.String path)
public void load(java.lang.String file, boolean wrap)
public void loadFromClassLoader(java.lang.ClassLoader classLoader, java.lang.String file, boolean wrap)
public LoadService.SearchState findFileForLoad(java.lang.String file)
public boolean require(java.lang.String requireName)
public boolean autoloadRequire(java.lang.String requireName)
protected void warnCircularRequire(java.lang.String requireName)
@Deprecated public boolean smartLoad(java.lang.String file)
require(String)
instead.public static void reflectedLoad(Ruby runtime, java.lang.String libraryName, java.lang.String className, java.lang.ClassLoader classLoader, boolean wrap)
runtime
- The runtime in which to loadlibraryName
- The name of the library, to use for error messagesclassName
- The class of the libraryclassLoader
- The classloader to use to load itwrap
- Whether to wrap top-level in an anonymous modulepublic IRubyObject getLoadPath()
public IRubyObject getLoadedFeatures()
public void removeInternalLoadedFeature(java.lang.String name)
public boolean featureAlreadyLoaded(java.lang.String name)
protected boolean isJarfileLibrary(LoadService.SearchState state, java.lang.String file)
protected void reraiseRaiseExceptions(java.lang.Throwable e) throws RaiseException
RaiseException
protected boolean tryLoadingLibraryOrScript(Ruby runtime, LoadService.SearchState state)
@Deprecated protected java.lang.String buildClassName(java.lang.String className)
protected void checkEmptyLoad(java.lang.String file) throws RaiseException
RaiseException
@Deprecated protected final void debugLogTry(java.lang.String what, java.lang.String msg)
@Deprecated protected final void debugLogFound(java.lang.String what, java.lang.String msg)
@Deprecated protected final void debugLogFound(LoadServiceResource resource)
protected Library findLibraryBySearchState(LoadService.SearchState state)
@Deprecated protected Library findBuiltinLibrary(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType)
@Deprecated protected Library findLibraryWithoutCWD(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType)
protected Library findLibraryWithClassloaders(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType)
@Deprecated protected Library createLibrary(LoadService.SearchState state, LoadServiceResource resource)
@Deprecated protected LoadServiceResource tryResourceFromCWD(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType) throws RaiseException
RaiseException
@Deprecated protected LoadServiceResource tryResourceFromDotSlash(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType) throws RaiseException
RaiseException
@Deprecated protected LoadServiceResource tryResourceFromHome(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType) throws RaiseException
RaiseException
@Deprecated protected LoadServiceResource tryResourceFromJarURL(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType)
@Deprecated protected LoadServiceResource tryResourceFromLoadPathOrURL(LoadService.SearchState state, java.lang.String baseName, LoadService.SuffixType suffixType)
protected java.lang.String getLoadPathEntry(IRubyObject entry)
@Deprecated protected LoadServiceResource tryResourceFromJarURLWithLoadPath(java.lang.String namePlusSuffix, java.lang.String loadPathEntry)
public java.util.jar.JarFile getJarFile(java.lang.String jarFileName)
protected boolean loadPathLooksLikeJarURL(java.lang.String loadPathEntry)
protected boolean loadPathLooksLikeClasspathURL(java.lang.String loadPathEntry)
@Deprecated protected LoadServiceResource tryResourceFromLoadPath(java.lang.String namePlusSuffix, java.lang.String loadPathEntry) throws RaiseException
RaiseException
@Deprecated protected LoadServiceResource tryResourceAsIs(java.lang.String namePlusSuffix) throws RaiseException
RaiseException
@Deprecated protected LoadServiceResource tryResourceAsIs(java.lang.String namePlusSuffix, java.lang.String debugName) throws RaiseException
RaiseException
protected LoadServiceResource findFileInClasspath(java.lang.String name)
name
- the file to find, this is a path nameprotected static boolean isRequireable(java.net.URL loc)
public LoadServiceResource getClassPathResource(java.lang.ClassLoader classLoader, java.lang.String name)
public static java.lang.String classpathFilenameFromURL(java.lang.String name, java.net.URL loc, boolean isClasspathScheme)
name
- the original filename requestedloc
- the URL to the resourceisClasspathScheme
- whether we're using the classpath: scehemeprotected java.lang.String resolveLoadName(LoadServiceResource foundResource, java.lang.String previousPath)
protected java.lang.String getFileName(JRubyFile file, java.lang.String namePlusSuffix)
@Deprecated public void addBuiltinLibrary(java.lang.String name, Library library)
@Deprecated public void removeBuiltinLibrary(java.lang.String name)
@Deprecated public java.util.List<java.lang.String> getBuiltinLibraries()
Copyright © 2001-2021 JRuby. All Rights Reserved.