geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r886300 - /geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
Date Wed, 02 Dec 2009 21:00:06 GMT
Author: gawor
Date: Wed Dec  2 21:00:05 2009
New Revision: 886300

URL: http://svn.apache.org/viewvc?rev=886300&view=rev
Log:
display required bundles and fragment info

Modified:
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java?rev=886300&r1=886299&r2=886300&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/DisplayManifestMojo.java
Wed Dec  2 21:00:05 2009
@@ -33,7 +33,9 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.BundleSpecification;
 import org.eclipse.osgi.service.resolver.ExportPackageDescription;
+import org.eclipse.osgi.service.resolver.HostSpecification;
 import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
 import org.osgi.framework.BundleException;
 
@@ -79,17 +81,21 @@
         stateController.resolveState();
         BundleDescription b = stateController.getBundleDescription(target);             
  
         if (b != null) {
-            displayImportExports(b);
+            displayManifest(b);
         }    
     }
 
-    private void displayImportExports(BundleDescription b) {
+    private void displayManifest(BundleDescription b) {
         System.out.println("Bundle: " + b.getSymbolicName());
         displayImports(b, ImportPackageSpecification.RESOLUTION_STATIC, "Imports:");
         displayImports(b, ImportPackageSpecification.RESOLUTION_OPTIONAL, "Optional Imports:");
         displayImports(b, ImportPackageSpecification.RESOLUTION_DYNAMIC, "Dynamic Imports:");
-                    
+                            
         displayExports(b);
+        
+        displayRequiredBundles(b);
+        
+        displayFragments(b);
     }
     
     
@@ -132,6 +138,26 @@
         }
         return imports;
     }
+        
+    private void displayRequiredBundles(BundleDescription b) {
+        BundleSpecification[] bundles = b.getRequiredBundles();
+        if (bundles != null && bundles.length > 0) {
+            System.out.println("Requires Bundles:");
+            for (BundleSpecification bundle : bundles) {
+                System.out.println(TAB + bundle.getName()); 
+            }
+            System.out.println();
+        }
+    }
+    
+    private void displayFragments(BundleDescription b) {
+        HostSpecification host = b.getHost();
+        if (host != null) {
+            System.out.println("Fragments:");
+            System.out.println(TAB + host);
+            System.out.println();
+        }
+    }
     
     public void setLog(Log log) {
         this.log = log;



Mime
View raw message