public class EndpointHandlerMapping extends RequestMappingHandlerMapping implements ApplicationContextAware
HandlerMapping to map Endpoints to URLs via Endpoint.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.
loggerBEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints)
Create a new
EndpointHandlerMapping instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
Set<? extends MvcEndpoint> |
getEndpoints()
Return the endpoints
|
String |
getPath(String endpoint) |
String |
getPrefix() |
boolean |
isDisabled()
Returns if this mapping is disabled.
|
protected boolean |
isHandler(Class<?> beanType)
Since all handler beans are passed into the constructor there is no need to detect
anything here
|
protected void |
registerHandlerMethod(Object handler,
Method method,
RequestMappingInfo mapping) |
void |
setDisabled(boolean disabled)
Sets if this mapping is disabled.
|
void |
setPrefix(String prefix) |
createRequestMappingInfo, getContentNegotiationManager, getCustomMethodCondition, getCustomTypeCondition, getFileExtensions, getMappingForMethod, resolveEmbeddedValuesInPatterns, setContentNegotiationManager, setEmbeddedValueResolver, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, useRegisteredSuffixPatternMatch, useSuffixPatternMatch, useTrailingSlashMatchgetMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatch, handleNoMatchcreateHandlerMethod, detectHandlerMethods, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, handlerMethodsInitialized, initHandlerMethods, lookupHandlerMethod, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategyadaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelpergetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextgetApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetApplicationContextpublic EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints)
EndpointHandlerMapping instance. All Endpoints will be
detected from the ApplicationContext.endpoints - the endpointspublic void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanafterPropertiesSet in class RequestMappingHandlerMappingprotected boolean isHandler(Class<?> beanType)
isHandler in class RequestMappingHandlerMappingprotected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping)
registerHandlerMethod in class AbstractHandlerMethodMapping<RequestMappingInfo>public void setPrefix(String prefix)
prefix - the prefix to setpublic String getPrefix()
public String getPath(String endpoint)
endpoint - the endpointpublic void setDisabled(boolean disabled)
disabled - if the mapping is disabledpublic boolean isDisabled()
public Set<? extends MvcEndpoint> getEndpoints()
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.