users@grizzly.java.net

Re: CometContext as class variable

From: Eric Luong <eluong_at_ualberta.ca>
Date: Wed, 20 Jul 2011 14:20:11 -0600

Ah, apologies, I linked the wrong post. This is the one I meant:

http://antwerkz.com/grizzly-2-0-and-comet/

Another place where it's seen is in the hidden frame example in the Oracle
documentation:

http://download.oracle.com/docs/cd/E18930_01/html/821-2418/ggrgt.html#ggrgr

On Wed, Jul 20, 2011 at 2:12 PM, Eric Luong <eluong_at_ualberta.ca> wrote:

> Hello,
>
> I noticed that in many of the sample code snippets, the CometContext is
> retrieved locally within doGet and doPost, e.g. here:
>
>
> http://antwerkz.com/glassfish-ose-3-1-is-out-with-websocket-support-included/
>
> I am still unfamiliar with underpinnings of Grizzly/Glassfish and servlet
> programming in general so I am curious why this is done. I tried retrieving
> a CometContext in a servlet's init and keeping and using it as a class
> variable. It seemed to work just the same, but could it cause other
> problems that the local way avoids? The only thing I can think of is that
> using only the class variable could perhaps cause concurrency or scalability
> issues.
>
> Thank-you for your insight!
>
> Eric
>