Interface ServletContainerProvider
-
- All Known Subinterfaces:
ExtendedServletContainerProvider
- All Known Implementing Classes:
NoOpServletContainerProvider
public interface ServletContainerProvider
This is internal Jersey SPI to hook to Jersey servlet initialization process driven byorg.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
. The provider implementation class is registered viaMETA-INF/services
.- Since:
- 2.4.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
configure(ResourceConfig resourceConfig)
This method is called for eachServletContainer
instance initialization, i.e.void
onRegister(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.String> servletNames)
Notifies the provider about all registered Jersey servlets by its names.void
postInit(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.Class<?>> classes, java.util.Set<java.lang.String> servletNames)
Do your post-initialization job after Jersey finished its servlet initialization.void
preInit(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.Class<?>> classes)
Do your pre-initialization job before Jersey starts its servlet initialization.
-
-
-
Method Detail
-
preInit
void preInit(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.Class<?>> classes) throws javax.servlet.ServletException
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.- 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:
javax.servlet.ServletException
- if an error has occurred.javax.servlet.ServletContainerInitializer.onStartup
is interrupted.
-
postInit
void postInit(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.Class<?>> classes, java.util.Set<java.lang.String> servletNames) throws javax.servlet.ServletException
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.- 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
.- Throws:
javax.servlet.ServletException
- if an error has occurred.javax.servlet.ServletContainerInitializer.onStartup
is interrupted.
-
onRegister
void onRegister(javax.servlet.ServletContext servletContext, java.util.Set<java.lang.String> servletNames) throws javax.servlet.ServletException
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.- 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:
javax.servlet.ServletException
- if an error has occurred.javax.servlet.ServletContainerInitializer.onStartup
is interrupted.
-
configure
void configure(ResourceConfig resourceConfig) throws javax.servlet.ServletException
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.- Parameters:
resourceConfig
- Jersey application configuration.- Throws:
javax.servlet.ServletException
- if an error has occurred.org.glassfish.jersey.servlet.WebComponent
construction is interrupted.
-
-