private ModuleClassLoader getModuleClassLoader(boolean logResolveError) { ResolutionReport report = resolve(); if (logResolveError && !Module.RESOLVED_SET.contains(module.getState())) { String reportMessage = report.getResolutionReportMessage(module.getCurrentRevision()); equinoxContainer .getEventPublisher() .publishFrameworkEvent( FrameworkEvent.ERROR, this, new BundleException(reportMessage, BundleException.RESOLVE_ERROR)); } return AccessController.doPrivileged( new PrivilegedAction<ModuleClassLoader>() { @Override public ModuleClassLoader run() { ModuleWiring wiring = getModule().getCurrentRevision().getWiring(); if (wiring != null) { ModuleLoader moduleLoader = wiring.getModuleLoader(); if (moduleLoader instanceof BundleLoader) { return ((BundleLoader) moduleLoader).getModuleClassLoader(); } } return null; } }); }
ResolutionReport resolve() { if (!Module.RESOLVED_SET.contains(module.getState())) { return module.getContainer().resolve(Arrays.asList(module), true); } return null; }