- java.lang.Object
-
- org.redkale.net.Servlet<C,R,P>
-
- org.redkale.net.DispatcherServlet<String,HttpContext,HttpRequest,HttpResponse,HttpServlet>
-
- org.redkale.net.http.HttpDispatcherServlet
-
public class HttpDispatcherServlet extends DispatcherServlet<String,HttpContext,HttpRequest,HttpResponse,HttpServlet>
HTTP Servlet的总入口,请求在HttpDispatcherServlet中进行分流。
一个HttpServer只有一个HttpDispatcherServlet, 用于管理所有HttpServlet。
详情见: https://redkale.org
- 作者:
- zhangjx
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
HttpDispatcherServlet.MappingEntry
-
字段概要
字段 修饰符和类型 字段 说明 protected Map<String,Class>
allMapStrings
protected HttpContext
context
protected Logger
logger
protected HttpDispatcherServlet.MappingEntry[]
regexArray
protected HttpDispatcherServlet.MappingEntry[]
regexWsArray
protected HttpServlet
resourceHttpServlet
protected Map<String,WebSocketServlet>
wsMappings
-
从类继承的字段 org.redkale.net.DispatcherServlet
application, filtersLock, headFilter
-
从类继承的字段 org.redkale.net.Servlet
_nonBlocking
-
-
构造器概要
构造器 限定符 构造器 说明 protected
HttpDispatcherServlet()
-
方法概要
-
从类继承的方法 org.redkale.net.DispatcherServlet
containsFilter, containsFilter, containsServlet, containsServlet, dispatch, forEachMappingKey, getExecuteCounter, getFilterConf, getFilters, getIllRequestCounter, getServletConf, getServlets, incrExecuteCounter, incrIllegalRequestCounter, putMapping, putServlet, removeFilter, removeFilter, removeMapping, removeMapping, removeServlet, servletStream, setFilterConf, setServletConf
-
从类继承的方法 org.redkale.net.Servlet
isNonBlocking
-
-
-
-
字段详细资料
-
logger
protected final Logger logger
-
resourceHttpServlet
protected HttpServlet resourceHttpServlet
-
regexArray
protected HttpDispatcherServlet.MappingEntry[] regexArray
-
regexWsArray
protected HttpDispatcherServlet.MappingEntry[] regexWsArray
-
wsMappings
protected Map<String,WebSocketServlet> wsMappings
-
context
protected HttpContext context
-
-
方法详细资料
-
removeHttpServlet
public HttpServlet removeHttpServlet(HttpServlet servlet)
-
removeHttpServlet
public HttpServlet removeHttpServlet(Service service)
-
removeHttpServlet
public <T extends WebSocket> HttpServlet removeHttpServlet(Class<T> websocketOrServletType)
-
addForbidURIRegex
public boolean addForbidURIRegex(String urlRegex)
-
removeForbidURIReg
public boolean removeForbidURIReg(String urlreg)
-
init
public void init(HttpContext context, AnyValue config)
- 覆盖:
init
在类中DispatcherServlet<String,HttpContext,HttpRequest,HttpResponse,HttpServlet>
-
execute
public void execute(HttpRequest request, HttpResponse response) throws IOException
- 指定者:
execute
在类中Servlet<HttpContext,HttpRequest,HttpResponse>
- 抛出:
IOException
-
addFilter
public void addFilter(Filter<HttpContext,HttpRequest,HttpResponse> filter, AnyValue conf)
-
addServlet
public void addServlet(@Nonnull HttpServlet servlet, Object prefix, AnyValue conf, String... mappingPaths)
添加HttpServlet- 指定者:
addServlet
在类中DispatcherServlet<String,HttpContext,HttpRequest,HttpResponse,HttpServlet>
- 参数:
servlet
- HttpServletprefix
- url前缀conf
- 配置信息mappingPaths
- 匹配规则
-
setResourceServlet
public void setResourceServlet(HttpServlet servlet)
设置静态资源HttpServlet- 参数:
servlet
- HttpServlet
-
getResourceServlet
public HttpServlet getResourceServlet()
获取静态资源HttpServlet- 返回:
- HttpServlet
-
postStart
public void postStart(HttpContext context, AnyValue config)
-
findServletByTopic
public HttpServlet findServletByTopic(String topic)
-
filterServlets
public Stream<HttpServlet> filterServlets(Predicate<HttpServlet> predicate)
-
mappingServlet
protected HttpServlet mappingServlet(String key)
-
doAfterRemove
protected void doAfterRemove(HttpServlet servlet)
-
destroy
public void destroy(HttpContext context, AnyValue config)
- 覆盖:
destroy
在类中DispatcherServlet<String,HttpContext,HttpRequest,HttpResponse,HttpServlet>
-
-