cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Persisting outgoing reqs interceptor
Date Tue, 20 Jul 2010 17:31:48 GMT

I'm willing to be the persistence interceptors in the management stuff is 
designed only for the Server side.   In general, that's what's trying to be 
managed.   The request comes in, response goes out.   The "in" occurs first 
and sets things up and the out requires that setup.   

Most likely, the in/out interceptors will need some updating to support use on 
the client side.    Patches would be more than welcome.

Dan
   

On Tuesday 20 July 2010 9:15:29 am Mishkin, Ernest wrote:
> Hello,
> 
> I must be missing something fundumental about in/out interceptor chains,
> because here's what's happening:
> 
> - this is about the client (making a call) code
> 
> - I register interceptors like this:
> 
>         client.getInInterceptors().add(new LoggingInInterceptor());
>         client.getOutInterceptors().add(new LoggingOutInterceptor());
>         PersistOutInterceptor persistOut = new PersistOutInterceptor();
>         persistOut.setExchangeDataDAO(<custom ExchangeDataDAO impl>);
>         client.getOutInterceptors().add(persistOut);
>         client.getInInterceptors().add(new PersistInInterceptor());
> 
> - when I make the call, I see that
> PersistOutInterceptor::handleMessage() is invoked first - which makes
> sense, I'm making an outgoing call, so first a message needs to go out.
> 
> However, the first line of code in that method is
> 
> ExchangeData exchangeData =
> message.getExchange().getInMessage().getContent(ExchangeData.class);
> 
> This throws NPE b/c getInMessage() returns null. And it sort of makes
> sense that it's null - there's no "in" message (aka response) yet -
> we're still trying to make the call.
> 
> So why does PersistOutInterceptor look for the *in* message? What am I
> missing in this very simple setup?
> 
> 
> Thanks!
> --Ernest
> 
> 
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: Thursday, July 15, 2010 5:13 PM
> To: users@cxf.apache.org
> Subject: Re: Persisting outgoing reqs interceptor
> 
> Hi
> 
> PersistIn/OutInterceptors were contributed too,
> http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or
> g/apache/cxf/management/interceptor/
> 
> for example,
> 
> http://svn.apache.org/repos/asf/cxf/trunk/rt/management/src/main/java/or
> g/apache/cxf/management/persistence/FilesystemExchangeDataDAO.java
> 
> can be used to persist data to the file, similarly the data can be saved
> to the db storage, etc
> 
> not sure if it is exactly what is needed...
> 
> cheers, Sergey
> 
> --------------------------------------------------------
> 
> The information contained in this message is intended only for the
> recipient, and may be a confidential attorney-client communication or may
> otherwise be privileged and confidential and protected from disclosure. If
> the reader of this message is not the intended recipient, or an employee
> or agent responsible for delivering this message to the intended
> recipient, please be aware that any dissemination or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please immediately notify us by replying to the
> message and deleting it from your computer. The McGraw-Hill Companies,
> Inc. reserves the right, subject to applicable local law, to monitor and
> review the content of any electronic message or information sent to or
> from McGraw-Hill employee e-mail addresses without informing the sender or
> recipient of the message.
> --------------------------------------------------------

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message