static void applyProfiles(File karafBase, List<String> profiles, boolean printOutput) throws IOException { BundleContext bundleContext = FrameworkUtil.getBundle(ProfileApplier.class).getBundleContext(); ServiceReference<ProfileService> reference = bundleContext.getServiceReference(ProfileService.class); ProfileService service = bundleContext.getService(reference); Profile profile = ProfileBuilder.Factory.create("temp") .addParents(profiles) .getProfile(); Profile overlay = service.getOverlayProfile(profile); final Profile effective = service.getEffectiveProfile(overlay, false); Map<String, byte[]> configs = effective.getFileConfigurations(); for (Map.Entry<String, byte[]> config : configs.entrySet()) { String pid = config.getKey(); if (!pid.equals(Profile.INTERNAL_PID + Profile.PROPERTIES_SUFFIX)) { Path configFile = Paths.get(karafBase.toString(), "etc", pid); logDebug("Creating file: %s", printOutput, configFile.toString()); Files.write(configFile, config.getValue()); } } FileLockUtils.execute(new File(karafBase, FEATURES_CFG), properties -> { appendToPropList(properties, "featuresBoot", effective.getFeatures()); appendToPropList(properties, "featuresRepositories", effective.getRepositories()); }, true); bundleContext.ungetService(reference); }
static void applyProfiles(File karafBase, List<String> profiles, boolean printOutput) throws IOException { BundleContext bundleContext = FrameworkUtil.getBundle(ProfileApplier.class).getBundleContext(); ServiceReference<ProfileService> reference = bundleContext.getServiceReference(ProfileService.class); ProfileService service = bundleContext.getService(reference); Profile profile = ProfileBuilder.Factory.create("temp") .addParents(profiles) .getProfile(); Profile overlay = service.getOverlayProfile(profile); final Profile effective = service.getEffectiveProfile(overlay, false); Map<String, byte[]> configs = effective.getFileConfigurations(); for (Map.Entry<String, byte[]> config : configs.entrySet()) { String pid = config.getKey(); if (!pid.equals(Profile.INTERNAL_PID + Profile.PROPERTIES_SUFFIX)) { Path configFile = Paths.get(karafBase.toString(), "etc", pid); logDebug("Creating file: %s", printOutput, configFile.toString()); Files.write(configFile, config.getValue()); } } FileLockUtils.execute(new File(karafBase, FEATURES_CFG), properties -> { appendToPropList(properties, "featuresBoot", effective.getFeatures()); appendToPropList(properties, "featuresRepositories", effective.getRepositories()); }, true); bundleContext.ungetService(reference); }
LOGGER.info(" Features: " + startupEffective.getFeatures().stream().collect(Collectors.joining(", "))); LOGGER.info(" Bundles: " + startupEffective.getBundles().stream().collect(Collectors.joining(", "))); resolver, startupRepositories.values(), startupEffective.getFeatures(), startupEffective.getBundles(), startupEffective.getOptionals(),
LOGGER.info(" Features: " + startupEffective.getFeatures().stream().collect(Collectors.joining(", "))); LOGGER.info(" Bundles: " + startupEffective.getBundles().stream().collect(Collectors.joining(", "))); resolver, startupRepositories.values(), startupEffective.getFeatures(), startupEffective.getBundles(), startupEffective.getOptionals(),
printConfigList("Repositories : ", output, profile.getRepositories()); if (profile.getFeatures().size() > 0) { printConfigList("Features : ", output, profile.getFeatures());
printConfigList("Repositories : ", output, profile.getRepositories()); if (profile.getFeatures().size() > 0) { printConfigList("Features : ", output, profile.getFeatures());
installFeatures.addAll(installedEffective.getFeatures());
generated.setName(generatedBootFeatureName); for (String nameOrPattern : bootEffective.getFeatures()) { for (Dependency d : f.getFeature()) { if (d.isPrerequisite()) { if (!startupEffective.getFeatures().contains(d.getName())) { LOGGER.warn("Feature " + d.getName() + " is a prerequisite and should be installed as a startup feature."); }
generated.setName(UUID.randomUUID().toString()); for (String nameOrPattern : bootEffective.getFeatures()) { for (Dependency d : f.getFeature()) { if (d.isPrerequisite()) { if (!startupEffective.getFeatures().contains(d.getName())) { LOGGER.warn("Feature " + d.getName() + " is a prerequisite and should be installed as a startup feature."); }
Set<Feature> installedFeatures = selector.getMatching(installedEffective.getFeatures()); ArtifactInstaller installer = new ArtifactInstaller(systemDirectory, downloader, blacklist); for (Feature feature : installedFeatures) {
Set<Feature> installedFeatures = selector.getMatching(installedEffective.getFeatures()); ArtifactInstaller installer = new ArtifactInstaller(systemDirectory, downloader, blacklist); for (Feature feature : installedFeatures) {