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 ClassesNested 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.TimeStatisticNested 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.jetty.ee10.annotations.AnnotationParsercreateAnnotationParser(int platform) This parser scans the bundles using the OSGi APIs instead of assuming a jar.protected org.eclipse.jetty.util.resource.ResourcegetJarFor(org.eclipse.jetty.ee10.webapp.WebAppContext context, jakarta.servlet.ServletContainerInitializer service) protected voidparseBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle, org.osgi.framework.Bundle bundle) protected voidparseFragmentBundle(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 annotationsprotected voidparseRequiredBundle(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 annotationsprotected voidparseWebBundle(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, AnnotationParser parser, org.osgi.framework.Bundle webbundle) Scan a bundle required by the webbundle for servlet annotationsvoidparseWebInfClasses(org.eclipse.jetty.ee10.annotations.AnnotationConfiguration.State state, org.eclipse.jetty.ee10.annotations.AnnotationParser parser) voidparseWebInfLib(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> replaces()Methods inherited from class org.eclipse.jetty.ee10.annotations.AnnotationConfiguration
configure, createServletContainerInitializerAnnotationHandlers, getInitializerOrdering, getMaxScanWait, getNonExcludedInitializers, isFromContainerClassPath, isFromExcludedJar, isFromWebInfClasses, isUseMultiThreading, matchesExclusionPattern, parseContainerPath, postConfigure, preConfigure, scanForAnnotationsMethods inherited from class org.eclipse.jetty.ee10.webapp.AbstractConfiguration
abort, deconfigure, destroy, getDependencies, getDependents, getServerClasses, getSystemClasses, isEnabledByDefaultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.ee10.webapp.Configuration
isAvailable
-
Constructor Details
-
AnnotationConfiguration
public AnnotationConfiguration()
-
-
Method Details
-
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:
createAnnotationParserin classorg.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:
getJarForin classorg.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.- The container jars are scanned.
- The WEB-INF/classes are scanned
- The osgi fragment to the web bundle are parsed.
- The WEB-INF/lib are scanned
- The required bundles are parsed
- Overrides:
parseWebInfLibin classorg.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 stateparser- The parserwebbundle- The current webbundlefragmentBundle- 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 stateparser- The parserwebbundle- 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:
parseWebInfClassesin classorg.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 stateparser- The parserwebbundle- The current webbundlerequiredBundle- 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)
-