|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EndpointInterceptor
Workflow interface that allows for customized endpoint invocation chains. Applications can register any number of existing or custom interceptors for certain groups of endpoints, to add common preprocessing behavior without needing to modify each endpoint implementation.
AnEndpointInterceptor
gets called before the appropriate EndpointAdapter
triggers the
invocation of the endpoint itself. This mechanism can be used for a large field of preprocessing aspects, e.g. for
authorization checks, or message header checks. Its main purpose is to allow for factoring out repetitive endpoint
code.
Typically an interceptor chain is defined per EndpointMapping
bean, sharing its granularity. To be able to
apply a certain interceptor chain to a group of handlers, one needs to map the desired handlers via one
EndpointMapping
bean. The interceptors themselves are defined as beans in the application context,
referenced by the mapping bean definition via its interceptors
property (in XML: a <list> of
<ref>).
EndpointInvocationChain.getInterceptors()
,
EndpointInterceptorAdapter
,
AbstractEndpointMapping.setInterceptors(EndpointInterceptor[])
Method Summary | |
---|---|
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. |
Method Detail |
---|
boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception
EndpointMapping
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.
messageContext
- contains the incoming request messageendpoint
- chosen endpoint to invoke
true
to continue processing of the request interceptor chain; false
to indicate
blocking of the request endpoint chain, without invoking the endpoint
Exception
- in case of errorsMessageContext.getRequest()
boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception
EndpointAdapter
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 handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object)
method has successfully completed.
messageContext
- contains both request and response messagesendpoint
- chosen endpoint to invoke
true
to continue processing of the reponse interceptor chain; false
to indicate
blocking of the response endpoint chain.
Exception
- in case of errorsMessageContext.getRequest()
,
MessageContext.hasResponse()
,
MessageContext.getResponse()
boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception
EndpointAdapter
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 handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object)
method has successfully completed.
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
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |