public class DefaultMethodEndpointAdapter extends AbstractMethodEndpointAdapter implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.InitializingBean
AbstractMethodEndpointAdapter
with support for pluggable argument resolvers and return value handlers.logger
Constructor and Description |
---|
DefaultMethodEndpointAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
List<MethodArgumentResolver> |
getCustomMethodArgumentResolvers()
Returns the custom argument resolvers.
|
List<MethodReturnValueHandler> |
getCustomMethodReturnValueHandlers()
Returns the custom return value handlers.
|
List<MethodArgumentResolver> |
getMethodArgumentResolvers()
Returns the list of
MethodArgumentResolver s to use. |
protected Object[] |
getMethodArguments(MessageContext messageContext,
MethodEndpoint methodEndpoint)
Returns the argument array for the given method endpoint.
|
List<MethodReturnValueHandler> |
getMethodReturnValueHandlers()
Returns the list of
MethodReturnValueHandler s to use. |
protected void |
handleMethodReturnValue(MessageContext messageContext,
Object returnValue,
MethodEndpoint methodEndpoint)
Handle the return value for the given method endpoint.
|
protected void |
initDefaultStrategies()
Initialize the default implementations for the adapter's strategies.
|
protected 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 of
MethodArgumentResolver s to use. |
void |
setMethodReturnValueHandlers(List<MethodReturnValueHandler> methodReturnValueHandlers)
Sets the list of
MethodReturnValueHandler s to use. |
protected boolean |
supportsInternal(MethodEndpoint methodEndpoint)
Given a method endpoint, return whether or not this adapter can support it.
|
invoke, supports
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
public List<MethodArgumentResolver> getMethodArgumentResolvers()
MethodArgumentResolver
s to use.public void setMethodArgumentResolvers(List<MethodArgumentResolver> methodArgumentResolvers)
MethodArgumentResolver
s to use.public List<MethodArgumentResolver> getCustomMethodArgumentResolvers()
public void setCustomMethodArgumentResolvers(List<MethodArgumentResolver> customMethodArgumentResolvers)
setMethodArgumentResolvers(List)
.public List<MethodReturnValueHandler> getMethodReturnValueHandlers()
MethodReturnValueHandler
s to use.public void setMethodReturnValueHandlers(List<MethodReturnValueHandler> methodReturnValueHandlers)
MethodReturnValueHandler
s to use.public List<MethodReturnValueHandler> getCustomMethodReturnValueHandlers()
public void setCustomMethodReturnValueHandlers(List<MethodReturnValueHandler> customMethodReturnValueHandlers)
setMethodReturnValueHandlers(List)
.public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected void initDefaultStrategies()
protected boolean supportsInternal(MethodEndpoint methodEndpoint)
AbstractMethodEndpointAdapter
supportsInternal
in class AbstractMethodEndpointAdapter
methodEndpoint
- method endpoint to checkprotected final void invokeInternal(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception
AbstractMethodEndpointAdapter
invokeInternal
in class AbstractMethodEndpointAdapter
messageContext
- the current message contextmethodEndpoint
- the method endpoint to useException
- in case of errorsprotected Object[] getMethodArguments(MessageContext messageContext, MethodEndpoint methodEndpoint) throws Exception
This implementation iterates over the set argument resolvers to resolve each argument.
messageContext
- the current message contextmethodEndpoint
- the method endpoint to get arguments forException
- in case of errorsprotected void handleMethodReturnValue(MessageContext messageContext, Object returnValue, MethodEndpoint methodEndpoint) throws Exception
This implementation iterates over the set setMethodReturnValueHandlers(java.util.List) return value handlers} to resolve the return value.
messageContext
- the current message contextreturnValue
- the return valuemethodEndpoint
- the method endpoint to get arguments forException
- in case of errorsCopyright © 2020 Pivotal Software. All rights reserved.