myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: fixed websocket event handling
Date Fri, 04 Oct 2019 14:59:48 GMT
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ab8199  fixed websocket event handling
3ab8199 is described below

commit 3ab81996f0b2358d7cbb375aaf012396eaf7da9c
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Fri Oct 4 16:59:41 2019 +0200

    fixed websocket event handling
---
 .../main/java/javax/faces/component/_UIWebsocket.java    | 16 ++++++++++++++++
 api/src/main/resources/META-INF/componentClass20.vm      | 13 -------------
 .../apache/myfaces/push/AbstractWebsocketComponent.java  |  6 ------
 3 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/api/src/main/java/javax/faces/component/_UIWebsocket.java b/api/src/main/java/javax/faces/component/_UIWebsocket.java
index c41260a..54ddc53 100644
--- a/api/src/main/java/javax/faces/component/_UIWebsocket.java
+++ b/api/src/main/java/javax/faces/component/_UIWebsocket.java
@@ -20,6 +20,8 @@
 package javax.faces.component;
 
 import java.io.Serializable;
+import java.util.Collection;
+import java.util.Collections;
 import javax.el.ValueExpression;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
@@ -39,6 +41,15 @@ abstract class _UIWebsocket extends UIComponentBase
     static public final String COMPONENT_FAMILY = "javax.faces.Script";
     static public final String COMPONENT_TYPE = "javax.faces.Websocket";
 
+    private static final Collection<String> EVERY_EVENT = Collections.unmodifiableList(new
java.util.ArrayList<String>()
+    {
+        @Override
+        public boolean contains(Object object)
+        {
+            return true;
+        }
+    });
+
     @JSFProperty
     public abstract String getChannel();
     
@@ -86,4 +97,9 @@ abstract class _UIWebsocket extends UIComponentBase
         channel, scope, user, onopen, onmessage, onclose, connected;
     }
 
+    @Override
+    public Collection<String> getEventNames()
+    {
+        return EVERY_EVENT;
+    }
 }
diff --git a/api/src/main/resources/META-INF/componentClass20.vm b/api/src/main/resources/META-INF/componentClass20.vm
index 1817848..4a2b7fc 100644
--- a/api/src/main/resources/META-INF/componentClass20.vm
+++ b/api/src/main/resources/META-INF/componentClass20.vm
@@ -130,19 +130,6 @@ $innersource
 #end
 #end
 
-#if ($component.implements)
-#if ( ($component.implements == "javax.faces.component.behavior.ClientBehaviorHolder")
-     && (${utils.getClassFromFullClass($component.className)} == "UIWebsocket"))
-    // Start UIWebsocket getEventNames template
-    @Override
-    public java.util.Collection<String> getEventNames()
-    {
-        return Collections.emptyList();
-    }
-    // End UIWebsocket getEventNames template
-#end
-#end
-
 #if ($component.defaultEventName)
 #if ($component.defaultEventName != "")
 
diff --git a/impl/src/main/java/org/apache/myfaces/push/AbstractWebsocketComponent.java b/impl/src/main/java/org/apache/myfaces/push/AbstractWebsocketComponent.java
index 4e46f12..11fe792 100644
--- a/impl/src/main/java/org/apache/myfaces/push/AbstractWebsocketComponent.java
+++ b/impl/src/main/java/org/apache/myfaces/push/AbstractWebsocketComponent.java
@@ -44,12 +44,6 @@ public abstract class AbstractWebsocketComponent extends UIOutput implements
Cli
         {
             return true;
         }
-
-        @Override
-        public boolean containsAll(Collection<?> c)
-        {
-            return true;
-        }
     });
 
     @JSFProperty


Mime
View raw message