Class PerContextHandlerRegistry

java.lang.Object
org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry
All Implemented Interfaces:
Comparable<PerContextHandlerRegistry>

public final class PerContextHandlerRegistry extends Object implements Comparable<PerContextHandlerRegistry>
This registry keeps track of all processing components per context: - servlets - filters - error pages
  • Constructor Details

    • PerContextHandlerRegistry

      public PerContextHandlerRegistry(@NotNull @NotNull org.apache.felix.http.base.internal.HttpConfig config)
      Default http service registry
      Parameters:
      config - The configuration
    • PerContextHandlerRegistry

      public PerContextHandlerRegistry(@NotNull @NotNull ServletContextHelperInfo info, @NotNull @NotNull org.apache.felix.http.base.internal.HttpConfig config)
      Registry for a servlet context helper (whiteboard support)
      Parameters:
      info - The servlet context helper info
      config - The configuration
  • Method Details

    • getContextServiceId

      public long getContextServiceId()
    • getConfig

      public org.apache.felix.http.base.internal.HttpConfig getConfig()
    • removeAll

      public void removeAll()
    • compareTo

      public int compareTo(@NotNull @NotNull PerContextHandlerRegistry other)
      Specified by:
      compareTo in interface Comparable<PerContextHandlerRegistry>
    • isMatching

      public String isMatching(@NotNull @NotNull String requestURI)
    • resolve

      public PathResolution resolve(@NotNull @NotNull String relativeRequestURI)
    • resolveServletByName

      public ServletHandler resolveServletByName(String name)
    • getFilterHandlers

      @NotNull public @NotNull FilterHandler[] getFilterHandlers(@Nullable @Nullable ServletHandler servletHandler, @NotNull @NotNull jakarta.servlet.DispatcherType dispatcherType, @NotNull @NotNull String requestURI)
      Get filter handlers for the request uri
      Parameters:
      servletHandler - The servlet handler (might be null)
      dispatcherType - The dispatcher type
      requestURI - The request uri
      Returns:
      The array of filter handlers, the array might be empty.
    • getErrorHandler

      @Nullable public @Nullable ServletHandler getErrorHandler(int code, @Nullable @Nullable Throwable exception)
      Get the servlet handling the error.
      Parameters:
      code - The error code
      exception - The optional exception
      Returns:
      The servlet handler or null.
    • getEventListenerRegistry

      public EventListenerRegistry getEventListenerRegistry()
    • getRuntime

      public void getRuntime(org.osgi.service.servlet.runtime.dto.ServletContextDTO dto, FailedDTOHolder failedDTOHolder)
      Create all DTOs for servlets, filters, resources and error pages
      Parameters:
      dto - The servlet context DTO
      failedDTOHolder - The container for all failed DTOs
    • registerServlet

      public void registerServlet(@NotNull @NotNull ServletHandler handler)
      Add a servlet
      Parameters:
      handler - The servlet handler
    • unregisterServlet

      public void unregisterServlet(@NotNull @NotNull ServletInfo servletInfo, boolean destroy)
      Remove a servlet
      Parameters:
      servletInfo - The servlet info
      destroy - Destroy the servlet
    • registerFilter

      public void registerFilter(@NotNull @NotNull FilterHandler handler)
      Add a filter
      Parameters:
      handler - The filter handler
    • unregisterFilter

      public void unregisterFilter(@NotNull @NotNull FilterInfo info, boolean destroy)
      Remove a filter
      Parameters:
      info - The filter info
      destroy - Destroy the filter
    • registerListeners

      public void registerListeners(@NotNull @NotNull ListenerHandler listenerHandler)
      Register listeners
      Parameters:
      listenerHandler - The listener handler
    • unregisterListeners

      public void unregisterListeners(@NotNull @NotNull ListenerInfo info)
      Unregister listeners
      Parameters:
      info - The listener info