五、请求处理过程示意图
关键接口预览
1、Filter, 过滤器
@FunctionalInterface
public interface Filter {
/**
* 过滤
* */
void doFilter(Context ctx, FilterChain chain) throws Throwable;
}
2、RouterInterceptor, 路由拦截器
public interface RouterInterceptor {
/**
* 执行拦截
*/
void doIntercept(Context ctx,
@Nullable Handler mainHandler,
RouterInterceptorChain chain) throws Throwable;
/**
* 提交结果(action / render 执行前调用)
*/
default Object postResult(Context ctx, @Nullable Object result) throws Throwable {
return result;
}
}
3、Handler, 处理器
@FunctionalInterface
public interface Handler {
/**
* 处理
*/
void handle(Context ctx) throws Throwable;
}
4、Interceptor, 拦截器
@FunctionalInterface
public interface Interceptor {
/**
* 拦截
* */
Object doIntercept(Invocation inv) throws Throwable;
}