cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse" <...@envoisolutions.com>
Subject Re: Proposal for chaning CXF Interceptor APIs. WAS: RE: When should we close the handlers in CXF?
Date Mon, 12 Feb 2007 15:02:16 GMT
On 2/12/07, Liu, Jervis <jliu@iona.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Polar Humenn [mailto:phumenn@iona.com]
> > Sent: Friday, February 09, 2007 1:11 AM
> > To: cxf-dev@incubator.apache.org
> > Subject: Re: Proposal for chaning CXF Interceptor APIs. WAS: RE: When
> > should we close the handlers in CXF?
> >
> >
> > Okay, I'm going to reply to my own message, because after a coffee I
> > have come to some nirvana about this issue.
> >
> > The reason you want an onFinish() call is to address the subchain
> > problem.  In one of the emails below it is stated:
> >
> >        A. MessageSenderInterceptor:  call conduit.close(message) after
> >     the complete chain    has been traversed.
> >
> >
> > I presume that you want A.handleMessage() to be called to do
> > some things
> > (like install more interceptors) and then after everything
> > has been done
> > to the message, you want A.onFinish() called to call
> > conduit.close(message).
> >
> > My basic question is, why isn't the conduit.close(message)
> > called in a
> > separate interceptor's handleMessage() call?
> >
> Actually, I have thought about this option as well. For every interceptor
> that needs a terminal action, we will need a pair of interceptors. For
> example, the SoapOutInterceptor will be SoapOutStartInterceptor and
> SoapOutEndInterceptor, SoapOutStartInterceptor writes the start element of
> SOAP Body and Envelope, while SoapOutEndInterceptor writes the end element
> of SOAP Body and Envelope. Same thing applies to conduit.close(message),
> we will need a MessageSenderEndInterceptor to call conduit.close(message)
> (or any other interceptors that is appropriate). This definitely works, and
> this can achieve exact same execution path as we can do with onComplete(),
> it just occurs to me that there are too many interceptors we have to write
> ;-)
>
>
Agreed. It could be done via another interceptor, but its a common enough
case that we'd like to make it simpler.

On a related note I would like to see the method named onTermination() -
this would imply "on termination of the chain take this action..." which
would give interceptors a chance to close resources associated with the
message. I'm -1 on the current "postHandleMessage" method name.

-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message