You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/03/06 05:40:39 UTC

Re: replacing/stopping messages in Filter.filterWrite

2007-02-28 (수), 09:18 +0100, Norman Maurer 쓰시길:
> Newcomb, Michael-P57487 schrieb:
> > Say I have a filter that wants to change what is being written. How do I
> > do that?
> >
> >   
> > Is it safe to create a new WriteRequest object like:
> >
> > nextFilter.filterWrite(session, new WriteRequest(myNewObject);

As Michael addressed in the other thread, the following is correct:

nextFilter.filterWrite(
	session, new WriteRequest(newObject, oldWriteRequest.getFuture()));

> > Also, what if my filter wants to stop the message from being written but
> > I still want WriteFuture.join() and WriteFuture.isWritten() == true?

Then you need to call WriteFuture.setWritten(false) by yourself.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6