Class JettyModuleExtender


  • public class JettyModuleExtender
    extends io.bootique.ModuleExtender<JettyModuleExtender>
    Provides API to contribute custom extensions to JettyModule. This class is a syntactic sugar for Bootique MapBuilder and SetBuilder.
    • Constructor Detail

      • JettyModuleExtender

        public JettyModuleExtender​(io.bootique.di.Binder binder)
    • Method Detail

      • initAllExtensions

        public JettyModuleExtender initAllExtensions()
        Should be called by owning Module to initialize all contribution maps and collections. Failure to call this method may result in injection failures for empty maps and collections.
        Specified by:
        initAllExtensions in class io.bootique.ModuleExtender<JettyModuleExtender>
        Returns:
        this extender instance.
      • addMappedListener

        public <T extends EventListenerJettyModuleExtender addMappedListener​(io.bootique.di.TypeLiteral<MappedListener<T>> mappedListenerType)
        Type Parameters:
        T -
        Parameters:
        mappedListenerType -
        Returns:
        this extender instance
      • setServletParam

        public JettyModuleExtender setServletParam​(String servletName,
                                                   String propertyName,
                                                   String propertyValue)
        Sets an init parameter of a named servlet. Same thing can be achieved via configuration.
        Returns:
        this extender instance
        Since:
        2.0
      • addServlet

        public JettyModuleExtender addServlet​(Class<? extends javax.servlet.Servlet> servletType)
        Adds a servlet of the specified type to the set of Jetty servlets. "servletType" must be annotated with WebServlet. Otherwise it should be mapped via other add(Mapped)Servlet methods, where you can explicitly specify URL patterns.
        Parameters:
        servletType - a class of the servlet to map.
        Returns:
        this extender instance.
      • addMappedServlet

        public <T extends javax.servlet.Servlet> JettyModuleExtender addMappedServlet​(io.bootique.di.TypeLiteral<MappedServlet<T>> mappedServletType)
      • addFilter

        public JettyModuleExtender addFilter​(Class<? extends javax.servlet.Filter> filterType)
        Adds a filter of the specified type to the set of Jetty filters. "filterType" must be annotated with WebFilter. Otherwise it should be mapped via other add(Mapped)Filter methods, where you can explicitly specify URL patterns, ordering, etc.
        Parameters:
        filterType - a class of the filter to map.
        Returns:
        this extender instance.
      • addMappedFilter

        public <T extends javax.servlet.Filter> JettyModuleExtender addMappedFilter​(io.bootique.di.TypeLiteral<MappedFilter<T>> mappedFilterType)
      • addContextHandlerExtender

        public JettyModuleExtender addContextHandlerExtender​(ServletContextHandlerExtender extender)
        Registers an extender of the Jetty ServletContextHandler. This is a low-level extension point that allows to install some Jetty extensions like the WebSockets engine. This should be usually of no interest to regular bootique-jetty users.
        Parameters:
        extender - an "extender" object that can customize ServletContextHandler.
        Returns:
        this extender instance
      • addContextHandlerExtender

        public JettyModuleExtender addContextHandlerExtender​(Class<? extends ServletContextHandlerExtender> type)
        Registers an extender of the Jetty ServletContextHandler. This is a low-level extension point that allows to install some Jetty extensions like the WebSockets engine. This should be usually of no interest to regular bootique-jetty users.
        Parameters:
        type - a class of an "extender" object that can customize ServletContextHandler.
        Returns:
        this extender instance
      • contributeFilters

        protected io.bootique.di.SetBuilder<javax.servlet.Filter> contributeFilters()
      • contributeServlets

        protected io.bootique.di.SetBuilder<javax.servlet.Servlet> contributeServlets()
      • contributeListeners

        protected io.bootique.di.SetBuilder<EventListener> contributeListeners()
      • contributeMappedFilters

        protected io.bootique.di.SetBuilder<MappedFilter> contributeMappedFilters()
      • contributeMappedServlets

        protected io.bootique.di.SetBuilder<MappedServlet> contributeMappedServlets()
      • contributeMappedListeners

        protected io.bootique.di.SetBuilder<MappedListener> contributeMappedListeners()
      • contributeMdcItems

        protected io.bootique.di.MapBuilder<String,​RequestMDCItem> contributeMdcItems()