Spring Web Services Framework

org.springframework.ws.soap.server.endpoint
Class SoapFaultMappingExceptionResolver

java.lang.Object
  extended by org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver
      extended by org.springframework.ws.soap.server.endpoint.AbstractSoapFaultDefinitionExceptionResolver
          extended by org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver
All Implemented Interfaces:
Ordered, EndpointExceptionResolver

public class SoapFaultMappingExceptionResolver
extends AbstractSoapFaultDefinitionExceptionResolver

Exception resolver that allows for mapping exception class names to SOAP Faults. The mappings are set using the exceptionMappings property, the format of which is documented in SoapFaultDefinitionEditor.

Since:
1.0.0
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
SoapFaultMappingExceptionResolver()
           
 
Method Summary
protected  int getDepth(String exceptionMapping, Exception ex)
          Return the depth to the superclass matching.
protected  SoapFaultDefinition getFaultDefinition(Object endpoint, Exception ex)
          Template method that returns the SoapFaultDefinition for the given exception.
 void setExceptionMappings(Properties mappings)
          Set the mappings between exception class names and SOAP Faults.
 
Methods inherited from class org.springframework.ws.soap.server.endpoint.AbstractSoapFaultDefinitionExceptionResolver
customizeFault, resolveExceptionInternal, setDefaultFault
 
Methods inherited from class org.springframework.ws.server.endpoint.AbstractEndpointExceptionResolver
buildLogMessage, getOrder, logException, resolveException, setMappedEndpoints, setOrder, setWarnLogCategory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapFaultMappingExceptionResolver

public SoapFaultMappingExceptionResolver()
Method Detail

setExceptionMappings

public void setExceptionMappings(Properties mappings)
Set the mappings between exception class names and SOAP Faults. The exception class name can be a substring, with no wildcard support at present.

The values of the given properties object should use the format described in SoapFaultDefinitionEditor.

Follows the same matching algorithm as SimpleMappingExceptionResolver.

Parameters:
mappings - exception patterns (can also be fully qualified class names) as keys, fault definition texts as values
See Also:
SoapFaultDefinitionEditor

getFaultDefinition

protected SoapFaultDefinition getFaultDefinition(Object endpoint,
                                                 Exception ex)
Description copied from class: AbstractSoapFaultDefinitionExceptionResolver
Template method that returns the SoapFaultDefinition for the given exception.

Specified by:
getFaultDefinition in class AbstractSoapFaultDefinitionExceptionResolver
Parameters:
endpoint - the executed endpoint, or null if none chosen at the time of the exception
ex - the exception to be handled
Returns:
the definition mapped to the exception, or null if none is found.

getDepth

protected int getDepth(String exceptionMapping,
                       Exception ex)
Return the depth to the superclass matching. 0 means ex matches exactly. Returns -1 if there's no match. Otherwise, returns depth. Lowest depth wins.

Follows the same algorithm as RollbackRuleAttribute, and SimpleMappingExceptionResolver


Spring Web Services Framework

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