public abstract class AbstractSentinelInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor
ServletRequest.getDispatcherType()) we will only
deal with the initial request. So we use reference count to track in
dispathing "onion" though which we could figure out whether we are in initial type "REQUEST".
That means the sub-requests which we rarely meet in practice will NOT be recorded in Sentinel.
How to implement a forward sub-request in your action:
initalRequest() {
ModelAndView mav = new ModelAndView();
mav.setViewName("another");
return mav;
}
| Modifier and Type | Field and Description |
|---|---|
static String |
SENTINEL_SPRING_WEB_CONTEXT_NAME |
| Constructor and Description |
|---|
AbstractSentinelInterceptor(BaseWebMvcConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception ex) |
protected String |
getContextName(javax.servlet.http.HttpServletRequest request)
Return the context name of the target web resource.
|
protected Entry |
getEntryInRequest(javax.servlet.http.HttpServletRequest request,
String attrKey) |
protected abstract String |
getResourceName(javax.servlet.http.HttpServletRequest request)
Return the resource name of the target web resource.
|
protected void |
handleBlockException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
BlockException e) |
protected String |
parseOrigin(javax.servlet.http.HttpServletRequest request) |
void |
postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
org.springframework.web.servlet.ModelAndView modelAndView) |
boolean |
preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler) |
protected void |
removeEntryInRequest(javax.servlet.http.HttpServletRequest request) |
protected void |
traceExceptionAndExit(Entry entry,
Exception ex) |
public static final String SENTINEL_SPRING_WEB_CONTEXT_NAME
public AbstractSentinelInterceptor(BaseWebMvcConfig config)
public boolean preHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler)
throws Exception
preHandle in interface org.springframework.web.servlet.HandlerInterceptorExceptionprotected abstract String getResourceName(javax.servlet.http.HttpServletRequest request)
request - web requestprotected String getContextName(javax.servlet.http.HttpServletRequest request)
request - web requestpublic void afterCompletion(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception ex)
throws Exception
afterCompletion in interface org.springframework.web.servlet.HandlerInterceptorExceptionpublic void postHandle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
org.springframework.web.servlet.ModelAndView modelAndView)
throws Exception
postHandle in interface org.springframework.web.servlet.HandlerInterceptorExceptionprotected Entry getEntryInRequest(javax.servlet.http.HttpServletRequest request, String attrKey)
protected void removeEntryInRequest(javax.servlet.http.HttpServletRequest request)
protected void handleBlockException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
BlockException e)
throws Exception
Exceptionprotected String parseOrigin(javax.servlet.http.HttpServletRequest request)
Copyright © 2020 Alibaba Group. All rights reserved.