felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1701875 - in /felix/sandbox/pderop/dependencymanager.ds: cnf/localrepo/ cnf/localrepo/org.apache.felix.framework/ cnf/releaserepo/ org.apache.felix.dependencymanager.annotation/.settings/ org.apache.felix.dependencymanager.benchmark/ org.a...
Date Tue, 08 Sep 2015 21:28:32 GMT
Author: pderop
Date: Tue Sep  8 21:28:31 2015
New Revision: 1701875

URL: http://svn.apache.org/r1701875
Log:
Use felix framework 5.2.0.
Eclipse project cleanup.
Resynchronized org.apache.felix.dependencymanager.ds with current scr from felix-trunk.
Removed osgi.compendium sources from org.apache.felix.dependencymanager.ds/ and import R6
api from maven central.

Added:
    felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/org.apache.felix.framework/org.apache.felix.framework-5.2.0.jar
  (with props)
Removed:
    felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/org.apache.felix.framework/org.apache.felix.framework-5.0.1.jar
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.annotation/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/osgi/
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.samples/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager/.settings/org.eclipse.jdt.core.prefs
Modified:
    felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml
    felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml.sha
    felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml
    felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml.sha
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/index.bndrun
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.bndrun
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.originalscr.bndrun
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/bnd.bnd
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/.settings/org.eclipse.jdt.core.prefs
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/bnd.bnd
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrGogoCommand.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrShellCommand.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ConfigurationSupport.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ScrManagedServiceServiceFactory.java
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/bnd.bnd
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.classpath
    felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.settings/org.eclipse.jdt.core.prefs

Modified: felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
Binary files - no diff available.

Modified: felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml.sha
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml.sha?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml.sha (original)
+++ felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/index.xml.sha Tue Sep  8 21:28:31
2015
@@ -1 +1 @@
-2a8ebeeec6f4b6073630917f331500803f99bac52abb24ce957a629a3ab22395
\ No newline at end of file
+44e75a81d54ba9b03e85cd36e92fa314477a38de6b7ea5845fe0b2a146bff521
\ No newline at end of file

Added: felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/org.apache.felix.framework/org.apache.felix.framework-5.2.0.jar
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/org.apache.felix.framework/org.apache.felix.framework-5.2.0.jar?rev=1701875&view=auto
==============================================================================
Binary file - no diff available.

Propchange: felix/sandbox/pderop/dependencymanager.ds/cnf/localrepo/org.apache.felix.framework/org.apache.felix.framework-5.2.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Modified: felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
Binary files - no diff available.

Modified: felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml.sha
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml.sha?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml.sha (original)
+++ felix/sandbox/pderop/dependencymanager.ds/cnf/releaserepo/index.xml.sha Tue Sep  8 21:28:31
2015
@@ -1 +1 @@
-eb94b8048aa20ec498f20529c2cad6c489c7e2614041671131b3284b91b9b1da
\ No newline at end of file
+82ec81ddaff91be4684bd7fee6659972f6c2403d604218eb6503e5603c9c7f26
\ No newline at end of file

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/index.bndrun
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/index.bndrun?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/index.bndrun
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/index.bndrun
Tue Sep  8 21:28:31 2015
@@ -30,7 +30,7 @@
     org.apache.felix.dependencymanager.benchmark.controller,\
     org.apache.felix.dependencymanager.benchmark.scr;version=latest
 	
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 
 -runproperties:  \
 	ds.loglevel=warn,\

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.bndrun
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.bndrun?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.bndrun
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.bndrun
Tue Sep  8 21:28:31 2015
@@ -30,7 +30,7 @@
     org.apache.felix.dependencymanager.benchmark.dependencymanager.parallel;version=latest,\
     org.apache.felix.dependencymanager.benchmark.controller;version=latest
 	
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 
 -runproperties:  \
 	ds.loglevel=warn,\

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.originalscr.bndrun
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.originalscr.bndrun?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.originalscr.bndrun
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.benchmark/noindex.originalscr.bndrun
Tue Sep  8 21:28:31 2015
@@ -30,7 +30,7 @@
     org.apache.felix.dependencymanager.benchmark.dependencymanager.parallel;version=latest,\
     org.apache.felix.dependencymanager.benchmark.controller;version=latest
 	
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 
 -runproperties:  \
 	ds.loglevel=warn,\

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/.settings/org.eclipse.jdt.core.prefs?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/.settings/org.eclipse.jdt.core.prefs
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/.settings/org.eclipse.jdt.core.prefs
Tue Sep  8 21:28:31 2015
@@ -1,10 +1,4 @@
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/bnd.bnd?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds.itest/bnd.bnd
Tue Sep  8 21:28:31 2015
@@ -1,11 +1,11 @@
 -buildpath:  \
 	org.osgi:org.osgi.core;version=6.0.0,\
