Class ErrorPageRegistry
- java.lang.Object
-
- org.apache.felix.http.base.internal.registry.ErrorPageRegistry
-
public final class ErrorPageRegistry extends Object
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 Modifier and Type Class Description static class
ErrorPageRegistry.ErrorRegistration
-
Constructor Summary
Constructors Constructor Description ErrorPageRegistry()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addServlet(ServletHandler handler)
Add the servlet for error handlingvoid
cleanup()
ServletHandler
get(Throwable exception, int errorCode)
Get the servlet handling the error (error code or exception).static ErrorPageRegistry.ErrorRegistration
getErrorRegistration(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(ServletInfo info, boolean destroy)
Remove the servlet from error handling
-
-
-
Method Detail
-
getErrorRegistration
@Nullable public static ErrorPageRegistry.ErrorRegistration getErrorRegistration(@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
public void addServlet(@NotNull ServletHandler handler)
Add the servlet for error handling- Parameters:
handler
- The servlet handler.
-
removeServlet
public void removeServlet(@NotNull ServletInfo info, boolean destroy)
Remove the servlet from error handling- Parameters:
info
- The servlet info.
-
cleanup
public void cleanup()
-
get
public ServletHandler get(Throwable exception, int errorCode)
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
-
-