Class PerContextHandlerRegistry

    • Constructor Detail

      • PerContextHandlerRegistry

        public PerContextHandlerRegistry​(@NotNull
                                         @NotNull org.apache.felix.http.base.internal.HttpConfig config)
        Default http service registry
      • 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
    • Method Detail

      • getContextServiceId

        public long getContextServiceId()
      • getConfig

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

        public void removeAll()
      • isMatching

        public String isMatching​(@NotNull
                                 @NotNull String requestURI)
      • getFilterHandlers

        @NotNull
        public @NotNull FilterHandler[] getFilterHandlers​(@Nullable
                                                          @Nullable ServletHandler servletHandler,
                                                          @NotNull
                                                          @NotNull javax.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.
      • getRuntime

        public void getRuntime​(org.osgi.service.http.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 -
      • unregisterListeners

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