users@grizzly.java.net

Re: comet context question

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 01 Jul 2008 21:22:14 -0400

Salut,

Cam Bazz wrote:
> Hello,
>
>
> what does the following lines do?
>
> CometContext<?> context =
> CometEngine.getEngine().getCometContext("/YBZ-war/tS");
> context.notify(null);
>
> I have not understood why <?> and why notify the context with null?

Where are you getting that code snipped from? (Hopefully not from me
:-)). I suspect ICEFaces are doing that when resuming connection...

The <?> is probably because a null is passed. Most of the time the
CometContext is undefined or CometContext<String> is used.


> should not we pass some sort of objects to context.notify()?

Not necessarily. When calling with null, your CometHandler.onEvent()
will be called, and the CometEvent.attachment() will return null. I
suspect peoples are doing that to resume a connection like:

public void onEvent(CometEvent event){
     cometContext.resumeCometListener(this);
}

Hence the event.attachment() is never called.

Hope that help.

A+

-- Jeanfrancois

>
> Best.
>
> -C.B.