public class WebappServiceLoader<T>
extends java.lang.Object
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.
ServletContainerInitializer
,
ServiceLoader
Constructor and Description |
---|
WebappServiceLoader(Context context)
Construct a loader to load services from a ServletContext.
|
public WebappServiceLoader(Context context)
context
- the context to usepublic java.util.List<T> load(java.lang.Class<T> serviceType) throws java.io.IOException
serviceType
- the type of service to loadjava.io.IOException
- if there was a problem loading any serviceCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.