public class DelegatingSmartEndpointInterceptor extends Object implements SmartEndpointInterceptor
SmartEndpointInterceptor interface that delegates to a delegate EndpointInterceptor.| Constructor and Description |
|---|
DelegatingSmartEndpointInterceptor(EndpointInterceptor delegate)
Creates a new instance of the
DelegatingSmartEndpointInterceptor with the given delegate. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCompletion(MessageContext messageContext,
Object endpoint,
Exception ex)
Callback after completion of request and response (fault) processing.
|
EndpointInterceptor |
getDelegate()
Returns the delegate.
|
boolean |
handleFault(MessageContext messageContext,
Object endpoint)
Processes the outgoing response fault.
|
boolean |
handleRequest(MessageContext messageContext,
Object endpoint)
Processes the incoming request message.
|
boolean |
handleResponse(MessageContext messageContext,
Object endpoint)
Processes the outgoing response message.
|
boolean |
shouldIntercept(MessageContext messageContext,
Object endpoint)
Indicates whether this interceptor should intercept the given message context.
|
protected boolean |
shouldIntercept(WebServiceMessage request,
Object endpoint)
Indicates whether this interceptor should intercept the given request message.
|
public DelegatingSmartEndpointInterceptor(EndpointInterceptor delegate)
DelegatingSmartEndpointInterceptor with the given delegate.delegate - the endpoint interceptor to delegate to.public EndpointInterceptor getDelegate()
public boolean shouldIntercept(MessageContext messageContext, Object endpoint)
This implementation delegates to shouldIntercept(WebServiceMessage, Object).
shouldIntercept in interface SmartEndpointInterceptormessageContext - contains the incoming request messageendpoint - chosen endpoint to invoketrue to indicate that this interceptor applies; false otherwiseprotected boolean shouldIntercept(WebServiceMessage request, Object endpoint)
This implementation always returns true.
request - the request messageendpoint - chosen endpoint to invoketrue to indicate that this interceptor applies; false otherwisepublic boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception
EndpointInterceptorEndpointMapping determined an appropriate endpoint
object, but before EndpointAdapter invokes the endpoint.
MessageDispatcher processes an endpoint in an invocation chain, consisting of any number of interceptors,
with the endpoint itself at the end. With this method, each interceptor can decide to abort the chain, typically
creating a custom response.
handleRequest in interface EndpointInterceptormessageContext - contains the incoming request messageendpoint - chosen endpoint to invoketrue to continue processing of the request interceptor chain; false to indicate
blocking of the request endpoint chain, without invoking the endpointException - in case of errorsMessageContext.getRequest()public boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception
EndpointInterceptorEndpointAdapter actually invoked the endpoint. Can
manipulate the response, if any, by adding new headers, etc.
MessageDispatcher processes an endpoint in an invocation chain, consisting of any number of interceptors,
with the endpoint itself at the end. With this method, each interceptor can post-process an invocation, getting
applied in inverse order of the execution chain.
Note: Will only be called if this interceptor's EndpointInterceptor.handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object) method has successfully completed.
handleResponse in interface EndpointInterceptormessageContext - contains both request and response messagesendpoint - chosen endpoint to invoketrue to continue processing of the response interceptor chain; false to indicate
blocking of the response endpoint chain.Exception - in case of errorsMessageContext.getRequest(),
MessageContext.hasResponse(),
MessageContext.getResponse()public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception
EndpointInterceptorEndpointAdapter actually invoked the endpoint. Can
manipulate the response, if any, by adding new headers, etc.
MessageDispatcher processes an endpoint in an invocation chain, consisting of any number of interceptors,
with the endpoint itself at the end. With this method, each interceptor can post-process an invocation, getting
applied in inverse order of the execution chain.
Note: Will only be called if this interceptor's EndpointInterceptor.handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object) method has successfully completed.
handleFault in interface EndpointInterceptormessageContext - contains both request and response messages, the response should contains a Faultendpoint - chosen endpoint to invoketrue to continue processing of the response interceptor chain; false to indicate
blocking of the response handler chain.Exceptionpublic void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception
EndpointInterceptorNote: Will only be called if this interceptor's EndpointInterceptor.handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object) method has successfully completed.
As with the EndpointInterceptor.handleResponse(org.springframework.ws.context.MessageContext, java.lang.Object) method, the method will be invoked on each interceptor in the chain in
reverse order, so the first interceptor will be the last to be invoked.
afterCompletion in interface EndpointInterceptormessageContext - contains both request and response messages, the response should contains a Faultendpoint - chosen endpoint to invokeex - exception thrown on handler execution, if anyException - in case of errors