jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [jsr372-experts mirror] why PushContext cannot be obtained from FacesContext?

From: Bauke Scholtz <balusc_at_gmail.com>
Date: Thu, 1 Sep 2016 23:46:05 +0200

Hi,

As to FacesContext#getPushContext(), it was initially there, but I removed
it for a technical reason I don't remember anymore. Most likely it was
triggered by a failing unit test. I will reinvestigate it and let you know.

As to Serializable, it will force the implementation to be Serializable
because that's required in order to be able to inject it in a view or
session scoped bean via a @Dependent producer. The reason for that in turn
is to be able to asynchronously trigger the push, e.g. initiated by an
@Asynchronous EJB method.

Cheers, B



On Thu, Sep 1, 2016 at 5:38 PM, Kito Mann <kito.mann_at_virtua.com> wrote:

> +1 You should definitely be able to get it from the FacesContext.
>
> ___
>
> Kito D. Mann | @kito99 | Author, JSF in Action
> Web Components, Polymer, JSF, PrimeFaces, Java EE, and Liferay training
> and consulting
> Virtua, Inc. | virtua.tech
> JSFCentral.com | @jsfcentral | knowesis.io
> <http://knowesis.io/web/webcomponents> - fresh Web Components info
> +1 203-998-0403
>
> * Listen to the Enterprise Java Newscast: *http://
> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
> <http://ww.enterprisejavanews.com>*
>
>
> On Wed, Aug 31, 2016 at 11:59 PM, Leonardo Uribe <leonardo.uribe_at_irian.at>
> wrote:
>
>> Hi
>>
>> Looking at f:websocket tag (I'm trying to implement it for MyFaces), it
>> comes to my mind one simple question: why PushContext cannot be obtained
>> from FacesContext?
>>
>> My reasoning is in JSF there is always a way to do certain things
>> programmatically. For example Application.evaluateExpressionGet(...) to
>> get beans using EL, but some new features seem to work only with CDI or
>> maybe rely too much on it.
>>
>> The annotation syntax using @Inject and @Push is nice, but I'm suspicious
>> about why PushContext extends Serializable. I don't understand why extends
>> from this interface, or if this is necessary.
>>
>> regards,
>>
>> Leonardo Uribe
>>
>
>