模块 org.redkale
程序包 org.redkale.net

类 DispatcherServlet<K extends Serializable,​C extends Context,​R extends Request<C>,​P extends Response<C,​R>,​S extends Servlet<C,​R,​P>>

  • 类型参数:
    K - SessionID的类型
    C - Context的子类型
    R - Request的子类型
    P - Response的子类型
    S - Servlet的子类型
    直接已知子类:
    HttpDispatcherServlet, SncpDispatcherServlet

    public abstract class DispatcherServlet<K extends Serializable,​C extends Context,​R extends Request<C>,​P extends Response<C,​R>,​S extends Servlet<C,​R,​P>>
    extends Servlet<C,​R,​P>
    根Servlet, 一个Server只能存在一个根Servlet 由之前PrepareServlet更名而来,since 2.7.0 用于分发Request请求

    详情见: https://redkale.org

    作者:
    zhangjx
    • 构造器详细资料

      • DispatcherServlet

        protected DispatcherServlet()
    • 方法详细资料

      • incrExecuteCounter

        protected void incrExecuteCounter()
      • incrIllegalRequestCounter

        protected void incrIllegalRequestCounter()
      • putServlet

        protected void putServlet​(S servlet)
      • removeServlet

        protected void removeServlet​(S servlet)
      • containsServlet

        public boolean containsServlet​(Class<? extends S> servletClass)
      • containsServlet

        public boolean containsServlet​(String servletClassName)
      • putMapping

        protected void putMapping​(K key,
                                  S servlet)
      • removeMapping

        protected void removeMapping​(K key)
      • removeMapping

        protected void removeMapping​(S servlet)
      • doAfterRemove

        protected void doAfterRemove​(S servlet)
      • mappingServlet

        protected S mappingServlet​(K key)
      • forEachMappingKey

        protected void forEachMappingKey​(BiConsumer<K,​S> consumer)
      • removeFilter

        public <T extends Filter<C,​R,​P>> T removeFilter​(Class<T> filterClass)
      • containsFilter

        public boolean containsFilter​(Class<? extends Filter> filterClass)
      • containsFilter

        public boolean containsFilter​(String filterClassName)
      • removeFilter

        public <T extends Filter<C,​R,​P>> T removeFilter​(Predicate<T> predicate)
      • getFilters

        public <T extends Filter<C,​R,​P>> List<T> getFilters()
      • addServlet

        public abstract void addServlet​(S servlet,
                                        Object attachment,
                                        AnyValue conf,
                                        K... mappings)
      • dispatch

        public final void dispatch​(R request,
                                   P response)
      • setServletConf

        protected void setServletConf​(Servlet servlet,
                                      AnyValue conf)
      • setFilterConf

        protected void setFilterConf​(Filter filter,
                                     AnyValue conf)
      • getServlets

        public List<S> getServlets()
      • servletStream

        protected Stream<S> servletStream()
      • getExecuteCounter

        public Long getExecuteCounter()
      • getIllRequestCounter

        public Long getIllRequestCounter()