Author: alexsmirnov
Date: 2007-05-03 16:15:45 -0400 (Thu, 03 May 2007)
New Revision: 165
Modified:
trunk/framework/src/main/java/org/ajax4jsf/ajax/UIPush.java
trunk/samples/useCases/src/main/java/org/ajax4jsf/MessageBean.java
Log:
remove dublicate calls to listener.processed() methods.
Modified: trunk/framework/src/main/java/org/ajax4jsf/ajax/UIPush.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/ajax/UIPush.java 2007-05-03 20:06:28 UTC
(rev 164)
+++ trunk/framework/src/main/java/org/ajax4jsf/ajax/UIPush.java 2007-05-03 20:15:45 UTC
(rev 165)
@@ -104,8 +104,7 @@
protected void setupReRender(FacesContext facesContext) {
super.setupReRender(facesContext);
// AjaxContext.getCurrentInstance(facesContext).addComponentToAjaxRender(this);
- //
- getListener(facesContext).processed();
+ //getListener(facesContext).processed();
}
Modified: trunk/samples/useCases/src/main/java/org/ajax4jsf/MessageBean.java
===================================================================
--- trunk/samples/useCases/src/main/java/org/ajax4jsf/MessageBean.java 2007-05-03 20:06:28
UTC (rev 164)
+++ trunk/samples/useCases/src/main/java/org/ajax4jsf/MessageBean.java 2007-05-03 20:15:45
UTC (rev 165)
@@ -16,7 +16,9 @@
private PushEventListener listener;
- private List messages = new ArrayList();
+ private List messages = new ArrayList(10);
+
+ private int counter = 0;
public MessageBean() {
// TODO Auto-generated constructor stub
@@ -53,7 +55,10 @@
while (isRunning()) {
Thread.sleep(10000);
Date current = new Date(System.currentTimeMillis());
- messages.add(current);
+ if(messages.size()>=10){
+ messages.remove(0);
+ }
+ messages.add(messages.size(),String.valueOf(counter++)+" at
"+current.toString());
System.out.println("event occurs");
synchronized (listener) {
listener.onEvent(new EventObject(this));