I am not getting the exact behaviour I expected with the version of Grizzly
that's included in GlassFish v2 UR1 and looking at the code for Grizzly
itself I see there are a couple of strange things. I realise that the code
for the standalone Grizzly and that for Grizzly in GF may be a little
different but in the standalone Grizzly there is a class CometContext with
the following method:
protected void notify(CometEvent event, int eventType, SelectionKey key)
and it defines various event types. However, the body of the method does
nothing with the event type so all events have the same (default) type. Is
this intentional?
Also, I have been trying to notify Comet events using this method by
creating a new CometEvent<MyAttachment> and attaching an attachment of type
MyAttachment. However, when I process the event in onEvent() of the
CometHandler, the following code:
System.out.println("Attachment is a " + event.attachment().getClass());
prints out that the attachment is of type CometEvent and not MyAttachment as
desired (and hence I can't do anything with it). Does anyone know why this
would be so?
I am close to having Grizzly and GlassFish with Comet behaving as I want so
it would be nice to finish things off.
Thanks,
-JCT