com.sun.enterprise.tools.verifier.hk2
Class PackageAnalyser

java.lang.Object
  extended by com.sun.enterprise.tools.verifier.hk2.PackageAnalyser

public class PackageAnalyser
extends Object

A class that inspects module definitions of a bundle and processes them to come up with package dependency matrix, split-packages, etc. Does not handle version information correctly while matching exporter to importers, so it assumes a package or a bundle has only one version at any given time in a distribution.

Author:
Sanjeeb.Sahoo@Sun.COM

Nested Class Summary
static class PackageAnalyser.Bundle
          A dats structure to capture bundle details needed for our processing.
static class PackageAnalyser.PackageCapability
          Holds information about an exported package.
static class PackageAnalyser.SplitPackage
          Holds information about a split-package.
static class PackageAnalyser.Wire
          A wire represents a connection between an exporter bundle to an importer bundle for a particular package.
 
Field Summary
 Set<PackageAnalyser.Bundle> bundles
           
 
Constructor Summary
PackageAnalyser(Repository moduleRepository)
           
PackageAnalyser(Repository repo, Logger logger)
           
 
Method Summary
 void analyse(PackageAnalyser.Bundle bundle)
          Analyse the dependency of a bundle and updates it in the given bundle object.
 Collection<PackageAnalyser.Wire> analyseWirings()
          Analyse package wiring between bundles.
 Set<PackageAnalyser.Bundle> findAllBundles()
           
 Collection<String> findAllExportedPackageNames()
           
 Collection<PackageAnalyser.PackageCapability> findAllExportedPackages()
           
 Collection<PackageAnalyser.SplitPackage> findDuplicatePackages()
          Inspects bundles and reports duplicate packages.
 Collection<PackageAnalyser.PackageCapability> findUnusedExports()
           
 Collection<PackageAnalyser.PackageCapability> findUnusedExports(PackageAnalyser.Bundle exporter)
          Find unused exported packages for a given bundle
 void generateBundleReport(PrintStream out)
           
 void generateWiringReport(Collection<PackageAnalyser.PackageCapability> exportedPkgs, Collection<PackageAnalyser.Wire> wires, PrintStream out)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundles

public Set<PackageAnalyser.Bundle> bundles
Constructor Detail

PackageAnalyser

public PackageAnalyser(Repository moduleRepository)

PackageAnalyser

public PackageAnalyser(Repository repo,
                       Logger logger)
Method Detail

analyse

public void analyse(PackageAnalyser.Bundle bundle)
             throws IOException
Analyse the dependency of a bundle and updates it in the given bundle object.

Parameters:
bundle - to be analysed
Throws:
IOException

analyseWirings

public Collection<PackageAnalyser.Wire> analyseWirings()
                                                throws IOException
Analyse package wiring between bundles. This method ignores

Returns:
Throws:
IOException

findDuplicatePackages

public Collection<PackageAnalyser.SplitPackage> findDuplicatePackages()
Inspects bundles and reports duplicate packages. Before calling this method, you must call this#analyseWirings() The colection is already sorted.

Returns:
set of split-packages, en empty set if none is found.

findAllExportedPackages

public Collection<PackageAnalyser.PackageCapability> findAllExportedPackages()

findAllExportedPackageNames

public Collection<String> findAllExportedPackageNames()

findAllBundles

public Set<PackageAnalyser.Bundle> findAllBundles()

findUnusedExports

public Collection<PackageAnalyser.PackageCapability> findUnusedExports()

findUnusedExports

public Collection<PackageAnalyser.PackageCapability> findUnusedExports(PackageAnalyser.Bundle exporter)
Find unused exported packages for a given bundle

Parameters:
exporter -
Returns:

generateWiringReport

public void generateWiringReport(Collection<PackageAnalyser.PackageCapability> exportedPkgs,
                                 Collection<PackageAnalyser.Wire> wires,
                                 PrintStream out)

generateBundleReport

public void generateBundleReport(PrintStream out)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2013 Oracle Corporation. All Rights Reserved.