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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns the custom argument resolvers.Returns the custom return value handlers.Returns the list ofMethodArgumentResolvers to use.protected 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) voidsetCustomMethodArgumentResolvers(List<MethodArgumentResolver> customMethodArgumentResolvers) Sets the custom handlers for method arguments.voidsetCustomMethodReturnValueHandlers(List<MethodReturnValueHandler> customMethodReturnValueHandlers) Sets the handlers for custom return value types.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.Methods inherited from class org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
invoke, supportsMethods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Constructor Details
-
DefaultMethodEndpointAdapter
public DefaultMethodEndpointAdapter()
-
-
Method Details
-
getMethodArgumentResolvers
Returns the list ofMethodArgumentResolvers to use. -
setMethodArgumentResolvers
Sets the list ofMethodArgumentResolvers 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 ofMethodReturnValueHandlers to use. -
setMethodReturnValueHandlers
Sets the list ofMethodReturnValueHandlers 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:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin 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: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 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
-