You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/09/10 18:53:02 UTC
svn commit: r693894 - in
/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features:
Feature.java internal/FeatureImpl.java internal/FeaturesServiceImpl.java
Author: gnodet
Date: Wed Sep 10 09:53:02 2008
New Revision: 693894
URL: http://svn.apache.org/viewvc?rev=693894&view=rev
Log:
SMX4KNL-82: The installation state of a feature is not displayed correctly after a restart when using the "features list" command
Modified:
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/Feature.java
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeatureImpl.java
servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/Feature.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/Feature.java?rev=693894&r1=693893&r2=693894&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/Feature.java (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/Feature.java Wed Sep 10 09:53:02 2008
@@ -34,6 +34,4 @@
Map<String, Map<String, String>> getConfigurations();
- boolean isInstalled();
-
}
Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeatureImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeatureImpl.java?rev=693894&r1=693893&r2=693894&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeatureImpl.java (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeatureImpl.java Wed Sep 10 09:53:02 2008
@@ -33,8 +33,6 @@
private List<String> dependencies = new ArrayList<String>();
private List<String> bundles = new ArrayList<String>();
private Map<String, Map<String,String>> configs = new HashMap<String, Map<String,String>>();
- private boolean installed = false;
-
public FeatureImpl(String name) {
this.name = name;
@@ -45,6 +43,14 @@
return name;
}
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
public List<String> getDependencies() {
return dependencies;
}
@@ -69,19 +75,4 @@
configs.put(name, properties);
}
- public boolean isInstalled() {
- return installed;
- }
-
- public void setInstalled(boolean installed) {
- this.installed = installed;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
}
Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java?rev=693894&r1=693893&r2=693894&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java Wed Sep 10 09:53:02 2008
@@ -137,7 +137,7 @@
}
public void installFeature(String name) throws Exception {
- FeatureImpl f = (FeatureImpl) getFeature(name);
+ Feature f = getFeature(name);
if (f == null) {
throw new Exception("No feature named '" + name + "' available");
}
@@ -163,7 +163,6 @@
bundles.add(b.getBundleId());
}
installed.put(name, bundles);
- f.setInstalled(true);
saveState();
}
@@ -221,7 +220,7 @@
Collection<String> features = new ArrayList<String>();
for (Repository repo : repositories.values()) {
for (Feature f : repo.getFeatures()) {
- String installStatus = f.isInstalled() ? "installed " : "uninstalled";
+ String installStatus = installed.containsKey(f.getName()) ? "installed " : "uninstalled";
String version = f.getVersion();
switch (version.length()) {
case 1: version = " " + version;