Interface WebAnnotations


  • public interface WebAnnotations
    Main link for web module annotation related services. The annotation services type acts as a Future, as a Future, and as a Future, with the sharing of a single class source between the other two futures. Current references are from: com.ibm.ws.webcontainer.osgi.DeployedModImpl.adapt(Class) That adapt implementation provides three entries into the annotation services:
    1. DeployedModule adapt to ClassSource_Aggregate
    2. DeployedModule adapt to AnnotationTargets_Targets
    3. DeployedModule adapt to ClassSource
    Notification plan: Adaptation to annotation targets requires a possibly time consuming scan. Informational messages are generated for the initiation of a scan, and for the completion of a scan.

    Note on fragment paths:

    These are specified through a complete, ordered, list, and through the partition of that list into included partial and excluded locations. Seed locations are fragment jars which are neither metadata-complete nor were excluded because they were omitted from an absolute ordering. Partial locations are those which are metadata-complete and not omitted from an absolute ordering. Excluded locations are those which were omitted because an absolute ordering is specified, and no others element is specified. The excluded locations are those which were not specified in the absolute ordering explicit listing.

    Note that exclusion has precedence over metadata-complete.

    Fragment paths are relative to the "WEB-INF/lib" folder, not to the rot web module container.

    Included locations are scanned for annotations and for class relationship information. Partial locations are scanned only for class relationship information. Excluded locations are scanned only for class relationship information, and only as required to complete class relationship information for referenced classes.

    Class relationship information is the class to superclass and the class to implements relationships.

    • Method Detail

      • getOrderedItems

        java.util.List<WebFragmentInfo> getOrderedItems()
                                                 throws com.ibm.wsspi.adaptable.module.UnableToAdaptException
        Answer the ordered list of fragment items.
        Returns:
        The ordered list of fragment items.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown in case of an error processing fragment metadata.
      • getExcludedItems

        java.util.List<WebFragmentInfo> getExcludedItems()
                                                  throws com.ibm.wsspi.adaptable.module.UnableToAdaptException
        Answer the list of excluded fragment items.
        Returns:
        The list of excluded fragment items.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown in case of an error processing fragment metadata.
      • getClassSource

        com.ibm.wsspi.anno.classsource.ClassSource_Aggregate getClassSource()
                                                                     throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer the class source of the module. This includes the WEB-INF/classes location and all fragments, in their proper order. Only WEB-INF/classes and included fragments paths are marked as seed locations.

        Returns:
        The web module class source.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
        See Also:
        #getOrderedFragmentPaths(), #getIncludedFragmentPaths(), #getExcludedFragmentPaths(), #getExternalFragmentPaths()
      • getAnnotationTargets

        com.ibm.wsspi.anno.targets.AnnotationTargets_Targets getAnnotationTargets()
                                                                           throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer the main annotation targets of the module. This uses the common web module class source.

        Returns:
        The main annotation targets for the module.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
        See Also:
        getClassSource()
      • isIncludedClass

        boolean isIncludedClass​(java.lang.String className)
                         throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Tell if the target class was scanned from an included fragment.

        Parameters:
        className - The name of the target class.
        Returns:
        True if the target class was scanned from an included fragment. Otherwise, false.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • isPartialClass

        boolean isPartialClass​(java.lang.String className)
                        throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Tell if the target class was scanned from a partial (metadata-complete) fragment.

        Parameters:
        className - The name of the target class.
        Returns:
        True if the target class was scanned from a partial fragment. Otherwise, false.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • isExcludedClass

        boolean isExcludedClass​(java.lang.String className)
                         throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Tell if the target class was scanned from an excluded location.

        Parameters:
        className - The name of the target class.
        Returns:
        True if the target class was scanned from an excluded location. Otherwise, false.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • isExternalClass

        boolean isExternalClass​(java.lang.String className)
                         throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Tell if the target class was scanned from an external location.

        Parameters:
        className - The name of the target class.
        Returns:
        True if the target class was scanned from an external location. Otherwise, false.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • getFragmentAnnotations

        FragmentAnnotations getFragmentAnnotations​(WebFragmentInfo webFragmentItem)
                                            throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer annotation targets generated from the module class source. Scan only the classes in the specified fragment.

        Use the common class source for this scan.

        Parameters:
        webFragmentItem - The fragment which is to be scanned.
        Returns:
        Class list specific annotation targets for the module.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • getSpecificAnnotations

        SpecificAnnotations getSpecificAnnotations​(java.util.Set<java.lang.String> specificClassNames)
                                            throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer annotation targets generated from the module class source. Scan only the specific extra classes.

        Use the common class source for this scan.

        The specific targets is not stored in the non-persistent cache!

        Parameters:
        specificClassNames - The names of the specific class which are to be scanned.
        Returns:
        Class list specific annotation targets for the module.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
        See Also:
        getClassSource()
      • getInfoStore

        com.ibm.wsspi.anno.info.InfoStore getInfoStore()
                                                throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer the common info store for the module. This uses the common web module class source.

        Returns:
        The common info store for the module.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown by an error processing fragment paths.
      • openInfoStore

        void openInfoStore()
                    throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Helper to open the info store. This is recommended if many calls are expected to getClassInfo(String). Opening the info store speeds class lookups, with a cost of retaining resources in the underlying file access layer.

        A call to open the info store requires a call to close the info store following all accesses.

        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown if the open failed. Often, because of a problem opening a ZIP or a JAR file.
      • closeInfoStore

        void closeInfoStore()
                     throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Helper to close the info store. This is required at the completion of using the info store.

        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown if the open failed. Often, because of a problem opening a ZIP or a JAR file.
      • getClassInfo

        com.ibm.wsspi.anno.info.ClassInfo getClassInfo​(java.lang.String className)
                                                throws com.ibm.wsspi.adaptable.module.UnableToAdaptException

        Answer a class info object from the web module info store.

        Parameters:
        className - The name of the class for which to retrieve a class info object.
        Returns:
        The class info object for the named class.
        Throws:
        com.ibm.wsspi.adaptable.module.UnableToAdaptException - Thrown if a non-recoverable error occurred while retrieving the class info object.