Author: ppitonak(a)redhat.com
Date: 2010-11-03 05:05:36 -0400 (Wed, 03 Nov 2010)
New Revision: 19906
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java
Log:
https://jira.jboss.org/browse/RF-9163
* code commented out, it has to be reimplemented because of new implementation of
a4j:push
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java 2010-11-03
08:36:10 UTC (rev 19905)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java 2010-11-03
09:05:36 UTC (rev 19906)
@@ -24,14 +24,14 @@
import java.io.Serializable;
import java.util.Date;
-import java.util.EventListener;
+//import java.util.EventListener;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
-import org.ajax4jsf.event.PushEventListener;
+//import org.ajax4jsf.event.PushEventListener;
import org.richfaces.component.UIPush;
import org.richfaces.tests.metamer.Attributes;
@@ -52,7 +52,7 @@
private static Logger logger;
private Attributes attributes;
private int counter = 0;
- private transient volatile PushEventListener listener;
+// private transient volatile PushEventListener listener;
@ManagedProperty(value = "#{a4jPushEventProcuder}")
private transient A4JPushEventProcuder pushEventProducer;
@@ -103,10 +103,10 @@
this.attributes = attributes;
}
- public void setListener(EventListener listener) {
- this.listener = (PushEventListener) listener;
- pushEventProducer.registerListener(this.listener);
- }
+// public void setListener(EventListener listener) {
+// this.listener = (PushEventListener) listener;
+// pushEventProducer.registerListener(this.listener);
+// }
public int getCounter() {
return counter;
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java 2010-11-03
08:36:10 UTC (rev 19905)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java 2010-11-03
09:05:36 UTC (rev 19906)
@@ -19,20 +19,19 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*******************************************************************************/
-
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
-import java.util.Collection;
-import java.util.EventObject;
-import java.util.HashSet;
-import java.util.LinkedList;
+//import java.util.Collection;
+//import java.util.EventObject;
+//import java.util.HashSet;
+//import java.util.LinkedList;
import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
-import org.ajax4jsf.event.PushEventListener;
+//import org.ajax4jsf.event.PushEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,27 +47,27 @@
private static final long serialVersionUID = 4532283098337277878L;
private Logger logger;
- private Collection<PushEventListener> registeredListeners = new
HashSet<PushEventListener>();
+// FIXME example has to be reimplemented because of new implementation of a4j:push
+// private Collection<PushEventListener> registeredListeners = new
HashSet<PushEventListener>();
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
}
-
- public void registerListener(PushEventListener listener) {
- synchronized (registeredListeners) {
- registeredListeners.add(listener);
- }
- }
-
- public void produceEvent() {
- Collection<PushEventListener> listeners;
- synchronized (registeredListeners) {
- listeners = new LinkedList<PushEventListener>(registeredListeners);
- }
- for (PushEventListener listener : listeners) {
- listener.onEvent(new EventObject(A4JPushBean.class));
- }
- logger.debug("push event (listeners: " + listeners.size() +
")");
- }
+// public void registerListener(PushEventListener listener) {
+// synchronized (registeredListeners) {
+// registeredListeners.add(listener);
+// }
+// }
+//
+// public void produceEvent() {
+// Collection<PushEventListener> listeners;
+// synchronized (registeredListeners) {
+// listeners = new LinkedList<PushEventListener>(registeredListeners);
+// }
+// for (PushEventListener listener : listeners) {
+// listener.onEvent(new EventObject(A4JPushBean.class));
+// }
+// logger.debug("push event (listeners: " + listeners.size() +
")");
+// }
}