public <M> Collection<ModuleDescriptor<M>> getModuleDescriptors(final Predicate<ModuleDescriptor<M>> moduleDescriptorPredicate) { return delegate.getModuleDescriptors(moduleDescriptorPredicate); }
/** * @throws IllegalStateException when a {@code com.atlassian.applinks.spi.manifest.ManifestProducer} * could not be loaded. */ private ManifestProducer getRequiredManifestProducer(final ApplicationType type) throws IllegalStateException { final Collection<ModuleDescriptor<ApplicationType>> descriptors = pluginAccessor.getModuleDescriptors(new ModuleDescriptorPredicate<ApplicationType>() { public boolean matches(ModuleDescriptor<? extends ApplicationType> moduleDescriptor) { return moduleDescriptor instanceof ApplicationTypeModuleDescriptor && type.getClass().isAssignableFrom(moduleDescriptor.getModule().getClass()); } }); if (!descriptors.isEmpty()) { // TODO: what if we have more than one? This could happen with hierarchical AppTypes (which we don't have atm) return ((ApplicationTypeModuleDescriptor) Iterables.get(descriptors, 0)) .getManifestProducer(); } else { throw new IllegalStateException("Cannot query application status for unknown application type \"" + type.getClass().getName() + "\""); } } }
/** * Run the healthcheck: get keys of disabled-by-default modules that are actually enabled */ @Override List<String> getItemsFailingCheck() { return pluginAccessor.getModuleDescriptors((Predicate<ModuleDescriptor<Object>>) moduleDescriptor -> !moduleDescriptor.isEnabledByDefault() && pluginAccessor.isPluginModuleEnabled(moduleDescriptor.getCompleteKey())) .stream() .map(ModuleDescriptor::getCompleteKey) .sorted() .collect(toList()); } }
@Override public Collection<ModuleDescriptor> getEnabledModuleDescriptorsByModuleClassname(String moduleClassname) { final ModuleOfClassnamePredicate ofType = new ModuleOfClassnamePredicate(moduleClassname); final EnabledModulePredicate enabled = new EnabledModulePredicate(pluginAccessor); return pluginAccessor.getModuleDescriptors(new ModuleDescriptorPredicate() { public boolean matches(final ModuleDescriptor moduleDescriptor) { return ofType.matches(moduleDescriptor) && enabled.matches(moduleDescriptor); } }); }