Interface ClassSource_Aggregate

All Superinterfaces:
ClassSource

public interface ClassSource_Aggregate extends ClassSource

Aggregator of class sources.

An important detail for child class sources is the scan policy which is set for the child class source. These are mainly used for WEB modules, which must carefully partition the scan results depending on scan policy.

Servlet annotations in metadata-complete and excluded locations of a WAR file are ignored. Servlet Container Initializer (SCI) and Manage Beans annotations are processing in all locations of a WAR file.

For JAR type modules (EJB and Client), child class sources are obtained for these parts of the module class path:

  • The JAR contents
  • MANIFEST Class-Path jars
  • Application library jars
  • The external references class loader

For a WEB module, child class sources are obtained for these parts of the web module class path:

  • WEB-INF/classes
  • WEB-INF/lib/*.jar
  • MANIFEST Class-Path jars
  • Application library jars
  • The external references class loader

The classes directory should be represented by a single class source. Each WEB-INF/lib jar should be represented by a single class source. The remainder of the class path may be represented by one or several class sources.

Scan policies are set as:

  • SEED
  • PARTIAL
  • EXCLUDED
  • EXTERNAL

For a web module, in all cases, all locations outside of the web module archive are marked as EXTERNAL. Locations within the web module archive are marked using the following specialized rules:

A web module with no locations marked as metadata-complete and with no absolute ordering will have WEB-INF/classes and all WEB-INF library jars marked as SEED.

A web module which is not metadata-complete and which has some jars marked as metadata-complete, and which has no absolute ordering, has WEB-INF/classes marked as SEED, has the non-metadata complete jars marked as PARTIAL.

A web module which is metadata-complete and which has an absolute ordering has WEB-INF/classes marked as PARTIAL and has jars marked as PARTIAL or EXCLUDED depending on which jars are present in the absolute ordering.

A web module which is not metadata-complete and which has an absolute ordering has WEB-INF/classes marked as SEED, has non-metadata-complete jars which are listed in the absolute ordering marked as SEED, has metadata-complete jars which are listed in the absolute ordering marked as PARTIAL, and has other jars not listed in the absolute ordering marked as EXCLUDED.

During scans, annotations are read from all SEED, PARTIAL, and EXCLUDED locations. The scan places the annotations data for these locations in independent storage, allowing each subset of annotations to be independently queried.

During scans, class information is read for all classes in SEED and PARTIAL locations. Class information for EXCLUDED and EXTERNAL locations is read only to complete class information for other classes.

  • Method Details

    • addClassSource

      void addClassSource(ClassSource classSource)

      Main API to add new class sources. Note that the added class source need not have the same factory as the aggregate class source. Add the class source with the SEED scan policy.

      Parameters:
      classSource - The class source to add to this aggregate.
    • addClassSource

      void addClassSource(ClassSource classSource, ClassSource_Aggregate.ScanPolicy scanPolicy)

      Main API to add new class sources. Note that the added class source need not have the same factory as the aggregate class source. Add the class source using the supplied scan policy.

      Parameters:
      classSource - The class source to add to this aggregate.
      scanPolicy - The policy to apply to the class source.
    • getClassSources

      List<? extends ClassSource> getClassSources()

      Answer the entire list of class sources of this aggregate.

      The order is significant, and is used to handle precedence for classes with multiple occurrences.

      Returns:
      The entire list of class sources of this aggregate.
    • getClassSources

      Set<? extends ClassSource> getClassSources(ClassSource_Aggregate.ScanPolicy scanPolicy)

      Answer the subset of class sources which have the specified scan policy.

      Parameters:
      scanPolicy - The scan policy on which to select class sources.
      Returns:
      The class sources which have the specified scan policy.
    • getSeedClassSources

      Set<? extends ClassSource> getSeedClassSources()

      Answer the subset of seed class sources of this aggregate.

      Unless partial class sources are defined, the sets of seed and excluded class sources partition the entire list of class sources. When partial class sources are defined, the seed, partial, and excluded class sources partition the entire list of class sources.

      Returns:
      The subset of seed class sources of this aggregate.
    • getPartialClassSources

      Set<? extends ClassSource> getPartialClassSources()

      Answer the subset of partial class sources of this aggregate.

      Returns:
      The subset of partial class sources of this aggregate.
    • getExcludedClassSources

      Set<? extends ClassSource> getExcludedClassSources()

      Answer the subset of excluded class sources of this aggregate.

      Returns:
      The subset of excluded class sources of this aggregate.
    • getExternalClassSources

      Set<? extends ClassSource> getExternalClassSources()

      Answer the subset of external class sources of this aggregate.

      Returns:
      The subset of external class sources of this aggregate.
    • getScanPolicy

      ClassSource_Aggregate.ScanPolicy getScanPolicy(ClassSource classSource)

      Tell the scan policy of the class source.

      Parameters:
      classSource - The class source for which to tell the scan policy.
      Returns:
      The scan policy of the class source.
    • getCanonicalName

      String getCanonicalName(String classSourceName)
    • getCanonicalNames

      Map<String,String> getCanonicalNames()
    • scanClasses

      void scanClasses(ClassSource_Streamer streamer)

      Scan the classes of the class source using a supplied streamer.

      Parameters:
      streamer - A selection and processing helper for the scan operation.
    • getTotalLookups

      long getTotalLookups()
    • getRepeatLookups

      long getRepeatLookups()
    • getLookupCounts

      Map<String,Integer> getLookupCounts()
    • getGlobalResult

      Boolean getGlobalResult(String resourceName)
    • getFailedLookups

      Set<String> getFailedLookups(ClassSource classSource)
    • getFirstSuccesses

      Map<String,? extends ClassSource> getFirstSuccesses()
    • getFirstSuccess

      ClassSource getFirstSuccess(String resourceName)