Spring Web Services Framework

org.springframework.ws.server.endpoint.adapter
Class DefaultMethodEndpointAdapter

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter
          extended by org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter
All Implemented Interfaces:
Aware, BeanClassLoaderAware, InitializingBean, EndpointAdapter

public class DefaultMethodEndpointAdapter
extends AbstractMethodEndpointAdapter
implements BeanClassLoaderAware, 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
DefaultMethodEndpointAdapter()
           
 
Method Summary
 void afterPropertiesSet()
           
 List<MethodArgumentResolver> getMethodArgumentResolvers()
          Returns the list of MethodArgumentResolvers 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 MethodReturnValueHandlers 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 setMethodArgumentResolvers(List<MethodArgumentResolver> methodArgumentResolvers)
          Sets the list of MethodArgumentResolvers to use.
 void setMethodReturnValueHandlers(List<MethodReturnValueHandler> methodReturnValueHandlers)
          Sets the list of MethodReturnValueHandlers 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMethodEndpointAdapter

public DefaultMethodEndpointAdapter()
Method Detail

getMethodArgumentResolvers

public List<MethodArgumentResolver> getMethodArgumentResolvers()
Returns the list of MethodArgumentResolvers to use.


setMethodArgumentResolvers

public void setMethodArgumentResolvers(List<MethodArgumentResolver> methodArgumentResolvers)
Sets the list of MethodArgumentResolvers to use.


getMethodReturnValueHandlers

public List<MethodReturnValueHandler> getMethodReturnValueHandlers()
Returns the list of MethodReturnValueHandlers to use.


setMethodReturnValueHandlers

public void setMethodReturnValueHandlers(List<MethodReturnValueHandler> methodReturnValueHandlers)
Sets the list of MethodReturnValueHandlers to use.


setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

initDefaultStrategies

protected void initDefaultStrategies()
Initialize the default implementations for the adapter's strategies.


supportsInternal

protected boolean supportsInternal(MethodEndpoint methodEndpoint)
Description copied from class: AbstractMethodEndpointAdapter
Given a method endpoint, return whether or not this adapter can support it.

Specified by:
supportsInternal in class AbstractMethodEndpointAdapter
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 class AbstractMethodEndpointAdapter
Parameters:
messageContext - the current message context
methodEndpoint - 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 context
methodEndpoint - 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 context
returnValue - the return value
methodEndpoint - the method endpoint to get arguments for
Throws:
Exception - in case of errors

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.