felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r813062 - in /felix/trunk/karaf/features/core/src/main: java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java resources/OSGI-INF/blueprint/gshell-features.xml
Date Wed, 09 Sep 2009 18:10:14 GMT
Author: gnodet
Date: Wed Sep  9 18:10:14 2009
New Revision: 813062

URL: http://svn.apache.org/viewvc?rev=813062&view=rev
Log:
FELIX-1576: The features service should do a PackageAdmin.refresh() after uninstalling a feature

Modified:
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java
    felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml

Modified: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java?rev=813062&r1=813061&r2=813062&view=diff
==============================================================================
--- felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java
(original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java
Wed Sep  9 18:10:14 2009
@@ -54,6 +54,7 @@
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 import org.osgi.service.prefs.PreferencesService;
+import org.osgi.service.packageadmin.PackageAdmin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -72,6 +73,7 @@
 
     private BundleContext bundleContext;
     private ConfigurationAdmin configAdmin;
+    private PackageAdmin packageAdmin;
     private PreferencesService preferences;
     private Set<URI> uris;
     private Map<URI, RepositoryImpl> repositories = new HashMap<URI, RepositoryImpl>();
@@ -97,6 +99,14 @@
         this.configAdmin = configAdmin;
     }
 
+    public PackageAdmin getPackageAdmin() {
+        return packageAdmin;
+    }
+
+    public void setPackageAdmin(PackageAdmin packageAdmin) {
+        this.packageAdmin = packageAdmin;
+    }
+
     public PreferencesService getPreferences() {
         return preferences;
     }
@@ -219,11 +229,11 @@
                 b.start();
             }
         }
-
         callListeners(new FeatureEvent(f, FeatureEvent.EventType.FeatureInstalled, false));
         installed.put(f, bundles);
         saveState();
     }
+
     protected Bundle installBundleIfNeeded(String bundleLocation) throws IOException, BundleException
{
         LOGGER.debug("Checking " + bundleLocation);
         InputStream is;
@@ -306,6 +316,9 @@
                 b.uninstall();
             }
         }
+        if (getPackageAdmin() != null) {
+            getPackageAdmin().refreshPackages(null);
+        }
         callListeners(new FeatureEvent(feature, FeatureEvent.EventType.FeatureInstalled,
false));
         saveState();
     }

Modified: felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml?rev=813062&r1=813061&r2=813062&view=diff
==============================================================================
--- felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
(original)
+++ felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
Wed Sep  9 18:10:14 2009
@@ -34,6 +34,7 @@
         <property name="urls" value="$[featuresRepositories]" />
         <property name="boot" value="$[featuresBoot]" />
         <property name="configAdmin" ref="configAdmin" />
+        <property name="packageAdmin" ref="packageAdmin" />
         <property name="preferences" ref="preferences" />
         <property name="bundleContext" ref="blueprintBundleContext" />
     </bean>
@@ -48,6 +49,8 @@
 
     <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService"
availability="optional"/>
 
+    <reference id="packageAdmin" interface="org.osgi.service.packageadmin.PackageAdmin"
/>
+
     <service ref="featuresService" interface="org.apache.felix.karaf.features.FeaturesService"
/>
 
 </blueprint>



Mime
View raw message