Class AnnotationActionEndpointMapping

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, EndpointMapping, SoapEndpointMapping

public class AnnotationActionEndpointMapping extends AbstractActionMethodEndpointMapping implements org.springframework.beans.factory.SmartInitializingSingleton
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, Corneil du Plessis (with thanks to Chris Bono)
See Also:
  • Constructor Details

    • AnnotationActionEndpointMapping

      public AnnotationActionEndpointMapping()
  • Method Details

    • 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
    • afterSingletonsInstantiated

      public void afterSingletonsInstantiated()
      Specified by:
      afterSingletonsInstantiated in interface org.springframework.beans.factory.SmartInitializingSingleton