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

[jsr372-experts] Re: [jsr372-experts mirror] Re: Re: [JAVASERVERFACES-SPEC_PUBLIC-1396] f:socket for SSE and WebSocket PROPOSAL

From: Bauke Scholtz <balusc_at_gmail.com>
Date: Thu, 10 Mar 2016 12:28:32 +0100

Hi,

I finally created test cases. I have updated the
https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1396 patch to
include test cases. You can find them in javaee8/websocket.

I only had to update HtmlUnit to 2.20 (for only the javaee8 test cases) as
Websocket support in HtmlUnit was added in 2.11 and the default version
used was the rather ancient 2.4.

Cheers, B


On Fri, Mar 4, 2016 at 7:21 PM, Josh Juneau <juneau001_at_gmail.com> wrote:

> +1...great job Bauke...this is a great enhancement.
>
> Josh Juneau
> juneau001_at_gmail.com
> http://jj-blogger.blogspot.com
> https://www.apress.com/index.php/author/author/view/id/1866
>
>
> On Fri, Mar 4, 2016 at 11:49 AM, Michael Müller <
> michael.mueller_at_mueller-bruehl.de> wrote:
>
>> Great work! Thanks.
>>
>> Herzliche Grüße - Best Regards,
>>
>> Michael Müller
>> Brühl, Germany
>> blog.mueller-bruehl.de
>> it-rezension.de
>> @muellermi
>>
>>
>> Read my books
>> "Web Development with Java and JSF": <https://leanpub.com/jsf>
>> https://leanpub.com/jsf
>> "Java Lambdas und (parallel) Streams" Deutsche Ausgabe:
>> <https://leanpub.com/lambdas-de>https://leanpub.com/lambdas-de
>> "Java Lambdas and (parallel) Streams" English edition:
>> <https://leanpub.com/lambdas>https://leanpub.com/lambdas
>>
>> Am 04.03.2016 um 16:08 schrieb Bauke Scholtz:
>>
>> Hi,
>>
>> I have furher improved f:websocket:
>> - support for view scope as in scope="view", this makes it possible to send
>> the message only to the current view.
>> - explicitly close session and view scoped websockets when associated
>> session or view is expired in server side, to avoid stale websockets (this
>> opens a nice possibility: JavaScript code in <f:websocket onclose> can be
>> used to directly notify user about expired session or view).
>> - support for user target as in user="#{request.remoteUser}" or
>> user="#{someLoggedInUser.id}", this makes it possible to have an
>> user-targeted push via channelName.send(someMessageObject, recipientUserId).
>> - support for observable CDI events: @Opened WebsocketEvent and @Closed
>> WebsocketEvent.
>>
>> I feel it's ready. Now only the test cases (and specification document?).
>> Detailed usage instructions can be found in javax.faces.push.Push javadoc.
>>
>> Cheers, B
>>
>> On Fri, Jan 29, 2016 at 3:58 PM, Josh Juneau <juneau001_at_gmail.com> <juneau001_at_gmail.com> wrote:
>>
>>
>> Excellent work! I will put this in my queue to blog about soon.
>>
>> Josh Juneaujuneau001@gmail.comhttp://jj-blogger.blogspot.comhttps://www.apress.com/index.php/author/author/view/id/1866
>>
>>
>> On Thu, Jan 28, 2016 at 7:48 AM, Kito Mann <kito.mann_at_virtua.com> <kito.mann_at_virtua.com> wrote:
>>
>>
>> Nice!
>>
>> ___
>>
>> 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+1 203-998-0403
>>
>>
>> * Listen to the Enterprise Java Newscast: *http://<http://blogs.jsfcentral.com/JSFNewscast/> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com<http://ww.enterprisejavanews.com> <http://ww.enterprisejavanews.com>*
>>
>>
>> On Thu, Jan 28, 2016 at 4:34 AM, Bauke Scholtz <balusc_at_gmail.com> <balusc_at_gmail.com> wrote:
>>
>>
>> Hi,
>>
>> As I wasn't fully satisfied with push scoping, I have further improved
>> f:websocket to support new attribute scope="session" (next to the default
>> of scope="application"). This will make it possible to send the message
>> only to the views in the current HTTP session, without the need to manually
>> mess with channel name. To remember the current HTTP session during
>> actually sending the push message (at that moment, there's not necessarily
>> a HTTP request available), I had to rework PushContext and add a new
>> annotation, @Push. The usage is now like:
>>
>> @Inject @Push
>> private PushContext channelName;
>>
>> public void someAction() {
>> channelName.send(someMessageObject);
>> }
>>
>> Test cases will follow.
>>
>> Cheers, B
>>
>> On Fri, Jan 15, 2016 at 3:02 PM, manfred riem <manfred.riem_at_oracle.com> <manfred.riem_at_oracle.com>
>> wrote:
>>
>>
>> Hi Bauke,
>>
>> On 1/14/16, 9:34 AM, Bauke Scholtz wrote:
>>
>>
>> I finished f:websocket, see patch inhttps://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1396
>>
>> Cool!
>>
>> No unit tests have been added, this will come later. Existing unit
>>
>> tests run without trouble.
>>
>> I will commit next week in case no one objects.
>>
>>
>> Please make sure when you commit the unit tests are included.
>>
>>
>> Thanks!
>>
>> Kind regards,
>> Manfred Riem
>>
>>
>>
>>
>>
>