类 ReversedProxyHandlerMapping
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.handler.AbstractHandlerMapping
-
- io.microsphere.spring.webmvc.handler.ReversedProxyHandlerMapping
-
- 所有已实现的接口:
java.util.EventListener
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>
,org.springframework.core.Ordered
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.HandlerMapping
public class ReversedProxyHandlerMapping extends org.springframework.web.servlet.handler.AbstractHandlerMapping implements org.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>
The performance optimizationHandlerMapping
to process the forwarded request from the reversed proxy web server, e.g, Spring Cloud Netflix Zuul, Spring Cloud Gateway or others. The request must have a header named"microsphere_wem_id"
, which is a string presentingthe id of endpoint
, used to locate the actualendpoint
easily, such asHandlerMethod
,HandlerFunction
andController
.As a result,
ReversedProxyHandlerMapping
has the higher precedence than others, which ensures that it prioritizesgetting the handler
and avoid the duplication that was executed by the reversed proxy. As regards the details ofendpoint
, it's recommended to read the JavaDoc ofWebEndpointMapping.getEndpoint()
.For now,
ReversedProxyHandlerMapping
only supports to get the handlers fromRequestMappingHandlerMapping
.- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
- 另请参阅:
WebEndpointMapping
,AbstractUrlHandlerMapping
,AbstractHandlerMethodMapping
,HandlerMetadataWebEndpointMappingFactory
,RequestMappingMetadataWebEndpointMappingFactory
,RequestMappingInfoHandlerMapping
-
-
字段概要
字段 修饰符和类型 字段 说明 static int
DEFAULT_ORDER
-
构造器概要
构造器 构造器 说明 ReversedProxyHandlerMapping()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected org.springframework.web.servlet.HandlerExecutionChain
getHandlerExecutionChain(WebEndpointMapping webEndpointMapping, javax.servlet.http.HttpServletRequest request)
protected java.lang.Object
getHandlerInternal(javax.servlet.http.HttpServletRequest request)
void
onApplicationEvent(WebEndpointMappingsReadyEvent event)
-
从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setPatternParser, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatterns
-
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
-
-
-
-
字段详细资料
-
DEFAULT_ORDER
public static final int DEFAULT_ORDER
- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
getHandlerInternal
protected java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
- 指定者:
getHandlerInternal
在类中org.springframework.web.servlet.handler.AbstractHandlerMapping
- 抛出:
java.lang.Exception
-
getHandlerExecutionChain
@Nullable protected org.springframework.web.servlet.HandlerExecutionChain getHandlerExecutionChain(WebEndpointMapping webEndpointMapping, javax.servlet.http.HttpServletRequest request)
-
onApplicationEvent
public void onApplicationEvent(WebEndpointMappingsReadyEvent event)
- 指定者:
onApplicationEvent
在接口中org.springframework.context.ApplicationListener<WebEndpointMappingsReadyEvent>
-
-