public class UriEndpointMapping extends AbstractMapBasedEndpointMapping
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 AxiomSoapMessageFactory
with the payloadCaching
disabled). However, this endpoint mapping obviously is transport specific.
Constructor and Description |
---|
UriEndpointMapping() |
Modifier and Type | Method and Description |
---|---|
protected String |
getLookupKeyForMessage(MessageContext messageContext)
Returns the 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.
|
getEndpointInternal, initApplicationContext, lookupEndpoint, registerEndpoint, setEndpointMap, setLazyInitEndpoints, setMappings, setRegisterBeanNames
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrder
public void setUsePath(boolean usePath)
false
.protected boolean validateLookupKey(String key)
AbstractMapBasedEndpointMapping
true
is the given string is valid.validateLookupKey
in class AbstractMapBasedEndpointMapping
protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception
AbstractMapBasedEndpointMapping
null
if a key cannot be found.getLookupKeyForMessage
in class AbstractMapBasedEndpointMapping
null
Exception