Interface ClassSource_Aggregate
- All Superinterfaces:
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.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Control value for processing web module components. -
Field Summary
Fields inherited from interface com.ibm.wsspi.anno.classsource.ClassSource
CLASS_EXTENSION, CLASS_SEPARATOR_CHAR, INNER_CLASS_SEPARATOR, RESOURCE_SEPARATOR_CHAR, RESOURCE_SEPARATOR_STRING
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassSource
(ClassSource classSource) Main API to add new class sources.void
addClassSource
(ClassSource classSource, ClassSource_Aggregate.ScanPolicy scanPolicy) Main API to add new class sources.getCanonicalName
(String classSourceName) List<? extends ClassSource>
Answer the entire list of class sources of this aggregate.Set<? extends ClassSource>
getClassSources
(ClassSource_Aggregate.ScanPolicy scanPolicy) Answer the subset of class sources which have the specified scan policy.Set<? extends ClassSource>
Answer the subset of excluded class sources of this aggregate.Set<? extends ClassSource>
Answer the subset of external class sources of this aggregate.getFailedLookups
(ClassSource classSource) getFirstSuccess
(String resourceName) Map<String,
? extends ClassSource> getGlobalResult
(String resourceName) Set<? extends ClassSource>
Answer the subset of partial class sources of this aggregate.long
getScanPolicy
(ClassSource classSource) Tell the scan policy of the class source.Set<? extends ClassSource>
Answer the subset of seed class sources of this aggregate.long
void
scanClasses
(ClassSource_Streamer streamer) Scan the classes of the class source using a supplied streamer.Methods inherited from interface com.ibm.wsspi.anno.classsource.ClassSource
close, closeClassStream, closeResourceStream, getCanonicalName, getClassExclusionCount, getClassInclusionCount, getClassNameFromResourceName, getFactory, getHashText, getInternMap, getName, getOptions, getParentSource, getResourceExclusionCount, getResourceNameFromClassName, getResult, getScanResults, inconvertResourceName, isClassResource, isDirectoryResource, isProcessedUsingJandex, log, logState, open, openClassStream, openResourceStream, outconvertResourceName, resourceAppend, scanClasses, scanReferencedClass, scanSpecificSeedClass, setParentSource
-
Method Details
-
addClassSource
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
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
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
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
-
getCanonicalNames
-
scanClasses
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
-
getGlobalResult
-
getFailedLookups
-
getFirstSuccesses
Map<String,? extends ClassSource> getFirstSuccesses() -
getFirstSuccess
-