class AbstractHandlerMethodMapping.MappingRegistry
extends java.lang.Object
Package-private for testing purposes.
Modifier and Type | Field and Description |
---|---|
private java.util.Map<HandlerMethod,CorsConfiguration> |
corsLookup |
private java.util.Map<T,HandlerMethod> |
mappingLookup |
private java.util.concurrent.locks.ReentrantReadWriteLock |
readWriteLock |
private java.util.Map<T,AbstractHandlerMethodMapping.MappingRegistration<T>> |
registry |
private MultiValueMap<java.lang.String,T> |
urlLookup |
Constructor and Description |
---|
MappingRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
acquireReadLock()
Acquire the read lock when using getMappings and getMappingsByUrl.
|
private void |
assertUniqueMethodMapping(HandlerMethod newHandlerMethod,
T mapping) |
CorsConfiguration |
getCorsConfiguration(HandlerMethod handlerMethod)
Return CORS configuration.
|
private java.util.List<java.lang.String> |
getDirectUrls(T mapping) |
java.util.Map<T,HandlerMethod> |
getMappings()
Return all mappings and handler methods.
|
java.util.List<T> |
getMappingsByUrl(java.lang.String urlPath)
Return matches for the given URL path.
|
void |
register(T mapping,
java.lang.Object handler,
java.lang.reflect.Method method) |
void |
releaseReadLock()
Release the read lock after using getMappings and getMappingsByUrl.
|
void |
unregister(T mapping) |
private final java.util.Map<T,AbstractHandlerMethodMapping.MappingRegistration<T>> registry
private final java.util.Map<T,HandlerMethod> mappingLookup
private final MultiValueMap<java.lang.String,T> urlLookup
private final java.util.Map<HandlerMethod,CorsConfiguration> corsLookup
private final java.util.concurrent.locks.ReentrantReadWriteLock readWriteLock
public java.util.Map<T,HandlerMethod> getMappings()
acquireReadLock()
public java.util.List<T> getMappingsByUrl(java.lang.String urlPath)
acquireReadLock()
public CorsConfiguration getCorsConfiguration(HandlerMethod handlerMethod)
public void acquireReadLock()
public void releaseReadLock()
public void register(T mapping, java.lang.Object handler, java.lang.reflect.Method method)
private void assertUniqueMethodMapping(HandlerMethod newHandlerMethod, T mapping)
private java.util.List<java.lang.String> getDirectUrls(T mapping)
public void unregister(T mapping)