Class ErrorPageRegistry
java.lang.Object
org.apache.felix.http.base.internal.registry.ErrorPageRegistry
The error page registry keeps tracks of the active/inactive servlets handling
error pages (error code and/or exception).
This registry is per servlet context.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addServlet
(@NotNull ServletHandler handler) Add the servlet for error handlingvoid
cleanup()
Get the servlet handling the error (error code or exception).static @Nullable ErrorPageRegistry.ErrorRegistration
getErrorRegistration
(@NotNull ServletInfo info) Parse the registration properties of the servlet for error handlingvoid
getRuntimeInfo
(org.osgi.service.servlet.runtime.dto.ServletContextDTO dto, Collection<org.osgi.service.servlet.runtime.dto.FailedErrorPageDTO> failedErrorPageDTOs) Get DTOs for error pages.void
removeServlet
(@NotNull ServletInfo info, boolean destroy) Remove the servlet from error handling
-
Constructor Details
-
ErrorPageRegistry
public ErrorPageRegistry()
-
-
Method Details
-
getErrorRegistration
@Nullable public static @Nullable ErrorPageRegistry.ErrorRegistration getErrorRegistration(@NotNull @NotNull ServletInfo info) Parse the registration properties of the servlet for error handling- Parameters:
info
- The servlet info- Returns:
- An error registration object if the servlet handles errors
-
addServlet
Add the servlet for error handling- Parameters:
handler
- The servlet handler.
-
removeServlet
Remove the servlet from error handling- Parameters:
info
- The servlet info.destroy
- Unused
-
cleanup
public void cleanup() -
get
Get the servlet handling the error (error code or exception). If an exception is provided, a handler for the exception is searched first. If no handler is found (or no exception provided) a handler for the error code is searched.- Parameters:
exception
- Optional exceptionerrorCode
- Error code- Returns:
- The servlet handling the error or
null
-
getRuntimeInfo
public void getRuntimeInfo(org.osgi.service.servlet.runtime.dto.ServletContextDTO dto, Collection<org.osgi.service.servlet.runtime.dto.FailedErrorPageDTO> failedErrorPageDTOs) Get DTOs for error pages.- Parameters:
dto
- The servlet context DTOfailedErrorPageDTOs
- The failed error page DTOs
-