Spring Web Services Framework

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

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.SimpleActionEndpointMapping
All Implemented Interfaces:
Aware, InitializingBean, ApplicationContextAware, 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:
MessageAddressingProperties.getAction()

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
SimpleActionEndpointMapping()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  URI getEndpointAddress(Object endpoint)
          Returns the address property of the given endpoint.
protected  void registerEndpoints(Map<URI,Object> actionMap)
          Register all endpoints specified in the action map.
 void setActionMap(Map<?,Object> actionMap)
          Set a Map with action URIs as keys and handler beans (or handler bean names) as values.
 void setAddress(URI address)
          Set the address property.
 void setMappings(Properties mappings)
          Map action URIs to endpoint bean names.
 
Methods inherited from class org.springframework.ws.soap.addressing.server.AbstractActionEndpointMapping
getEndpointInternal, getFaultAction, getFaultActionSuffix, getOutputActionSuffix, getResponseAction, lookupEndpoint, registerEndpoint, setApplicationContext, setFaultActionSuffix, setOutputActionSuffix
 
Methods inherited from class org.springframework.ws.soap.addressing.server.AbstractAddressingEndpointMapping
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

SimpleActionEndpointMapping

public SimpleActionEndpointMapping()
Method Detail

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(java.util.Map)

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:
setMappings(java.util.Properties)

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 InitializingBean
Overrides:
afterPropertiesSet in class AbstractAddressingEndpointMapping
Throws:
Exception

registerEndpoints

protected void registerEndpoints(Map<URI,Object> actionMap)
                          throws 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:
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

Spring Web Services Framework

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