On 1/22/07, Liu, Jervis <[EMAIL PROTECTED]> wrote:
Hi, I would like to summarize what we have been discussed in this thread
(including Eoghan's proposal posted last Oct [1]) regarding Interceptor API
changes. Any comments would be appreciated.
Currently our Interceptor APIs look like below:
public interface Interceptor<T extends Message> {
void handleMessage(T message) throws Fault;
void handleFault(T message);
}
Also in the interceptor chain, we have a notion of sub-chain or
interceptor chain reentrance by calling
message.getInterceptorChain().doIntercept(message)
or message.getInterceptorChain().doInterceptInSubChain(message).
The main issues we have with the current implementation are:
1. Fault handling. See Eoghag's email [1]
2. Sub-chain reentrance. See previous discussion in this thread.
We propose to change Interceptor API as below:
public interface Interceptor<T extends Message> {
void handleMessage(T message) throws Fault;
void handleFault(T message);
void close(T message);
}
handleFault(T message) method is used to process fault message (which is
done by handleMessage() in fault-chain currently).
I'm not sure I understand how you want to use this. I guess I could see two
ways
1. Remove In/OutFault interceptors and call handleFault on the In/Out
interceptors. I don't know that mapping works especially well though.
2. Don't call handleFault on in/out interceptors, but only on the
in/outFault interceptors - this would mean, for example, that the logic from
Soap11OutFaultInterceptor would be moved from the handleMessage to
handleFault.
Can you be more specific about what you mean?
close(T message) method is called on a reverse direction at the end of
interceptor chain or when a fault or exception occurs. Take the fault
handling case as an example, below is how handleFault and close work
together
+1 to close() - Although I think Eoghan has a good point about the ordering
not necessarily being the same. I think we need to do a little bit more
digging before we can know whether or not sub chains can be removed.
when a fault occurs on the in-chain, we unwind the current chain by calling
close() on each previously traversed interceptor and then jump to the
out-fault-chain, calling handleFault() on each interceptor with the fault
message.
Close method is also used to remove the sub-chain reentrance. See the
SOAPHandlerInterceptor example I posted previously.
Cheers,
Jervis
[1]
http://mail-archives.apache.org/mod_mbox/incubator-cxf-dev/200611.mbox/[EMAIL
PROTECTED]
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog