karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-5197] Kar service now checks features install flag
Date Mon, 12 Jun 2017 13:19:39 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x 7a842870c -> c1956822e


[KARAF-5197] Kar service now checks features install flag


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/c1956822
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/c1956822
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/c1956822

Branch: refs/heads/karaf-4.1.x
Commit: c1956822ef16fb0d6b4aa28c1736cc5d6d7fa9e6
Parents: 7a84287
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Mon Jun 12 15:18:11 2017 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Mon Jun 12 15:19:22 2017 +0200

----------------------------------------------------------------------
 .../karaf/kar/internal/KarServiceImpl.java      | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/c1956822/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
index f769fc8..ff071e9 100644
--- a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
+++ b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
@@ -275,15 +275,19 @@ public class KarServiceImpl implements KarService {
                 if (repository.getURI().equals(karFeatureRepoUri)) {
                     try {
                         for (Feature feature : repository.getFeatures()) {
-                            try {
-                                LOGGER.debug("noAutoRefreshBundles is " + isNoAutoRefreshBundles());
-                                if (isNoAutoRefreshBundles()) {
-                                    featuresService.installFeature(feature, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles));
-                                } else {
-                                    featuresService.installFeature(feature, EnumSet.noneOf(FeaturesService.Option.class));
+                            if (feature.getInstall() == null || !feature.getInstall().equals("manual"))
{
+                                try {
+                                    LOGGER.debug("noAutoRefreshBundles is " + isNoAutoRefreshBundles());
+                                    if (isNoAutoRefreshBundles()) {
+                                        featuresService.installFeature(feature, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles));
+                                    } else {
+                                        featuresService.installFeature(feature, EnumSet.noneOf(FeaturesService.Option.class));
+                                    }
+                                } catch (Exception e) {
+                                    LOGGER.warn("Unable to install Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
                                 }
-                            } catch (Exception e) {
-                                LOGGER.warn("Unable to install Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                            } else {
+                                LOGGER.warn("Feature " + feature.getName() + "/" + feature.getVersion()
+ " has install flag set to \"manual\", so it's not automatically installed");
                             }
                         }
                     } catch (Exception e) {
@@ -427,10 +431,12 @@ public class KarServiceImpl implements KarService {
                 if (repository.getURI().equals(karFeatureRepoUri)) {
                     try {
                         for (Feature feature : repository.getFeatures()) {
-                            try {
-                                featuresService.uninstallFeature(feature.getName(), feature.getVersion());
-                            } catch (Exception e) {
-                                LOGGER.warn("Unable to uninstall Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                            if (feature.getInstall() == null || !feature.getInstall().equals("manual"))
{
+                                try {
+                                    featuresService.uninstallFeature(feature.getName(), feature.getVersion());
+                                } catch (Exception e) {
+                                    LOGGER.warn("Unable to uninstall Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                                }
                             }
                         }
                     } catch (Exception e) {


Mime
View raw message