Primarily intended for use loading ServletContainerInitializers as defined by Servlet 8.2.4. This implementation does not attempt lazy loading as the container is required to introspect all implementations discovered.
If the ServletContext defines ORDERED_LIBS, then only JARs in WEB-INF/lib that are named in that set will be included in the search for provider configuration files; if ORDERED_LIBS is not defined then all JARs will be searched for provider configuration files. Providers defined by resources in the parent ClassLoader will always be returned.
Provider classes will be loaded using the context's ClassLoader.
jakarta.servlet.ServletContainerInitializer , java.util.ServiceLoader
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private final Pattern | |
| private final Context | |
| private static final String | |
| private static final String | |
| private final ServletContext |
| Access | Constructor and Description |
|---|---|
| public | WebappServiceLoader(Context
the context to use context)Construct a loader to load services from a ServletContext. |
| Modifier and Type | Method and Description |
|---|---|
| public List | |
| pack-priv List | |
| pack-priv void |
| CLASSES | back to summary |
|---|---|
| private static final String CLASSES | |
| containerSciFilterPattern | back to summary |
|---|---|
| private final Pattern containerSciFilterPattern | |
| context | back to summary |
|---|---|
| private final Context context | |
| LIB | back to summary |
|---|---|
| private static final String LIB | |
| SERVICES | back to summary |
|---|---|
| private static final String SERVICES | |
| servletContext | back to summary |
|---|---|
| private final ServletContext servletContext | |
| WebappServiceLoader | back to summary |
|---|---|
| public WebappServiceLoader(Context context) Construct a loader to load services from a ServletContext.
| |
| load | back to summary |
|---|---|
| public List Load the providers for a service type. Container defined services will be loaded before application defined services in case the application depends on a Container provided service. Note that services are always loaded via the Context (web application) class loader so it is possible for an application to provide an alternative implementation of what would normally be a Container provided service.
| |
| loadServices | back to summary |
|---|---|
| pack-priv List | |
| parseConfigFile | back to summary |
|---|---|
| pack-priv void parseConfigFile(LinkedHashSet<String> servicesFound, URL url) throws IOException | |