Class DefaultMethodEndpointAdapter
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.InitializingBean
,EndpointAdapter
public class DefaultMethodEndpointAdapter
extends AbstractMethodEndpointAdapter
implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean
Default extension of
AbstractMethodEndpointAdapter
with support for pluggable
argument resolvers and return value
handlers.- Since:
- 2.0
- Author:
- Arjen Poutsma
-
Field Summary
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the custom argument resolvers.Returns the custom return value handlers.Returns the list ofMethodArgumentResolver
s to use.protected Object[]
getMethodArguments
(MessageContext messageContext, MethodEndpoint methodEndpoint) Returns the argument array for the given method endpoint.Returns the list ofMethodReturnValueHandler
s to use.protected void
handleMethodReturnValue
(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) Handle the return value for the given method endpoint.protected void
Initialize the default implementations for the adapter's strategies.protected final void
invokeInternal
(MessageContext messageContext, MethodEndpoint methodEndpoint) Use the given method endpoint to handle the request.void
setBeanClassLoader
(ClassLoader classLoader) void
setCustomMethodArgumentResolvers
(List<MethodArgumentResolver> customMethodArgumentResolvers) Sets the custom handlers for method arguments.void
setCustomMethodReturnValueHandlers
(List<MethodReturnValueHandler> customMethodReturnValueHandlers) Sets the handlers for custom return value types.void
setMethodArgumentResolvers
(List<MethodArgumentResolver> methodArgumentResolvers) Sets the list ofMethodArgumentResolver
s to use.void
setMethodReturnValueHandlers
(List<MethodReturnValueHandler> methodReturnValueHandlers) Sets the list ofMethodReturnValueHandler
s to use.protected boolean
supportsInternal
(MethodEndpoint methodEndpoint) Given a method endpoint, return whether or not this adapter can support it.Methods inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
invoke, supports
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Constructor Details
-
DefaultMethodEndpointAdapter
public DefaultMethodEndpointAdapter()
-
-
Method Details
-
getMethodArgumentResolvers
Returns the list ofMethodArgumentResolver
s to use. -
setMethodArgumentResolvers
Sets the list ofMethodArgumentResolver
s to use. -
getCustomMethodArgumentResolvers
Returns the custom argument resolvers. -
setCustomMethodArgumentResolvers
public void setCustomMethodArgumentResolvers(List<MethodArgumentResolver> customMethodArgumentResolvers) Sets the custom handlers for method arguments. Custom handlers are ordered after built-in ones. To override the built-in support for return value handling usesetMethodArgumentResolvers(List)
. -
getMethodReturnValueHandlers
Returns the list ofMethodReturnValueHandler
s to use. -
setMethodReturnValueHandlers
Sets the list ofMethodReturnValueHandler
s to use. -
getCustomMethodReturnValueHandlers
Returns the custom return value handlers. -
setCustomMethodReturnValueHandlers
public void setCustomMethodReturnValueHandlers(List<MethodReturnValueHandler> customMethodReturnValueHandlers) Sets the handlers for custom return value types. Custom handlers are ordered after built-in ones. To override the built-in support for return value handling usesetMethodReturnValueHandlers(List)
. -
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
initDefaultStrategies
protected void initDefaultStrategies()Initialize the default implementations for the adapter's strategies. -
supportsInternal
Description copied from class:AbstractMethodEndpointAdapter
Given a method endpoint, return whether or not this adapter can support it.- Specified by:
supportsInternal
in classAbstractMethodEndpointAdapter
- Parameters:
methodEndpoint
- method endpoint to check- Returns:
- whether or not this adapter can adapt the given method
-
invokeInternal
protected final void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception Description copied from class:AbstractMethodEndpointAdapter
Use the given method endpoint to handle the request.- Specified by:
invokeInternal
in classAbstractMethodEndpointAdapter
- Parameters:
messageContext
- the current message contextmethodEndpoint
- the method endpoint to use- Throws:
Exception
- in case of errors
-
getMethodArguments
protected Object[] getMethodArguments(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception Returns the argument array for the given method endpoint.This implementation iterates over the set argument resolvers to resolve each argument.
- Parameters:
messageContext
- the current message contextmethodEndpoint
- the method endpoint to get arguments for- Returns:
- the arguments
- Throws:
Exception
- in case of errors
-
handleMethodReturnValue
protected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception Handle the return value for the given method endpoint.This implementation iterates over the set setMethodReturnValueHandlers(java.util.List) return value handlers} to resolve the return value.
- Parameters:
messageContext
- the current message contextreturnValue
- the return valuemethodEndpoint
- the method endpoint to get arguments for- Throws:
Exception
- in case of errors
-