Spring Web Services Framework

org.springframework.ws.soap.addressing.server
Class AnnotationActionEndpointMapping

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.soap.addressing.server.AbstractAddressingEndpointMapping
          extended by org.springframework.ws.soap.addressing.server.AbstractActionEndpointMapping
              extended by org.springframework.ws.soap.addressing.server.AbstractActionMethodEndpointMapping
                  extended by org.springframework.ws.soap.addressing.server.AnnotationActionEndpointMapping
All Implemented Interfaces:
Aware, BeanPostProcessor, InitializingBean, ApplicationContextAware, Ordered, EndpointMapping, SoapEndpointMapping

public class AnnotationActionEndpointMapping
extends AbstractActionMethodEndpointMapping
implements BeanPostProcessor

Implementation of the EndpointMapping interface that uses the @Action annotation to map methods to a WS-Addressing Action header.

Endpoints typically have the following form:

 @Endpoint
 @Address("mailto:[email protected]")
 public class MyEndpoint{
    @Action("http://fabrikam123.example/mail/Delete")
    public Source doSomethingWithRequest() {
       ...
    }
 }
 

If set, the @Address annotation on the endpoint class should be equal to the destination property of the incoming message.

Since:
1.5.0
Author:
Arjen Poutsma
See Also:
Action, Address

Field Summary
 
Fields inherited from class org.springframework.ws.soap.addressing.server.AbstractActionEndpointMapping
DEFAULT_FAULT_ACTION_SUFFIX, DEFAULT_OUTPUT_ACTION_SUFFIX
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AnnotationActionEndpointMapping()
           
 
Method Summary
protected  URI getActionForMethod(Method method)
          Returns the action value for the specified method.
protected  URI getEndpointAddress(Object endpoint)
          Returns the address property of the given MethodEndpoint, by looking for the Address annotation.
protected  Class<? extends Annotation> getEndpointAnnotationType()
          Returns the 'endpoint' annotation type.
protected  URI getFaultAction(Object endpoint, MessageAddressingProperties map)
          Provides the WS-Addressing Action for response fault messages, given the endpoint, and request Message Addressing Properties.
protected  URI getResponseAction(Object endpoint, MessageAddressingProperties map)
          Provides the WS-Addressing Action for response messages, given the endpoint, and request Message Addressing Properties.
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 
Methods inherited from class org.springframework.ws.soap.addressing.server.AbstractActionMethodEndpointMapping
getEndpointClass, registerMethods
 
Methods inherited from class org.springframework.ws.soap.addressing.server.AbstractActionEndpointMapping
getEndpointInternal, getFaultActionSuffix, getOutputActionSuffix, lookupEndpoint, registerEndpoint, setApplicationContext, setFaultActionSuffix, setOutputActionSuffix
 
Methods inherited from class org.springframework.ws.soap.addressing.server.AbstractAddressingEndpointMapping
afterPropertiesSet, getEndpoint, getMessageIdStrategy, getMessageIdStrategy, getMessageSenders, getMessageSenders, getOrder, initDefaultStrategies, setActorOrRole, setActorsOrRoles, setMessageIdStrategy, setMessageSender, setMessageSenders, setOrder, setPostInterceptors, setPreInterceptors, setUltimateReceiver, setVersions
 
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

AnnotationActionEndpointMapping

public AnnotationActionEndpointMapping()
Method Detail

getEndpointAnnotationType

protected Class<? extends Annotation> getEndpointAnnotationType()
Returns the 'endpoint' annotation type. Default is Endpoint.


getActionForMethod

protected URI getActionForMethod(Method method)
Returns the action value for the specified method. Default implementation looks for the Action annotation value.

Specified by:
getActionForMethod in class AbstractActionMethodEndpointMapping

getEndpointAddress

protected URI getEndpointAddress(Object endpoint)
Returns the address property of the given MethodEndpoint, by looking for the Address annotation. The value of this property should match the destination of incoming messages. Returns null if the anotation is not present, thus ignoring the destination property.

Specified by:
getEndpointAddress in class AbstractActionEndpointMapping
Parameters:
endpoint - the method endpoint to return the address for
Returns:
the endpoint address; or null to ignore the destination property

getResponseAction

protected URI getResponseAction(Object endpoint,
                                MessageAddressingProperties map)
Description copied from class: AbstractAddressingEndpointMapping
Provides the WS-Addressing Action for response messages, given the endpoint, and request Message Addressing Properties.

Overrides:
getResponseAction in class AbstractActionEndpointMapping
Parameters:
endpoint - the mapped endpoint
map - the MAP for the request
Returns:
the response Action

getFaultAction

protected URI getFaultAction(Object endpoint,
                             MessageAddressingProperties map)
Description copied from class: AbstractAddressingEndpointMapping
Provides the WS-Addressing Action for response fault messages, given the endpoint, and request Message Addressing Properties.

Overrides:
getFaultAction in class AbstractActionEndpointMapping
Parameters:
endpoint - the mapped endpoint
map - the MAP for the request
Returns:
the response Action

postProcessBeforeInitialization

public final Object postProcessBeforeInitialization(Object bean,
                                                    String beanName)
                                             throws BeansException
Specified by:
postProcessBeforeInitialization in interface BeanPostProcessor
Throws:
BeansException

postProcessAfterInitialization

public final Object postProcessAfterInitialization(Object bean,
                                                   String beanName)
                                            throws BeansException
Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Throws:
BeansException

Spring Web Services Framework

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