public abstract class AbstractEndpointExceptionResolver extends Object implements EndpointExceptionResolver, org.springframework.core.Ordered
EndpointExceptionResolvers
.
Provides a set of mapped endpoints that the resolver should map.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Shared
Log for subclasses to use. |
Constructor and Description |
---|
AbstractEndpointExceptionResolver() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildLogMessage(Exception ex,
MessageContext messageContext)
Build a log message for the given exception, occured during processing the given message context.
|
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. |
boolean |
resolveException(MessageContext messageContext,
Object endpoint,
Exception ex)
Default implementation that checks whether the given
endpoint is in the set of mapped endpoints . |
protected abstract boolean |
resolveExceptionInternal(MessageContext messageContext,
Object endpoint,
Exception ex)
Template method for resolving exceptions that is called by
resolveException(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.
|
void |
setOrder(int order)
Specify the order value for this mapping.
|
void |
setWarnLogCategory(String loggerName)
Set the log category for warn logging.
|
protected final org.apache.commons.logging.Log logger
Log
for subclasses to use.public void setMappedEndpoints(Set<?> mappedEndpoints)
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.
public void setWarnLogCategory(String loggerName)
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.
LogFactory.getLog(String)
,
org.apache.log4j.Logger#getLogger(String)
,
Logger.getLogger(String)
public final void setOrder(int order)
Default value is Integer.MAX_VALUE
, meaning that it's non-ordered.
Ordered.getOrder()
public final int getOrder()
getOrder
in interface org.springframework.core.Ordered
public final boolean resolveException(MessageContext messageContext, Object endpoint, Exception ex)
endpoint
is in the set of mapped endpoints
.resolveException
in interface EndpointExceptionResolver
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 executiontrue
if resolved; false
otherwiseresolveExceptionInternal(MessageContext,Object,Exception)
protected void logException(Exception ex, MessageContext messageContext)
"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.
ex
- the exception that got thrown during handler executionmessageContext
- current message context requestsetWarnLogCategory(java.lang.String)
,
buildLogMessage(java.lang.Exception, org.springframework.ws.context.MessageContext)
,
Log.warn(Object, Throwable)
protected String buildLogMessage(Exception ex, MessageContext messageContext)
ex
- the exception that got thrown during handler executionmessageContext
- the message contextprotected abstract boolean resolveExceptionInternal(MessageContext messageContext, Object endpoint, Exception ex)
resolveException(org.springframework.ws.context.MessageContext, java.lang.Object, java.lang.Exception)
.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 executiontrue
if resolved; false
otherwiseresolveException(MessageContext,Object,Exception)
Copyright © 2020 Pivotal Software. All rights reserved.