Spring Web Services Framework

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

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

public abstract class AbstractSoapFaultDefinitionExceptionResolver
extends AbstractEndpointExceptionResolver

Abstract base class for SOAP-based EndpointExceptionResolver implementations that depend on SoapFaultDefinition. Provides a default endpoint property, and a template method that provides the definition for a given exception.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
setDefaultFault(SoapFaultDefinition), getFaultDefinition(Object,Exception)

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
AbstractSoapFaultDefinitionExceptionResolver()
           
 
Method Summary
protected  void customizeFault(Object endpoint, Exception ex, SoapFault fault)
          Customize the SoapFault created by this resolver.
protected abstract  SoapFaultDefinition getFaultDefinition(Object endpoint, Exception ex)
          Template method that returns the SoapFaultDefinition for the given exception.
protected  boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex)
          Template method for resolving exceptions that is called by AbstractEndpointExceptionResolver.resolveException(org.springframework.ws.context.MessageContext, java.lang.Object, java.lang.Exception).
 void setDefaultFault(SoapFaultDefinition defaultFault)
          Set the default fault.
 
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

AbstractSoapFaultDefinitionExceptionResolver

public AbstractSoapFaultDefinitionExceptionResolver()
Method Detail

setDefaultFault

public void setDefaultFault(SoapFaultDefinition defaultFault)
Set the default fault. This fault will be returned if no specific mapping was found.


getFaultDefinition

protected abstract SoapFaultDefinition getFaultDefinition(Object endpoint,
                                                          Exception ex)
Template method that returns the SoapFaultDefinition for the given exception.

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.

resolveExceptionInternal

protected final boolean resolveExceptionInternal(MessageContext messageContext,
                                                 Object endpoint,
                                                 Exception ex)
Description copied from class: AbstractEndpointExceptionResolver
Template method for resolving exceptions that is called by AbstractEndpointExceptionResolver.resolveException(org.springframework.ws.context.MessageContext, java.lang.Object, java.lang.Exception).

Specified by:
resolveExceptionInternal in class AbstractEndpointExceptionResolver
Parameters:
messageContext - current message context
endpoint - the executed endpoint, or null if none chosen at the time of the exception
ex - the exception that got thrown during endpoint execution
Returns:
true if resolved; false otherwise
See Also:
AbstractEndpointExceptionResolver.resolveException(MessageContext,Object,Exception)

customizeFault

protected void customizeFault(Object endpoint,
                              Exception ex,
                              SoapFault fault)
Customize the SoapFault created by this resolver. Called for each created fault

The default implementation is empty. Can be overridden in subclasses to customize the properties of the fault, such as adding details, etc.

Parameters:
endpoint - the executed endpoint, or null if none chosen at the time of the exception
ex - the exception to be handled
fault - the created fault

Spring Web Services Framework

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