Class UriEndpointMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping
org.springframework.ws.server.endpoint.mapping.UriEndpointMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
,EndpointMapping
Implementation of the
EndpointMapping
interface to map from the full request URI or request URI path to
endpoint beans. Supports both mapping to bean instances and mapping to bean names: the latter is required for
prototype handlers.
When the usePath
property is enabled, the mapping will be based on the URI path rather
than the full URI.
The endpointMap
property is suitable for populating the endpoint map with bean references, e.g. via the map
element in XML bean definitions.
Mappings to bean names can be set via the mappings
property, in a form accepted by the
java.util.Properties
class, like as follows:
http://example.com:8080/services/bookFlight=bookFlightEndpoint jms://exampleQueue=getFlightsEndpointor, when the
usePath
property is enabled:
/services/bookFlight=bookFlightEndpointThe syntax is [URI|PATH]=ENDPOINT_BEAN_NAME.
This endpoint mapping does not read from the request message, and therefore is more suitable for message factories
which directly read from the transport request (such as the SaajSoapMessageFactory
with the
payloadCaching
disabled). However, this endpoint mapping obviously is transport specific.
- Since:
- 1.5.0
- Author:
- Arjen Poutsma
-
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getLookupKeyForMessage
(MessageContext messageContext) Returns the endpoint key for the given message context.void
setUsePath
(boolean usePath) Indicates whether the path should be used instead of the full URI.protected boolean
validateLookupKey
(String key) Validates the given endpoint key.Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpointMapping
getEndpointInternal, initApplicationContext, lookupEndpoint, registerEndpoint, setEndpointMap, setLazyInitEndpoints, setMappings, setRegisterBeanNames
Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
UriEndpointMapping
public UriEndpointMapping()
-
-
Method Details
-
setUsePath
public void setUsePath(boolean usePath) Indicates whether the path should be used instead of the full URI. Default isfalse
.- Since:
- 2.1.1
-
validateLookupKey
Description copied from class:AbstractMapBasedEndpointMapping
Validates the given endpoint key. Should returntrue
is the given string is valid.- Specified by:
validateLookupKey
in classAbstractMapBasedEndpointMapping
-
getLookupKeyForMessage
Description copied from class:AbstractMapBasedEndpointMapping
Returns the endpoint key for the given message context. Returnsnull
if a key cannot be found.- Specified by:
getLookupKeyForMessage
in classAbstractMapBasedEndpointMapping
- Returns:
- the registration key; or
null
- Throws:
Exception
-