> It depends where you are creating your CometHandler.
> If you creates it inside a Servlet, then you can probably "attach" it
> using the CometHandler.attach().
Yes, it's created in the servlet. Btw, I haven't understood the CometHandler.attach() method, or the need for it. At least I haven't found a use case for it yet. From the servlet, you can pass resources directly in the CometHandler constructor, because you create the CometHandler yourself anyway. The notifiers can pass data, too, so when do you need it?
> > Is it valid to just use the EJBs objects from the servlet?
>
> Yes it should.
I'll try. Although I guess the safest way to do it is to do a JNDI look up each time the onEvent Method is called (that's where I need the EJBs).
> > Injection in CometHandler would be nice...
>
> Agree...at the time I wrote the Comet stuff, I don't
> think the GlassFish
> team would have let me add Injection ;-) Now that
> Comet is more an dmore
> used, for sure this is on the radar. I'm not ready
> yet to push the
> project on the spotlight, but Atmosphere.dev.java.net
> is the Grizzly
> Comet 2.0, and that one will support Injection.
Nice, looking forward to it. Also, I hope there will be a standard (JSR/JEE) way to do stuff like at some point (that would be Servlets 3.1??).
> Hope that help.
Definitely. Thanks for your and ksak's help and explanations!
Markus
[Message sent by forum member 'markusoj' (markusoj)]
http://forums.java.net/jive/thread.jspa?messageID=287515