+	org.osgi:osgi.cmpn;version=6.0.0,\
 	org.apache.felix.dependencymanager.ds;version=latest,\
-	osgi.enterprise;version=5.0,\
 	${junit},\
 	biz.aQute.bndlib;version=2.4
 -runee: JavaSE-1.8
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 -runsystempackages:  \
 	sun.reflect
 -runvm: -ea

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/.settings/org.eclipse.jdt.core.prefs?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/.settings/org.eclipse.jdt.core.prefs
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/.settings/org.eclipse.jdt.core.prefs
Tue Sep  8 21:28:31 2015
@@ -1,14 +1,4 @@
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/bnd.bnd?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/bnd.bnd
Tue Sep  8 21:28:31 2015
@@ -1,8 +1,8 @@
 Bundle-Version: 1.0.0
 -buildpath:  \
 	org.osgi:org.osgi.core;version=6.0.0,\
+	org.osgi:osgi.cmpn;version=6.0.0,\
 	org.osgi:org.osgi.annotation;version=6.0.0,\
-	org.osgi:org.osgi.enterprise;version=5.0.0,\
 	org.apache.felix:org.apache.felix.utils;version=1.4.2;strategy=exact,\
 	org.codehaus.mojo:animal-sniffer-annotations;version=1.9;strategy=exact,\
 	net.sf.kxml:kxml2;version=2.2.2;strategy=exact,\

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrCommand.java
Tue Sep  8 21:28:31 2015
@@ -33,8 +33,8 @@ import java.util.Map.Entry;
 import java.util.TreeMap;
 import java.util.regex.Pattern;
 
-import org.apache.felix.scr.info.ScrInfo;
 import org.apache.felix.scr.impl.config.ScrConfiguration;
+import org.apache.felix.scr.info.ScrInfo;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -59,7 +59,7 @@ public class ScrCommand implements ScrIn
     private final BundleContext bundleContext;
     private final ServiceComponentRuntime scrService;
     private final ScrConfiguration scrConfiguration;
-    
+
     private ServiceRegistration<ScrInfo> reg;
     private ServiceRegistration<?> gogoReg;
     private ServiceRegistration<?> shellReg;
@@ -147,7 +147,7 @@ public class ScrCommand implements ScrIn
 
     // ---------- Actual implementation
 
