/** {@inheritDoc} */ @Override protected final Class<?> findClass(String className, boolean exportsOnly, final boolean resolve) throws ClassNotFoundException { // Check if we have already loaded it.. Class<?> loadedClass = findLoadedClass(className); if (loadedClass != null) { if (resolve) { resolveClass(loadedClass); } return loadedClass; } final ModuleLogger log = Module.log; final Module module = this.module; log.trace("Finding class %s from %s", className, module); final Class<?> clazz = module.loadModuleClass(className, resolve); if (clazz != null) { return clazz; } log.trace("Class %s not found from %s", className, module); throw new ClassNotFoundException(className + " from [" + module + "]"); }
/** * Find a library from one of the resource loaders. * * @param libname the library name * @return the full absolute path to the library */ @Override protected final String findLibrary(final String libname) { final ModuleLogger log = Module.log; log.trace("Attempting to load native library %s from %s", libname, module); for (ResourceLoaderSpec loader : paths.get().getSourceList(ResourceLoaderSpec.NO_RESOURCE_LOADERS)) { final String library = loader.getResourceLoader().getLibrary(libname); if (library != null) { return library; } } return null; }
MavenArtifactUtil.downloadFile(artifactCoordinates + ":pom", artifactAbsoluteHttpPath + "pom", targetArtifactPomFile); } catch (IOException e) { Module.getModuleLogger().trace(e, "Could not doDownload '%s' from '%s' repository", artifactRelativeHttpPath, remoteRepos); Module.getModuleLogger().trace(e, "Could not doDownload '%s' from '%s' repository", artifactRelativeHttpPath, remoteRepos);
/** {@inheritDoc} */ @Override protected final Class<?> findClass(String className, boolean exportsOnly, final boolean resolve) throws ClassNotFoundException { // Check if we have already loaded it.. Class<?> loadedClass = findLoadedClass(className); if (loadedClass != null) { if (resolve) { resolveClass(loadedClass); } return loadedClass; } final ModuleLogger log = Module.log; loadedClass = jaxpClassesByName.get(className); if (loadedClass != null) { log.jaxpClassLoaded(loadedClass, module); if (resolve) { resolveClass(loadedClass); } return loadedClass; } final Module module = this.module; log.trace("Finding class %s from %s", className, module); final Class<?> clazz = module.loadModuleClass(className, resolve); if (clazz != null) { return clazz; } log.trace("Class %s not found from %s", className, module); throw new ClassNotFoundException(getClassNotFoundExceptionMessage(className, module)); }
/** * Find a library from one of the resource loaders. * * @param libname the library name * @return the full absolute path to the library */ @Override protected final String findLibrary(final String libname) { final ModuleLogger log = Module.log; log.trace("Attempting to load native library %s from %s", libname, module); for (ResourceLoaderSpec loader : paths.getSourceList(NO_RESOURCE_LOADERS)) { final String library = loader.getResourceLoader().getLibrary(libname); if (library != null) { return library; } } return null; }
builder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createJarResourceLoader(root.getParent(), new JarFile(root, true)))); } catch (Exception e) { Module.log.trace(e, "Resource %s does not appear to be a valid JAR. Loaded as file resource.", root); builder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createFileResourceLoader(entry, root)));
try { final ModuleLogger log = Module.log; log.trace("Locally loading module %s from %s", identifier, this); final long startTime = Metrics.getCurrentCPUTime(); final ModuleSpec moduleSpec = findModule(identifier); loadTimeUpdater.addAndGet(this, Metrics.getCurrentCPUTime() - startTime); if (moduleSpec == null) { log.trace("Module %s not found from %s", identifier, this); return null; newFuture.setModule(module = loadModuleLocal(aliasTarget)); } catch (RuntimeException e) { log.trace(e, "Failed to load module %s (alias for %s)", identifier, aliasTarget); throw e; } catch (Error e) { log.trace(e, "Failed to load module %s (alias for %s)", identifier, aliasTarget); throw e; module = defineModule((ConcreteModuleSpec) moduleSpec, newFuture); log.trace("Loaded module %s from %s", identifier, this); ok = true; return module;
log.trace("Attempting to find all resources %s in %s", canonPath, this); final String path = pathOf(canonPath); final Map<String, List<LocalLoader>> paths = getPathsUnchecked();
public Module run() throws Exception { final ModuleLogger log = Module.log; final ModuleIdentifier moduleIdentifier = moduleSpec.getModuleIdentifier(); final Module module = new Module(moduleSpec, ModuleLoader.this); module.getClassLoaderPrivate().recalculate(); module.setDependencies(moduleSpec.getDependenciesInternal()); log.moduleDefined(moduleIdentifier, ModuleLoader.this); try { futureModule.setModule(module); return module; } catch (RuntimeException e) { log.trace(e, "Failed to load module %s", moduleIdentifier); throw e; } catch (Error e) { log.trace(e, "Failed to load module %s", moduleIdentifier); throw e; } } });
public Module run() throws Exception { final ModuleLogger log = Module.log; final String name = moduleSpec.getName(); final Module module = new Module(moduleSpec, ModuleLoader.this); module.getClassLoaderPrivate().recalculate(); module.setDependencies(moduleSpec.getDependenciesInternal()); log.moduleDefined(name, ModuleLoader.this); try { futureModule.setModule(module); return module; } catch (RuntimeException e) { log.trace(e, "Failed to load module %s", name); throw e; } catch (Error e) { log.trace(e, "Failed to load module %s", name); throw e; } } });
log.trace("Attempting to find resource %s in %s", canonPath, this); final String path = pathOf(canonPath); final URLConnectionResource jaxpResource = ModuleClassLoader.jaxpImplResources.get(canonPath);
Module.getModuleLogger().trace(ex, "Could not doDownload '%s' from '%s' repository", artifactRelativeHttpPath, remoteRepos);
log.trace("Attempting to find all resources %s in %s", canonPath, this); final String path = pathOf(canonPath); final URLConnectionResource jaxpResource = ModuleClassLoader.jaxpImplResources.get(canonPath);
try { final ModuleLogger log = Module.log; log.trace("Locally loading module %s from %s", name, this); final long startTime = Metrics.getCurrentCPUTime(); final ModuleSpec moduleSpec = findModule(name); loadTime.addAndGet(Metrics.getCurrentCPUTime() - startTime); if (moduleSpec == null) { log.trace("Module %s not found from %s", name, this); return null; log.trace("Added module %s as alias of %s from %s", moduleSpec.getName(), aliasModuleSpec.getAliasName(), this); ok = true; break; log.trace("Loaded module %s from %s", name, this); ok = true;
log.trace("Attempting to find resource %s in %s", canonPath, this); final String path = pathOf(canonPath); final URLConnectionResource jaxpResource = ModuleClassLoader.jaxpImplResources.get(canonPath);
log.trace("Attempting to find resource %s in %s", canonPath, this); final String path = pathOf(canonPath); final Map<String, List<LocalLoader>> paths = getPathsUnchecked();
log.trace("Attempting to find resource %s in %s", canonPath, this); final String path = pathOf(canonPath); final Map<String, List<LocalLoader>> paths = getPathsUnchecked();
/** * Define a package from a package spec. * * @param name the package name * @param spec the package specification * @return the new package */ private Package definePackage(final String name, final PackageSpec spec) { final Module module = this.module; final ModuleLogger log = Module.log; log.trace("Attempting to define package %s in %s", name, module); final Package pkg; if (spec == null) { pkg = definePackage(name, null, null, null, null, null, null, null); } else { pkg = definePackage(name, spec.getSpecTitle(), spec.getSpecVersion(), spec.getSpecVendor(), spec.getImplTitle(), spec.getImplVersion(), spec.getImplVendor(), spec.getSealBase()); final AssertionSetting setting = spec.getAssertionSetting(); if (setting != AssertionSetting.INHERIT) { setPackageAssertionStatus(name, setting == AssertionSetting.ENABLED); } } log.trace("Defined package %s in %s", name, module); return pkg; }
/** * Define a package from a package spec. * * @param name the package name * @param spec the package specification * @return the new package */ private Package definePackage(final String name, final PackageSpec spec) { final Module module = this.module; final ModuleLogger log = Module.log; log.trace("Attempting to define package %s in %s", name, module); final Package pkg; if (spec == null) { pkg = definePackage(name, null, null, null, null, null, null, null); } else { pkg = definePackage(name, spec.getSpecTitle(), spec.getSpecVersion(), spec.getSpecVendor(), spec.getImplTitle(), spec.getImplVersion(), spec.getImplVendor(), spec.getSealBase()); final AssertionSetting setting = spec.getAssertionSetting(); if (setting != AssertionSetting.INHERIT) { setPackageAssertionStatus(name, setting == AssertionSetting.ENABLED); } } log.trace("Defined package %s in %s", name, module); return pkg; }