Class DelegatingSmartEndpointInterceptor
- All Implemented Interfaces:
EndpointInterceptor
,SmartEndpointInterceptor
- Direct Known Subclasses:
DelegatingSmartSoapEndpointInterceptor
SmartEndpointInterceptor
interface that delegates to a delegate
EndpointInterceptor
.- Since:
- 2.0
- Author:
- Arjen Poutsma
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of theDelegatingSmartEndpointInterceptor
with the given delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(MessageContext messageContext, Object endpoint, Exception ex) Callback after completion of request and response (fault) processing.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.
-
Constructor Details
-
DelegatingSmartEndpointInterceptor
Creates a new instance of theDelegatingSmartEndpointInterceptor
with the given delegate.- Parameters:
delegate
- the endpoint interceptor to delegate to.
-
-
Method Details
-
getDelegate
Returns the delegate.- Returns:
- the delegate
-
shouldIntercept
Indicates whether this interceptor should intercept the given message context.This implementation delegates to
shouldIntercept(WebServiceMessage, Object)
.- Specified by:
shouldIntercept
in interfaceSmartEndpointInterceptor
- Parameters:
messageContext
- contains the incoming request messageendpoint
- chosen endpoint to invoke- Returns:
true
to indicate that this interceptor applies;false
otherwise
-
shouldIntercept
Indicates whether this interceptor should intercept the given request message.This implementation always returns
true
.- Parameters:
request
- the request messageendpoint
- chosen endpoint to invoke- Returns:
true
to indicate that this interceptor applies;false
otherwise
-
handleRequest
Description copied from interface:EndpointInterceptor
Processes the incoming request message. Called afterEndpointMapping
determined an appropriate endpoint object, but beforeEndpointAdapter
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.- Specified by:
handleRequest
in interfaceEndpointInterceptor
- Parameters:
messageContext
- contains the incoming request messageendpoint
- chosen endpoint to invoke- Returns:
true
to continue processing of the request interceptor chain;false
to indicate blocking of the request endpoint chain, without invoking the endpoint- Throws:
Exception
- in case of errors- See Also:
-
handleResponse
Description copied from interface:EndpointInterceptor
Processes the outgoing response message. Called afterEndpointAdapter
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.- Specified by:
handleResponse
in interfaceEndpointInterceptor
- Parameters:
messageContext
- contains both request and response messagesendpoint
- chosen endpoint to invoke- Returns:
true
to continue processing of the response interceptor chain;false
to indicate blocking of the response endpoint chain.- Throws:
Exception
- in case of errors- See Also:
-
handleFault
Description copied from interface:EndpointInterceptor
Processes the outgoing response fault. Called afterEndpointAdapter
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.- Specified by:
handleFault
in interfaceEndpointInterceptor
- Parameters:
messageContext
- contains both request and response messages, the response should contains a Faultendpoint
- chosen endpoint to invoke- Returns:
true
to continue processing of the response interceptor chain;false
to indicate blocking of the response handler chain.- Throws:
Exception
-
afterCompletion
public void afterCompletion(MessageContext messageContext, Object endpoint, Exception ex) throws Exception Description copied from interface:EndpointInterceptor
Callback after completion of request and response (fault) processing. Will be called on any outcome of endpoint invocation, thus allows for proper resource cleanup.Note: 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.- Specified by:
afterCompletion
in interfaceEndpointInterceptor
- Parameters:
messageContext
- contains both request and response messages, the response should contains a Faultendpoint
- chosen endpoint to invokeex
- exception thrown on handler execution, if any- Throws:
Exception
- in case of errors
-