Build failed in Jenkins: karaf-2.3.x #1149

2014-04-11 Thread Apache Jenkins Server
See 

--
[...truncated 5578 lines...]
[INFO] Apache Karaf :: Diagnostic :: Common .. SKIPPED
[INFO] Apache Karaf :: Diagnostic :: Command . SKIPPED
[INFO] Apache Karaf :: Diagnostic :: Management .. SKIPPED
[INFO] Apache Karaf :: Tooling ... SKIPPED
[INFO] Apache Karaf :: Tooling :: Maven2 Features plugin . SKIPPED
[INFO] Apache Karaf :: Assembly .. SKIPPED
[INFO] Apache Karaf :: Demos . SKIPPED
[INFO] Apache Karaf :: Demos :: Web .. SKIPPED
[INFO] Apache Karaf :: Demos :: Branding . SKIPPED
[INFO] Apache Karaf :: Demos :: Branding :: Shell  SKIPPED
[INFO] Apache Karaf :: Demos :: Demo Dump provider ... SKIPPED
[INFO] Apache Karaf :: Demos :: Extend Console Command ... SKIPPED
[INFO] Apache Karaf :: Demos :: Deployer . SKIPPED
[INFO] Apache Karaf :: Demos :: Deployer :: Kar .. SKIPPED
[INFO] Apache Karaf :: Demos :: Deployer :: Wrap Bundle osgi.commons-lang  
SKIPPED
[INFO] Apache Karaf :: Demos :: Deployer :: Bundle ... SKIPPED
[INFO] Apache Karaf :: Demos :: Deployer :: Feature .. SKIPPED
[INFO] Apache Karaf :: Tooling :: Maven2 Command Help plugin  SKIPPED
[INFO] Apache Karaf :: Tooling :: Exam Testing Framework . SKIPPED
[INFO] Apache Karaf :: Tooling :: Exam Testing Framework :: Options  SKIPPED
[INFO] Apache Karaf :: Tooling :: Exam Testing Framework :: Container  SKIPPED
[INFO] Apache Karaf :: Archetypes  SKIPPED
[INFO] Apache Karaf :: Archetypes :: Assembly Archetype .. SKIPPED
[INFO] Apache Karaf :: Archetypes :: Blueprint Archetype . SKIPPED
[INFO] Apache Karaf :: Archetypes :: Bundle Archetype  SKIPPED
[INFO] Apache Karaf :: Archetypes :: Command Archetype ... SKIPPED
[INFO] Apache Karaf :: Archetypes :: Feature Archetype ... SKIPPED
[INFO] Apache Karaf :: Archetypes :: Kar Archetype ... SKIPPED
[INFO] Apache Karaf :: Integration Tests . SKIPPED
[INFO] 
[INFO] BUILD FAILURE
[INFO] 
[INFO] Total time: 12:14.682s
[INFO] Finished at: Sat Apr 12 03:30:59 UTC 2014
[INFO] Final Memory: 59M/250M
[INFO] 
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on 
project org.apache.karaf.management.mbeans.services: Failed to retrieve remote 
metadata 
org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.services:2.3.6-SNAPSHOT/maven-metadata.xml:
 Could not transfer metadata 
org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.services:2.3.6-SNAPSHOT/maven-metadata.xml
 from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Failed to 
transfer file: 
https://repository.apache.org/content/repositories/snapshots/org/apache/karaf/management/mbeans/org.apache.karaf.management.mbeans.services/2.3.6-SNAPSHOT/maven-metadata.xml.
 Return code is: 502, ReasonPhrase:Proxy Error. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy) on 
project org.apache.karaf.management.mbeans.services: Failed to retrieve remote 
metadata 
org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.services:2.3.6-SNAPSHOT/maven-metadata.xml:
 Could not transfer metadata 
org.apache.karaf.management.mbeans:org.apache.karaf.management.mbeans.services:2.3.6-SNAPSHOT/maven-metadata.xml
 from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Failed to 
transfer file: 
https://repository.apache.org/content/repositories/snapshots/org/apache/karaf/management/mbeans/org.apache.karaf.management.mbeans.services/2.3.6-SNAPSHOT/maven-metadata.xml.
 Return code is: 502, ReasonPhrase:Proxy Error.
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
   

Build failed in Jenkins: karaf-2.3.x » Apache Karaf :: Management :: MBeans :: Services #1149

2014-04-11 Thread Apache Jenkins Server
See 


--
[INFO] 
[INFO] 
[INFO] Building Apache Karaf :: Management :: MBeans :: Services 2.3.6-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Deleting 

[INFO] 
[INFO] --- maven-bundle-plugin:2.4.0:cleanVersions (cleanVersions) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] 
[INFO] --- maven-antrun-plugin:1.7:run (copy-notice) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Executing tasks

main:
 [copy] Copying 1 file to 

[INFO] Executed tasks
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to 

[WARNING] Note: 

 uses or overrides a deprecated API.
[WARNING] Note: Recompile with -Xlint:deprecation for details.
[WARNING] Note: 

 uses unchecked or unsafe operations.
[WARNING] Note: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 

