Class AbstractEndpointExceptionResolver
- All Implemented Interfaces:
org.springframework.core.Ordered
,EndpointExceptionResolver
- Direct Known Subclasses:
AbstractSoapFaultDefinitionExceptionResolver
,SimpleSoapExceptionResolver
EndpointExceptionResolvers
.
Provides a set of mapped endpoints that the resolver should map.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma, Tareq Abed Rabbo
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.apache.commons.logging.Log
SharedLog
for subclasses to use.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildLogMessage
(Exception ex, MessageContext messageContext) Build a log message for the given exception, occured during processing the given message context.final int
getOrder()
protected void
logException
(Exception ex, MessageContext messageContext) Log the given exception at warn level, provided that warn logging has been activated through the"warnLogCategory"
property.final boolean
resolveException
(MessageContext messageContext, Object endpoint, Exception ex) Default implementation that checks whether the givenendpoint
is in the set ofmapped endpoints
.protected abstract boolean
resolveExceptionInternal
(MessageContext messageContext, Object endpoint, Exception ex) Template method for resolving exceptions that is called byresolveException(org.springframework.ws.context.MessageContext, java.lang.Object, java.lang.Exception)
.void
setMappedEndpoints
(Set<?> mappedEndpoints) Specify the set of endpoints that this exception resolver should map.final void
setOrder
(int order) Specify the order value for this mapping.void
setWarnLogCategory
(String loggerName) Set the log category for warn logging.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerSharedLog
for subclasses to use.
-
-
Constructor Details
-
AbstractEndpointExceptionResolver
public AbstractEndpointExceptionResolver()
-
-
Method Details
-
setMappedEndpoints
Specify the set of endpoints that this exception resolver should map.The exception mappings and the default fault will only apply to the specified endpoints.
If no endpoints are set, both the exception mappings and the default fault will apply to all handlers. This means that a specified default fault will be used as fallback for all exceptions; any further
EndpointExceptionResolvers
in the chain will be ignored in this case. -
setWarnLogCategory
Set the log category for warn logging. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.Default is no warn logging. Specify this setting to activate warn logging into a specific category. Alternatively, override the
logException(java.lang.Exception, org.springframework.ws.context.MessageContext)
method for custom logging.- See Also:
-
LogFactory.getLog(String)
org.apache.log4j.Logger#getLogger(String)
Logger.getLogger(String)
-
setOrder
public final void setOrder(int order) Specify the order value for this mapping.Default value is
Integer.MAX_VALUE
, meaning that it's non-ordered.- See Also:
-
Ordered.getOrder()
-
getOrder
public final int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
resolveException
Default implementation that checks whether the givenendpoint
is in the set ofmapped endpoints
.- Specified by:
resolveException
in interfaceEndpointExceptionResolver
- Parameters:
messageContext
- current message contextendpoint
- the executed endpoint, or null if none chosen at the time of the exceptionex
- the exception that got thrown during endpoint execution- Returns:
true
if resolved;false
otherwise- See Also:
-
logException
Log the given exception at warn level, provided that warn logging has been activated through the"warnLogCategory"
property.Calls
buildLogMessage(java.lang.Exception, org.springframework.ws.context.MessageContext)
in order to determine the concrete message to log. Always passes the full exception to the logger.- Parameters:
ex
- the exception that got thrown during handler executionmessageContext
- current message context request- See Also:
-
buildLogMessage
Build a log message for the given exception, occured during processing the given message context.- Parameters:
ex
- the exception that got thrown during handler executionmessageContext
- the message context- Returns:
- the log message to use
-
resolveExceptionInternal
protected abstract boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex) Template method for resolving exceptions that is called byresolveException(org.springframework.ws.context.MessageContext, java.lang.Object, java.lang.Exception)
.- Parameters:
messageContext
- current message contextendpoint
- the executed endpoint, ornull
if none chosen at the time of the exceptionex
- the exception that got thrown during endpoint execution- Returns:
true
if resolved;false
otherwise- See Also:
-