public class EndpointHandlerMapping
extends RequestMappingHandlerMapping
implements org.springframework.context.ApplicationContextAware
HandlerMapping
to map Endpoint
s 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 signaturess will break in a non-servlet environment.
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
|
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) |
public EndpointHandlerMapping(Collection<? extends MvcEndpoint> endpoints)
EndpointHandlerMapping
instance. All Endpoint
s will be
detected from the ApplicationContext
.endpoints
- public void afterPropertiesSet()
protected boolean isHandler(Class<?> beanType)
protected void registerHandlerMethod(Object handler, Method method, RequestMappingInfo mapping)
public void setPrefix(String prefix)
prefix
- the prefix to setpublic void setDisabled(boolean disabled)
public boolean isDisabled()
public Set<? extends MvcEndpoint> getEndpoints()
Copyright © 2014. All rights reserved.