felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r801925 [1/2] - in /felix/trunk/karaf: ./ assembly/ assembly/src/main/descriptors/ assembly/src/main/filtered-resources/etc/ deployer/features/ deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/ deployer/features/src/...
Date Fri, 07 Aug 2009 09:55:55 GMT
Author: gnodet
Date: Fri Aug  7 09:55:51 2009
New Revision: 801925

URL: http://svn.apache.org/viewvc?rev=801925&view=rev
Log:
FELIX-1457: refactor features management layer

Added:
    felix/trunk/karaf/features/
    felix/trunk/karaf/features/command/
    felix/trunk/karaf/features/command/pom.xml
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/pom.xml
    felix/trunk/karaf/features/command/src/
    felix/trunk/karaf/features/command/src/main/
    felix/trunk/karaf/features/command/src/main/java/
    felix/trunk/karaf/features/command/src/main/java/org/
    felix/trunk/karaf/features/command/src/main/java/org/apache/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/AddUrlCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/FeaturesCommandSupport.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/FeaturesCommandSupport.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/InstallFeatureCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/InstallFeatureCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListFeaturesCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListUrlCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListUrlCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RefreshUrlCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RefreshUrlCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RemoveUrlCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RemoveUrlCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/UninstallFeatureCommand.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/UninstallFeatureCommand.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/AvailableFeatureCompleter.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/AvailableFeatureCompleter.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/FeatureRepositoryCompleter.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/FeatureRepositoryCompleter.java
    felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/InstalledFeatureCompleter.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/InstalledFeatureCompleter.java
    felix/trunk/karaf/features/command/src/main/resources/
    felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/
    felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/
    felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/features-command.xml
    felix/trunk/karaf/features/core/
    felix/trunk/karaf/features/core/pom.xml
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/pom.xml
    felix/trunk/karaf/features/core/src/
    felix/trunk/karaf/features/core/src/main/
    felix/trunk/karaf/features/core/src/main/java/
    felix/trunk/karaf/features/core/src/main/java/org/
    felix/trunk/karaf/features/core/src/main/java/org/apache/
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Feature.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Feature.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeatureEvent.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesRegistry.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesListener.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistryMBean.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesService.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesService.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Repository.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Repository.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/RepositoryEvent.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeatureImpl.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java
    felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/RepositoryImpl.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java
    felix/trunk/karaf/features/core/src/main/resources/
    felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/
    felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/
    felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
    felix/trunk/karaf/features/core/src/test/
    felix/trunk/karaf/features/core/src/test/java/
    felix/trunk/karaf/features/core/src/test/java/org/
    felix/trunk/karaf/features/core/src/test/java/org/apache/
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeatureTest.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeatureTest.java
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeaturesServiceTest.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeaturesServiceTest.java
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/RepositoryTest.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/RepositoryTest.java
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/internal/
    felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/internal/FeaturesServiceImplTest.java
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImplTest.java
    felix/trunk/karaf/features/core/src/test/resources/
    felix/trunk/karaf/features/core/src/test/resources/org/
    felix/trunk/karaf/features/core/src/test/resources/org/apache/
    felix/trunk/karaf/features/core/src/test/resources/org/apache/felix/
    felix/trunk/karaf/features/core/src/test/resources/org/apache/felix/karaf/
    felix/trunk/karaf/features/core/src/test/resources/org/apache/felix/karaf/features/
    felix/trunk/karaf/features/core/src/test/resources/org/apache/felix/karaf/features/repo1.xml
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/resources/org/apache/felix/karaf/gshell/features/repo1.xml
    felix/trunk/karaf/features/management/
    felix/trunk/karaf/features/management/pom.xml
      - copied, changed from r801923, felix/trunk/karaf/gshell/gshell-features/pom.xml
    felix/trunk/karaf/features/management/src/
    felix/trunk/karaf/features/management/src/main/
    felix/trunk/karaf/features/management/src/main/java/
    felix/trunk/karaf/features/management/src/main/java/org/
    felix/trunk/karaf/features/management/src/main/java/org/apache/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/FeaturesServiceMBean.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/codec/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/codec/JmxFeature.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/codec/JmxFeatureEvent.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/codec/JmxRepository.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/codec/JmxRepositoryEvent.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/internal/
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/internal/FeaturesServiceMBeanImpl.java
    felix/trunk/karaf/features/management/src/main/java/org/apache/felix/karaf/features/management/internal/MBeanRegistrer.java
    felix/trunk/karaf/features/management/src/main/resources/
    felix/trunk/karaf/features/management/src/main/resources/OSGI-INF/
    felix/trunk/karaf/features/management/src/main/resources/OSGI-INF/blueprint/
    felix/trunk/karaf/features/management/src/main/resources/OSGI-INF/blueprint/features-management.xml
      - copied, changed from r801923, felix/trunk/karaf/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml
    felix/trunk/karaf/features/pom.xml
      - copied, changed from r801923, felix/trunk/karaf/gshell/pom.xml
Removed:
    felix/trunk/karaf/gshell/gshell-features/pom.xml
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Feature.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesRegistry.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesService.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Repository.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/FeaturesCommandSupport.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/InstallFeatureCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListFeaturesCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListUrlCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RefreshUrlCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RemoveUrlCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/UninstallFeatureCommand.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/AvailableFeatureCompleter.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/FeatureRepositoryCompleter.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/InstalledFeatureCompleter.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/DefaultNamingStrategy.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeature.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeatureMBean.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistry.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistryMBean.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedRepository.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedRepositoryMBean.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagementAgent.java
    felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/NamingStrategy.java
    felix/trunk/karaf/gshell/gshell-features/src/main/resources/OSGI-INF/blueprint/gshell-features.xml
    felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeatureTest.java
    felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeaturesServiceTest.java
    felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/RepositoryTest.java
    felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImplTest.java
    felix/trunk/karaf/gshell/gshell-features/src/test/resources/org/apache/felix/karaf/gshell/features/repo1.xml
