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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ClassSource_Aggregate.ScanPolicy
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.java.lang.String
getCanonicalName(java.lang.String classSourceName)
java.util.Map<java.lang.String,java.lang.String>
getCanonicalNames()
java.util.List<? extends ClassSource>
getClassSources()
Answer the entire list of class sources of this aggregate.java.util.Set<? extends ClassSource>
getClassSources(ClassSource_Aggregate.ScanPolicy scanPolicy)
Answer the subset of class sources which have the specified scan policy.java.util.Set<? extends ClassSource>
getExcludedClassSources()
Answer the subset of excluded class sources of this aggregate.java.util.Set<? extends ClassSource>
getExternalClassSources()
Answer the subset of external class sources of this aggregate.java.util.Set<java.lang.String>
getFailedLookups(ClassSource classSource)
ClassSource
getFirstSuccess(java.lang.String resourceName)
java.util.Map<java.lang.String,? extends ClassSource>
getFirstSuccesses()
java.lang.Boolean
getGlobalResult(java.lang.String resourceName)
java.util.Map<java.lang.String,java.lang.Integer>
getLookupCounts()
java.util.Set<? extends ClassSource>
getPartialClassSources()
Answer the subset of partial class sources of this aggregate.long
getRepeatLookups()
ClassSource_Aggregate.ScanPolicy
getScanPolicy(ClassSource classSource)
Tell the scan policy of the class source.java.util.Set<? extends ClassSource>
getSeedClassSources()
Answer the subset of seed class sources of this aggregate.long
getTotalLookups()
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 Detail
-
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.scanPolicy
- The policy to apply to the class source.
-
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
java.util.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
java.util.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
java.util.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
java.util.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
java.util.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
java.util.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
java.lang.String getCanonicalName(java.lang.String classSourceName)
-
getCanonicalNames
java.util.Map<java.lang.String,java.lang.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
java.util.Map<java.lang.String,java.lang.Integer> getLookupCounts()
-
getGlobalResult
java.lang.Boolean getGlobalResult(java.lang.String resourceName)
-
getFailedLookups
java.util.Set<java.lang.String> getFailedLookups(ClassSource classSource)
-
getFirstSuccesses
java.util.Map<java.lang.String,? extends ClassSource> getFirstSuccesses()
-
getFirstSuccess
ClassSource getFirstSuccess(java.lang.String resourceName)
-
-