users@grizzly.java.net

Re: more questions

From: Cam Bazz <cambazz_at_gmail.com>
Date: Thu, 3 Jul 2008 23:26:08 +0300

Hello,

Could it be possible for me to locally incorparate this getnumberofsessions
method, either by subclassing or modifying the source of the 1.0.20?

Best,
-C.A.

On Wed, Jul 2, 2008 at 7:02 PM, Jeanfrancois Arcand <
Jeanfrancois.Arcand_at_sun.com> wrote:

>
>
> Cam Bazz wrote:
>
>>
>>
>> yes it will be greatly helpful if you could add them also to the 1.0.20
>>
>> I need the list of comet handlers so once can get the number of current
>> users. since there is no practical way of getting number of open sessions in
>> glassfish.
>>
>
> OK I've filled this:
>
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=179
>
> will work on it as soon as possible.
>
>
>
>> If I were to keep a list of handlers myself, I would do that inside the
>> doGet method where we create a new handler, right?
>>
>
> Yes.
>
>
>
>> and also where do I grab the comethandler id at creation time?
>>
>
> Yes
>
> :-)
>
> -- Jeanfrancois
>
>
>
>>
>>
>> Best.
>>
>>
>> On Wed, Jul 2, 2008 at 6:53 PM, Jeanfrancois Arcand <
>> Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>> wrote:
>>
>> Salut,
>>
>>
>> Cam Bazz wrote:
>>
>> Hello,
>>
>> I have included the grizzly 1.20 jar and removed the
>> appserv-rt.jar and the problem of intterrupt not firing is gone.
>>
>> now these problems are solved, I can do more advanced comet
>> kung-foo.
>>
>>
>> LOL...Great!
>>
>>
>>
>>
>> I am curious in the following three subjects:
>>
>> a. how can I notify a specific comet lisnener? right now I am
>> notifying everyone with context.notify(null);
>>
>>
>> Use this CometContext API:
>>
>> 6 /**
>> 457 * Notify a single {_at_link CometHandler}. The attachment
>> can be null.
>> 458 * The <code>type</code> will determine which
>> code>CometHandler</code> 459 * method will be invoked:
>> 460 * <pre><code>
>> 461 * CometEvent.INTERRUPT ->
>> <code>CometHandler.onInterrupt</code>
>> 462 * CometEvent.NOTIFY -> <code>CometHandler.onEvent</code>
>> 463 * CometEvent.INITIALIZE ->
>> <code>CometHandler.onInitialize</code>
>> 464 * CometEvent.TERMINATE ->
>> <code>CometHandler.onTerminate</code>
>> 465 * CometEvent.READ -> <code>CometHandler.onEvent</code>
>> 466 * </code></pre>
>> 467 * @param attachment An object shared amongst {_at_link
>> CometHandler}. 468 * @param type The type of notification.
>> 469 * @param cometHandlerID Notify a single CometHandler.
>> 470 */
>> 471 public void notify(final E attachment,final int
>> eventType,final int cometHandlerID)
>>
>>
>>
>> b. what kind of datastructure must be used to track users
>> connected?
>>
>>
>> You need to maintain your own list of CometHandler...but can you
>> gives me more information about why you need access those
>> CometHandler> I'm asking because I think it should be a good idea to
>> have a public API on CometContext to get the current list of
>> connected users. Something like:
>>
>> public List<CometHandler> getCometHandlers();
>>
>>
>>
>> c. is there anyway to get the number of total long polling clients?
>>
>>
>> Another reason to add the getCometHandlers() :-) So far there is no
>> such API available.
>>
>> I can add that API to Grizzly 1.0.20 and 1.8.0.1 <http://1.8.0.1> if
>> you think that will be useful.
>>
>> Thanks,
>>
>>
>> -- Jeanfrancois
>>
>>
>>
>> Best,
>>
>> -C.B.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> <mailto:users-unsubscribe_at_grizzly.dev.java.net>
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>> <mailto:users-help_at_grizzly.dev.java.net>
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>