Class SimpleMethodEndpointMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping<String>
org.springframework.ws.server.endpoint.mapping.SimpleMethodEndpointMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.core.Ordered
,EndpointMapping
public class SimpleMethodEndpointMapping
extends AbstractMethodEndpointMapping<String>
implements org.springframework.beans.factory.InitializingBean
Simple subclass of
AbstractMethodEndpointMapping
that maps from the local name
of the request payload to methods. Endpoint beans are registered using the
endpoints
property; the endpoint methods that start with methodPrefix
and end with methodSuffix
will be registered.
Endpoints typically have the following form:
public class MyEndpoint{ public Source handleMyMessage(Source source) { ... } }This method will handle any message that has the
MyMessage
as a payload root
local name.- Since:
- 1.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default method prefix.static final String
Default method suffix.Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Object[]
protected @Nullable String
getLookupKeyForMessage
(MessageContext messageContext) Returns the local part of the payload root element of the request.protected @Nullable String
getLookupKeyForMethod
(Method method) Returns the name of the given method, with the prefix and suffix stripped off.Returns the method prefix.Returns the method suffix.void
setEndpoints
(Object[] endpoints) Sets the endpoints.void
setMethodPrefix
(String methodPrefix) Sets the method prefix.void
setMethodSuffix
(String methodSuffix) Sets the method suffix.Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractMethodEndpointMapping
getEndpointClass, getEndpointInternal, getLookupKeysForMethod, lookupEndpoint, registerEndpoint, registerMethods, registerMethods
Methods inherited from class org.springframework.ws.server.endpoint.mapping.AbstractEndpointMapping
createEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initApplicationContext, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrder
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
DEFAULT_METHOD_PREFIX
Default method prefix.- See Also:
-
DEFAULT_METHOD_SUFFIX
Default method suffix.- See Also:
-
-
Constructor Details
-
SimpleMethodEndpointMapping
public SimpleMethodEndpointMapping()
-
-
Method Details
-
getEndpoints
-
setEndpoints
Sets the endpoints. The endpoint methods that start withmethodPrefix
and end withmethodSuffix
will be registered. -
getMethodPrefix
Returns the method prefix. -
setMethodPrefix
Sets the method prefix. All methods with names starting with this string will be registered. Default is "handle
".- See Also:
-
getMethodSuffix
Returns the method suffix. -
setMethodSuffix
Sets the method suffix. All methods with names ending with this string will be registered. Default is "" (i.e. no suffix).- See Also:
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
getLookupKeyForMethod
Returns the name of the given method, with the prefix and suffix stripped off.- Overrides:
getLookupKeyForMethod
in classAbstractMethodEndpointMapping<String>
- Parameters:
method
- the method- Returns:
- a registration key, or
null
if the method is not to be registered - See Also:
-
getLookupKeyForMessage
protected @Nullable String getLookupKeyForMessage(MessageContext messageContext) throws TransformerException Returns the local part of the payload root element of the request.- Specified by:
getLookupKeyForMessage
in classAbstractMethodEndpointMapping<String>
- Returns:
- the registration keys
- Throws:
TransformerException
-