Modified:
    felix/trunk/karaf/assembly/pom.xml
    felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml
    felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml
    felix/trunk/karaf/assembly/src/main/filtered-resources/etc/startup.properties
    felix/trunk/karaf/deployer/features/pom.xml
    felix/trunk/karaf/deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/FeatureDeploymentListener.java
    felix/trunk/karaf/deployer/features/src/main/resources/OSGI-INF/blueprint/features-deployer.xml
    felix/trunk/karaf/gshell/pom.xml
    felix/trunk/karaf/pom.xml
    felix/trunk/karaf/webconsole/features/pom.xml
    felix/trunk/karaf/webconsole/features/src/main/java/org/apache/felix/karaf/webconsole/features/FeaturesPlugin.java
    felix/trunk/karaf/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml

Modified: felix/trunk/karaf/assembly/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/pom.xml?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/pom.xml (original)
+++ felix/trunk/karaf/assembly/pom.xml Fri Aug  7 09:55:51 2009
@@ -59,6 +59,18 @@
             <artifactId>org.apache.felix.karaf.deployer.features</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix.karaf.features</groupId>
+            <artifactId>org.apache.felix.karaf.features.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix.karaf.features</groupId>
+            <artifactId>org.apache.felix.karaf.features.command</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix.karaf.features</groupId>
+            <artifactId>org.apache.felix.karaf.features.management</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.felix.karaf.gshell</groupId>
             <artifactId>org.apache.felix.karaf.gshell.console</artifactId>
         </dependency>
@@ -80,10 +92,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.felix.karaf.gshell</groupId>
-            <artifactId>org.apache.felix.karaf.gshell.features</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix.karaf.gshell</groupId>
             <artifactId>org.apache.felix.karaf.gshell.config</artifactId>
         </dependency>
         <dependency>

Modified: felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml (original)
+++ felix/trunk/karaf/assembly/src/main/descriptors/unix-bin.xml Fri Aug  7 09:55:51 2009
@@ -168,6 +168,17 @@
             <outputDirectory>/system</outputDirectory>
             <unpack>false</unpack>
             <useProjectArtifact>false</useProjectArtifact>
+            <outputFileNameMapping>org/apache/felix/karaf/features/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+            <includes>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.core</include>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.command</include>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.management</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>/system</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
             <outputFileNameMapping>org/apache/felix/karaf/deployer/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.deployer:org.apache.felix.karaf.deployer.filemonitor</include>
@@ -186,7 +197,6 @@
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.admin</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.osgi</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.log</include>
-                <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.features</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.config</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.packages</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.ssh</include>

Modified: felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml (original)
+++ felix/trunk/karaf/assembly/src/main/descriptors/windows-bin.xml Fri Aug  7 09:55:51 2009
@@ -160,6 +160,17 @@
             <outputDirectory>/system</outputDirectory>
             <unpack>false</unpack>
             <useProjectArtifact>false</useProjectArtifact>
+            <outputFileNameMapping>org/apache/felix/karaf/features/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+            <includes>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.core</include>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.command</include>
+                <include>org.apache.felix.karaf.features:org.apache.felix.karaf.features.management</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>/system</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
             <outputFileNameMapping>org/apache/felix/karaf/deployer/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.deployer:org.apache.felix.karaf.deployer.filemonitor</include>
@@ -178,7 +189,6 @@
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.admin</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.osgi</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.log</include>
-                <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.features</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.config</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.packages</include>
                 <include>org.apache.felix.karaf.gshell:org.apache.felix.karaf.gshell.ssh</include>

Modified: felix/trunk/karaf/assembly/src/main/filtered-resources/etc/startup.properties
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/assembly/src/main/filtered-resources/etc/startup.properties?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/assembly/src/main/filtered-resources/etc/startup.properties (original)
+++ felix/trunk/karaf/assembly/src/main/filtered-resources/etc/startup.properties Fri Aug  7 09:55:51 2009
@@ -43,7 +43,6 @@
 org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.features/${pom.version}/org.apache.felix.karaf.deployer.features-${pom.version}.jar=30
 org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.admin/${pom.version}/org.apache.felix.karaf.gshell.admin-${pom.version}.jar=30
 org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.osgi/${pom.version}/org.apache.felix.karaf.gshell.osgi-${pom.version}.jar=30
-org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.features/${pom.version}/org.apache.felix.karaf.gshell.features-${pom.version}.jar=30
 org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.log/${pom.version}/org.apache.felix.karaf.gshell.log-${pom.version}.jar=30
 org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.config/${pom.version}/org.apache.felix.karaf.gshell.config-${pom.version}.jar=30
 org/apache/felix/karaf/gshell/org.apache.felix.karaf.gshell.packages/${pom.version}/org.apache.felix.karaf.gshell.packages-${pom.version}.jar=30
@@ -51,6 +50,10 @@
 org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.config/${pom.version}/org.apache.felix.karaf.jaas.config-${pom.version}.jar=30
 org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.modules/${pom.version}/org.apache.felix.karaf.jaas.modules-${pom.version}.jar=30
 
