|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.xml.transform.TransformerObjectSupport org.springframework.ws.server.endpoint.AbstractLoggingInterceptor
public abstract class AbstractLoggingInterceptor
Abstract base class for EndpointInterceptor
instances that log a part of a
WebServiceMessage
. By default, both request and response messages are logged, but this behaviour can be
changed using the logRequest
and logResponse
properties.
Field Summary | |
---|---|
protected Log |
logger
The default Log instance used to write trace messages. |
Constructor Summary | |
---|---|
AbstractLoggingInterceptor()
|
Method Summary | |
---|---|
protected abstract Source |
getSource(WebServiceMessage message)
Abstract template method that returns the Source for the given WebServiceMessage . |
boolean |
handleFault(MessageContext messageContext,
Object endpoint)
Does nothing by default. |
boolean |
handleRequest(MessageContext messageContext,
Object endpoint)
Logs the request message payload. |
boolean |
handleResponse(MessageContext messageContext,
Object endpoint)
Logs the response message payload. |
protected boolean |
isLogEnabled()
Determine whether the logger field is enabled. |
protected void |
logMessage(String message)
Logs the given string message. |
protected void |
logMessageSource(String logMessage,
Source source)
Logs the given source to the logger , using the message as a prefix. |
void |
setLoggerName(String loggerName)
Set the name of the logger to use. |
void |
setLogRequest(boolean logRequest)
Indicates whether the request should be logged. |
void |
setLogResponse(boolean logResponse)
Indicates whether the response should be logged. |
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 |
Field Detail |
---|
protected transient Log logger
Log
instance used to write trace messages. This instance is mapped to the implementing
Class
.
Constructor Detail |
---|
public AbstractLoggingInterceptor()
Method Detail |
---|
public final void setLogRequest(boolean logRequest)
true
.
public final void setLogResponse(boolean logResponse)
true
.
public void setLoggerName(String loggerName)
LogFactory.getLog(String)
,
org.apache.log4j.Logger#getLogger(String)
,
Logger
public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws TransformerException
logRequest
is set to true
,
which is the default.
handleRequest
in interface EndpointInterceptor
messageContext
- the message contextendpoint
- chosen endpoint to invoke
true
TransformerException
- when the payload cannot be transformed to a stringMessageContext.getRequest()
public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception
logResponse
is set to true
,
which is the default.
handleResponse
in interface EndpointInterceptor
messageContext
- the message contextendpoint
- chosen endpoint to invoke
true
TransformerException
- when the payload cannot be transformed to a string
Exception
- in case of errorsMessageContext.getRequest()
,
MessageContext.hasResponse()
,
MessageContext.getResponse()
public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception
handleFault
in interface EndpointInterceptor
messageContext
- contains both request and response messages, the response should contains a Faultendpoint
- chosen endpoint to invoke
true
to continue processing of the reponse interceptor chain; false
to indicate
blocking of the response handler chain.
Exception
protected boolean isLogEnabled()
logger
field is enabled.
Default is true
when the "debug" level is enabled. Subclasses can override this to change the level
under which logging occurs.
protected void logMessageSource(String logMessage, Source source) throws TransformerException
source
to the logger
, using the message as a prefix.
By default, this message creates a string representation of the given source, and delegates to logMessage(String)
.
logMessage
- the log messagesource
- the source to be logged
TransformerException
- in case of errorsprotected void logMessage(String message)
message
- the messageprotected abstract Source getSource(WebServiceMessage message)
Source
for the given WebServiceMessage
.
message
- the message
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |