Class AnnotationConfiguration

java.lang.Object
org.eclipse.jetty.ee10.webapp.AbstractConfiguration
org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
org.eclipse.jetty.ee10.osgi.annotations.AnnotationConfiguration
All Implemented Interfaces:
org.eclipse.jetty.ee10.webapp.Configuration

public class AnnotationConfiguration extends org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
Extend the AnnotationConfiguration to support OSGi: Look for annotations inside WEB-INF/lib and also in the fragments and required bundles. Discover them using a scanner adapted to OSGi instead of the jarscanner.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration

    org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.ClassInheritanceMap, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.DiscoveredServletContainerInitializerHolder, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.ParserTask, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.ServletContainerInitializerComparator, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.ServletContainerInitializerOrdering, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State, org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.TimeStatistic

    Nested classes/interfaces inherited from class org.eclipse.jetty.ee10.webapp.AbstractConfiguration

    org.eclipse.jetty.ee10.webapp.AbstractConfiguration.Builder
  • Field Summary

    Fields inherited from class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration

    CLASS_INHERITANCE_MAP, CONTAINER_INITIALIZER_STARTER, CONTAINER_INITIALIZERS, DEFAULT_MAX_SCAN_WAIT, DEFAULT_MULTI_THREADED, MAX_SCAN_WAIT, MULTI_THREADED, SERVLET_CONTAINER_INITIALIZER_EXCLUSION_PATTERN, SERVLET_CONTAINER_INITIALIZER_ORDER, STATE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.eclipse.jetty.ee10.annotations.AnnotationParser
    createAnnotationParser(int platform)
    This parser scans the bundles using the OSGi APIs instead of assuming a jar.
    protected org.eclipse.jetty.util.resource.Resource
    getJarFor(org.eclipse.jetty.ee10.webapp.WebAppContext context, jakarta.servlet.ServletContainerInitializer service)
     
    protected void
    parseBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle bundle)
     
    protected void
    parseFragmentBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle fragmentBundle)
    Scan a fragment bundle for servlet annotations
    protected void
    parseRequiredBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle requiredBundle)
    Scan a bundle required by the webbundle for servlet annotations
    protected void
    parseWebBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle)
    Scan a bundle required by the webbundle for servlet annotations
    void
    parseWebInfClasses(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, org.eclipse.jetty.ee10.annotations.AnnotationParser parser)
     
    void
    parseWebInfLib(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, org.eclipse.jetty.ee10.annotations.AnnotationParser parser)
    Here is the order in which jars and osgi artifacts are scanned for discoverable annotations.
    Class<? extends org.eclipse.jetty.ee10.webapp.Configuration>
     

    Methods inherited from class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration

    configure, createServletContainerInitializerAnnotationHandlers, getInitializerOrdering, getMaxScanWait, getNonExcludedInitializers, isFromContainerClassPath, isFromExcludedJar, isFromWebInfClasses, isUseMultiThreading, matchesExclusionPattern, parseContainerPath, postConfigure, preConfigure, scanForAnnotations

    Methods inherited from class org.eclipse.jetty.ee10.webapp.AbstractConfiguration

    abort, deconfigure, destroy, getDependencies, getDependents, getServerClasses, getSystemClasses, isEnabledByDefault

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.ee10.webapp.Configuration

    isAvailable
  • Constructor Details

    • AnnotationConfiguration

      public AnnotationConfiguration()
  • Method Details

    • replaces

      public Class<? extends org.eclipse.jetty.ee10.webapp.Configuration> replaces()
    • createAnnotationParser

      protected org.eclipse.jetty.ee10.annotations.AnnotationParser createAnnotationParser(int platform)
      This parser scans the bundles using the OSGi APIs instead of assuming a jar.
      Overrides:
      createAnnotationParser in class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
    • getJarFor

      protected org.eclipse.jetty.util.resource.Resource getJarFor(org.eclipse.jetty.ee10.webapp.WebAppContext context, jakarta.servlet.ServletContainerInitializer service)
      Overrides:
      getJarFor in class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
    • parseWebInfLib

      public void parseWebInfLib(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, org.eclipse.jetty.ee10.annotations.AnnotationParser parser) throws Exception
      Here is the order in which jars and osgi artifacts are scanned for discoverable annotations.
      1. The container jars are scanned.
      2. The WEB-INF/classes are scanned
      3. The osgi fragment to the web bundle are parsed.
      4. The WEB-INF/lib are scanned
      5. The required bundles are parsed
      Overrides:
      parseWebInfLib in class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
      Throws:
      Exception
    • parseFragmentBundle

      protected void parseFragmentBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle fragmentBundle) throws Exception
      Scan a fragment bundle for servlet annotations
      Parameters:
      state - The webapp context state
      parser - The parser
      webbundle - The current webbundle
      fragmentBundle - The OSGi fragment bundle to scan
      Throws:
      Exception - if unable to parse fragment bundle
    • parseWebBundle

      protected void parseWebBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle) throws Exception
      Scan a bundle required by the webbundle for servlet annotations
      Parameters:
      state - The webapp context state
      parser - The parser
      webbundle - The current webbundle
      Throws:
      Exception - if unable to parse the web bundle
    • parseWebInfClasses

      public void parseWebInfClasses(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, org.eclipse.jetty.ee10.annotations.AnnotationParser parser)
      Overrides:
      parseWebInfClasses in class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
    • parseRequiredBundle

      protected void parseRequiredBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle requiredBundle) throws Exception
      Scan a bundle required by the webbundle for servlet annotations
      Parameters:
      state - The webapp annotation parse state
      parser - The parser
      webbundle - The current webbundle
      requiredBundle - The OSGi required bundle to scan
      Throws:
      Exception - if unable to parse the required bundle
    • parseBundle

      protected void parseBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle bundle)