/** * Set a simple import filter, based on a {@code boolean} flag specifying whether services should be * imported. If the flag is {@code true}, the import filter is set to {@link PathFilters#getDefaultImportFilterWithServices()}, * otherwise it is set to {@link PathFilters#getDefaultImportFilter()}. Any previous import filter setting is * overwritten. * * @param services the services flag * @return this builder */ public DependencySpecBuilder setImportServices(final boolean services) { return setImportFilter(services ? PathFilters.getDefaultImportFilterWithServices() : PathFilters.getDefaultImportFilter()); }
/** * Create a dependency on the given module. * * @param exportFilter the export filter to apply * @param identifier the module identifier * @param optional {@code true} if the dependency is optional, {@code false} if it is mandatory * @return the dependency spec */ public static DependencySpec createModuleDependencySpec(final PathFilter exportFilter, final ModuleIdentifier identifier, final boolean optional) { return createModuleDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, null, identifier, optional); }
/** * Create a dependency on the given module. * * @param exportFilter the export filter to apply * @param moduleLoader the specific module loader from which the module should be acquired * @param identifier the module identifier * @param optional {@code true} if the dependency is optional, {@code false} if it is mandatory * @return the dependency spec */ public static DependencySpec createModuleDependencySpec(final PathFilter exportFilter, final ModuleLoader moduleLoader, final ModuleIdentifier identifier, final boolean optional) { return createModuleDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, moduleLoader, identifier, optional); }
final PathFilter importFilter; if (importBuilder.isEmpty()) { importFilter = services.equals(D_NONE) ? PathFilters.getDefaultImportFilter() : PathFilters.getDefaultImportFilterWithServices(); } else { if (! services.equals(D_NONE)) {
/** * Create a dependency on the given module. * * @param identifier the module identifier * @param export {@code true} if this is a fully re-exported dependency, {@code false} if it should not be exported * @param optional {@code true} if the dependency is optional, {@code false} if it is mandatory * @return the dependency spec */ public static DependencySpec createModuleDependencySpec(final ModuleIdentifier identifier, final boolean export, final boolean optional) { return createModuleDependencySpec(PathFilters.getDefaultImportFilter(), export ? PathFilters.acceptAll() : PathFilters.rejectAll(), null, identifier, optional); }
/** * Create a dependency on the given local loader. * * @param localLoader the local loader * @param loaderPaths the set of paths that is exposed by the local loader * @param export {@code true} if this is a fully re-exported dependency, {@code false} if it should not be exported * @return the dependency spec */ public static DependencySpec createLocalDependencySpec(final LocalLoader localLoader, final Set<String> loaderPaths, boolean export) { return createLocalDependencySpec(PathFilters.acceptAll(), export ? PathFilters.getDefaultImportFilter() : PathFilters.rejectAll(), localLoader, loaderPaths); }
/** * Create a dependency on the given module. * * @param moduleLoader the specific module loader from which the module should be acquired * @param identifier the module identifier * @param export {@code true} if this is a fully re-exported dependency, {@code false} if it should not be exported * @return the dependency spec */ public static DependencySpec createModuleDependencySpec(final ModuleLoader moduleLoader, final ModuleIdentifier identifier, final boolean export) { return createModuleDependencySpec(PathFilters.getDefaultImportFilter(), export ? PathFilters.acceptAll() : PathFilters.rejectAll(), moduleLoader, identifier, false); }
/** * Create a dependency on the given module. * * @param moduleLoader the specific module loader from which the module should be acquired * @param identifier the module identifier * @param export {@code true} if this is a fully re-exported dependency, {@code false} if it should not be exported * @param optional {@code true} if the dependency is optional, {@code false} if it is mandatory * @return the dependency spec */ public static DependencySpec createModuleDependencySpec(final ModuleLoader moduleLoader, final ModuleIdentifier identifier, final boolean export, final boolean optional) { return createModuleDependencySpec(PathFilters.getDefaultImportFilter(), export ? PathFilters.acceptAll() : PathFilters.rejectAll(), moduleLoader, identifier, optional); }
private Index calculateModuleIndex(final Module module) throws ModuleLoadException, IOException { final Indexer indexer = new Indexer(); final PathFilter filter = PathFilters.getDefaultImportFilter(); final Iterator<Resource> iterator = module.iterateResources(filter); while (iterator.hasNext()) { Resource resource = iterator.next(); if(resource.getName().endsWith(".class")) { try (InputStream in = resource.openStream()) { indexer.index(in); } catch (Exception e) { ServerLogger.DEPLOYMENT_LOGGER.cannotIndexClass(resource.getName(), resource.getURL().toExternalForm(), e); } } } return indexer.complete(); }
private Index calculateModuleIndex(final Module module) throws ModuleLoadException, IOException { final Indexer indexer = new Indexer(); final PathFilter filter = PathFilters.getDefaultImportFilter(); final Iterator<Resource> iterator = module.iterateResources(filter); while (iterator.hasNext()) { Resource resource = iterator.next(); if(resource.getName().endsWith(".class")) { try (InputStream in = resource.openStream()) { indexer.index(in); } catch (Exception e) { ServerLogger.DEPLOYMENT_LOGGER.cannotIndexClass(resource.getName(), resource.getURL().toExternalForm(), e); } } } return indexer.complete(); }
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;
specBuilder.addSystemDependency(DependencySpec.createSystemDependencySpec(PathFilters.getDefaultImportFilter(), exportFilter, paths)); return;