users@grizzly.java.net

RE: Confusion over some Comet functions in Grizzly

From: John C. Turnbull <ozemale_at_ozemail.com.au>
Date: Sat, 12 Jan 2008 06:51:47 +1100

Hi Jeanfrancois,

> > protected void notify(CometEvent event, int eventType,
> SelectionKey key)
>
> Right, but the method is protected, so you cannot use it (it's for an
> internal call).
>
> Hum are you sure you are using this method?

My bad, I am not using that method. I am using the public notify() method
that also takes 3 parameters one of which is the attachment itself.
 
> > I am close to having Grizzly and GlassFish with Comet behaving as I
> want
> > so it would be nice to finish things off.
>
> You have 3 solutions:
>
> (1) notify(Object attachment,int eventType) //
> (NOTIFY|INITIALIZE|TERMINATE|INTERRUPT|READ);
>
> Most of the time you only use the NOTIFY.
>
> (2) notify(Object attachmenent);
>
> same as above, but it force a NOTIFY event.
>
> (3) notify(Object attachment,int eventType,int cometHandlerHash);
>
> same as (1), but this time you can specify which cometHandler you want
> to notify instead of all of them.
>
> In you case (1) is what you are looking at. Can you try it and let me
> know?

Yes, I am using (3) now successfully as I only want one handler notified in
this particular case. It's working very well now. Thanks!

-JCT