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 TransformerObjectSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the list ofMethodArgumentResolvers to use.protected @Nullable Object[]getMethodArguments(MessageContext messageContext, MethodEndpoint methodEndpoint) Returns the argument array for the given method endpoint.Returns the list ofMethodReturnValueHandlers to use.protected voidhandleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) Handle the return value for the given method endpoint.protected voidInitialize the default implementations for the adapter's strategies.protected final voidinvokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) Use the given method endpoint to handle the request.voidsetBeanClassLoader(ClassLoader classLoader) voidsetMethodArgumentResolvers(List<MethodArgumentResolver> methodArgumentResolvers) Sets the list ofMethodArgumentResolvers to use.voidsetMethodReturnValueHandlers(List<MethodReturnValueHandler> methodReturnValueHandlers) Sets the list ofMethodReturnValueHandlers to use.protected booleansupportsInternal(MethodEndpoint methodEndpoint) Given a method endpoint, return whether or not this adapter can support it.static DefaultMethodEndpointAdapterCreate a new instance with default method argument and return value resolvers.Methods inherited from class AbstractMethodEndpointAdapter
invoke, supportsMethods inherited from class 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 ofMethodArgumentResolvers to use. -
setMethodArgumentResolvers
Sets the list ofMethodArgumentResolvers to use. -
getMethodReturnValueHandlers
Returns the list ofMethodReturnValueHandlers to use. -
setMethodReturnValueHandlers
Sets the list ofMethodReturnValueHandlers to use. -
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
afterPropertiesSet
-
initDefaultStrategies
protected void initDefaultStrategies()Initialize the default implementations for the adapter's strategies. -
supportsInternal
Description copied from class:AbstractMethodEndpointAdapterGiven a method endpoint, return whether or not this adapter can support it.- Specified by:
supportsInternalin 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:AbstractMethodEndpointAdapterUse the given method endpoint to handle the request.- Specified by:
invokeInternalin 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
-