Class NoOpServletContainerProvider
java.lang.Object
org.glassfish.jersey.servlet.internal.spi.NoOpServletContainerProvider
- All Implemented Interfaces:
ExtendedServletContainerProvider
,ServletContainerProvider
public class NoOpServletContainerProvider
extends Object
implements ExtendedServletContainerProvider
Basic
ExtendedServletContainerProvider
that provides
dummy no-op method implementation. It should be convenient to extend if you only need to implement
a subset of the original SPI methods.- Author:
- Jakub Podlesak
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Used by Jersey runtime to tell if the extension covers HTTP Servlet request response handling with respect to underlying injection manager.void
configure
(ResourceConfig resourceConfig) This method is called for eachServletContainer
instance initialization, i.e. duringWebComponent
initialization.Give me aRequestScopedInitializerProvider
instance, that will be utilized at runtime to set the actual HTTP Servlet request and response.void
onRegister
(jakarta.servlet.ServletContext servletContext, Set<String> servletNames) Notifies the provider about all registered Jersey servlets by its names.void
postInit
(jakarta.servlet.ServletContext servletContext, Set<Class<?>> classes, Set<String> servletNames) Do your post-initialization job after Jersey finished its servlet initialization.void
Do your pre-initialization job before Jersey starts its servlet initialization.
-
Field Details
-
HTTP_SERVLET_REQUEST_TYPE
-
HTTP_SERVLET_RESPONSE_TYPE
-
-
Constructor Details
-
NoOpServletContainerProvider
public NoOpServletContainerProvider()
-
-
Method Details
-
preInit
public void preInit(jakarta.servlet.ServletContext servletContext, Set<Class<?>> classes) throws jakarta.servlet.ServletException Description copied from interface:ServletContainerProvider
Do your pre-initialization job before Jersey starts its servlet initialization. It is allowed to configureServletContext
or add/remove servlet registrations. ParameterservletNames
contains list of names of currently registered Jersey servlets.- Specified by:
preInit
in interfaceServletContainerProvider
- Parameters:
servletContext
- theServletContext
of the JAX-RS/Jersey web application that is being started.classes
- the mutable Set of application classes that extendApplication
, implement, or have been annotated with the class typesPath
,Provider
orApplicationPath
. May be empty, nevernull
.- Throws:
jakarta.servlet.ServletException
- if an error has occurred.jakarta.servlet.ServletContainerInitializer.onStartup
is interrupted.
-
postInit
public void postInit(jakarta.servlet.ServletContext servletContext, Set<Class<?>> classes, Set<String> servletNames) Description copied from interface:ServletContainerProvider
Do your post-initialization job after Jersey finished its servlet initialization. It is allowed to configureServletContext
or add/remove servlet registrations. ParameterservletNames
contains list of names of currently registered Jersey servlets.- Specified by:
postInit
in interfaceServletContainerProvider
- Parameters:
servletContext
- theServletContext
of the JAX-RS/Jersey web application that is being started.classes
- the mutable Set of application classes that extendApplication
, implement, or have been annotated with the class typesPath
,Provider
orApplicationPath
. May be empty, nevernull
.servletNames
- the Immutable set of Jersey's ServletContainer names. May be empty, nevernull
.
-
onRegister
public void onRegister(jakarta.servlet.ServletContext servletContext, Set<String> servletNames) throws jakarta.servlet.ServletException Description copied from interface:ServletContainerProvider
Notifies the provider about all registered Jersey servlets by its names. It is allowed to configureServletContext
. Do not add/remove any servlet registrations here. ParameterservletNames
contains list of names of registered Jersey servlets. Currently it isServletContainer
ororg.glassfish.jersey.servlet.portability.PortableServletContainer
servlets. It does not matter servlet container is configured inweb.xml
, byorg.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
or by customer direct Servlet API calls.- Specified by:
onRegister
in interfaceServletContainerProvider
- Parameters:
servletContext
- theServletContext
of the JAX-RS/Jersey web application that is being started.servletNames
- the Immutable set of Jersey's ServletContainer names. May be empty, nevernull
.- Throws:
jakarta.servlet.ServletException
- if an error has occurred.jakarta.servlet.ServletContainerInitializer.onStartup
is interrupted.
-
configure
Description copied from interface:ServletContainerProvider
This method is called for eachServletContainer
instance initialization, i.e. duringWebComponent
initialization. The method is also called duringServletContainer.reload()
orServletContainer.reload(ResourceConfig)
methods invocation. It does not matter servlet container is configured inweb.xml
, byorg.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
or by customer direct Servlet API calls.- Specified by:
configure
in interfaceServletContainerProvider
- Parameters:
resourceConfig
- Jersey application configuration.- Throws:
jakarta.servlet.ServletException
- if an error has occurred.org.glassfish.jersey.servlet.WebComponent
construction is interrupted.
-
bindsServletRequestResponse
public boolean bindsServletRequestResponse()Description copied from interface:ExtendedServletContainerProvider
Used by Jersey runtime to tell if the extension covers HTTP Servlet request response handling with respect to underlying injection manager. Returntrue
, if your implementation configures HK2 bindings forHttpServletRequest
andHttpServletResponse
inServletContainerProvider.configure(ResourceConfig)
method and also provides aRequestScopedInitializer
implementation viaExtendedServletContainerProvider.getRequestScopedInitializerProvider()
.- Specified by:
bindsServletRequestResponse
in interfaceExtendedServletContainerProvider
- Returns:
true
if the extension fully covers HTTP request/response handling.
-
getRequestScopedInitializerProvider
Description copied from interface:ExtendedServletContainerProvider
Give me aRequestScopedInitializerProvider
instance, that will be utilized at runtime to set the actual HTTP Servlet request and response. The provider returned will be used at runtime for every and each incoming request so that the actual request/response instances could be made accessible from Jersey injection manager.- Specified by:
getRequestScopedInitializerProvider
in interfaceExtendedServletContainerProvider
- Returns:
- request scoped initializer provider.
-