private FoundLibrary findServiceLibrary(String name) { DebugLog.JarExtension.logTry(name); Library extensionLibrary = ClassExtensionLibrary.tryFind(runtime, name); if (extensionLibrary != null) { DebugLog.JarExtension.logFound(name); return new FoundLibrary(extensionLibrary, name); } else { return null; } }
protected Library findLibraryWithClassloaders(SearchState state, String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String file = baseName + suffix; LoadServiceResource resource = findFileInClasspath(file); if (resource != null) { state.setLoadName(resolveLoadName(resource, file)); return createLibrary(state, resource); } } return null; }
public FoundLibrary findBySearchState(LoadService.SearchState state) { FoundLibrary lib = findLibrary(state.searchFile, state.suffixType); if (lib != null) { state.library = lib; state.setLoadName(lib.getLoadName()); } return lib; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } this.librarySearcher = new LibrarySearcher(this); }
public FoundLibrary findLibrary(String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { FoundLibrary library = findBuiltinLibrary(baseName, suffix); if (library == null) library = findResourceLibrary(baseName, suffix); if (library != null) { return library; } } return findServiceLibrary(baseName); }
public boolean trySearch(SearchState state) { debugLogTry("jarWithExtension", state.searchFile); // This code exploits the fact that all .jar files will be found for the JarredScript feature. // This is where the basic extension mechanism gets fixed Library oldLibrary = state.library; state.library = ClassExtensionLibrary.tryFind(runtime, state.searchFile); debugLogFound("jarWithExtension", state.searchFile); // If there was a good library before, we go back to that if(state.library == null && oldLibrary != null) { state.library = oldLibrary; } return true; } }
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } }
/** * Add additional directories to the load path. * * @param additionalDirectories a List of additional dirs to append to the load path */ public void addPaths(List<String> additionalDirectories) { for (String dir : additionalDirectories) { addPath(dir); } }
protected Library findLibraryWithClassloaders(SearchState state, String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String file = baseName + suffix; LoadServiceResource resource = findFileInClasspath(file); if (resource != null) { state.setLoadName(resolveLoadName(resource, file)); return createLibrary(state, resource); } } return null; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } this.librarySearcher = new LibrarySearcher(this); }
public FoundLibrary findLibrary(String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { FoundLibrary library = findBuiltinLibrary(baseName, suffix); if (library == null) library = findResourceLibrary(baseName, suffix); if (library != null) { return library; } } return findServiceLibrary(baseName); }
private FoundLibrary findServiceLibrary(String name) { DebugLog.JarExtension.logTry(name); Library extensionLibrary = ClassExtensionLibrary.tryFind(runtime, name); if (extensionLibrary != null) { DebugLog.JarExtension.logFound(name); return new FoundLibrary(extensionLibrary, name); } else { return null; } }
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } }
public FoundLibrary findBySearchState(LoadService.SearchState state) { FoundLibrary lib = findLibrary(state.searchFile, state.suffixType); if (lib != null) { state.library = lib; state.setLoadName(lib.getLoadName()); } return lib; }
protected Library findLibraryWithClassloaders(SearchState state, String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String file = baseName + suffix; LoadServiceResource resource = findFileInClasspath(file); if (resource != null) { state.loadName = resolveLoadName(resource, file); return createLibrary(state, resource); } } return null; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
protected Library findLibraryWithClassloaders(SearchState state, String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String file = baseName + suffix; LoadServiceResource resource = findFileInClasspath(file); if (resource != null) { state.loadName = resolveLoadName(resource, file); return createLibrary(state, resource); } } return null; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }