From jira-events at lists.jboss.org Fri Mar 23 16:37:48 2012
Content-Type: multipart/mixed; boundary="===============5822873714151080243=="
MIME-Version: 1.0
From: =?utf-8?q?Luk=C3=A1=C5=A1_Fry=C4=8D_=28JIRA=29_=3Cjira-events_at_lists=2E?=
=?utf-8?q?jboss=2Eorg=3E?=
To: richfaces-issues at lists.jboss.org
Subject: [richfaces-issues] [JBoss JIRA] (RF-12072) Lost event in push
Date: Fri, 23 Mar 2012 16:37:48 -0400
Message-ID: <712040448.28978.1332535068085.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com>
In-Reply-To: 1823827590.22721.1332335688298.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com
--===============5822873714151080243==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
[ https://issues.jboss.org/browse/RF-12072?page=3Dcom.atlassian.jira.p=
lugin.system.issuetabpanels:all-tabpanel ]
Luk=C3=A1=C5=A1 Fry=C4=8D updated RF-12072:
----------------------------
Workaround Description: =
Use {{a4j:jsFunction}} and {{}}
{code:XML}
{code}
Workaround: Workaround Exists
=
> Lost event in push
> ------------------
>
> Key: RF-12072
> URL: https://issues.jboss.org/browse/RF-12072
> Project: RichFaces
> Issue Type: Bug
> Security Level: Public(Everyone can see) =
> Components: component-push/poll
> Reporter: Stian Thorgersen
> Assignee: Luk=C3=A1=C5=A1 Fry=C4=8D
> Fix For: 4.2.1.CR1
>
>
> Event can be lost if produced while a response is being prepared. I've at=
tached an example where a push event is used to refresh a count whenever an=
event is fired. It's using Thread.sleep to simulate an event being produce=
d while the response is being prepared. Note, if the sleep just before retu=
rning the count is removed it all works fine, and the page is refreshed eve=
ry 5 seconds, but with the sleep in place the event is lost.
> View:
> {code}
>
>
> xmlns:f=3D"http://java.sun.com/jsf/core"
> xmlns:h=3D"http://java.sun.com/jsf/html"
> xmlns:a4j=3D"http://richfaces.org/a4j"
> xmlns:rich=3D"http://richfaces.org/rich">
>
>
>
>
>
>
>
>
>
>
>
>
> {code}
> Bean:
> {code}
> package com.example;
> import java.io.Serializable;
> import java.util.concurrent.atomic.AtomicInteger;
> import javax.enterprise.context.SessionScoped;
> import javax.inject.Named;
> import org.richfaces.application.push.TopicKey;
> import org.richfaces.application.push.TopicsContext;
> @Named
> @SessionScoped
> public class MyBean implements Serializable
> {
> private AtomicInteger count =3D new AtomicInteger();
> public int getCount()
> {
> int c =3D count.get();
> new Thread()
> {
> public void run()
> {
> try
> {
> Thread.sleep(5000);
> count.incrementAndGet();
> TopicKey topicKey =3D new TopicKey("chat");
> TopicsContext topicsContext =3D TopicsContext.lookup(=
);
> topicsContext.publish(topicKey, "");
> }
> catch (Exception e)
> {
> e.printStackTrace();
> }
> };
> }.start();
> =
> try
> {
> Thread.sleep(10000);
> }
> catch (InterruptedException e)
> {
> }
> return c;
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrato=
rs: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
=
--===============5822873714151080243==--