users@grizzly.java.net

Re: Grizzly and Glassfish filters

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 19 Jan 2009 19:47:15 -0500

Salut,

Survivant 00 wrote:
> I want to know if it's possible to create filters for Glassfish using
> the Grizzly API ?

Not yet.

>
> Suppose that I want to log every connections and disconnection made on
> Glassfish, can I do that ?

Right now it would be quite hard to implement as there is no public API
available. But just file an RFE here:

https://glassfish.dev.java.net/servlets/ProjectIssues

and I will find a way to allow you to do that. I'm not promising for
this week, but for sure I will add some -D property that allow such
extension. So far we only allow Adapter/GrizzlyAdapter deployment, but I
will talk with Jerome (GF leads) and se if we can do the same things
with ProtocolFilter.

A+

-- Jeanfrancois


>
> I hope we can, and if I can.. how can I choose the filters order ?
>
> Do we have a sample somewhere for that ?
>
> I don't know if we can do that
>
> // to be notify when a client/server close the connection
> selectionKeyHandler.setConnectionCloseHandler(new
> ConnectionCloseHandler() {
>
> public void locallyClosed(SelectionKey key) {
> if(s_logger.isDebugEnabled()){
> s_logger.debug(key + " is being locally cancelled");
> }
> }
>
> public void remotlyClosed(SelectionKey key) {
> if(s_logger.isDebugEnabled()){
> s_logger.debug(key + " is being remotly cancelled
> (connection closed)");
> }
> }
> });