users@grizzly.java.net

Re: client auth filter example

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Tue, 02 Mar 2010 11:03:17 +0100

Hi,

> I'm had a curious look at Grizzly examples in latest branch ( 2.0).
> I could
> see that you are using a number of filter chains there : transport,
> string,
> multiline, clientauth and client. While I understand what each
> filter does,
> I am kinda confused about the sequence of their call. I think that
> while
> accepting a request (reading) all the filters are called starting from
> transport to the client. Whereas, while writing, they will be called
> in the
> opposite order..right?
Absolutely! :)

> In the auth example, I see that clientauth filter
> ends up calling the other filter.
Can you pls. elaborate, what do you mean by "calling the other
filter"? Cause what ClientAuthFilter might do - work as a pipe for
client<->server communication, when connection is authenticated, or
initialize authentication, if connection was not authenticated yet.

> probably there is an explicit call to
> other filters from clientauth filter.
No.

> How is the sequence of the filter supposed to work?
As you have mentioned, when read event occurs - filterchain calls
filters from first to last, where on write event, filterchain calls
from filters from last to first.
AuthFilters (both client and server) controls message authentication
header (they add those header on write, and read/check the header on
read).
ClientAuthFilter has a logic to suspend the message write, if
connection was not authenticated yet. In this situation
ClientAuthFilter saves the current message and initializes
authentication by sending authentication-request message and waiting
for authentication response. Once connection gets authenticated,
ClientAuthFilter resumes all suspended message writes.

Hope this will help.

WBR,
Alexey.

> Any pointer to reference material is much appreciated.
> --
> View this message in context: http://old.nabble.com/client-auth-filter-example-tp27752503p27752503.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>