Class EndpointHandlerMapping
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.context.support.WebApplicationObjectSupport
- org.springframework.web.servlet.handler.AbstractHandlerMapping
- org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
- org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping
- org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
- org.springframework.boot.actuate.endpoint.mvc.AbstractEndpointHandlerMapping<MvcEndpoint>
- org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.context.EmbeddedValueResolverAware
,org.springframework.core.Ordered
,org.springframework.web.context.ServletContextAware
,org.springframework.web.servlet.handler.MatchableHandlerMapping
,org.springframework.web.servlet.HandlerMapping
public class EndpointHandlerMapping extends AbstractEndpointHandlerMapping<MvcEndpoint>
HandlerMapping
to mapEndpoint
s to URLs viaEndpoint.getId()
. The semantics of@RequestMapping
should be identical to a normal@Controller
, but the endpoints should not be annotated as@Controller
(otherwise they will be mapped by the normal MVC mechanisms).One of the aims of the mapping is to support endpoints that work as HTTP endpoints but can still provide useful service interfaces when there is no HTTP server (and no Spring MVC on the classpath). Note that any endpoints having method signatures will break in a non-servlet environment.
Constructor Summary
Constructors Constructor Description EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints)
Create a newEndpointHandlerMapping
instance.EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints, org.springframework.web.cors.CorsConfiguration corsConfiguration)
Create a newEndpointHandlerMapping
instance.
Method Summary
Methods inherited from class org.springframework.boot.actuate.endpoint.mvc.AbstractEndpointHandlerMapping
afterPropertiesSet, extendInterceptors, getCorsHandlerExecutionChain, getEndpoints, getHandlerExecutionChain, getPath, getPath, getPrefix, initCorsConfiguration, isDisabled, isHandler, postProcessEndpoints, registerHandlerMethod, setDisabled, setPrefix, setSecurityInterceptor
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
createRequestMappingInfo, getContentNegotiationManager, getCustomMethodCondition, getCustomTypeCondition, getFileExtensions, getMappingForMethod, match, resolveEmbeddedValuesInPatterns, setContentNegotiationManager, setEmbeddedValueResolver, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, useRegisteredSuffixPatternMatch, useSuffixPatternMatch, useTrailingSlashMatch
Methods inherited from class org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping
getMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatch, handleNoMatch
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, getNamingStrategy, handlerMethodsInitialized, initHandlerMethods, lookupHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, unregisterMapping
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, getAdaptedInterceptors, getCorsConfigurations, getCorsProcessor, getDefaultHandler, getHandler, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Constructor Detail
EndpointHandlerMapping
public EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints)
Create a newEndpointHandlerMapping
instance. AllEndpoint
s will be detected from theApplicationContext
. The endpoints will not accept CORS requests.- Parameters:
endpoints
- the endpoints
EndpointHandlerMapping
public EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints, org.springframework.web.cors.CorsConfiguration corsConfiguration)
Create a newEndpointHandlerMapping
instance. AllEndpoint
s will be detected from theApplicationContext
. The endpoints will accepts CORS requests based on the givencorsConfiguration
.- Parameters:
endpoints
- the endpointscorsConfiguration
- the CORS configuration for the endpoints- Since:
- 1.3.0