-    
+
     public void update( boolean infoAsService )
     {
         if (infoAsService)
@@ -169,26 +169,26 @@ public class ScrCommand implements ScrIn
             }
         }
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.felix.scr.impl.ScrInfo#list(java.lang.String, java.io.PrintStream,
java.io.PrintStream)
      */
     public void list(final String bundleIdentifier, final PrintWriter out)
     {
-        List<ComponentDescriptionDTO> components;
+        List<ComponentConfigurationDTO> components;
 
         if (bundleIdentifier != null)
         {
             Bundle bundle = null;
             try
             {
-                long bundleId = Long.parseLong(bundleIdentifier);
+                final long bundleId = Long.parseLong(bundleIdentifier);
                 bundle = bundleContext.getBundle(bundleId);
             }
-            catch (NumberFormatException nfe)
+            catch (final NumberFormatException nfe)
             {
                 // might be a bundle symbolic name
-                Bundle[] bundles = bundleContext.getBundles();
+                final Bundle[] bundles = bundleContext.getBundles();
                 for (int i = 0; i < bundles.length; i++)
                 {
                     if (bundleIdentifier.equals(bundles[i].getSymbolicName()))
@@ -205,7 +205,11 @@ public class ScrCommand implements ScrIn
             }
             if (ComponentRegistry.isBundleActive(bundle))
             {
-                components = new ArrayList<ComponentDescriptionDTO>(scrService.getComponentDescriptionDTOs(bundle));
+                components = new ArrayList<ComponentConfigurationDTO>();
+                for(final ComponentDescriptionDTO cmp : scrService.getComponentDescriptionDTOs(bundle))
+                {
+                    components.addAll(scrService.getComponentConfigurationDTOs(cmp));
+                }
                 if (components.isEmpty())
                 {
                     out.println("Bundle " + bundleIdentifier + " declares no components");
@@ -220,7 +224,11 @@ public class ScrCommand implements ScrIn
         }
         else
         {
-            components = new ArrayList<ComponentDescriptionDTO>(scrService.getComponentDescriptionDTOs());
+            components = new ArrayList<ComponentConfigurationDTO>();
+            for(final ComponentDescriptionDTO cmp : scrService.getComponentDescriptionDTOs())
+            {
+                components.addAll(scrService.getComponentConfigurationDTOs(cmp));
+            }
             if (components.isEmpty())
             {
                 out.println("No components registered");
@@ -228,42 +236,42 @@ public class ScrCommand implements ScrIn
             }
         }
 
-        Collections.sort( components, new Comparator<ComponentDescriptionDTO>()
+        Collections.sort( components, new Comparator<ComponentConfigurationDTO>()
                 {
 
-                    public int compare(ComponentDescriptionDTO c1, ComponentDescriptionDTO
c2)
+                    public int compare(final ComponentConfigurationDTO c1, final ComponentConfigurationDTO
c2)
                     {
-                        return c1.name.compareTo(c2.name);
+                        return Long.signum(c1.id - c2.id);
                     }
 
                 });
 
-        out.println(" Name  BundleId DefaultEnabled");
-        for ( ComponentDescriptionDTO component : components )
+        out.println(" Id   State BundleId Name");
+        for ( final ComponentConfigurationDTO component : components )
         {
-            out.println( String.format( "[%1$s] [%2$4d] [%3$b]", component.name, component.bundle.id,
component.defaultEnabled ) );
+            out.println( String.format( "[%1$4d] [%2$s] [%3$4d] %4$s", component.id, toStateString(
component.state ), component.description.bundle.id, component.description.name ) );
         }
         out.flush();
    }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.felix.scr.impl.ScrInfo#info(java.lang.String, java.io.PrintStream,
java.io.PrintStream)
      */
-    public void info(final String componentId, PrintWriter out)
+    public void info(final String componentId, final PrintWriter out)
     {
-        Collection<ComponentDescriptionDTO> components = getComponentFromArg(componentId);
-        if (components == null)
+        final Result result = getComponentsFromArg(componentId, false);
+        if (result.components.isEmpty())
         {
             return;
         }
 
-        Collections.sort( new ArrayList<ComponentDescriptionDTO>(components), new Comparator<ComponentDescriptionDTO>()
+        Collections.sort( new ArrayList<ComponentDescriptionDTO>(result.components),
new Comparator<ComponentDescriptionDTO>()
                 {
 
-                    public int compare(ComponentDescriptionDTO c1, ComponentDescriptionDTO
c2)
+                    public int compare(final ComponentDescriptionDTO c1, final ComponentDescriptionDTO
c2)
                     {
-                        long bundleId1 = c1.bundle.id;
-                        long bundleId2 = c2.bundle.id;
+                        final long bundleId1 = c1.bundle.id;
+                        final long bundleId2 = c2.bundle.id;
                         int result = Long.signum(bundleId1 - bundleId2);
                         if ( result == 0)
                         {
@@ -276,7 +284,7 @@ public class ScrCommand implements ScrIn
 
         long bundleId = -1;
 
-        for ( ComponentDescriptionDTO component : components )
+        for ( ComponentDescriptionDTO component : result.components )
         {
             if ( component.bundle.id != bundleId )
             {
@@ -367,9 +375,16 @@ public class ScrCommand implements ScrIn
 
             Map<String, Object> props = component.properties;
             propertyInfo(props, out, "");
-            for (ComponentConfigurationDTO cc: scrService.getComponentConfigurationDTOs(component))
+            if ( result.configuration != null )
             {
-                info(cc, out);
+                info(result.configuration, out);
+            }
+            else
+            {
+                for (final ComponentConfigurationDTO cc: scrService.getComponentConfigurationDTOs(component))
+                {
+                    info(cc, out);
+                }
             }
         }
 
@@ -468,16 +483,11 @@ public class ScrCommand implements ScrIn
         propertyInfo( cc.properties, out, "    ");
     }
 
-    void change(final String componentIdentifier, PrintWriter out, boolean enable)
+    void change(final String componentIdentifier, final PrintWriter out, final boolean enable)
     {
-        Collection<ComponentDescriptionDTO> components = getComponentFromArg(componentIdentifier);
-        ArrayList<String> disposed = new ArrayList<String>();
-        if (components == null)
-        {
-            return;
-        }
+        final Result result = getComponentsFromArg(componentIdentifier, true);
 
-        for ( ComponentDescriptionDTO component : components )
+        for ( final ComponentDescriptionDTO component : result.components )
         {
             if ( enable )
             {
@@ -505,17 +515,12 @@ public class ScrCommand implements ScrIn
             }
         }
         out.flush();
-        if ( !disposed.isEmpty() )
-        {
-            throw new IllegalArgumentException( "Components " + disposed + " already disposed,
cannot change state" );
-
-        }
     }
 
-    /* (non-Javadoc)
+    /**
      * @see org.apache.felix.scr.impl.ScrInfo#config(java.io.PrintStream)
      */
-    public void config(PrintWriter out)
+    public void config(final PrintWriter out)
     {
         out.print("Log Level: ");
         out.println(scrConfiguration.getLogLevel());
@@ -531,45 +536,75 @@ public class ScrCommand implements ScrIn
         out.println(scrConfiguration.globalExtender());
         out.print("Info Service registered: ");
         out.println(scrConfiguration.infoAsService() ? "Supported" : "Unsupported");
+        out.flush();
     }
 
-    private String toStateString(int state)
+    private String toStateString(final int state)
     {
-        switch (state) {
+        switch (state)
+        {
 
         case (ComponentConfigurationDTO.UNSATISFIED_REFERENCE):
             return "unsatisfied reference";
         case (ComponentConfigurationDTO.ACTIVE):
             return "active      ";
         case (ComponentConfigurationDTO.SATISFIED):
-            return "satisfied  ";
+            return "satisfied   ";
+        case (ComponentConfigurationDTO.UNSATISFIED_CONFIGURATION):
+            return "unsatisfied config";
         default:
             return "unkown: " + state;
         }
     }
 
-    private Collection<ComponentDescriptionDTO> getComponentFromArg(final String componentIdentifier)
+    private static final class Result {
+        public Collection<ComponentDescriptionDTO> components = new ArrayList<ComponentDescriptionDTO>();
+        public ComponentConfigurationDTO configuration;
+    }
+
+    private Result getComponentsFromArg(final String componentIdentifier, final boolean nameMatch)
     {
-        Collection<ComponentDescriptionDTO> components = scrService.getComponentDescriptionDTOs();
-        if (componentIdentifier != null)
+        final Pattern p = (componentIdentifier == null ? null : Pattern.compile(componentIdentifier));
+        final Result result = new Result();
+
+        for(final ComponentDescriptionDTO cmp : scrService.getComponentDescriptionDTOs())
         {
-            ArrayList<ComponentDescriptionDTO> cs = new ArrayList<ComponentDescriptionDTO>(components.size());
-            Pattern p = Pattern.compile(componentIdentifier);
-            for (ComponentDescriptionDTO component: components)
+            if (componentIdentifier != null)
             {
-                if ( p.matcher( component.name).matches() )
+                if ( p.matcher(cmp.name).matches() )
                 {
-                    cs.add( component );
+                    result.components.add(cmp);
+                }
+                else if ( !nameMatch )
+                {
+                    boolean done = false;
+                    for (final ComponentConfigurationDTO cfg: scrService.getComponentConfigurationDTOs(cmp))
+                    {
+                        if ( p.matcher( String.valueOf( cfg.id )).matches() )
+                        {
+                            result.components.add( cmp );
+                            result.configuration = cfg;
+                            done = true;
+                            break;
+                        }
+                    }
+                    if ( done )
+                    {
+                        break;
+                    }
                 }
             }
-            if (cs.isEmpty())
+            else
             {
-                throw new IllegalArgumentException("No Component with ID or matching " +
componentIdentifier);
+                result.components.add(cmp);
             }
-            components = cs;
+        }
+        if (componentIdentifier != null && result.components.isEmpty())
+        {
+            throw new IllegalArgumentException("No Component with name or configuration with
ID matching " + componentIdentifier);
         }
 
-        return components;
+        return result;
     }
 
 }

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrGogoCommand.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrGogoCommand.java?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrGogoCommand.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrGogoCommand.java
Tue Sep  8 21:28:31 2015
@@ -56,7 +56,7 @@ class ScrGogoCommand
         this.scrCommand = scrCommand;
     }
 
-    @Descriptor("List all components")
+    @Descriptor("List all component configurations")
     public void list()
     {
         try
@@ -69,7 +69,7 @@ class ScrGogoCommand
         }
     }
 
-    @Descriptor("List components of a specific bundle")
+    @Descriptor("List component configurations of a specific bundle")
     public void list(@Descriptor("Symbolic name or ID of the bundle") final String bundleIdentifier)
     {
         try
@@ -82,8 +82,8 @@ class ScrGogoCommand
         }
     }
 
-    @Descriptor("Dump information of a component")
-    public void info(@Descriptor("Name or ID of the component") final String componentIdentifier)
+    @Descriptor("Dump information of a component or component configuration")
+    public void info(@Descriptor("Name of the component or ID of the component configuration")
final String componentIdentifier)
     {
         try
         {
@@ -96,7 +96,7 @@ class ScrGogoCommand
     }
 
     @Descriptor("Enable a disabled component")
-    public void enable(@Descriptor("Name or ID of the component") final String componentIdentifier)
+    public void enable(@Descriptor("Name of the component") final String componentIdentifier)
     {
         try
         {
@@ -109,7 +109,7 @@ class ScrGogoCommand
     }
 
     @Descriptor("Disable an enabled component")
-    public void disable(@Descriptor("Name or ID of the component") final String componentIdentifier)
+    public void disable(@Descriptor("Name of the component") final String componentIdentifier)
     {
         try
         {

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrShellCommand.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrShellCommand.java?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrShellCommand.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/ScrShellCommand.java
Tue Sep  8 21:28:31 2015
@@ -118,8 +118,8 @@ class ScrShellCommand implements Command
             out.println("");
             out.println("scr " + LIST_CMD + " [ <bundleId> ]");
             out.println("");
-            out.println("This command lists registered components. If a bundle ID is\n"
-                + "added, only the components of the selected bundles are listed.");
+            out.println("This command lists registered component configurations. If a bundle
ID is\n"
+                + "added, only the component configurations of the selected bundles are listed.");
             out.println("");
         }
         else if (INFO_CMD.equals( command ))
@@ -128,23 +128,23 @@ class ScrShellCommand implements Command
             out.println("scr " + INFO_CMD + " <componentId>");
             out.println("");
             out.println("This command dumps information of the component whose\n"
-                + "component ID is given as command argument.");
+                + "component name or component configuration ID is given as command argument.");
             out.println("");
         }
         else if (ENABLE_CMD.equals( command ))
         {
             out.println("");
-            out.println("scr " + ENABLE_CMD + " <componentId>");
+            out.println("scr " + ENABLE_CMD + " <componentName>");
             out.println("");
-            out.println("This command enables the component whose component ID\n" + "is given
as command argument.");
+            out.println("This command enables the component whose component name\n" + "is
given as command argument.");
             out.println("");
         }
         else if (DISABLE_CMD.equals( command ))
         {
             out.println("");
-            out.println("scr " + DISABLE_CMD + " <componentId>");
+            out.println("scr " + DISABLE_CMD + " <componentName>");
             out.println("");
-            out.println("This command disables the component whose component ID\n" + "is
given as command argument.");
+            out.println("This command disables the component whose component name\n" + "is
given as command argument.");
             out.println("");
         }
         else if (CONFIG_CMD.equals( command ))
@@ -160,8 +160,8 @@ class ScrShellCommand implements Command
             out.println("scr " + HELP_CMD + " [" + LIST_CMD + "]");
             out.println("scr " + LIST_CMD + " [ <bundleId> ]");
             out.println("scr " + INFO_CMD + " <componentId>");
-            out.println("scr " + ENABLE_CMD + " <componentId>");
-            out.println("scr " + DISABLE_CMD + " <componentId>");
+            out.println("scr " + ENABLE_CMD + " <componentName>");
+            out.println("scr " + DISABLE_CMD + " <componentName>");
             out.println("scr " + CONFIG_CMD);
         }
     }

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ConfigurationSupport.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ConfigurationSupport.java?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ConfigurationSupport.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ConfigurationSupport.java
Tue Sep  8 21:28:31 2015
@@ -95,8 +95,10 @@ public class ConfigurationSupport implem
         }
     }
 
-    // ---------- BaseConfigurationSupport overwrites
-
+    /**
+     * The return value is only relevant for the call from {@link #configurationEvent(ConfigurationEvent)}
+     * in the case of a deleted configuration which is not a factory configuration!
+     */
     public boolean configureComponentHolder(final ComponentHolder<?> holder)
     {
 
@@ -127,9 +129,9 @@ public class ConfigurationSupport implem
                                         bundleContext.getBundle() );
                                 if ( !factory.isEmpty() )
                                 {
+                                    boolean created = false;
                                     for ( Configuration config: factory )
                                     {
-                                        boolean created = false;
                                         Activator.log( LogService.LOG_DEBUG, null,
                                                 "Configuring holder {0} with factory configuration
{1}", new Object[] {
                                                         holder, config }, null );
@@ -142,10 +144,10 @@ public class ConfigurationSupport implem
                                                     config.getProperties(),
                                                     changeCount );
                                         }
-                                        if ( !created )
-                                        {
-                                        	return false;
-                                        }
+                                    }
+                                    if ( !created )
+                                    {
+                                        return false;
                                     }
                                 }
                                 else

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ScrManagedServiceServiceFactory.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ScrManagedServiceServiceFactory.java?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ScrManagedServiceServiceFactory.java
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.ds/src/org/apache/felix/scr/impl/config/ScrManagedServiceServiceFactory.java
Tue Sep  8 21:28:31 2015
@@ -59,7 +59,7 @@ public class ScrManagedServiceServiceFac
                     LogService.LOG_ERROR,
                     null,
                     "Cannot create MetaType providing ManagedService; not providing Metatype
information but just accepting configuration",
-                    t );
+                    null );
         }
         return new ScrManagedService( this.scrConfiguration );
     }

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/bnd.bnd?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.itest/bnd.bnd
Tue Sep  8 21:28:31 2015
@@ -23,7 +23,7 @@
 	org.apache.felix.dependencymanager.shell;version=latest
 -runee: JavaSE-1.8
 -runvm: -ea
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 -buildpath:  \
 	osgi.core;version=4.2,\
 	osgi.cmpn;version=4.2,\

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.runtime.itest/bnd.bnd
Tue Sep  8 21:28:31 2015
@@ -31,7 +31,7 @@
 	org.apache.felix.dependencymanager.runtime;version=latest,\
 	org.apache.felix.dependencymanager.shell;version=latest
 -runee: JavaSE-1.8
--runfw: org.apache.felix.framework;version=5.0.1
+-runfw: org.apache.felix.framework;version=5.2
 -runsystempackages: \
 	sun.reflect
 -runvm:-ea

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.classpath
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.classpath?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
Binary files - no diff available.

Modified: felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.settings/org.eclipse.jdt.core.prefs?rev=1701875&r1=1701874&r2=1701875&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.settings/org.eclipse.jdt.core.prefs
(original)
+++ felix/sandbox/pderop/dependencymanager.ds/org.apache.felix.dependencymanager.shell/.settings/org.eclipse.jdt.core.prefs
Tue Sep  8 21:28:31 2015
@@ -1,11 +1,7 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8



Mime
View raw message