Hello list
I'm testing the Grizzly Framework 2.0 and I'm stuck with one problem.
I've created my filter chain as:
FilterChain chain = transport.getFilterChain();
chain.add(new TransportFilter());
chain.add(new TextLineFilter());
chain.add(new ServerLogicFilter());
My class TextLineFilter, reads lines of text from the buffers and puts the lines as a message to the next filter using
ctx.setMessage(line);
Where ctx is the received instance of FilterChainContext.
My class ServerLogicFilter is in charge of implementing the logic, but only deals with the string lines. In handeRead(...), I get the line with ctx.getMessage() and I could also write a new line using ctx.setMessage(...) in the handleWrite(...) method.
Now I want to write a message to a client some time after the read operation was completed. I've kept the Connection that I got from the FilterChainContext (using getConnection()). I want to send a message through the connection but I only have Connection.write(Buffer) and similar.
Is there any way I could write a message in the connection so the FilterChain could write this object (in my case, a String) with the filters I've already added to the chain?
Thanks in advance,
Rivas