Class SimpleActionEndpointMapping

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

public class SimpleActionEndpointMapping extends AbstractActionEndpointMapping
Implementation of the EndpointMapping interface to map from WS-Addressing Action Message Addressing Property to endpoint beans. Supports both mapping to bean instances and mapping to bean names.

The endpointMap property is suitable for populating the endpoint map with bean references, e.g. via the map element in XML bean definitions.

Mappings to bean names can be set via the mappings property, in a form accepted by the java.util.Properties class, like as follows:

 http://www.springframework.org/spring-ws/samples/airline/BookFlight=bookFlightEndpoint
 http://www.springframework.org/spring-ws/samples/airline/GetFlights=getFlightsEndpoint
 
The syntax is WS_ADDRESSING_ACTION=ENDPOINT_BEAN_NAME.

If set, the address property should be equal to the destination property of the incominging message. As such, it can be used to create multiple Endpoint References, by defining multiple SimpleActionEndpointMapping bean definitions with different address property values.

Since:
1.5.0
Author:
Arjen Poutsma
See Also:
  • Constructor Details

    • SimpleActionEndpointMapping

      public SimpleActionEndpointMapping()
  • Method Details

    • setMappings

      public void setMappings(Properties mappings) throws URISyntaxException
      Map action URIs to endpoint bean names. This is the typical way of configuring this EndpointMapping.
      Parameters:
      mappings - properties with URLs as keys and bean names as values
      Throws:
      URISyntaxException
      See Also:
    • setActionMap

      public void setActionMap(Map<?,Object> actionMap) throws URISyntaxException
      Set a Map with action URIs as keys and handler beans (or handler bean names) as values. Convenient for population with bean references.
      Parameters:
      actionMap - map with action URIs as keys and beans as values
      Throws:
      URISyntaxException
      See Also:
    • setAddress

      public void setAddress(URI address)
      Set the address property. If set, value of this property is compared to the destination property of the incominging message.
      Parameters:
      address - the address URI
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class AbstractAddressingEndpointMapping
      Throws:
      Exception
    • registerEndpoints

      protected void registerEndpoints(Map<URI,Object> actionMap) throws org.springframework.beans.BeansException
      Register all endpoints specified in the action map.
      Parameters:
      actionMap - Map with action URIs as keys and endppint beans or bean names as values
      Throws:
      org.springframework.beans.BeansException - if an endpoint couldn't be registered
      IllegalStateException - if there is a conflicting endpoint registered
    • getEndpointAddress

      protected URI getEndpointAddress(Object endpoint)
      Description copied from class: AbstractActionEndpointMapping
      Returns the address property of the given endpoint. The value of this property should match the destination of incoming messages. May return null to ignore the destination.
      Specified by:
      getEndpointAddress in class AbstractActionEndpointMapping
      Parameters:
      endpoint - the endpoint to return the address for
      Returns:
      the endpoint address; or null to ignore the destination property