[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Surefire report directory: 


---
 T E S T S
---

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-bundle-plugin:2.4.0:bundle (default-bundle) @ 
org.apache.karaf.management.mbeans.services ---
[JENKINS] Recording test results
[INFO] 
[INFO] --- maven-site-plugin:3.3:attach-descriptor (attach-descriptor) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ 
org.apache.karaf.management.mbeans.services ---
[INFO] Installing 

 to 
/home/jenkins/jenkins-slave/workspace/karaf-2.3.x/.repository/org/apache/karaf/management/mbeans/org.apache.karaf.management.mbeans.services/2.3.6-SNAPSHOT/org.apache.karaf.management.mbeans.services-2.3.6-SNAPSHOT.jar
[INFO] Installing 

 to 
/home/jenkins/jenkins-slave/workspace/karaf-2.3.x/.repository/org/apache/karaf/management/mbeans/org.apache.karaf.management.mbeans.services/2.3.6-SNAPSHOT/org.apache.karaf.management.mbeans.services-2.3.6-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-bundle-plugin:2.4.0:install (default-i

Build failed in Jenkins: Karaf-WebConsole #579

2014-04-11 Thread Apache Jenkins Server
See 

--
Started by timer
Building remotely on ubuntu5 (Ubuntu ubuntu) in workspace 

ERROR: A Maven installation needs to be available for this project to be 
built.Either your server has no Maven installations defined, or the requested 
Maven version does not exist.
Retrying after 10 seconds
ERROR: A Maven installation needs to be available for this project to be 
built.Either your server has no Maven installations defined, or the requested 
Maven version does not exist.
Retrying after 10 seconds
ERROR: A Maven installation needs to be available for this project to be 
built.Either your server has no Maven installations defined, or the requested 
Maven version does not exist.



Jenkins build is back to normal : karaf-3.0.x » Apache Karaf :: Tooling :: Maven Karaf Plugin #52

2014-04-11 Thread Apache Jenkins Server
See 




Jenkins build is still unstable: karaf-2.x #55

2014-04-11 Thread Apache Jenkins Server
See 



Jenkins build is still unstable: karaf-2.x » Apache Karaf :: Integration Tests #55

2014-04-11 Thread Apache Jenkins Server
See 



Build failed in Jenkins: karaf-master #2512

2014-04-11 Thread Apache Jenkins Server
See 

Changes:

[gnodet] [KARAF-2888] Clean API a bit, expose required repos and features

[gnodet] [KARAF-2852] Merge features/core and features/command

[gnodet] [KARAF-2852] Merge bundle/command into bundle/core

[gnodet] [KARAF-2852] Merge config/core and config/command

[gnodet] [KARAF-2852] Merge instance/core and instance/command

[gnodet] [KARAF-2852] Merge diagnostic/core and diagnostic/command

[gnodet] [KARAF-2852] Merge kar/core and kar/command

[gnodet] [KARAF-2852] Merge log/core and log/command

[gnodet] [KARAF-2852] Merge package/core and package/command

[gnodet] [KARAF-2852] Merge service/command into service/core

[gnodet] [KARAF-2852] Merge system/core and system/command

[gnodet] [KARAF-2852] Merge http/core and http/command

[gnodet] [KARAF-2852] Merge obr/core and obr/command

[gnodet] [KARAF-2852] Merge wrapper/core and wrapper/command

[gnodet] [KARAF-2833] Make obr independent of blueprint

[gnodet] [KARAF-2852] Merge web/core and web/command

[gnodet] [KARAF-2852] Merge region/core and region/command

[gnodet] [KARAF-2852] Merge jndi/core and jndi/command

[gnodet] [KARAF-2833] Make jndi independent of blueprint

[janstey] KARAF-2899 - NPE when running features:listUrl

[gnodet] [KARAF-2888] Call listeners when features are installed or uninstalled

[gnodet] [KARAF-2888] Better computation of bundles to refresh and print them 
in simulation

[gnodet] [KARAF-2852] Merge jms/core and jms/command

[gnodet] [KARAF-2852] Merge jdbc/core and jdbc/command

[gnodet] [KARAF-2888] Refactor repository validation so that we use a single 
pass, cache the created Schema

[gnodet] [KARAF-2852] Remove obsolete artifacts references

[gnodet] [KARAF-2888] Optimize start bundle sorting which is really slow

[gnodet] [KARAF-2852] Remove unused files

[gnodet] [KARAF-2900] Allow generic requirements as condition to features

[gnodet] Revert "[KARAF-2852] Merge features/core and features/command"

[gnodet] Make sure aries-util is not referenced in the framework car

[gnodet] [KARAF-2901] Add an option to show bundle version in bundle:tree-show

[gnodet] [KARAF-2902] Separate section for Karaf-xxx headers and sort headers

--
[...truncated 173 lines...]
[INFO] Apache Karaf :: Features :: Core .. SKIPPED
[INFO] Apache Karaf :: JAAS .. SKIPPED
[INFO] Apache Karaf :: JAAS :: Boot .. SKIPPED
[INFO] Apache Karaf :: JAAS :: Config  SKIPPED
[INFO] Apache Karaf :: JAAS :: Modules ... SKIPPED
[INFO] Apache Karaf :: Service ... SKIPPED
[INFO] Apache Karaf :: Service :: Guard .. SKIPPED
[INFO] Apache Karaf :: Shell . SKIPPED
[INFO] Apache Karaf :: Shell :: Core . SKIPPED
[INFO] Apache Karaf :: Features :: Command ... SKIPPED
[INFO] Apache Karaf :: KAR :: Core ... SKIPPED
[INFO] Apache Karaf :: Region :: Persistence . SKIPPED
[INFO] Apache Karaf :: Bundle  SKIPPED
[INFO] Apache Karaf :: Bundle :: Core  SKIPPED
[INFO] Apache Karaf :: Bundle :: BlueprintStateService ... SKIPPED
[INFO] Apache Karaf :: Bundle :: SpringStateService .. SKIPPED
[INFO] Apache Karaf :: ConfigAdmin :: Core ... SKIPPED
[INFO] Apache Karaf :: Instance :: Core .. SKIPPED
[INFO] Apache Karaf :: Package :: Core ... SKIPPED
[INFO] Apache Karaf :: HTTP :: Core .. SKIPPED
[INFO] Apache Karaf :: Service :: Core ... SKIPPED
[INFO] Apache Karaf :: Log :: Core ... SKIPPED
[INFO] Apache Karaf :: Deployer .. SKIPPED
[INFO] Apache Karaf :: Deployer :: Spring  SKIPPED
[INFO] Apache Karaf :: Deployer :: Blueprint . SKIPPED
[INFO] Apache Karaf :: Deployer :: Features .. SKIPPED
[INFO] Apache Karaf :: Deployer :: Karaf Archive (.kar) .. SKIPPED
[INFO] Apache Karaf :: Deployer :: Wrap Non OSGi Jar . SKIPPED
[INFO] Apache Karaf :: Shell :: Various Commands . SKIPPED
[INFO] Apache Karaf :: Shell :: Console .. SKIPPED
[INFO] Apache Karaf :: Shell :: SSH .. SKIPPED
[INFO] Apache Karaf :: Shell :: Table  SKIPPED
[INFO] Apache Karaf :: JAAS :: Jasypt Encryption . SKIPPED
[INFO] Apache Karaf :: JAAS :: Command ... SKIPPED
[INFO] Apache Karaf :: JAAS :: Blueprint . SKIPPED
[INFO] Apache Karaf :: JAAS :: Blueprint :: Config ... SKIPPED
[INFO] Apache Karaf :: JAAS :: Blueprint :: Jasypt ... SKIPPED
[INFO] Apache Karaf :: Client  SKIPPED
[INFO] Apache Karaf :: Management  SKIPPED
[INFO] Apache Karaf :: Management :: Boot  SKIPPED
[INFO] Apache Karaf :: Man

Build failed in Jenkins: karaf-master » Apache Karaf #2512

2014-04-11 Thread Apache Jenkins Server
See 


Changes:

[gnodet] [KARAF-2852] Remove obsolete artifacts references

[gnodet] Revert "[KARAF-2852] Merge features/core and features/command"

--
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
<===[JENKINS REMOTING CAPACITY]===>   channel started
log4j:WARN No appenders could be found for logger 
(org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
Executing Maven:  -B -f 
 
-Dmaven.repo.local=
 -B -e clean deploy
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for 
org.apache.karaf.services:org.apache.karaf.services.eventadmin:bundle:4.0.0-SNAPSHOT
[WARNING] The expression ${pom.artifactId} is deprecated. Please use 
${project.artifactId} instead.
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten 
the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support 
building such malformed projects.
[WARNING] 
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache Karaf
[INFO] Apache Karaf :: Util
[INFO] Apache Karaf :: Main
[INFO] Apache Karaf :: Features
[INFO] Apache Karaf :: Features :: Core
[INFO] Apache Karaf :: JAAS
[INFO] Apache Karaf :: JAAS :: Boot
[INFO] Apache Karaf :: JAAS :: Config
[INFO] Apache Karaf :: JAAS :: Modules
[INFO] Apache Karaf :: Service
[INFO] Apache Karaf :: Service :: Guard
[INFO] Apache Karaf :: Shell
[INFO] Apache Karaf :: Shell :: Core
[INFO] Apache Karaf :: Features :: Command
[INFO] Apache Karaf :: KAR :: Core
[INFO] Apache Karaf :: Region :: Persistence
[INFO] Apache Karaf :: Bundle
[INFO] Apache Karaf :: Bundle :: Core
[INFO] Apache Karaf :: Bundle :: BlueprintStateService
[INFO] Apache Karaf :: Bundle :: SpringStateService
[INFO] Apache Karaf :: ConfigAdmin :: Core
[INFO] Apache Karaf :: Instance :: Core
[INFO] Apache Karaf :: Package :: Core
[INFO] Apache Karaf :: HTTP :: Core
[INFO] Apache Karaf :: Service :: Core
[INFO] Apache Karaf :: Log :: Core
[INFO] Apache Karaf :: Deployer
[INFO] Apache Karaf :: Deployer :: Spring
[INFO] Apache Karaf :: Deployer :: Blueprint
[INFO] Apache Karaf :: Deployer :: Features
[INFO] Apache Karaf :: Deployer :: Karaf Archive (.kar)
[INFO] Apache Karaf :: Deployer :: Wrap Non OSGi Jar
[INFO] Apache Karaf :: Shell :: Various Commands
[INFO] Apache Karaf :: Shell :: Console
[INFO] Apache Karaf :: Shell :: SSH
[INFO] Apache Karaf :: Shell :: Table
[INFO] Apache Karaf :: JAAS :: Jasypt Encryption
[INFO] Apache Karaf :: JAAS :: Command
[INFO] Apache Karaf :: JAAS :: Blueprint
[INFO] Apache Karaf :: JAAS :: Blueprint :: Config
[INFO] Apache Karaf :: JAAS :: Blueprint :: Jasypt
[INFO] Apache Karaf :: Client
[INFO] Apache Karaf :: Management
[INFO] Apache Karaf :: Management :: Boot
[INFO] Apache Karaf :: Management
[INFO] Apache Karaf :: System :: Core
[INFO] Apache Karaf :: Web :: Core
[INFO] Apache Karaf :: Wrapper :: Core
[INFO] Apache Karaf :: Web Console
[INFO] Apache Karaf :: Web Console :: Console
[INFO] Apache Karaf :: Web Console :: Branding
[INFO] Apache Karaf :: Web Console :: Features Plugin
[INFO] Apache Karaf :: Web Console :: Gogo Plugin
[INFO] Apache Karaf :: Web Console :: HTTP Plugin
[INFO] Apache Karaf :: Web Console :: Instance Plugin
[INFO] Apache Karaf :: Exception
[INFO] Apache Karaf :: Scheduler
[INFO] Apache Karaf :: Scheduler :: Core
[INFO] Apache Karaf :: Declarative Services (DS)
[INFO] Apache Karaf :: SCR :: Shell Commands
[INFO] Apache Karaf :: SCR :: Management MBeans
[INFO] Apache Karaf :: SCR :: Examples
[INFO] Apache Karaf :: SCR :: Examples :: Basic Service
[INFO] Apache Karaf :: SCR :: Examples :: Managed Services
[INFO] Apache Karaf :: SCR :: Examples :: Component Factories
[INFO] Apache Karaf :: Diagnostic :: Core
[INFO] Apache Karaf :: OBR :: Core
[INFO] Apache Karaf :: JNDI :: Core
[INFO] Apache Karaf :: JDBC :: Core
[INFO] Apache Karaf :: JMS :: Core
[INFO] Apache Karaf :: Tooling
[INFO] Apache Karaf :: Tooling :: Maven Karaf Plugin
[INFO] Apache Karaf :: Assemblies
[INFO] Apache Karaf :: Assemblies :: Features
[INFO] Apache Karaf :: Assemblies :: Features :: Framework
[INFO] Apache Karaf :: OSGi Services :: EventAdmin
[INFO] Apache Karaf :: Assemblies :: Features :: Standard
[INFO] Apache Karaf :: Assemblies :: Features :: Spring
[INFO] Apache Karaf :: Assemblies :: Features :: Enterprise
[INFO] Apache Karaf :: Assemblies :: Demos
[INFO] Apache Karaf :: Assemblies :: Minimal Distribution
[INFO] Apache Karaf :: Ass

[09/33] git commit: [KARAF-2888] Optimize start bundle sorting which is really slow

2014-04-11 Thread gnodet
[KARAF-2888] Optimize start bundle sorting which is really slow


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

Branch: refs/heads/master
Commit: 78fbae7faa140f88b76358d89af044dcc8693411
Parents: 286939f
Author: Guillaume Nodet 
Authored: Fri Apr 11 15:47:33 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:03 2014 +0200

--
 .../internal/service/FeaturesServiceImpl.java   |  5 +-
 .../internal/service/RequirementSort.java   | 87 +++-
 2 files changed, 33 insertions(+), 59 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/78fbae7f/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index 65223d5..7008ef6 100644
--- 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -64,10 +64,7 @@ import org.osgi.framework.FrameworkEvent;
 import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.Version;
-import org.osgi.framework.namespace.PackageNamespace;
 import org.osgi.framework.startlevel.BundleStartLevel;
-import org.osgi.framework.wiring.BundleCapability;
-import org.osgi.framework.wiring.BundleRequirement;
 import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.framework.wiring.BundleWire;
 import org.osgi.framework.wiring.BundleWiring;
@@ -1043,7 +1040,7 @@ public class FeaturesServiceImpl implements 
FeaturesService {
 
 // TODO: remove this hack, but it avoids loading the class after the 
bundle is refreshed
 new CopyOnWriteArrayIdentityList().iterator();
-new RequirementSort();
+RequirementSort.sort(Collections.emptyList());
 
 if (!noRefresh) {
 toStop = new HashSet();

http://git-wip-us.apache.org/repos/asf/karaf/blob/78fbae7f/features/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
 
b/features/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
index e9ecece..96b99ee 100644
--- 
a/features/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
+++ 
b/features/src/main/java/org/apache/karaf/features/internal/service/RequirementSort.java
@@ -16,92 +16,69 @@
  */
 package org.apache.karaf.features.internal.service;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
 
-import org.apache.karaf.features.internal.resolver.RequirementImpl;
+import org.apache.karaf.features.internal.resolver.CapabilitySet;
 import org.apache.karaf.features.internal.resolver.SimpleFilter;
 import org.osgi.framework.Constants;
 import org.osgi.resource.Capability;
 import org.osgi.resource.Requirement;
 import org.osgi.resource.Resource;
 
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-
-public class RequirementSort  {
+public class RequirementSort  {
 
 /**
  * Sorts {@link Resource} based on their {@link Requirement}s and {@link 
Capability}s.
- * @param resources
- * @return
  */
 public static  Collection sort(Collection 
resources) {
+Set namespaces = new HashSet();
+for (Resource r : resources) {
+for (Capability cap : r.getCapabilities(null)) {
+namespaces.add(cap.getNamespace());
+}
+}
+CapabilitySet capSet = new CapabilitySet(new 
ArrayList(namespaces));
+for (Resource r : resources) {
+for (Capability cap : r.getCapabilities(null)) {
+capSet.addCapability(cap);
+}
+}
 Set sorted = new LinkedHashSet();
 Set visited = new LinkedHashSet();
 for (T r : resources) {
-visit(r, resources, visited, sorted);
+visit(r, visited, sorted, capSet);
 }
 return sorted;
 }
 
 
-private static  void visit(T resource, Collection 
resources, Set visited, Set sorted) {
-if (visited.contains(resource)) {
+private static  void visit(T resource, Set vis

[11/33] git commit: [KARAF-2900] Allow generic requirements as condition to features

2014-04-11 Thread gnodet
[KARAF-2900] Allow generic requirements as condition to features


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

Branch: refs/heads/master
Commit: f2669e1d709da292b679307f523a771769129e8b
Parents: fc37f55
Author: Guillaume Nodet 
Authored: Fri Apr 11 17:04:09 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:03 2014 +0200

--
 .../standard/src/main/feature/feature.xml   |  5 +++-
 .../org/apache/karaf/features/Conditional.java  |  2 +-
 .../features/command/InfoFeatureCommand.java| 10 +++
 .../internal/deployment/DeploymentBuilder.java  | 30 
 .../features/internal/model/Conditional.java| 14 -
 .../internal/resolver/FeatureResource.java  | 16 +--
 .../internal/service/FeaturesServiceImpl.java   |  2 +-
 .../apache/karaf/features/ConditionalTest.java  | 13 +++--
 .../karaf/features/internal/service/f06.xml |  4 +++
 9 files changed, 69 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/f2669e1d/assemblies/features/standard/src/main/feature/feature.xml
--
diff --git a/assemblies/features/standard/src/main/feature/feature.xml 
b/assemblies/features/standard/src/main/feature/feature.xml
index 4d06455..86f8270 100644
--- a/assemblies/features/standard/src/main/feature/feature.xml
+++ b/assemblies/features/standard/src/main/feature/feature.xml
@@ -222,7 +222,10 @@
 
 shell
 jaas
-mvn:org.apache.mina/mina-core/${mina.version}
+
+
req:osgi.ee;filter:="(&(osgi.ee=JavaSE)(!(version>=1.7)))"
+mvn:org.apache.mina/mina-core/${mina.version}
+
 mvn:org.apache.sshd/sshd-core/${sshd.version}
 mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version}
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/f2669e1d/features/src/main/java/org/apache/karaf/features/Conditional.java
--
diff --git a/features/src/main/java/org/apache/karaf/features/Conditional.java 
b/features/src/main/java/org/apache/karaf/features/Conditional.java
index c0e4d59..fdc9261 100644
--- a/features/src/main/java/org/apache/karaf/features/Conditional.java
+++ b/features/src/main/java/org/apache/karaf/features/Conditional.java
@@ -21,7 +21,7 @@ import java.util.Map;
 
 public interface Conditional {
 
-List getCondition();
+List getCondition();
 
 List getDependencies();
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/f2669e1d/features/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
 
b/features/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
index 7084a6e..5ad855c 100644
--- 
a/features/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
+++ 
b/features/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
@@ -219,7 +219,7 @@ public class InfoFeatureCommand extends 
FeaturesCommandSupport {
 
 if (conditional) {
 for (Conditional cond : resolved.getConditional()) {
-List condition = 
cond.getCondition();
+List condition = cond.getCondition();
 List conditionalBundles = 
cond.getBundles();
 for (BundleInfo bundleInfo : conditionalBundles) {
 bundleLocation.add(bundleInfo.getLocation() + 
"(condition:"+condition+")");
@@ -278,13 +278,11 @@ public class InfoFeatureCommand extends 
FeaturesCommandSupport {
 
 private String getConditionDescription(Conditional cond) {
 StringBuffer sb = new StringBuffer();
-Iterator di = cond.getCondition().iterator();
-while (di.hasNext()) {
-Dependency dep = di.next();
-sb.append(dep.getName()).append("/").append(dep.getVersion());
-if (di.hasNext()) {
+for (String dep : cond.getCondition()) {
+if (sb.length() > 0) {
 sb.append(" ");
 }
+sb.append(dep);
 }
 return sb.toString();
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/f2669e1d/features/src/main/java/org/apache/karaf/features/internal/deployment/DeploymentBuilder.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/intern

[33/33] git commit: [KARAF-2902] Separate section for Karaf-xxx headers and sort headers

2014-04-11 Thread gnodet
[KARAF-2902] Separate section for Karaf-xxx headers and sort headers


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

Branch: refs/heads/master
Commit: fd4b3f67799c1d37f6756e1a9d2fe4c3c780f4e9
Parents: 6727c1b
Author: Guillaume Nodet 
Authored: Fri Apr 11 19:19:13 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:04 2014 +0200

--
 .../apache/karaf/bundle/command/Headers.java| 27 
 1 file changed, 22 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/fd4b3f67/bundle/core/src/main/java/org/apache/karaf/bundle/command/Headers.java
--
diff --git 
a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Headers.java 
b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Headers.java
index 16083ff..5cf92c3 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Headers.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Headers.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 
 import org.apache.felix.utils.manifest.Attribute;
 import org.apache.felix.utils.manifest.Clause;
@@ -48,6 +49,7 @@ import org.osgi.framework.wiring.BundleWiring;
 @Service
 public class Headers extends BundlesCommand {
 
+protected final static String KARAF_PREFIX = "Karaf-";
 protected final static String BUNDLE_PREFIX = "Bundle-";
 protected final static String PACKAGE_SUFFFIX = "-Package";
 protected final static String SERVICE_SUFFIX = "-Service";
@@ -90,10 +92,11 @@ public class Headers extends BundlesCommand {
 
 protected String generateFormattedOutput(Bundle bundle) {
 StringBuilder output = new StringBuilder();
-Map otherAttribs = new HashMap();
-Map bundleAttribs = new HashMap();
-Map serviceAttribs = new HashMap();
-Map packagesAttribs = new HashMap();
+Map otherAttribs = new TreeMap();
+Map karafAttribs = new TreeMap();
+Map bundleAttribs = new TreeMap();
+Map serviceAttribs = new TreeMap();
+Map packagesAttribs = new TreeMap();
 Dictionary dict = bundle.getHeaders();
 Enumeration keys = dict.keys();
 
@@ -101,7 +104,10 @@ public class Headers extends BundlesCommand {
 while (keys.hasMoreElements()) {
 String k = (String) keys.nextElement();
 Object v = dict.get(k);
-if (k.startsWith(BUNDLE_PREFIX)) {
+if (k.startsWith(KARAF_PREFIX)) {
+// starts with Karaf-xxx
+karafAttribs.put(k, v);
+} else if (k.startsWith(BUNDLE_PREFIX)) {
 // starts with Bundle-xxx
 bundleAttribs.put(k, v);
 } else if (k.endsWith(SERVICE_SUFFIX) || 
k.endsWith(CAPABILITY_SUFFIX)) {
@@ -124,6 +130,8 @@ public class Headers extends BundlesCommand {
 // ---
 // all other attributes
 //
+// all Karaf attributes
+//
 // all Bundle attributes
 //
 // all Service attributes
@@ -138,6 +146,15 @@ public class Headers extends BundlesCommand {
 output.append('\n');
 }
 
+it = karafAttribs.entrySet().iterator();
+while (it.hasNext()) {
+Map.Entry e = it.next();
+output.append(String.format("%s = %s\n", e.getKey(), 
ShellUtil.getValueString(e.getValue(;
+}
+if (karafAttribs.size() > 0) {
+output.append('\n');
+}
+
 it = bundleAttribs.entrySet().iterator();
 while (it.hasNext()) {
 Map.Entry e = it.next();



[29/33] Revert "[KARAF-2852] Merge features/core and features/command"

2014-04-11 Thread gnodet
http://git-wip-us.apache.org/repos/asf/karaf/blob/0c8e8a81/features/core/src/main/java/org/apache/karaf/features/internal/resolver/CandidateComparator.java
--
diff --git 
a/features/core/src/main/java/org/apache/karaf/features/internal/resolver/CandidateComparator.java
 
b/features/core/src/main/java/org/apache/karaf/features/internal/resolver/CandidateComparator.java
new file mode 100644
index 000..ad4cc85
--- /dev/null
+++ 
b/features/core/src/main/java/org/apache/karaf/features/internal/resolver/CandidateComparator.java
@@ -0,0 +1,129 @@
+/*
+ * 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.karaf.features.internal.resolver;
+
+import java.util.Comparator;
+
+import org.osgi.framework.Version;
+import org.osgi.framework.namespace.BundleNamespace;
+import org.osgi.framework.namespace.PackageNamespace;
+import org.osgi.framework.wiring.BundleCapability;
+import org.osgi.resource.Capability;
+
+public class CandidateComparator implements Comparator
+{
+public int compare(Capability cap1, Capability cap2)
+{
+int c = 0;
+// Always prefer system bundle
+if (cap1 instanceof BundleCapability && !(cap2 instanceof 
BundleCapability)) {
+c = -1;
+} else if (!(cap1 instanceof BundleCapability) && cap2 instanceof 
BundleCapability) {
+c = 1;
+}
+// Compare revision capabilities.
+if ((c == 0) && 
cap1.getNamespace().equals(BundleNamespace.BUNDLE_NAMESPACE))
+{
+c = ((Comparable) 
cap1.getAttributes().get(BundleNamespace.BUNDLE_NAMESPACE))
+
.compareTo(cap2.getAttributes().get(BundleNamespace.BUNDLE_NAMESPACE));
+if (c == 0)
+{
+Version v1 = 
(!cap1.getAttributes().containsKey(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+: (Version) 
cap1.getAttributes().get(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE);
+Version v2 = 
(!cap2.getAttributes().containsKey(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+: (Version) 
cap2.getAttributes().get(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE);
+// Compare these in reverse order, since we want
+// highest version to have priority.
+c = compareVersions(v2, v1);
+}
+}
+// Compare package capabilities.
+else if ((c == 0) && 
cap1.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE))
+{
+c = ((Comparable) 
cap1.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE))
+
.compareTo(cap2.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE));
+if (c == 0)
+{
+Version v1 = 
(!cap1.getAttributes().containsKey(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+: (Version) 
cap1.getAttributes().get(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE);
+Version v2 = 
(!cap2.getAttributes().containsKey(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+: (Version) 
cap2.getAttributes().get(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE);
+// Compare these in reverse order, since we want
+// highest version to have priority.
+c = compareVersions(v2, v1);
+// if same version, rather compare on the bundle version
+if (c == 0)
+{
+v1 = 
(!cap1.getAttributes().containsKey(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+: (Version) 
cap1.getAttributes().get(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE);
+v2 = 
(!cap2.getAttributes().containsKey(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE))
+? Version.emptyVersion
+   

[10/33] git commit: [KARAF-2852] Remove unused files

2014-04-11 Thread gnodet
[KARAF-2852] Remove unused files


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

Branch: refs/heads/master
Commit: fc37f55e2b3946490296eeef54a383fed21b0381
Parents: 78fbae7
Author: Guillaume Nodet 
Authored: Fri Apr 11 15:50:24 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:03 2014 +0200

--
 service/command/NOTICE  | 71 --
 service/command/pom.xml | 98 
 .../src/main/resources/OSGI-INF/bundle.info | 20 
 3 files changed, 189 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/fc37f55e/service/command/NOTICE
--
diff --git a/service/command/NOTICE b/service/command/NOTICE
deleted file mode 100644
index b70f1f9..000
--- a/service/command/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License

http://git-wip-us.apache.org/repos/asf/karaf/blob/fc37f55e/service/command/pom.xml
--
diff --git a/service/command/pom.xml b/service/command/pom.xml
deleted file mode 100644
index c33e13d..000
--- a/service/command/pom.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-
-
-
-4.0.0
-
-
-org.apache.karaf.service
-service
-4.0.0-SNAPSHOT
-../pom.xml
-
-
-org.apache.karaf.service.command
-bundle
-Apache Karaf :: Service :: Command
-Provides shell commands to manipulate OSGi 
services
-
-
-
${basedir}/../../etc/appended-resources
-
-
-
-
-
-org.apache.karaf.shell
-org.apache.karaf.shell.core
-provided
-
-
-org.apache.karaf.bundle
-org.apache.karaf.bundle.command
-provided
-
-
-org.osgi
-org.osgi.core
-provided
-
-
-org.osgi
-org.osgi.compendium
-provided
-
-
-org.slf4j
-slf4j-jdk14
-test
-
-
-
-
-
-
-src/main/resources
-
-**/*
-
-
-
-src/main/resources
-true
-
-**/*.info
-
-
-
-
-
-org.apache.felix
-maven-bundle-plugin
-
-
-

[15/33] git commit: [KARAF-2901] Add an option to show bundle version in bundle:tree-show

2014-04-11 Thread gnodet
[KARAF-2901] Add an option to show bundle version in bundle:tree-show


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

Branch: refs/heads/master
Commit: 6727c1b74a83006c9c2aac98ecfb6daf5d4be928
Parents: edd82fd
Author: Guillaume Nodet 
Authored: Fri Apr 11 19:17:49 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:04 2014 +0200

--
 .../karaf/bundle/command/ShowBundleTree.java  | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/6727c1b7/bundle/core/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
--
diff --git 
a/bundle/core/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java 
b/bundle/core/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
index a83ce39..f6f3d48 100644
--- 
a/bundle/core/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
+++ 
b/bundle/core/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
@@ -30,6 +30,7 @@ import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.bundle.command.bundletree.Node;
 import org.apache.karaf.bundle.command.bundletree.Tree;
 import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
 import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -52,6 +53,10 @@ import static java.lang.String.format;
 public class ShowBundleTree extends BundleCommand {
 
 private static final Logger LOGGER = 
LoggerFactory.getLogger(ShowBundleTree.class);
+
+@Option(name = "-v", aliases = { "--version" }, description = "Show bundle 
versions")
+private boolean versions;
+
 private Tree tree;
 
 public ShowBundleTree() {
@@ -104,9 +109,16 @@ public class ShowBundleTree extends BundleCommand {
 tree.write(System.out, new Tree.Converter() {
 
 public String toString(Node node) {
-return String.format("%s [%s]",
- node.getValue().getSymbolicName(),
- node.getValue().getBundleId());
+if (versions) {
+return String.format("%s / [%s] [%s]",
+node.getValue().getSymbolicName(),
+node.getValue().getVersion().toString(),
+node.getValue().getBundleId());
+} else {
+return String.format("%s [%s]",
+node.getValue().getSymbolicName(),
+node.getValue().getBundleId());
+}
 }
 });
 }



[06/33] [KARAF-2852] Merge jms/core and jms/command

2014-04-11 Thread gnodet
http://git-wip-us.apache.org/repos/asf/karaf/blob/0f53437c/jms/src/main/java/org/apache/karaf/jms/internal/JmsMBeanImpl.java
--
diff --git a/jms/src/main/java/org/apache/karaf/jms/internal/JmsMBeanImpl.java 
b/jms/src/main/java/org/apache/karaf/jms/internal/JmsMBeanImpl.java
new file mode 100644
index 000..cc46434
--- /dev/null
+++ b/jms/src/main/java/org/apache/karaf/jms/internal/JmsMBeanImpl.java
@@ -0,0 +1,155 @@
+/*
+ * 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.karaf.jms.internal;
+
+import org.apache.karaf.jms.JmsMBean;
+import org.apache.karaf.jms.JmsMessage;
+import org.apache.karaf.jms.JmsService;
+
+import javax.management.MBeanException;
+import javax.management.openmbean.*;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Default implementation of the JMS MBean.
+ */
+public class JmsMBeanImpl implements JmsMBean {
+
+private JmsService jmsService;
+
+@Override
+public List getConnectionfactories() throws MBeanException {
+try {
+return jmsService.connectionFactories();
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public void create(String name, String type, String url) throws 
MBeanException {
+try {
+jmsService.create(name, type, url);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public void delete(String name) throws MBeanException {
+try {
+jmsService.delete(name);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public Map info(String connectionFactory, String username, 
String password) throws MBeanException {
+try {
+return jmsService.info(connectionFactory, username, password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public int count(String connectionFactory, String queue, String username, 
String password) throws MBeanException {
+try {
+return jmsService.count(connectionFactory, queue, username, 
password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public List queues(String connectionFactory, String username, 
String password) throws MBeanException {
+try {
+return jmsService.queues(connectionFactory, username, password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public List topics(String connectionFactory, String username, 
String password) throws MBeanException {
+try {
+return jmsService.topics(connectionFactory, username, password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public void send(String connectionFactory, String queue, String content, 
String replyTo, String username, String password) throws MBeanException {
+try {
+jmsService.send(connectionFactory, queue, content, replyTo, 
username, password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public int consume(String connectionFactory, String queue, String 
selector, String username, String password) throws MBeanException {
+try {
+return jmsService.consume(connectionFactory, queue, selector, 
username, password);
+} catch (Throwable t) {
+throw new MBeanException(null, t.getMessage());
+}
+}
+
+@Override
+public int move(String connectionFactory, String source, String 
destination, String selector, String username, String password) throws 
MBeanException {
+try {
+return jmsService.move(connectionFactory, source, destination, 
selector, username, password);
+} catch (Throwable t) {
+throw new 

[13/33] git commit: [KARAF-2888] Refactor repository validation so that we use a single pass, cache the created Schema

2014-04-11 Thread gnodet
[KARAF-2888] Refactor repository validation so that we use a single pass, cache 
the created Schema


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

Branch: refs/heads/master
Commit: 1306af5f222e8bf8925d0e42b0062ec3d367c1d3
Parents: a9b763f
Author: Guillaume Nodet 
Authored: Fri Apr 11 11:14:16 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:03 2014 +0200

--
 features/pom.xml|   4 +
 .../org/apache/karaf/features/Repository.java   |   3 +-
 .../karaf/features/internal/model/JaxbUtil.java | 149 ++-
 .../internal/service/BootFeaturesInstaller.java |   2 +-
 .../internal/service/FeatureValidationUtil.java |  80 +-
 .../internal/service/FeaturesServiceImpl.java   |   4 +-
 .../internal/service/RepositoryImpl.java|  15 +-
 .../service/FeaturesValidationTest.java |  49 +-
 .../karaf/tooling/features/CreateKarMojo.java   |  23 ++-
 .../features/GenerateDescriptorMojo.java|   9 +-
 .../karaf/tooling/features/InstallKarsMojo.java |   9 +-
 .../features/GenerateDescriptorMojoTest.java|   9 +-
 .../java/org/apache/karaf/util/XmlUtils.java|  64 +---
 13 files changed, 231 insertions(+), 189 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/1306af5f/features/pom.xml
--
diff --git a/features/pom.xml b/features/pom.xml
index 5013057..d722ada 100644
--- a/features/pom.xml
+++ b/features/pom.xml
@@ -129,12 +129,16 @@
 org.apache.felix.resolver,
 org.apache.felix.utils.version,
 org.apache.felix.utils.manifest,
+org.apache.karaf.util,
 org.apache.karaf.util.collections,
 org.apache.karaf.util.json,
 org.apache.karaf.util.tracker,
 org.osgi.service.resolver,
 org.osgi.service.repository
 
+
+
org.apache.karaf.util;inline="org/apache/karaf/util/XmlUtils*.class"
+
 
 org.apache.karaf.features.internal.osgi.Activator
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/1306af5f/features/src/main/java/org/apache/karaf/features/Repository.java
--
diff --git a/features/src/main/java/org/apache/karaf/features/Repository.java 
b/features/src/main/java/org/apache/karaf/features/Repository.java
index 6ee96da..3ea12ec 100644
--- a/features/src/main/java/org/apache/karaf/features/Repository.java
+++ b/features/src/main/java/org/apache/karaf/features/Repository.java
@@ -16,6 +16,7 @@
  */
 package org.apache.karaf.features;
 
+import java.io.IOException;
 import java.net.URI;
 
 /**
@@ -23,7 +24,7 @@ import java.net.URI;
  */
 public interface Repository {
 
-String getName();
+String getName() throws IOException;
 
 URI getURI();
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/1306af5f/features/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java 
b/features/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
index 39c057a..2036452 100644
--- 
a/features/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
+++ 
b/features/src/main/java/org/apache/karaf/features/internal/model/JaxbUtil.java
@@ -23,19 +23,27 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.net.URL;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.xml.XMLConstants;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.ValidationEvent;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.stream.XMLInputFactory;
+import javax.xml.namespace.QName;
+import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFa

[01/33] [KARAF-2852] Merge jdbc/core and jdbc/command

2014-04-11 Thread gnodet
Repository: karaf
Updated Branches:
  refs/heads/master 4b6b7afb1 -> fd4b3f677


http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-generic.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-generic.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-generic.xml
new file mode 100644
index 000..090daee
--- /dev/null
+++ 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-generic.xml
@@ -0,0 +1,141 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+ 
+
+
+
+
+
+
+
+ 
+
+ 
+
+ 
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-h2.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-h2.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-h2.xml
new file mode 100644
index 000..19805f4
--- /dev/null
+++ b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-h2.xml
@@ -0,0 +1,31 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-hsql.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-hsql.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-hsql.xml
new file mode 100644
index 000..3ea9ba8
--- /dev/null
+++ b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-hsql.xml
@@ -0,0 +1,31 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mssql.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mssql.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mssql.xml
new file mode 100644
index 000..35e6ed9
--- /dev/null
+++ 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mssql.xml
@@ -0,0 +1,32 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mysql.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mysql.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mysql.xml
new file mode 100644
index 000..012ecaf
--- /dev/null
+++ 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-mysql.xml
@@ -0,0 +1,31 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-oracle.xml
--
diff --git 
a/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-oracle.xml 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-oracle.xml
new file mode 100644
index 000..8168b16
--- /dev/null
+++ 
b/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-oracle.xml
@@ -0,0 +1,31 @@
+
+
+http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/a9b763f2/jdbc/src/main/resources/org/apache/karaf/jdbc/internal/datasource-postgres.xml
--
diff 

[12/33] git commit: [KARAF-2852] Remove obsolete artifacts references

2014-04-11 Thread gnodet
[KARAF-2852] Remove obsolete artifacts references


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

Branch: refs/heads/master
Commit: 286939f9bb41391c06dbbf7a69ecf810d726086d
Parents: 1306af5
Author: Guillaume Nodet 
Authored: Fri Apr 11 11:15:19 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:03 2014 +0200

--
 assemblies/features/standard/pom.xml | 67 +-
 pom.xml  | 95 ---
 2 files changed, 1 insertion(+), 161 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/286939f9/assemblies/features/standard/pom.xml
--
diff --git a/assemblies/features/standard/pom.xml 
b/assemblies/features/standard/pom.xml
index dda4142..e693f54 100644
--- a/assemblies/features/standard/pom.xml
+++ b/assemblies/features/standard/pom.xml
@@ -51,21 +51,11 @@
 provided
 
 
-org.apache.karaf.features
-org.apache.karaf.features.command
-provided
-
-
 org.apache.karaf.instance
 org.apache.karaf.instance.core
 provided
 
 
-org.apache.karaf.instance
-org.apache.karaf.instance.command
-provided
-
-
 org.apache.karaf.jaas
 org.apache.karaf.jaas.modules
 provided
@@ -86,31 +76,16 @@
 provided
 
 
-org.apache.karaf.diagnostic
-org.apache.karaf.diagnostic.command
-provided
-
-
 org.apache.karaf.log
 org.apache.karaf.log.core
 provided
 
 
-org.apache.karaf.log
-org.apache.karaf.log.command
-provided
-
-
 org.apache.karaf.service
 org.apache.karaf.service.core
 provided
 
 
-org.apache.karaf.service
-org.apache.karaf.service.command
-provided
-
-
 org.apache.karaf.shell
 org.apache.karaf.shell.core
 provided
@@ -144,11 +119,6 @@
 org.apache.karaf.wrapper.core
 provided
 
-
-org.apache.karaf.wrapper
-org.apache.karaf.wrapper.command
-provided
-
 
 
 
@@ -177,11 +147,6 @@
 provided
 
 
-org.apache.karaf.obr
-org.apache.karaf.obr.command
-provided
-
-
 org.ops4j.pax.swissbox
 pax-swissbox-lifecycle
 provided
@@ -209,11 +174,6 @@
 org.apache.karaf.config.core
 provided
 
-
-org.apache.karaf.config
-org.apache.karaf.config.command
-provided
-
 
 
 
@@ -223,12 +183,7 @@
 
 
 org.apache.karaf.region
-org.apache.karaf.region.persist
-provided
-
-
-org.apache.karaf.region
-org.apache.karaf.region.command
+org.apache.karaf.region.core
 provided
 
 
@@ -270,11 +225,6 @@
 org.apache.karaf.package.core
 provided
 
-
-org.apache.karaf.package
-org.apache.karaf.package.command
-provided
-
 
 
 
@@ -302,11 +252,6 @@
 org.apache.karaf.http.core
 provided
 
-
-org.apache.karaf.http
-org.apache.karaf.http.command
-provided
-
 
 
 
@@ -362,11 +307,6 @@
 org.apache.karaf.web.core
 provided
 
-
-org.apache.karaf.web
-org.apache.karaf.web.command
-provided
-
 
 
 
@@ -375,11 +315,6 @@
 provided
 
 
-org.apache.karaf.kar
-org.apache.karaf.kar.command
-provided
-
-
 org.apache.karaf.deployer
 org.apache.karaf.deployer.kar
 provided

http://git-wip-us.apache.org/repos/asf/karaf/blob/286939f9/pom.xml
--
diff --git a/pom.xml b/pom.xml
index d5f8423..48c5951 100644
--- a/pom.xml
+++ b/pom.xml
@@ -385,11 +385,6 @@
 
 
 org.apache.karaf.bundle
-org.apache.karaf.b

[04/33] git commit: [KARAF-2888] Better computation of bundles to refresh and print them in simulation

2014-04-11 Thread gnodet
[KARAF-2888] Better computation of bundles to refresh and print them in 
simulation


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

Branch: refs/heads/master
Commit: 53996d9c13aa766b590cfa34a77b738df2c50afa
Parents: 6a19214
Author: Guillaume Nodet 
Authored: Thu Apr 10 23:39:15 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:02 2014 +0200

--
 .../internal/service/FeaturesServiceImpl.java   | 172 ---
 1 file changed, 71 insertions(+), 101 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/53996d9c/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index e6dbc32..0bd1e67 100644
--- 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -69,6 +69,8 @@ import org.osgi.framework.startlevel.BundleStartLevel;
 import org.osgi.framework.wiring.BundleCapability;
 import org.osgi.framework.wiring.BundleRequirement;
 import org.osgi.framework.wiring.BundleRevision;
+import org.osgi.framework.wiring.BundleWire;
+import org.osgi.framework.wiring.BundleWiring;
 import org.osgi.framework.wiring.FrameworkWiring;
 import org.osgi.resource.Resource;
 import org.osgi.resource.Wire;
@@ -793,7 +795,7 @@ public class FeaturesServiceImpl implements FeaturesService 
{
  Collections.emptySet(),
  overrides,
  Collections.emptySet());
-Map> resolution = builder.resolve(systemBundles, 
false);
+Map> resolution = builder.resolve(systemBundles, 
true);
 Collection allResources = resolution.keySet();
 Map providers = builder.getProviders();
 
@@ -858,14 +860,76 @@ public class FeaturesServiceImpl implements 
FeaturesService {
 //
 logDeployment(deployment, verbose);
 
+//
+// Compute the set of bundles to refresh
+//
+Set toRefresh = new HashSet();
+toRefresh.addAll(deployment.toDelete);
+toRefresh.addAll(deployment.toUpdate.keySet());
+
+if (!noRefreshManaged) {
+int size;
+do {
+size = toRefresh.size();
+for (Bundle bundle : bundles) {
+// Continue if we already know about this bundle
+if (toRefresh.contains(bundle)) {
+continue;
+}
+// Ignore non resolved bundle
+BundleWiring wiring = bundle.adapt(BundleWiring.class);
+if (wiring == null) {
+continue;
+}
+// Get through the old resolution and flag this bundle
+// if it was wired to a bundle to be refreshed
+for (BundleWire wire : wiring.getRequiredWires(null)) {
+if 
(toRefresh.contains(wire.getProvider().getBundle())) {
+toRefresh.add(bundle);
+break;
+}
+}
+// Get through the new resolution and flag this bundle
+// if it's wired to any new bundle
+List newWires = resolution.get(wiring.getRevision());
+if (newWires != null) {
+for (Wire wire : newWires) {
+Bundle b = null;
+if (wire.getProvider() instanceof BundleRevision) {
+b = ((BundleRevision) 
wire.getProvider()).getBundle();
+} else {
+b = 
deployment.resToBnd.get(wire.getProvider());
+}
+if (b == null || toRefresh.contains(b)) {
+toRefresh.add(bundle);
+break;
+}
+}
+}
+}
+} while (toRefresh.size() > size);
+}
+if (noRefreshUnmanaged) {
+Set newSet = new HashSet();
+for (Bundle bundle : toRefresh) {
+if (managed.contains(bundle.getBundleId())) {
+newSet.add(b

[14/33] git commit: Make sure aries-util is not referenced in the framework car

2014-04-11 Thread gnodet
Make sure aries-util is not referenced in the framework car


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

Branch: refs/heads/master
Commit: edd82fda337ed048b7c8fa24bb51c917d89bdaea
Parents: 0c8e8a8
Author: Guillaume Nodet 
Authored: Fri Apr 11 19:16:08 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:04 2014 +0200

--
 assemblies/features/framework/pom.xml |  4 
 shell/core/pom.xml| 10 --
 2 files changed, 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/edd82fda/assemblies/features/framework/pom.xml
--
diff --git a/assemblies/features/framework/pom.xml 
b/assemblies/features/framework/pom.xml
index 4675b0a..fd73a47 100644
--- a/assemblies/features/framework/pom.xml
+++ b/assemblies/features/framework/pom.xml
@@ -173,10 +173,6 @@
 
 
 
-org.apache.karaf.region
-org.apache.karaf.region.core
-
-
 org.apache.karaf.features
 org.apache.karaf.features.core
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/edd82fda/shell/core/pom.xml
--
diff --git a/shell/core/pom.xml b/shell/core/pom.xml
index 92c7555..572430c 100644
--- a/shell/core/pom.xml
+++ b/shell/core/pom.xml
@@ -68,16 +68,6 @@
 
 
 
-org.apache.aries.blueprint
-org.apache.aries.blueprint.api
-provided
-
-
-org.apache.aries.blueprint
-org.apache.aries.blueprint.core
-provided
-
-
 org.apache.felix
 org.apache.felix.gogo.runtime
 provided



[05/33] git commit: [KARAF-2888] Call listeners when features are installed or uninstalled

2014-04-11 Thread gnodet
[KARAF-2888] Call listeners when features are installed or uninstalled


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

Branch: refs/heads/master
Commit: 6a19214e566cec14c821aac849c8718a08eadaac
Parents: 4b6b7af
Author: Guillaume Nodet 
Authored: Thu Apr 10 16:27:21 2014 +0200
Committer: Guillaume Nodet 
Committed: Fri Apr 11 19:20:02 2014 +0200

--
 .../internal/service/FeaturesServiceImpl.java   | 28 +---
 1 file changed, 12 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/karaf/blob/6a19214e/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
--
diff --git 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index 6c16650..e6dbc32 100644
--- 
a/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ 
b/features/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -799,7 +799,10 @@ public class FeaturesServiceImpl implements 
FeaturesService {
 
 // Install conditionals
 List installedFeatureIds = getFeatureIds(allResources);
-List installedFeatures = getFeatures(repositories, 
installedFeatureIds);
+List newFeatures = new ArrayList(installedFeatureIds);
+newFeatures.removeAll(installed);
+List delFeatures = new ArrayList(installed);
+delFeatures.removeAll(installedFeatureIds);
 
 //
 // Compute list of installable resources (those with uris)
@@ -955,25 +958,12 @@ public class FeaturesServiceImpl implements 
FeaturesService {
 //
 // Update and save state
 //
-List newFeatures = new ArrayList();
 synchronized (lock) {
-List allFeatures = new ArrayList();
-for (Resource resource : allResources) {
-String name = FeatureNamespace.getName(resource);
-if (name != null) {
-Version version = FeatureNamespace.getVersion(resource);
-String id = version != null ? name + "/" + version : name;
-allFeatures.add(id);
-if (!state.installedFeatures.contains(id)) {
-newFeatures.add(id);
-}
-}
-}
 state.bundleChecksums.putAll(deployment.newCheckums);
 state.features.clear();
 state.features.addAll(features);
 state.installedFeatures.clear();
-state.installedFeatures.addAll(allFeatures);
+state.installedFeatures.addAll(installedFeatureIds);
 state.managedBundles.clear();
 state.managedBundles.addAll(managed);
 saveState();
@@ -1061,7 +1051,13 @@ public class FeaturesServiceImpl implements 
FeaturesService {
 }
 }
 
-// TODO: call listeners for features added and removed
+// Call listeners
+for (Feature feature : getFeatures(repositories, delFeatures)) {
+callListeners(new FeatureEvent(feature, 
FeatureEvent.EventType.FeatureUninstalled, false));
+}
+for (Feature feature : getFeatures(repositories, newFeatures)) {
+callListeners(new FeatureEvent(feature, 
FeatureEvent.EventType.FeatureInstalled, false));
+}
 
 print("Done.", verbose);
 }