Filter文档
This commit is contained in:
@@ -13,10 +13,12 @@ import org.redkale.util.AnyValue;
|
||||
* 协议拦截器类, 类似JavaEE中的javax.servlet.Filter <br>
|
||||
* javax.servlet.Filter方法doFilter是同步操作,此Filter.doFilter则是异步操作,方法return前必须调用Response.nextEvent() <br>
|
||||
* 通过给Filter标记注解@Priority来确定执行的顺序, Priority.value值越大越先执行 <br>
|
||||
* 如果doFilter方法是非阻塞的,需要在Filter类上标记@NonBlocking
|
||||
* 如果doFilter方法是非阻塞的,需要在Filter类上标记@NonBlocking <br>
|
||||
* 可通过{@link org.redkale.annotation.Priority}进行顺序设置
|
||||
*
|
||||
* <p>详情见: https://redkale.org
|
||||
*
|
||||
* @see org.redkale.annotation.Priority
|
||||
* @author zhangjx
|
||||
* @param <C> Context的子类型
|
||||
* @param <R> Request的子类型
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.function.*;
|
||||
import java.util.logging.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
import org.redkale.annotation.Nonnull;
|
||||
import org.redkale.net.*;
|
||||
import org.redkale.net.Filter;
|
||||
import org.redkale.net.http.Rest.RestDynSourceType;
|
||||
@@ -388,7 +389,7 @@ public class HttpDispatcherServlet
|
||||
* @param mappingPaths 匹配规则
|
||||
*/
|
||||
@Override
|
||||
public void addServlet(HttpServlet servlet, Object prefix, AnyValue conf, String... mappingPaths) {
|
||||
public void addServlet(@Nonnull HttpServlet servlet, Object prefix, AnyValue conf, String... mappingPaths) {
|
||||
if (prefix == null) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@ import org.redkale.util.AnyValue;
|
||||
|
||||
/**
|
||||
* HTTP 过滤器 <br>
|
||||
* 可通过{@link org.redkale.annotation.Priority}进行顺序设置
|
||||
*
|
||||
* <p>详情见: https://redkale.org
|
||||
*
|
||||
* @see org.redkale.annotation.Priority
|
||||
* @author zhangjx
|
||||
*/
|
||||
public abstract class HttpFilter extends Filter<HttpContext, HttpRequest, HttpResponse> {
|
||||
|
||||
@@ -33,4 +33,3 @@ public class TestMessageRegexConsumer implements MessageConsumer<TestBean> {
|
||||
System.out.println("执行 TestMessageRegexConsumer.destroy");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user