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
-
Field Summary
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the list ofMethodArgumentResolver
s to use.protected @Nullable 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
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.static DefaultMethodEndpointAdapter
Create a new instance with default method argument and return value resolvers.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
-
withDefaults
Create a new instance with default method argument and return value resolvers.- Returns:
- a new instance with defaults configured
-
getMethodArgumentResolvers
Returns the list ofMethodArgumentResolver
s to use. -
setMethodArgumentResolvers
Sets the list ofMethodArgumentResolver
s to use. -
getMethodReturnValueHandlers
Returns the list ofMethodReturnValueHandler
s to use. -
setMethodReturnValueHandlers
Sets the list ofMethodReturnValueHandler
s to use. -
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 @Nullable 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
-