+org/apache/felix/karaf/features/org.apache.felix.karaf.features.core/${pom.version}/org.apache.felix.karaf.features.core-${pom.version}.jar=30
+org/apache/felix/karaf/features/org.apache.felix.karaf.features.command/${pom.version}/org.apache.felix.karaf.features.command-${pom.version}.jar=30
+org/apache/felix/karaf/features/org.apache.felix.karaf.features.management/${pom.version}/org.apache.felix.karaf.features.management-${pom.version}.jar=30
+
 org/apache/felix/karaf/org.apache.felix.karaf.management/${pom.version}/org.apache.felix.karaf.management-${pom.version}.jar=30
 org/osgi/org.osgi.impl.bundle.jmx/${osgi.jmx.version}/org.osgi.impl.bundle.jmx-${osgi.jmx.version}.jar=30
 

Modified: felix/trunk/karaf/deployer/features/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/deployer/features/pom.xml?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/deployer/features/pom.xml (original)
+++ felix/trunk/karaf/deployer/features/pom.xml Fri Aug  7 09:55:51 2009
@@ -46,8 +46,8 @@
             <artifactId>spring-osgi-core</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix.karaf.gshell</groupId>
-            <artifactId>org.apache.felix.karaf.gshell.features</artifactId>
+            <groupId>org.apache.felix.karaf.features</groupId>
+            <artifactId>org.apache.felix.karaf.features.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.felix.karaf.deployer</groupId>

