public Iterable<ModuleDescriptorStub> getDependenciesInContext(RequestCache requestCache, UrlBuildingStrategy urlBuildingStrategy, final String context, boolean excludeSuperBatchedResources, final Set<String> skippedResources, boolean includeDependenciesForFailedUrlReadingConditions) { final Set<ModuleDescriptorStub> contextResources = new LinkedHashSet<>(); final Class<WebResourceModuleDescriptor> clazz = WebResourceModuleDescriptor.class; List<String> contextDependencies = new ArrayList<>(); for (final WebResourceModuleDescriptor descriptor : webResourceIntegration.getPluginAccessor().getEnabledModuleDescriptorsByClass(clazz)) { if (descriptor != null && descriptor.getContexts().contains(context)) { contextDependencies.add(descriptor.getCompleteKey()); } } // Adding modules. Bundle bundle = requestCache.getSnapshot().get(Config.CONTEXT_PREFIX + ":" + context); if (bundle != null) { contextDependencies.addAll(bundle.getDependencies()); } for (String key : contextDependencies) { final LinkedHashMap<String, ModuleDescriptorStub> dependencies = new LinkedHashMap<>(); final Iterable<String> superBatchResources = excludeSuperBatchedResources ? getSuperBatchDependencyKeys() : Collections.<String> emptyList(); resolveDependencies(requestCache, urlBuildingStrategy, key, dependencies, superBatchResources, new Stack<String>(), skippedResources, includeDependenciesForFailedUrlReadingConditions); for (final ModuleDescriptorStub dependency : dependencies.values()) { contextResources.add(dependency); } } return unmodifiableCollection(contextResources); }
for (WebResourceModuleDescriptor descriptor : pluginAccessor.getEnabledModuleDescriptorsByClass(WebResourceModuleDescriptor.class)) { String key = descriptor.getCompleteKey(); Set<String> ctx = new HashSet<String>(descriptor.getContexts());
if (isRootPage && webResourceDescriptor.getContexts().size() > 1) { String msg = "web-resource \"" + completeKey + "\" cannot be added to a context because it's tagged as a root-page"; for (String context : webResourceDescriptor.getContexts()) { if (!context.equals(completeKey)) { String contextResourceKey = CONTEXT_PREFIX + ":" + context;