FELIX-1530 Extend the "scr info" command to print the configuration policy
and the activate, deactivate and modified methods names.
Enhance the "scr list" command to indicate inactive bundles instead of
irritatingly listing them as not declaring components.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@824124 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
index 4d14abf..6401852 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
@@ -136,10 +136,18 @@
                     err.println( "Missing bundle with ID " + bundleId );
                     return;
                 }
-                components = scrService.getComponents( bundle );
-                if ( components == null )
+                if ( bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STARTING )
                 {
-                    out.println( "Bundle " + bundleId + " declares no components" );
+                    components = scrService.getComponents( bundle );
+                    if ( components == null )
+                    {
+                        out.println( "Bundle " + bundleId + " declares no components" );
+                        return;
+                    }
+                }
+                else
+                {
+                    out.println( "Bundle " + bundleId + " is not active" );
                     return;
                 }
             }
@@ -194,6 +202,34 @@
         out.print( "Activation: " );
         out.println( component.isImmediate() ? "immediate" : "delayed" );
 
+        // DS 1.1 new features
+        out.print( "Configuration Policy: " );
+        out.println( component.getConfigurationPolicy() );
+        out.print( "Activate Method: " );
+        out.print( component.getActivate() );
+        if ( component.isActivateDeclared() )
+        {
+            out.print( " (declared in the descriptor)" );
+        }
+        out.println();
+        out.print( "Deactivate Method: " );
+        out.print( component.getDeactivate() );
+        if ( component.isDeactivateDeclared() )
+        {
+            out.print( " (declared in the descriptor)" );
+        }
+        out.println();
+        out.print( "Modified Method: " );
+        if ( component.getModified() != null )
+        {
+            out.print( component.getModified() );
+        }
+        else
+        {
+            out.print( "-" );
+        }
+        out.println();
+
         if ( component.getFactory() != null )
         {
             out.print( "Factory: " );