Modified: felix/trunk/karaf/deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/FeatureDeploymentListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/FeatureDeploymentListener.java?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/FeatureDeploymentListener.java (original)
+++ felix/trunk/karaf/deployer/features/src/main/java/org/apache/felix/karaf/deployer/features/FeatureDeploymentListener.java Fri Aug  7 09:55:51 2009
@@ -40,18 +40,15 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.felix.karaf.gshell.features.Feature;
-import org.apache.felix.karaf.gshell.features.FeaturesService;
-import org.apache.felix.karaf.gshell.features.Repository;
+import org.apache.felix.karaf.features.Feature;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Repository;
 import org.apache.felix.karaf.deployer.filemonitor.DeploymentListener;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;
 import org.osgi.framework.Constants;
 import org.osgi.framework.SynchronousBundleListener;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.osgi.context.BundleContextAware;
 
 /**
  * A deployment listener able to hot deploy a feature descriptor

Modified: felix/trunk/karaf/deployer/features/src/main/resources/OSGI-INF/blueprint/features-deployer.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/deployer/features/src/main/resources/OSGI-INF/blueprint/features-deployer.xml?rev=801925&r1=801924&r2=801925&view=diff
==============================================================================
--- felix/trunk/karaf/deployer/features/src/main/resources/OSGI-INF/blueprint/features-deployer.xml (original)
+++ felix/trunk/karaf/deployer/features/src/main/resources/OSGI-INF/blueprint/features-deployer.xml Fri Aug  7 09:55:51 2009
@@ -28,7 +28,7 @@
           init-method="init" destroy-method="destroy" activation="lazy">
         <property name="bundleContext" ref="blueprintBundleContext"/>
         <property name="featuresService">
-            <reference interface="org.apache.felix.karaf.gshell.features.FeaturesService"/>
+            <reference interface="org.apache.felix.karaf.features.FeaturesService"/>
         </property>
     </bean>
 

Copied: felix/trunk/karaf/features/command/pom.xml (from r801923, felix/trunk/karaf/gshell/gshell-features/pom.xml)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/pom.xml?p2=felix/trunk/karaf/features/command/pom.xml&p1=felix/trunk/karaf/gshell/gshell-features/pom.xml&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/pom.xml (original)
+++ felix/trunk/karaf/features/command/pom.xml Fri Aug  7 09:55:51 2009
@@ -22,20 +22,16 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.felix.karaf.gshell</groupId>
-        <artifactId>gshell</artifactId>
+        <groupId>org.apache.felix.karaf.features</groupId>
+        <artifactId>features</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.apache.felix.karaf.gshell</groupId>
-    <artifactId>org.apache.felix.karaf.gshell.features</artifactId>
+    <groupId>org.apache.felix.karaf.features</groupId>
+    <artifactId>org.apache.felix.karaf.features.command</artifactId>
     <packaging>bundle</packaging>
     <version>1.2.0-SNAPSHOT</version>
-    <name>Apache Felix Karaf :: GShell Features</name>
-
-    <description>
-        Provides Features in GShell
-    </description>
+    <name>Apache Felix Karaf :: Features Command</name>
 
     <dependencies>
         <dependency>
@@ -51,6 +47,11 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.felix.karaf.features</groupId>
+            <artifactId>org.apache.felix.karaf.features.core</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.bundlerepository</artifactId>
         </dependency>

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/AddUrlCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/AddUrlCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/AddUrlCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/AddUrlCommand.java Fri Aug  7 09:55:51 2009
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
 import java.net.URI;
 import java.util.List;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
+import org.apache.felix.karaf.features.FeaturesService;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
 

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/FeaturesCommandSupport.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/FeaturesCommandSupport.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/FeaturesCommandSupport.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/FeaturesCommandSupport.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/FeaturesCommandSupport.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/FeaturesCommandSupport.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/FeaturesCommandSupport.java Fri Aug  7 09:55:51 2009
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
 import org.apache.felix.karaf.gshell.console.OsgiCommandSupport;
+import org.apache.felix.karaf.features.FeaturesService;
 import org.osgi.framework.ServiceReference;
 
 public abstract class FeaturesCommandSupport extends OsgiCommandSupport {

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/InstallFeatureCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/InstallFeatureCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/InstallFeatureCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/InstallFeatureCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/InstallFeatureCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/InstallFeatureCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/InstallFeatureCommand.java Fri Aug  7 09:55:51 2009
@@ -14,9 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
+import org.apache.felix.karaf.features.FeaturesService;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
 

Added: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListFeaturesCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListFeaturesCommand.java?rev=801925&view=auto
==============================================================================
--- felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListFeaturesCommand.java (added)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListFeaturesCommand.java Fri Aug  7 09:55:51 2009
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.felix.karaf.features.command;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Feature;
+import org.apache.felix.gogo.commands.Option;
+import org.apache.felix.gogo.commands.Command;
+
+@Command(scope = "features", name = "list", description = "List existing features.")
+public class ListFeaturesCommand extends FeaturesCommandSupport {
+
+    @Option(name = "-i", aliases={"--installed"}, description="Display the list of installed features")
+    boolean installed;
+
+    protected void doExecute(FeaturesService admin) throws Exception {
+        List<Feature> features;
+        List<Feature> installedFeatures;
+        if (installed) {
+            features = Arrays.asList(admin.listInstalledFeatures());
+            installedFeatures = features;
+            if (features == null || features.size() == 0) {
+                System.out.println("No features installed.");
+                return;
+            }
+        } else {
+            features = Arrays.asList(admin.listFeatures());
+            installedFeatures = Arrays.asList(admin.listInstalledFeatures());
+            if (features == null || features.size() == 0) {
+                System.out.println("No features available.");
+                return;
+            }
+        }
+        int maxVersionSize = 7;
+        for (Feature feature : features) {
+            maxVersionSize = Math.max(maxVersionSize, feature.getVersion().length());
+        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("  State         Version    ");
+        for (int i = 7; i < maxVersionSize; i++) {
+            sb.append(" ");
+        }
+        sb.append("Name");
+        System.out.println(sb.toString());
+        for (Feature feature : features) {
+            sb.setLength(0);
+            sb.append("[");
+            if (installedFeatures.contains(feature)) {
+                sb.append("installed  ");
+            } else {
+                sb.append("uninstalled");
+            }
+            sb.append("] [");
+            String v = feature.getVersion();
+            sb.append(v);
+            for (int i = v.length(); i < maxVersionSize; i++) {
+                sb.append(" ");
+            }
+            sb.append("] ");
+            sb.append(feature.getName());
+            System.out.println(sb.toString());
+        }
+    }
+
+}

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListUrlCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListUrlCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListUrlCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListUrlCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListUrlCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/ListUrlCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/ListUrlCommand.java Fri Aug  7 09:55:51 2009
@@ -14,10 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
+
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Repository;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
-import org.apache.felix.karaf.gshell.features.Repository;
 
 public class ListUrlCommand extends FeaturesCommandSupport {
 

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RefreshUrlCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RefreshUrlCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RefreshUrlCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RefreshUrlCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RefreshUrlCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RefreshUrlCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RefreshUrlCommand.java Fri Aug  7 09:55:51 2009
@@ -14,16 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
-import org.apache.felix.karaf.gshell.features.Repository;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Repository;
 
 @Command(scope = "features", name = "refreshUrl", description = "Reload the repositories to obtain a fresh list of features.")
 public class RefreshUrlCommand extends FeaturesCommandSupport {

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RemoveUrlCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RemoveUrlCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RemoveUrlCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RemoveUrlCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RemoveUrlCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/RemoveUrlCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/RemoveUrlCommand.java Fri Aug  7 09:55:51 2009
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
 import java.net.URI;
 import java.util.List;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.karaf.features.FeaturesService;
 
 @Command(scope = "features", name = "removeUrl", description = "Remove a list of repository URLs from the features service.")
 public class RemoveUrlCommand extends FeaturesCommandSupport {

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/UninstallFeatureCommand.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/UninstallFeatureCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/UninstallFeatureCommand.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/UninstallFeatureCommand.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/UninstallFeatureCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/UninstallFeatureCommand.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/UninstallFeatureCommand.java Fri Aug  7 09:55:51 2009
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features.command;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
 import org.apache.felix.gogo.commands.Argument;
 import org.apache.felix.gogo.commands.Command;
+import org.apache.felix.karaf.features.FeaturesService;
 
 @Command(scope = "features", name = "uninstall", description = "Uninstall a feature.")
 public class UninstallFeatureCommand extends FeaturesCommandSupport {

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/AvailableFeatureCompleter.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/AvailableFeatureCompleter.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/AvailableFeatureCompleter.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/AvailableFeatureCompleter.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/AvailableFeatureCompleter.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/AvailableFeatureCompleter.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/AvailableFeatureCompleter.java Fri Aug  7 09:55:51 2009
@@ -14,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.completers;
+package org.apache.felix.karaf.features.command.completers;
 
-import java.util.Collection;
 import java.util.List;
 
-import org.apache.felix.karaf.gshell.features.management.ManagedFeature;
-import org.apache.felix.karaf.gshell.features.management.ManagedFeaturesRegistry;
 import org.apache.felix.karaf.gshell.console.completer.StringsCompleter;
 import org.apache.felix.karaf.gshell.console.Completer;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Feature;
 
 /**
  * {@link jline.Completor} for available features.
@@ -32,22 +31,21 @@
  */
 public class AvailableFeatureCompleter implements Completer {
 
-    private ManagedFeaturesRegistry featuresRegistry;
-    private StringsCompleter delegate;
+    private FeaturesService featuresService;
 
-    public void setFeaturesRegistry(ManagedFeaturesRegistry featuresRegistry) {
-        this.featuresRegistry = featuresRegistry;
+    public void setFeaturesService(FeaturesService featuresService) {
+        this.featuresService = featuresService;
     }
 
     public int complete(final String buffer, final int cursor, final List candidates) {
-
-        Collection<ManagedFeature> features = featuresRegistry.getAvailableFeatures().values();
-        delegate = new StringsCompleter();
-
-        for (ManagedFeature feature : features) {
-            delegate.getStrings().add(feature.getName());
+        StringsCompleter delegate = new StringsCompleter();
+        try {
+            for (Feature feature : featuresService.listFeatures()) {
+                delegate.getStrings().add(feature.getName());
+            }
+        } catch (Exception e) {
+            // Ignore
         }
-
         return delegate.complete(buffer, cursor, candidates);
     }
 

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/FeatureRepositoryCompleter.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/FeatureRepositoryCompleter.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/FeatureRepositoryCompleter.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/FeatureRepositoryCompleter.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/FeatureRepositoryCompleter.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/FeatureRepositoryCompleter.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/FeatureRepositoryCompleter.java Fri Aug  7 09:55:51 2009
@@ -14,13 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.completers;
+package org.apache.felix.karaf.features.command.completers;
 
 import java.util.List;
 
-import org.apache.felix.karaf.gshell.features.management.ManagedFeaturesRegistry;
 import org.apache.felix.karaf.gshell.console.completer.StringsCompleter;
 import org.apache.felix.karaf.gshell.console.Completer;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Repository;
 
 /**
  * {@link jline.Completor} for Feature Repository URLs.
@@ -31,14 +32,21 @@
 
 public class FeatureRepositoryCompleter implements Completer {
 
-    private ManagedFeaturesRegistry featuresRegistry;
+    private FeaturesService featuresService;
 
-    public void setFeaturesRegistry(ManagedFeaturesRegistry featuresRegistry) {
-        this.featuresRegistry = featuresRegistry;
+    public void setFeaturesService(FeaturesService featuresService) {
+        this.featuresService = featuresService;
     }
 
     public int complete(final String buffer, final int cursor, final List candidates) {
-        StringsCompleter delegate = new StringsCompleter(featuresRegistry.getRepositories().keySet());
+        StringsCompleter delegate = new StringsCompleter();
+        try {
+            for (Repository repository : featuresService.listRepositories()) {
+                delegate.getStrings().add(repository.getURI().toString());
+            }
+        } catch (Exception e) {
+            // Ignore
+        }
         return delegate.complete(buffer, cursor, candidates);
     }
 

Copied: felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/InstalledFeatureCompleter.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/InstalledFeatureCompleter.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/InstalledFeatureCompleter.java?p2=felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/InstalledFeatureCompleter.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/InstalledFeatureCompleter.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/completers/InstalledFeatureCompleter.java (original)
+++ felix/trunk/karaf/features/command/src/main/java/org/apache/felix/karaf/features/command/completers/InstalledFeatureCompleter.java Fri Aug  7 09:55:51 2009
@@ -14,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.completers;
+package org.apache.felix.karaf.features.command.completers;
 
-import java.util.Collection;
 import java.util.List;
 
 import org.apache.felix.karaf.gshell.console.Completer;
 import org.apache.felix.karaf.gshell.console.completer.StringsCompleter;
-import org.apache.felix.karaf.gshell.features.management.ManagedFeature;
-import org.apache.felix.karaf.gshell.features.management.ManagedFeaturesRegistry;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Feature;
 
 /**
  * {@link jline.Completor} for installed features.
@@ -32,23 +31,22 @@
  */
 public class InstalledFeatureCompleter implements Completer {
 
-    private ManagedFeaturesRegistry featuresRegistry;
-    private StringsCompleter delegate;
+    private FeaturesService featuresService;
 
-    public void setFeaturesRegistry(ManagedFeaturesRegistry featuresRegistry) {
-        this.featuresRegistry = featuresRegistry;
+    public void setFeaturesService(FeaturesService featuresService) {
+        this.featuresService = featuresService;
     }
 
     public int complete(final String buffer, final int cursor, final List candidates) {
-        Collection<ManagedFeature> features = featuresRegistry.getInstalledFeatures().values();
-        delegate = new StringsCompleter();
-
-        for (ManagedFeature feature : features) {
-            delegate.getStrings().add(feature.getName());
+        StringsCompleter delegate = new StringsCompleter();
+        try {
+            for (Feature feature : featuresService.listInstalledFeatures()) {
+                delegate.getStrings().add(feature.getName());
+            }
+        } catch (Exception e) {
+            // Ignore
         }
-
         return delegate.complete(buffer, cursor, candidates);
     }
 
-
 }

Added: felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/features-command.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/features-command.xml?rev=801925&view=auto
==============================================================================
--- felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/features-command.xml (added)
+++ felix/trunk/karaf/features/command/src/main/resources/OSGI-INF/blueprint/features-command.xml Fri Aug  7 09:55:51 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
+        <command name="features/addUrl">
+            <action class="org.apache.felix.karaf.features.command.AddUrlCommand"/>
+        </command>
+        <command name="features/listUrl">
+            <action class="org.apache.felix.karaf.features.command.ListUrlCommand"/>
+        </command>
+        <command name="features/removeUrl">
+            <action class="org.apache.felix.karaf.features.command.RemoveUrlCommand"/>
+            <completers>
+                <ref component-id="removeUrlCompleter" />
+            </completers>
+        </command>
+        <command name="features/refreshUrl">
+            <action class="org.apache.felix.karaf.features.command.RefreshUrlCommand"/>
+        </command>
+        <command name="features/install">
+            <action class="org.apache.felix.karaf.features.command.InstallFeatureCommand"/>
+            <completers>
+                <ref component-id="installFeatureCompleter" />
+            </completers>
+        </command>
+        <command name="features/uninstall">
+            <action class="org.apache.felix.karaf.features.command.UninstallFeatureCommand"/>
+            <completers>
+                <ref component-id="uninstallFeatureCompleter" />
+            </completers>
+        </command>
+        <command name="features/list">
+            <action class="org.apache.felix.karaf.features.command.ListFeaturesCommand"/>
+        </command>
+    </command-bundle>
+
+    <reference id="featuresService" interface="org.apache.felix.karaf.features.FeaturesService" />
+
+    <bean id="installFeatureCompleter" class="org.apache.felix.karaf.features.command.completers.AvailableFeatureCompleter">
+        <property name="featuresService" ref="featuresService" />
+    </bean>
+
+    <bean id="uninstallFeatureCompleter" class="org.apache.felix.karaf.features.command.completers.InstalledFeatureCompleter">
+        <property name="featuresService" ref="featuresService" />
+    </bean>
+
+    <bean id="removeUrlCompleter" class="org.apache.felix.karaf.features.command.completers.FeatureRepositoryCompleter">
+        <property name="featuresService" ref="featuresService" />
+    </bean>
+
+</blueprint>

Copied: felix/trunk/karaf/features/core/pom.xml (from r801923, felix/trunk/karaf/gshell/gshell-features/pom.xml)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/pom.xml?p2=felix/trunk/karaf/features/core/pom.xml&p1=felix/trunk/karaf/gshell/gshell-features/pom.xml&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/pom.xml (original)
+++ felix/trunk/karaf/features/core/pom.xml Fri Aug  7 09:55:51 2009
@@ -22,20 +22,16 @@
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.apache.felix.karaf.gshell</groupId>
-        <artifactId>gshell</artifactId>
+        <groupId>org.apache.felix.karaf.features</groupId>
+        <artifactId>features</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
 
-    <groupId>org.apache.felix.karaf.gshell</groupId>
-    <artifactId>org.apache.felix.karaf.gshell.features</artifactId>
+    <groupId>org.apache.felix.karaf.features</groupId>
+    <artifactId>org.apache.felix.karaf.features.core</artifactId>
     <packaging>bundle</packaging>
     <version>1.2.0-SNAPSHOT</version>
-    <name>Apache Felix Karaf :: GShell Features</name>
-
-    <description>
-        Provides Features in GShell
-    </description>
+    <name>Apache Felix Karaf :: Features Core</name>
 
     <dependencies>
         <dependency>
@@ -95,7 +91,7 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
-                        <Export-Package>${pom.artifactId}*;version=${project.version}</Export-Package>
+                        <Export-Package>org.apache.felix.karaf.features;version=${project.version}</Export-Package>
                         <Import-Package>
                             javax.management,
                             javax.management.loading,
@@ -104,7 +100,7 @@
                             org.apache.felix.karaf.gshell.console,
                             *
                         </Import-Package>
-                        <Private-Package>!*</Private-Package>
+                        <Private-Package>org.apache.felix.karaf.features.internal</Private-Package>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>
                     </instructions>
                 </configuration>

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Feature.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Feature.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Feature.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Feature.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Feature.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Feature.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Feature.java Fri Aug  7 09:55:51 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features;
+package org.apache.felix.karaf.features;
 
 import java.util.List;
 import java.util.Map;

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeatureEvent.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesRegistry.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeatureEvent.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeatureEvent.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesRegistry.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesRegistry.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeatureEvent.java Fri Aug  7 09:55:51 2009
@@ -14,25 +14,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features;
+package org.apache.felix.karaf.features;
 
-/**
- * Main interface for a Feature Registry which tracks available and installed features.
- * Tracks features and repositories.
- */
-public interface FeaturesRegistry {
-
-    void setFeaturesService(FeaturesService service);
-
-    void register(Feature feature);
-
-    void unregister(Feature feature);
-
-    void registerInstalled(Feature feature);
-
-    void unregisterInstalled(Feature feature);
+import java.util.EventObject;
 
-    void register(Repository repository);
+public class FeatureEvent extends EventObject {
 
-    void unregister(Repository repository);
+    public static enum EventType {
+        FeatureInstalled,
+        FeatureUninstalled
+    }
+
+    private final EventType type;
+    private final Feature feature;
+    private final boolean replay;
+
+    public FeatureEvent(Feature feature, EventType type, boolean replay) {
+        super(feature);
+        this.type = type;
+        this.feature = feature;
+        this.replay = replay;
+    }
+
+    public EventType getType() {
+        return type;
+    }
+
+    public Feature getFeature() {
+        return feature;
+    }
+
+    public boolean isReplay() {
+        return replay;
+    }
 }

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesListener.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistryMBean.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesListener.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesListener.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistryMBean.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/management/ManagedFeaturesRegistryMBean.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesListener.java Fri Aug  7 09:55:51 2009
@@ -14,14 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.management;
+package org.apache.felix.karaf.features;
 
-public interface ManagedFeaturesRegistryMBean {
+public interface FeaturesListener {
 
-    void installFeature(String name) throws Exception;
+    void featureEvent(FeatureEvent event);
 
-    void installFeature(String name, String version) throws Exception;
-
-    void installRepository(String repositoryUri) throws Exception;
+    void repositoryEvent(RepositoryEvent event);
 
 }

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesService.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesService.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesService.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesService.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesService.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/FeaturesService.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/FeaturesService.java Fri Aug  7 09:55:51 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features;
+package org.apache.felix.karaf.features;
 
 import java.net.URI;
 
@@ -37,8 +37,8 @@
     
     void uninstallFeature(String name, String version) throws Exception;
 
-    String[] listFeatures() throws Exception;
+    Feature[] listFeatures() throws Exception;
 
-    String[] listInstalledFeatures();
+    Feature[] listInstalledFeatures();
 
 }

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Repository.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Repository.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Repository.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Repository.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Repository.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/Repository.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/Repository.java Fri Aug  7 09:55:51 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features;
+package org.apache.felix.karaf.features;
 
 import java.net.URI;
 

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/RepositoryEvent.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/RepositoryEvent.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/RepositoryEvent.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/commands/AddUrlCommand.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/RepositoryEvent.java Fri Aug  7 09:55:51 2009
@@ -14,24 +14,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.commands;
+package org.apache.felix.karaf.features;
 
-import java.net.URI;
-import java.util.List;
+import java.util.EventObject;
 
-import org.apache.felix.karaf.gshell.features.FeaturesService;
-import org.apache.felix.gogo.commands.Argument;
-import org.apache.felix.gogo.commands.Command;
+public class RepositoryEvent extends EventObject {
 
-@Command(scope = "features", name = "addUrl", description = "Add a list of repository URLs to the features service.")
-public class AddUrlCommand extends FeaturesCommandSupport {
+    public static enum EventType {
+        RepositoryAdded,
+        RepositoryRemoved,
+    }
+
+    private final EventType type;
+    private final Repository repository;
+    private final boolean replay;
+
+    public RepositoryEvent(Repository repository, EventType type, boolean replay) {
+        super(repository);
+        this.type = type;
+        this.repository = repository;
+        this.replay = replay;
+    }
 
-    @Argument(required = true, multiValued = true, description = "Repository URLs")
-    List<String> urls;
+    public EventType getType() {
+        return type;
+    }
+
+    public Repository getRepository() {
+        return repository;
+    }
 
-    protected void doExecute(FeaturesService admin) throws Exception {
-        for (String url : urls) {
-            admin.addRepository(new URI(url));
-        }
+    public boolean isReplay() {
+        return replay;
     }
-}
+}
\ No newline at end of file

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeatureImpl.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeatureImpl.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeatureImpl.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeatureImpl.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeatureImpl.java Fri Aug  7 09:55:51 2009
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.internal;
+package org.apache.felix.karaf.features.internal;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.felix.karaf.gshell.features.Feature;
+import org.apache.felix.karaf.features.Feature;
 
 /**
  * A feature

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/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?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/FeaturesServiceImpl.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/FeaturesServiceImpl.java Fri Aug  7 09:55:51 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.internal;
+package org.apache.felix.karaf.features.internal;
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -31,15 +31,18 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.felix.karaf.gshell.features.Feature;
-import org.apache.felix.karaf.gshell.features.FeaturesRegistry;
-import org.apache.felix.karaf.gshell.features.FeaturesService;
-import org.apache.felix.karaf.gshell.features.Repository;
+import org.apache.felix.karaf.features.FeaturesService;
+import org.apache.felix.karaf.features.Feature;
+import org.apache.felix.karaf.features.Repository;
+import org.apache.felix.karaf.features.FeaturesListener;
+import org.apache.felix.karaf.features.FeatureEvent;
+import org.apache.felix.karaf.features.RepositoryEvent;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -76,7 +79,7 @@
     private Map<Feature, Set<Long>> installed = new HashMap<Feature, Set<Long>>();
     private String boot;
     private boolean bootFeaturesInstalled;
-    private FeaturesRegistry featuresRegistry;
+    private List<FeaturesListener> listeners = new CopyOnWriteArrayList<FeaturesListener>();
 
     public BundleContext getBundleContext() {
         return bundleContext;
@@ -102,9 +105,18 @@
         this.preferences = preferences;
     }
 
-    public void setFeaturesServiceRegistry(FeaturesRegistry featuresRegistry) {
-        this.featuresRegistry = featuresRegistry;
-        this.featuresRegistry.setFeaturesService(this);
+    public void registerListener(FeaturesListener listener) {
+        listeners.add(listener);
+        for (Repository repository : listRepositories()) {
+            listener.repositoryEvent(new RepositoryEvent(repository, RepositoryEvent.EventType.RepositoryAdded, true));
+        }
+        for (Feature feature : listInstalledFeatures()) {
+            listener.featureEvent(new FeatureEvent(feature, FeatureEvent.EventType.FeatureInstalled, true));
+        }
+    }
+
+    public void unregisterListener(FeaturesListener listener) {
+        listeners.remove(listener);
     }
 
     public void setUrls(String uris) throws URISyntaxException {
@@ -129,7 +141,7 @@
     protected RepositoryImpl internalAddRepository(URI uri) throws Exception {
         RepositoryImpl repo = new RepositoryImpl(uri);
         repositories.put(uri, repo);
-        featuresRegistry.register(repo);
+        callListeners(new RepositoryEvent(repo, RepositoryEvent.EventType.RepositoryAdded, false));
         features = null;
         return repo;
     }
@@ -142,8 +154,8 @@
     }
 
     public void internalRemoveRepository(URI uri) {
-        featuresRegistry.unregister(repositories.get(uri));
-        repositories.remove(uri);
+        Repository repo = repositories.remove(uri);
+        callListeners(new RepositoryEvent(repo, RepositoryEvent.EventType.RepositoryRemoved, false));
         features = null;
     }
 
@@ -202,7 +214,7 @@
             bundleContext.getBundle(id).start();
         }
 
-        featuresRegistry.registerInstalled(f);
+        callListeners(new FeatureEvent(f, FeatureEvent.EventType.FeatureInstalled, false));
         installed.put(f, bundles);
         saveState();
     }
@@ -285,46 +297,23 @@
         for (long bundleId : bundles) {
             getBundleContext().getBundle(bundleId).uninstall();
         }
-        featuresRegistry.unregisterInstalled(feature);
+        callListeners(new FeatureEvent(feature, FeatureEvent.EventType.FeatureInstalled, false));
         saveState();
     }
 
-    public String[] listFeatures() throws Exception {
-        Collection<String> features = new ArrayList<String>();
+    public Feature[] listFeatures() throws Exception {
+        Collection<Feature> features = new ArrayList<Feature>();
         for (Map<String, Feature> featureWithDifferentVersion : getFeatures().values()) {
 			for (Feature f : featureWithDifferentVersion.values()) {
-				String installStatus = installed.containsKey(f) ? "installed  "
-						: "uninstalled";
-				String version = f.getVersion();
-				switch (version.length()) {
-				case 1:
-					version = "       " + version;
-				case 2:
-					version = "      " + version;
-				case 3:
-					version = "     " + version;
-				case 4:
-					version = "    " + version;
-				case 5:
-					version = "   " + version;
-				case 6:
-					version = "  " + version;
-				case 7:
-					version = " " + version;
-				}
-				features.add("[" + installStatus + "] " + " [" + version + "] "
-						+ f.getName());
-			}
-		}
-        return features.toArray(new String[features.size()]);
-    }
-
-    public String[] listInstalledFeatures() {
-        List<String> result = new ArrayList<String>();
-        for (Feature feature : installed.keySet()) {
-            result.add(feature.getName());
+                features.add(f);
+            }
         }
-        return result.toArray(new String[result.size()]);
+        return features.toArray(new Feature[features.size()]);
+    }
+
+    public Feature[] listInstalledFeatures() {
+        Set<Feature> result = installed.keySet();
+        return result.toArray(new Feature[result.size()]);
     }
 
     protected Feature getFeature(String name, String version) throws Exception {
@@ -470,7 +459,7 @@
                 }
                 installed = loadMap(prefs.node("features"));
                 for (Feature f : installed.keySet()) {
-                    featuresRegistry.registerInstalled(f);
+                    callListeners(new FeatureEvent(f, FeatureEvent.EventType.FeatureInstalled, true));
                 }
                 bootFeaturesInstalled = prefs.getBoolean("bootFeaturesInstalled", false);
                 return true;
@@ -537,6 +526,18 @@
         return set;
     }
 
+    protected void callListeners(FeatureEvent event) {
+        for (FeaturesListener listener : listeners) {
+            listener.featureEvent(event);
+        }
+    }
+
+    protected void callListeners(RepositoryEvent event) {
+        for (FeaturesListener listener : listeners) {
+            listener.repositoryEvent(event);
+        }
+    }
+
     static Pattern fuzzyVersion  = Pattern.compile("(\\d+)(\\.(\\d+)(\\.(\\d+))?)?([^a-zA-Z0-9](.*))?",
                                                    Pattern.DOTALL);
     static Pattern fuzzyModifier = Pattern.compile("(\\d+[.-])*(.*)",

Copied: felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/RepositoryImpl.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/RepositoryImpl.java?p2=felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/RepositoryImpl.java&p1=felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/main/java/org/apache/felix/karaf/gshell/features/internal/RepositoryImpl.java (original)
+++ felix/trunk/karaf/features/core/src/main/java/org/apache/felix/karaf/features/internal/RepositoryImpl.java Fri Aug  7 09:55:51 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features.internal;
+package org.apache.felix.karaf.features.internal;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -38,8 +38,8 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.apache.felix.karaf.gshell.features.Feature;
-import org.apache.felix.karaf.gshell.features.Repository;
+import org.apache.felix.karaf.features.Repository;
+import org.apache.felix.karaf.features.Feature;
 import org.xml.sax.SAXException;
 
 /**

Added: 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=801925&view=auto
==============================================================================
--- felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml (added)
+++ felix/trunk/karaf/features/core/src/main/resources/OSGI-INF/blueprint/gshell-features.xml Fri Aug  7 09:55:51 2009
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <ext:property-placeholder placeholder-prefix="$(" placeholder-suffix=")"/>
+
+    <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" ignore-missing-locations="true">
+        <ext:default-properties>
+            <ext:property name="featuresRepositories" value=""/>
+            <ext:property name="featuresBoot" value=""/>
+        </ext:default-properties>
+        <ext:location>file:$(karaf.home)/etc/org.apache.felix.karaf.features.cfg</ext:location>
+    </ext:property-placeholder>
+
+    <bean id="featuresService" class="org.apache.felix.karaf.features.internal.FeaturesServiceImpl" init-method="start" destroy-method="stop">
+        <property name="urls" value="$[featuresRepositories]" />
+        <property name="boot" value="$[featuresBoot]" />
+        <property name="configAdmin" ref="configAdmin" />
+        <property name="preferences" ref="preferences" />
+        <property name="bundleContext" ref="blueprintBundleContext" />
+    </bean>
+
+    <reference-list id="featuresListeners" interface="org.apache.felix.karaf.features.FeaturesListener" availability="optional">
+        <reference-listener ref="featuresService"
+                            bind-method="registerListener"
+                            unbind-method="unregisterListener" />
+    </reference-list>
+
+    <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
+
+    <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" availability="optional"/>
+
+    <service ref="featuresService" interface="org.apache.felix.karaf.features.FeaturesService" />
+
+</blueprint>

Copied: felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeatureTest.java (from r801923, felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeatureTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeatureTest.java?p2=felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeatureTest.java&p1=felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeatureTest.java&r1=801923&r2=801925&rev=801925&view=diff
==============================================================================
--- felix/trunk/karaf/gshell/gshell-features/src/test/java/org/apache/felix/karaf/gshell/features/FeatureTest.java (original)
+++ felix/trunk/karaf/features/core/src/test/java/org/apache/felix/karaf/features/FeatureTest.java Fri Aug  7 09:55:51 2009
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.felix.karaf.gshell.features;
+package org.apache.felix.karaf.features;
 
 import junit.framework.TestCase;
-import org.apache.felix.karaf.gshell.features.internal.FeatureImpl;
+import org.apache.felix.karaf.features.internal.FeatureImpl;
 
 public class FeatureTest extends TestCase {
 	



Mime
View raw message